Skip to content
Snippets Groups Projects

feat(export): prepared network tab and form to send the data to API

Merged Tadeusz Miesiąc requested to merge feature/export-network-download into development
3 unresolved threads

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.

Edited by Tadeusz Miesiąc

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • 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 };
  • 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);
  • 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]);
  • Overall LGTM but I'm not sold by the context-based solution

    Possibly RFC, but firstly let's discuss this solution at the daily meeting

  • Adrian Orłów approved this merge request

    approved this merge request

  • added 1 commit

    • 9484a2d1 - refactor(export): improved code from PR review

    Compare with previous version

  • Tadeusz Miesiąc enabled an automatic merge when the pipeline for 9484a2d1 succeeds

    enabled an automatic merge when the pipeline for 9484a2d1 succeeds

  • Tadeusz Miesiąc aborted the automatic merge because source branch was updated

    aborted the automatic merge because source branch was updated

  • Tadeusz Miesiąc added 3 commits

    added 3 commits

    Compare with previous version

  • Tadeusz Miesiąc enabled an automatic merge when the pipeline for a0e814b3 succeeds

    enabled an automatic merge when the pipeline for a0e814b3 succeeds

  • Tadeusz Miesiąc aborted the automatic merge because source branch was updated

    aborted the automatic merge because source branch was updated

  • added 1 commit

    • 0aa68f92 - Merge branch 'development' into feature/export-network-download

    Compare with previous version

  • Tadeusz Miesiąc enabled an automatic merge when the pipeline for 0aa68f92 succeeds

    enabled an automatic merge when the pipeline for 0aa68f92 succeeds

  • Tadeusz Miesiąc mentioned in commit d6dd7738

    mentioned in commit d6dd7738

  • Please register or sign in to reply
    Loading