feat(export): prepared network tab and form to send the data to API
Description
Prepared form to submit network and elements tab in export drawer.
Why compound component instead of hook? It's basically the same solution but compound component gives clear sign that all components are working together into common goal.
Most of the changes are related to moving components and helpers around.
Merge request reports
Activity
- Resolved by Adrian Orłów
- Resolved by Tadeusz Miesiąc
6 types: string[]; 7 columns: string[]; 8 submaps: number[]; 9 annotations: string[]; 10 includedCompartmentIds: string[]; 11 excludedCompartmentIds: string[]; 12 }; 13 14 type GetDownloadBodyRequestProps = { 15 types: CheckboxItem[]; 16 columns: CheckboxItem[]; 17 modelIds: number[]; 18 annotations: CheckboxItem[]; 19 includedCompartmentPathways: CheckboxItem[]; 20 excludedCompartmentPathways: CheckboxItem[]; 21 }; changed this line in version 2 of the diff
43 type CheckboxElement = { id: string; label: string }; 44 45 type CheckboxElements = CheckboxElement[]; 46 47 export const getCompartmentPathwaysCheckboxElements = ( 48 items: CompartmentPathwayDetails[], 49 ): CheckboxElements => { 50 const addedNames: AddedNames = {}; 51 52 const setNameToIdIfUndefined = (item: CompartmentPathwayDetails): void => { 53 if (addedNames[item.name] === undefined) { 54 addedNames[item.name] = item.id; 55 } 56 }; 57 58 items.forEach(setNameToIdIfUndefined); changed this line in version 2 of the diff
- Resolved by Tadeusz Miesiąc
- Resolved by Tadeusz Miesiąc
11 import { Network } from './Network'; 12 import { getModelsIds } from './ExportDrawer.component.utils'; 7 13 8 14 export const ExportDrawer = (): React.ReactNode => { 15 const models = useAppSelector(modelsDataSelector); 16 const dispatch = useAppDispatch(); 9 17 const [activeTab, setActiveTab] = useState<TabNames>(TAB_NAMES.ELEMENTS); 10 18 11 19 const handleTabChange = (tabName: TabNames): void => { 12 20 setActiveTab(tabName); 13 21 }; 14 22 23 useEffect(() => { 24 const modelsIds = getModelsIds(models); 25 dispatch(getCompartmentPathways(modelsIds)); 26 }, [dispatch, models]); changed this line in version 2 of the diff
@AdrianOrlow getCompartmentPathways - data from this request is not needed on the start of the app to let app work properly. Fetching data on component mount doesn't break UX. I will stick with this solution
added 1 commit
- 9484a2d1 - refactor(export): improved code from PR review
enabled an automatic merge when the pipeline for 9484a2d1 succeeds
added 3 commits
-
9484a2d1...4f5ae131 - 2 commits from branch
development
- a0e814b3 - Merge branch 'development' into feature/export-network-download
-
9484a2d1...4f5ae131 - 2 commits from branch
enabled an automatic merge when the pipeline for a0e814b3 succeeds
added 1 commit
- 0aa68f92 - Merge branch 'development' into feature/export-network-download
enabled an automatic merge when the pipeline for 0aa68f92 succeeds
mentioned in commit d6dd7738