Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GRF-599 fix blank page on categories when manipulating channels list before it is fetched #18504

Merged
merged 3 commits into from
Nov 28, 2022

Conversation

amigaire
Copy link
Contributor

Description (for Contributor and Core Developer)

When the PIM is build and launched for the 1st time, or when we delete the project's cache, the ChannelSelector component receives an empty list of channels. It try to access the "code" property of every channel of this empty list which resulted in an error and a blank page.

Now we do not display the component if the channels list is empty

Definition Of Done (for Core Developer only)

  • Tests
  • Migration & Installer
  • PM Validation (Story)
  • Changelog (maintenance bug fixes)
  • Tech Doc

@olivierpontier
Copy link
Contributor

The issue looks to come from this line
Here we are expecting that the list of values is never empty. This should throw our error.

A solution could be to fully accept that the value possibly does not exist in the list of values and the component should be resilient enough to handle it.

const selectedChannel: Channel|undefined = values.find(channel => channel.code === value);

Could you add some tests to cover this use case please?

Base automatically changed from GRF-494 to master November 25, 2022 15:32
@amigaire amigaire merged commit 98645ee into master Nov 28, 2022
@amigaire amigaire deleted the GRF-599 branch November 28, 2022 08:18
@amigaire amigaire restored the GRF-599 branch November 28, 2022 08:30
@amigaire amigaire deleted the GRF-599 branch November 28, 2022 08:33
@jeremyBeaucousinAkeneo jeremyBeaucousinAkeneo restored the GRF-599 branch November 28, 2022 08:34
@jeremyBeaucousinAkeneo jeremyBeaucousinAkeneo deleted the GRF-599 branch November 28, 2022 08:59
tseho pushed a commit that referenced this pull request Aug 25, 2023
tseho pushed a commit that referenced this pull request Aug 25, 2023
tseho pushed a commit that referenced this pull request Aug 25, 2023
tseho pushed a commit that referenced this pull request Aug 25, 2023
tseho pushed a commit that referenced this pull request Aug 30, 2023
tseho pushed a commit that referenced this pull request Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants