datalad / datalad-catalog

Create a user-friendly data catalog from structured metadata
https://datalad-catalog.netlify.app
MIT License
15 stars 12 forks source link

Developer docs and diagrams for app flow #395

Closed jsheunis closed 3 months ago

jsheunis commented 11 months ago

In the same vein as https://github.com/datalad/datalad-catalog/issues/393 (and with some overlap in content), we need a clear description and diagram for the flow of the app. This should make it easy for developers to find the correct place to add their contributions.

jsheunis commented 11 months ago

Component datasetView

created()

flowchart TD

Parameters[/"URL parameter: dataset_id
URL parameter: dataset_version
URL parameter: tab_name?"/]
Created(["created() start"])
Fetch_super_file{"Try to
fetch catalog
superdataset
file"}
Set_super[set superdataset id and version on $root]
Fetch_dataset_file["Fetch metadata file
of selected dataset"]
404([404])
Set_selected_dataset_app["Set selected dataset on app level:
this.$root.selectedDataset = info from file"]
Set_dataset_ready{{this.dataset_ready = true}}
Watched>Watched variable]
Fetch_subdatasets["Fetch subdatasets of $root.selected_dataset
and set info and counts on $root.selected_dataset"]
Set_subdatasets_ready{{this.subdatasets_ready = true}}
Set_filetree["Make files available:
$root.selectedDataset.tree =
$root.selectedDataset['children']"]
Set_files_ready{{this.files_ready = true}}
Populate_tabs_array["Populate array with available tabs,
in order of appearance"]
Set_correct_tab["Set the correct tab based
on URL parameter"]
Completed(["created() complete"])

Created --> Fetch_super_file
Fetch_super_file -- success --> Set_super
Set_super --> Fetch_dataset_file
Fetch_super_file -- failure --> Fetch_dataset_file
Parameters --> Fetch_dataset_file
Fetch_dataset_file --success--> Set_selected_dataset_app
Fetch_dataset_file --failure--> 404
Set_selected_dataset_app --> Set_dataset_ready
Set_dataset_ready --> Fetch_subdatasets
Set_dataset_ready -.- Watched
Fetch_subdatasets --> Set_subdatasets_ready
Set_subdatasets_ready --> Set_filetree
Set_subdatasets_ready -.- Watched
Set_filetree --> Set_files_ready
Set_files_ready --> Populate_tabs_array
Parameters --> Set_correct_tab
Populate_tabs_array --> Set_correct_tab
Set_correct_tab --> Completed