Skip to content
Snippets Groups Projects

feat(export): network download (MIN-240)

Merged mateusz-winiarczyk requested to merge MIN-240-download-network into development
3 unresolved threads

Added the possibility to download data from network from the export tab. We send the items selected by the user to the backend and the backend returns the text to be saved in a file. The data is saved in a .csv file. An improvement reported by Marek regarding removing types and columns sections, displaying only available annotations and removing special characters from their names has also been added.

network

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
13 annotations: string[];
14 includedCompartmentIds: number[];
15 excludedCompartmentIds: number[];
16 reactionTypes: string[];
17 };
18
19 const downloadFileFromBlob = (data: string): void => {
20 const fileName = `${PROJECT_ID}-networkExport.csv`;
21 const url = window.URL.createObjectURL(new Blob([data]));
22 const link = document.createElement('a');
23 link.href = url;
24 link.setAttribute('download', fileName);
25 document.body.appendChild(link);
26 link.click();
27 link.remove();
28 };
  • Adrian Orłów
    Adrian Orłów @AdrianOrlow started a thread on an outdated change in commit 34cbc30e
  • 10 reactionTypes: string[];
    11 };
    12
    13 type GetDownloadBodyRequestProps = {
    14 types: CheckboxItem[];
    15 columns: CheckboxItem[];
    16 modelIds: number[];
    17 annotations: CheckboxItem[];
    18 includedCompartmentPathways: CheckboxItem[];
    19 excludedCompartmentPathways: CheckboxItem[];
    20 };
    21
    22 const extractAndParseNumberIdFromCompartment = (compartment: CheckboxItem): number => {
    23 const [, id] = compartment.id.split('-');
    24 return Number(id);
    25 };
  • Adrian Orłów
    Adrian Orłów @AdrianOrlow started a thread on an outdated change in commit 34cbc30e
  • 9 excludedCompartmentIds: number[];
    10 reactionTypes: string[];
    11 };
    12
    13 type GetDownloadBodyRequestProps = {
    14 types: CheckboxItem[];
    15 columns: CheckboxItem[];
    16 modelIds: number[];
    17 annotations: CheckboxItem[];
    18 includedCompartmentPathways: CheckboxItem[];
    19 excludedCompartmentPathways: CheckboxItem[];
    20 };
    21
    22 const extractAndParseNumberIdFromCompartment = (compartment: CheckboxItem): number => {
    23 const [, id] = compartment.id.split('-');
    24 return Number(id);
  • Adrian Orłów approved this merge request

    approved this merge request

  • added 5 commits

    Compare with previous version

  • added 1 commit

    • e89c9c6c - refactor(export): extract downloadFileFromBlob to separate file

    Compare with previous version

  • mentioned in commit 8f926bf4

  • Please register or sign in to reply
    Loading