Skip to content

Commit c6324fa

Browse files
authored
Merge branch 'master' into SWAP-4573-remove-default-values-in-dtos-to-prevent-overwriting
2 parents 1e123f1 + d177626 commit c6324fa

File tree

57 files changed

+5945
-4467
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+5945
-4467
lines changed

.env.example

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ DELETE_GROUPS=""
4848
CREATE_DATASET_GROUPS="all"
4949
CREATE_DATASET_WITH_PID_GROUPS=""
5050
CREATE_DATASET_PRIVILEGED_GROUPS=""
51-
CREATE_JOB_GROUPS=""
52-
UPDATE_JOB_GROUPS=""
51+
CREATE_JOB_PRIVILEGED_GROUPS=""
52+
UPDATE_JOB_PRIVILEGED_GROUPS=""
5353
SAMPLE_PRIVILEGED_GROUPS="sampleingestor"
5454
SAMPLE_GROUPS="group1"
5555
PROPOSAL_GROUPS=""

.github/workflows/deploy.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
push: true
4040
tags: ${{ steps.meta.outputs.tags }}
4141

42-
- uses: actions/create-github-app-token@v1
42+
- uses: actions/create-github-app-token@v2
4343
id: app-token
4444
with:
4545
app-id: ${{ secrets.WORKFLOW_DISPATCHER_APP_ID }}

.github/workflows/release-and-publish-sdk.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ jobs:
9292
push: true
9393
tags: ${{ steps.meta.outputs.tags }}
9494

95-
- uses: actions/create-github-app-token@v1
95+
- uses: actions/create-github-app-token@v2
9696
id: app-token
9797
with:
9898
app-id: ${{ secrets.WORKFLOW_DISPATCHER_APP_ID }}

.github/workflows/test.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ jobs:
153153
CREATE_DATASET_WITH_PID_GROUPS: "group2"
154154
CREATE_DATASET_PRIVILEGED_GROUPS: "datasetIngestor,group3"
155155
ACCESS_GROUPS_STATIC_VALUES: "ess"
156-
CREATE_JOB_GROUPS: group1,group2
157-
UPDATE_JOB_GROUPS: group1
156+
CREATE_JOB_PRIVILEGED_GROUPS: group1,group2
157+
UPDATE_JOB_PRIVILEGED_GROUPS: group3
158158
DELETE_JOB_GROUPS: "archivemanager,admin"
159159
PROPOSAL_GROUPS: "proposalingestor"
160160
SAMPLE_PRIVILEGED_GROUPS: "sampleingestor"

docs/frontend-config-guide/dynamic-dataset-detail-component.md

+26-4
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ Below you can find the example configuration, but for more advanced customizatio
2323
"type": "regular",
2424
"label": "General Information",
2525
"order": 0,
26+
"row": 1,
27+
"col": 4,
2628
"fields": [
2729
{
2830
"element": "text",
@@ -34,29 +36,45 @@ Below you can find the example configuration, but for more advanced customizatio
3436
"source": "pid",
3537
"order": 1
3638
},
39+
{
40+
"element": "internalLink",
41+
"source": "proposalIds",
42+
"order": 2
43+
},
3744
{
3845
"element": "text",
3946
"source": "description",
40-
"order": 2
47+
"order": 3
4148
}
49+
{
50+
"element": "text",
51+
"source": "scientificMetadata.start_time.value",
52+
"order": 4
53+
},
4254
]
4355
},
4456
{
4557
"type": "attachments",
4658
"label": "Scientific Metadata",
4759
"order": 1,
60+
"row": 1,
61+
"col": 6,
4862
"options": { "limit": 10, "size": "large" }
4963
},
5064
{
5165
"type": "scientificMetadata",
5266
"label": "Scientific Metadata",
5367
"viewMode": "table",
54-
"order": 2
68+
"order": 2,
69+
"row": 1,
70+
"col": 10,
5571
},
5672
{
5773
"type": "datasetJsonView",
5874
"label": "Metadata JSON view",
59-
"order": 3
75+
"order": 3,
76+
"row": 1,
77+
"col": 10,
6078
}
6179
]
6280
}
@@ -69,7 +87,7 @@ Below you can find the example configuration, but for more advanced customizatio
6987
| **regular** | **label** | Title for the section that can be customized. | - `label`: Custom label for the section (e.g., "General Information") | `"label": "General Information"` |
7088
| | **order** | Controls the display order of the Regular section in the UI | - `order`: Integer, determines position in the UI | `"order": 0` |
7189
| | **fields** | List of fields to display within the section. It should contain an array of objects, each with `element`, `source`, and `order` fields. | | `{"fields": [{"element": "text", "source": "datasetName", "order": 0}]}` |
72-
| | - **element** | Defines the type of data to display in the row (e.g., text, copy, tag, linky, date). | - `element`: Field type (e.g., `text`, `copy`, `tag`, `linky`, `date`) | `"element": "text" ` |
90+
| | - **element** | Defines the type of data to display in the row (e.g., text, copy, tag, linky, date, internalLink). | - `element`: Field type (e.g., `text`, `copy`, `tag`, `linky`, `date`, `internalLink`) | `"element": "text" ` |
7391
| | - **source** | Specifies the dataset property to display, and it must match a field in the `OutputDatasetDto` . | - `source`: Dataset property name | `"source": "datasetName"` |
7492
| | - **order** | Controls the display order of the field in the fields. | - `order`: Integer, defines the sequence of fields in the UI. Lower values appear first. | `"order": 1` |
7593
| **attachments** | **label** | Custom label for the section that can be configured. | - `label`: Custom title for the attachments section (e.g., "Gallery") | `"label": "Scientific Metadata"` |
@@ -110,6 +128,10 @@ Below you can find the example configuration, but for more advanced customizatio
110128

