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

Fetch optionLists in individual requests #14122

Open
standeren opened this issue Nov 21, 2024 · 0 comments · Fixed by #14266 · May be fixed by #14269
Open

Fetch optionLists in individual requests #14122

standeren opened this issue Nov 21, 2024 · 0 comments · Fixed by #14266 · May be fixed by #14269
Assignees
Labels
added-to-sprint frontend quality/code Violations from current rules for code, best practices, etc. Or just bad code. skip-documentation Issues where updating documentation is not relevant skip-releasenotes Issues that do not make sense to list in our release notes team/studio-domain1

Comments

@standeren
Copy link
Contributor

standeren commented Nov 21, 2024

Description

Today we are fetching all optionLists from backend in a singel request. If one of them is in an invalid format, the whole request will fail and you will not be able to view the content of any of the lists.

We should add a query useOptionListQuery.ts that will use the endpoint for fetching a specified optionList based on a given optionListId.

In the places where we use the query today we should adapt it like this:

In OptionListEditor.tsx:
This component is already receiving the optionListId so we can simply replace the query and pass the id to the new hook. Then a potential error from this query in this component, will be handled correct as it is implemented today.

In AppContentLibrary.tsx:
We should adapt the code list implementation to take all optionListIds as the incoming data and a onGetCodeList callback to fetch the singel code list when we need it. This way we will only get valid option lists to render and show an error per individual codeList.

In ExportForm.tsx:
We should keep the fetch all query in order to use it in this component and accept that the exported form will not have any lists if the api call fails due to a single faulty code list. This functionality is developed along with the needs of a single customer and hidden behind a feature flag.

@standeren standeren converted this from a draft issue Nov 21, 2024
@standeren standeren added quality/code Violations from current rules for code, best practices, etc. Or just bad code. skip-releasenotes Issues that do not make sense to list in our release notes added-to-sprint team/studio-domain1 skip-documentation Issues where updating documentation is not relevant labels Nov 21, 2024
@standeren standeren removed the backend label Nov 25, 2024
@standeren standeren moved this from 📈 Todo to 👷 In Progress in Team Studio Nov 29, 2024
@standeren standeren self-assigned this Nov 29, 2024
@standeren standeren linked a pull request Dec 12, 2024 that will close this issue
3 tasks
@github-project-automation github-project-automation bot moved this from 👷 In Progress to Documentation in Team Studio Dec 20, 2024
@standeren standeren moved this from Documentation to ✅ Done in Team Studio Dec 20, 2024
@standeren standeren moved this from ✅ Done to 👷 In Progress in Team Studio Dec 20, 2024
@standeren standeren reopened this Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
added-to-sprint frontend quality/code Violations from current rules for code, best practices, etc. Or just bad code. skip-documentation Issues where updating documentation is not relevant skip-releasenotes Issues that do not make sense to list in our release notes team/studio-domain1
Projects
Status: 👷 In Progress
2 participants