stable

Clone or download

Read-only

Refactor baselines loading

Part of epic #12142 Baseline v1 For each baseline displayed in baselines list, we need to load some extra data: - user - baseline artifact (and corresponding tracker) Data fetching is done through baselines presenter and presented baslines are returned with additional attributes. This pattern brings many difficulties: - the presenter code base is not easy to maintain (not trivial complexity) - the presenter code base is not easy to test (too many thing are done here) - returned object is kind of baseline, but not exatcly. This implies difficulties for naming such objects in tests. - it is very difficult (if not impossible) to share fetched data with other components (like futures comparisons list). For all of these reasons, a refactoring is necessary. Here is the new architecture: - all loaded data are stored (and shared) in a global store - each fetchable resource has a dedicated action (to load the resource) and a dedicated getter (used with resource id). - additional actions are responsible for loading resources and associated ones. - when a component need an associated object, it get it from the global store with the id This refactoring is limited to baselines list for change size reason. So, many trade-off are made, in particular in baseline store action. Change-Id: I02bf7da22a3081c5a885336866e2a35a37e1146f

Modified Files

Name
M scripts/baseline/components/HomePage.vue +1 −9 Go to diff View file
A scripts/baseline/components/baselines-list/Baseline.vue +94 −0 Go to diff View file
R scripts/baseline/components/baselines-list/BaselinesTableBodyCellSkeleton.vue Go to diff View file
M scripts/baseline/components/baselines-list/BaselinesTable.spec.js +57 −39 Go to diff View file
M scripts/baseline/components/baselines-list/BaselinesTable.vue +30 −11 Go to diff View file
D scripts/baseline/components/baselines-list/BaselinesTableBodyCells.spec.js +0 −43 Go to diff View file
D scripts/baseline/components/baselines-list/BaselinesTableBodyCells.vue +0 −79 Go to diff View file
D scripts/baseline/components/baselines-list/BaselinesTableBodySkeleton.vue +0 −35 Go to diff View file
M scripts/baseline/components/common/ArtifactBadge.spec.js +2 −3 Go to diff View file
M scripts/baseline/components/common/ArtifactBadge.vue +6 −2 Go to diff View file
M scripts/baseline/presenters/baseline.js +2 −49 Go to diff View file
M scripts/baseline/presenters/baseline.spec.js +3 −154 Go to diff View file
M scripts/baseline/store/baseline.js +38 −5 Go to diff View file
M scripts/baseline/store/baseline.spec.js +22 −24 Go to diff View file
M scripts/baseline/store/baselines.js +19 −4 Go to diff View file
M scripts/baseline/store/baselines.spec.js +80 −5 Go to diff View file
M scripts/baseline/store/options.js +52 −2 Go to diff View file
A scripts/baseline/store/options.spec.js +246 −0 Go to diff View file
M scripts/baseline/support/factories.js +4 −1 Go to diff View file
M scripts/baseline/support/store-wrapper.spec-helper.js +3 −1 Go to diff View file