111129
![alt text](./screenshots/regular-tag.png)
112130

131+
- internalLink: Converts the value into a clickable link for internal navigation. Supported fields: `instrumentIds`, `proposalIds`, `sampleIds`, and `inputDatasets`.
132+
133+
![alt text](./screenshots/regular-internalLink.png)
134+
113135
- **scientificMetadata:** Displays metadata in different views:
114136

115137
- table
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
module.exports = {
2+
async up(db, client) {
3+
await db.collection("Attachment").updateMany(
4+
{
5+
$or: [
6+
{ datasetId: { $exists: true } },
7+
{ sampleId: { $exists: true } },
8+
{ proposalId: { $exists: true } },
9+
{ id: { $exists: true } },
10+
{ aid: { $exists: false } },
11+
],
12+
},
13+
[
14+
{
15+
$set: {
16+
relationships: {
17+
// Build relationships array by checking ALL IDs
18+
$cond: [
19+
{
20+
$or: [
21+
{ $ifNull: ["$datasetId", false] },
22+
{ $ifNull: ["$sampleId", false] },
23+
{ $ifNull: ["$proposalId", false] },
24+
],
25+
},
26+
{
27+
$concatArrays: [
28+
// Add dataset relationship if datasetId exists
29+
{
30+
$cond: [
31+
{ $ifNull: ["$datasetId", false] },
32+
[
33+
{
34+
targetId: "$datasetId",
35+
targetType: "dataset",
36+
relationType: "is attached to",
37+
},
38+
],
39+
[],
40+
],
41+
},
42+
// Add sample relationship if sampleId exists
43+
{
44+
$cond: [
45+
{ $ifNull: ["$sampleId", false] },
46+
[
47+
{
48+
targetId: "$sampleId",
49+
targetType: "sample",
50+
relationType: "is attached to",
51+
},
52+
],
53+
[],
54+
],
55+
},
56+
// Add proposal relationship if proposalId exists
57+
{
58+
$cond: [
59+
{ $ifNull: ["$proposalId", false] },
60+
[
61+
{
62+
targetId: "$proposalId",
63+
targetType: "proposal",
64+
relationType: "is attached to",
65+
},
66+
],
67+
[],
68+
],
69+
},
70+
],
71+
},
72+
// Fallback to existing relationships if no IDs
73+
"$relationships",
74+
],
75+
},
76+
aid: { $ifNull: ["$id", "$_id"] },
77+
},
78+
},
79+
{ $unset: ["datasetId", "sampleId", "proposalId", "id"] },
80+
],
81+
);
82+
},
83+
84+
async down(db, client) {
85+
await db
86+
.collection("Attachment")
87+
.updateMany({ relationships: { $exists: true } }, [
88+
{
89+
$set: {
90+
datasetId: {
91+
$let: {
92+
vars: {
93+
datasetRel: {
94+
$arrayElemAt: [
95+
{
96+
$filter: {
97+
input: "$relationships",
98+
as: "rel",
99+
cond: { $eq: ["$$rel.targetType", "dataset"] },
100+
},
101+
},
102+
0,
103+
],
104+
},
105+
},
106+
in: {
107+
$ifNull: ["$$datasetRel.targetId", "$$REMOVE"],
108+
},
109+
},
110+
},
111+
sampleId: {
112+
$let: {
113+
vars: {
114+
sampleRel: {
115+
$arrayElemAt: [
116+
{
117+
$filter: {
118+
input: "$relationships",
119+
as: "rel",
120+
cond: { $eq: ["$$rel.targetType", "sample"] },
121+
},
122+
},
123+
0,
124+
],
125+
},
126+
},
127+
in: {
128+
$ifNull: ["$$sampleRel.targetId", "$$REMOVE"],
129+
},
130+
},
131+
},
132+
proposalId: {
133+
$let: {
134+
vars: {
135+
proposalRel: {
136+
$arrayElemAt: [
137+
{
138+
$filter: {
139+
input: "$relationships",
140+
as: "rel",
141+
cond: { $eq: ["$$rel.targetType", "proposal"] },
142+
},
143+
},
144+
0,
145+
],
146+
},
147+
},
148+
in: {
149+
$ifNull: ["$$proposalRel.targetId", "$$REMOVE"],
150+
},
151+
},
152+
},
153+
// Revert aid back to id.
154+
id: "$aid",
155+
},
156+
},
157+
{ $unset: ["relationships", "aid"] },
158+
]);
159+
},
160+
};

0 commit comments

Comments
 (0)