Commit acb1010
authored
feat: make configurable action buttons shared component (#1977)
## Description
This PR refactors the datafiles action as a configurable components that
can be used in other pages of the app.
The configuration has been updated to make the configurable actions more
flexible.
## Motivation
Up to this point, SciCat had only configurable actions for the data
files associated to each dataset.
In the last year, it have become clear that we need to expand this
concept also to dataset as a whole, the datasets list, all the way to
the selection.
## Changes:
Please provide a list of the changes implemented by this PR
* created configurable actions component
* migrate datafiles action to use configurable actions component
## Tests included
- [x] Included for each change/fix?
- [x] Passing? (Merge will not be approved unless this is checked)
## Documentation
- [ ] swagger documentation updated \[required\] Not needed
- [x] official documentation updated \[nice-to-have\]
## Backend version
- [ ] Does it require a specific version of the backend
- which version of the backend is required:
## Summary by Sourcery
Extract datafiles action buttons into a shared, configurable component
and remove the legacy dataset-specific implementations
New Features:
- Introduce a shared ConfigurableActionsModule providing reusable
ConfigurableActionsComponent and ConfigurableActionComponent for
rendering action buttons
Enhancements:
- Replace dataset-specific DatafilesActions and DatafilesAction
components and templates with the generic configurable actions component
- Refactor component logic to use optional chaining for file inputs and
update input type annotations
Tests:
- Update specs to reference ConfigurableActionComponent and
ConfigurableActionsComponent instead of the old datafiles action
components
- Remove obsolete mocks and commented-out test code
Chores:
- Add ConfigurableActionsModule to SharedScicatFrontendModule and remove
legacy DatafilesAction declarations from DatasetsModule
- Delete deprecated datafiles-actions component files and SCSS
## Summary by Sourcery
Introduce a reusable configurable action buttons component and migrate
the existing datafiles actions to use it, generalize action settings in
the app config, and clean up the legacy implementations. Also add a
suite of shared dataset filter components and update tests accordingly.
New Features:
- Add ConfigurableActionsModule with ConfigurableActionsComponent and
ConfigurableActionComponent for rendering action buttons based on
configuration.
- Add new shared dataset filter components (keyword, location, group,
type, date range, PID, text, and condition filters) under
shared/modules/filters.
Enhancements:
- Migrate datafiles action buttons (and scaffold batch-view and
dataset-detail) to use the generic configurable actions component and
extend AppConfigInterface with datasetActions, datasetDetailsActions,
and datasetSelectionActions.
- Simplify DatafilesComponent lifecycle and data handling by delegating
form and request logic to the shared ConfigurableActionComponent.
Tests:
- Update existing specs to reference ConfigurableActionsComponent and
add comprehensive mock data and tests for configurable actions.
- Remove obsolete mocks, commented-out code, and legacy
datafiles-actions component tests.
Chores:
- Remove deprecated DatafilesActionsComponent/DatafilesActionComponent
files and update module declarations to import
ConfigurableActionsModule.
- Clean up shared module imports by removing unused Material modules and
adding ConfigurableActionsModule and TranslateModule.File tree
59 files changed
+3632
-1629
lines changed- .vscode
- CI/e2e
- cypress/e2e
- datasets
- published-data
- src
- app
- app-routing
- datasets
- batch-view
- datafiles-actions
- datafiles
- dataset-detail
- dataset-detail-dynamic
- dataset-detail
- assets
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
59 files changed
+3632
-1629
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
13 | | - | |
| 14 | + | |
14 | 15 | | |
| 16 | + | |
| 17 | + | |
15 | 18 | | |
16 | 19 | | |
17 | 20 | | |
| |||
24 | 27 | | |
25 | 28 | | |
26 | 29 | | |
27 | | - | |
28 | 30 | | |
29 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
30 | 42 | | |
31 | 43 | | |
32 | | - | |
33 | 44 | | |
34 | 45 | | |
35 | 46 | | |
| |||
38 | 49 | | |
39 | 50 | | |
40 | 51 | | |
41 | | - | |
| 52 | + | |
42 | 53 | | |
43 | 54 | | |
44 | 55 | | |
| |||
50 | 61 | | |
51 | 62 | | |
52 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
53 | 67 | | |
54 | 68 | | |
55 | 69 | | |
| |||
60 | 74 | | |
61 | 75 | | |
62 | 76 | | |
63 | | - | |
| 77 | + | |
| 78 | + | |
64 | 79 | | |
65 | 80 | | |
66 | 81 | | |
67 | 82 | | |
68 | 83 | | |
69 | 84 | | |
70 | | - | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
71 | 97 | | |
72 | 98 | | |
73 | 99 | | |
74 | 100 | | |
75 | | - | |
| 101 | + | |
| 102 | + | |
76 | 103 | | |
77 | 104 | | |
78 | 105 | | |
79 | 106 | | |
80 | 107 | | |
81 | 108 | | |
82 | | - | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
83 | 124 | | |
84 | 125 | | |
85 | 126 | | |
86 | 127 | | |
87 | | - | |
88 | | - | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
89 | 131 | | |
90 | 132 | | |
91 | 133 | | |
92 | | - | |
| 134 | + | |
93 | 135 | | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
94 | 150 | | |
95 | 151 | | |
96 | 152 | | |
97 | 153 | | |
98 | | - | |
99 | | - | |
| 154 | + | |
| 155 | + | |
100 | 156 | | |
101 | 157 | | |
102 | 158 | | |
103 | | - | |
| 159 | + | |
104 | 160 | | |
105 | | - | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
106 | 176 | | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
107 | 270 | | |
108 | 271 | | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
109 | 287 | | |
110 | 288 | | |
111 | 289 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| |||
0 commit comments