-
Notifications
You must be signed in to change notification settings - Fork 7
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
Ia 2976 remove single table #1322
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…966_add_react_router_doc
…966_add_react_router_doc
- Use TableWithDeepLink - move API calls to react-query - Update useFilterState to have finer managment of filtersUpdated - Add method to generate csv and xlsx download urls - Add custom success messages for form deletion and restoration
- remove SingleTable - Adapt FormsTable to handle params with prefix - Remove "all=true" query param from useGetForms as doesn't do anything
- Add react-query hooks to fetch all filter dropdowns - Add react-quzry hook to update/validate links - Add LinkFilters and LinkTable components - Add makeQueryString utils in routing
- Add method to update the whole state while also handling filtersUpdated status
- remove useless param from csv and xlsx urls - Add comment/doc about useGetForm use - Simplify params for forms fetching in FormsTable - Delete unused "redux" requests
- Add custom link filters for the org unit details links tab - remove obsolete redux AI calls - remove unused SingleTable filter configs - remove unused APi call from queries array
- Add FormVersions table - convert method to get colulmns to hook - improve typing of useApiParams - add useGetFormVersions hook - Remove useless state in PeriodPicker - Replace useEffect with useMemo in FormVersionsDialog
- Move Logs components to org units, as they are not so generic - Add useGetLogs and useGetLogsDetails hooks (generic, so not in org units folder) - Convert LogsComponent to TS - Convert LogsDetails to TS and to function component - delete fetchLogDetails 'redux' request
- Add react-query hooks - remove redux fetching - move table column config in hook - remove FormattedMessage - Force re-render of index.js via react-query key invalidation, i.o "forceRefresh" state value - delete (now) unused request
- adapt list test: download buttons are disabled i.o. not rendered if no results - adapt API urls in tables and hooks so they are consistent (i.e always include table params)
- wait for necessary requests - remove unnecessarty intercepts
- Add default values for table params in OrgUnitChildren - Make validation status non clearable in filter - remove useless intercepts in test - fix urls in tests
- fix urls
- Add LinkTableWithDownoads component - Refactor LinkTable to receive data, params and other url related data as props, i.o fetching it itself - Refactor Links to use LinkTableWithDownloads - Add OrgUnitLinks component and use it in org unit details
…no data - to avoid infinite error loop in FormVersions
- Pass tableDefaults as prop to the table to make the default behaviour clearer
beygorghor
approved these changes
Jun 17, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some small remarks. Very nice job! Iaso codebase is looking better everyday 😃
hat/assets/js/apps/Iaso/domains/algorithmRuns/hooks/useRunTableColumns.tsx
Show resolved
Hide resolved
hat/assets/js/apps/Iaso/domains/dataSources/components/AddNewEmptyVersion.tsx
Outdated
Show resolved
Hide resolved
hat/assets/js/apps/Iaso/domains/orgUnits/details/Children/OrgUnitChildrenFilters.tsx
Outdated
Show resolved
Hide resolved
hat/assets/js/apps/Iaso/domains/orgUnits/history/LogsComponent.tsx
Outdated
Show resolved
Hide resolved
quang-le
added
Released
and removed
postrelease
Should be merged just after the release
labels
Jul 2, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The (deprecated)
SingleTable
component was causing double API fetching in Forms page and making parts of the codebase hard to maintainRelated JIRA tickets : IA-2976, IA-2983, IA-989, IA-1730, IA-1719, IA-1714, IA-1705
Self proofreading checklist
Doc
Changes
Forms:
FormsTable
components based onTableWithDeepLink
SingleTable
SingleTable
for "Forms" tab in Org unit detailsall
from API callssearchActive
params: was not working, and the actual behaviour was correct that wayForm versions:
Data sources:
FormattedMessage
withformatMessage
index
via react-query key invalidation, i.oforceRefresh
state valueDevices:
SingleTable
withTableWithDeepLink
Org Unit History:
Logs
components to org units, as they are not so genericuseGetLogs
anduseGetLogsDetails
hooks (generic, so not in org units folder)LogsComponent
to TSLogsDetails
to TS and to function componentfetchLogDetails
'redux' requestLinks:
LinkFilters
andLinkTable
componentsLinkTableWithDownloads
component, that wraps theLinkTable
and theDownloadButtonsComponent
, handles loading state, conditional rendering and url formatting for both, and can be passed filters as children, so it's easily reusable in org unit details.config
andmessages
to TSOrg Unit Details Links:
OrgUnitLinks
component: usesLinksWithDownloadButtons
and aLinkFilters
made specifically for the links tabOrg Unit Details Children:
Org Unit Details (general):
classes.hiddenOpacity
with conditional rendering for all tabs. (This fixes IA-3026)useOrgUnitTabParams
hook to pass the correct params (with Prefixes) to the tab tablesurls.ts
groups
API call, so that the right params are sent to the APIAlgorithm Runs:
Redux:
SingleTable
- Delete component
- Delete all filter configs
useTableState
hook to handle ordering and pagination for non-deep-linked tablesuseFilterState
to update the whole state while also handlingfiltersUpdated
statususeFilterState
to have finer managment offiltersUpdated
makeQueryString
anduseQueryString
utils in routinguseGetOrgUnitTypes
hookcy.intercept
in Org unit tab testscy.visit
in forms cypress test (halves duration of that test)How to test
Print screen / video
Nothing should change
Notes
cypress successful run: https://github.com/BLSQ/iaso/actions/runs/9452079172
Sorry for the PR size, it just got much bigger than expected, especially when refactoring class components became unavoidable
TS typing may be a bit light in some places, but I think this can be fixed separately