Skip to content

Commit b6237cb

Browse files
authored
Release 27-02-2025 (#1730)
<!-- Follow semantic-release guidelines for the PR title, which is used in the changelog. Title should follow the format `<type>(<scope>): <subject>`, where - Type is one of: build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test|BREAKING CHANGE - Scope (optional) describes the place of the change (eg a particular milestone) and is usually omitted - subject should be a non-capitalized one-line description in present imperative tense and not ending with a period See https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#-git-commit-guidelines for more details. --> ## Description <!-- Short description of the pull request --> ## Motivation <!-- Background on use case, changes needed --> ## Fixes <!-- Please provide a list of the issues fixed by this PR --> * Bug fixed (#X) ## Changes: <!-- Please provide a list of the changes implemented by this PR --> * changes made ## Tests included - [ ] Included for each change/fix? - [ ] Passing? <!-- Merge will not be approved unless tests pass --> ## Documentation - [ ] swagger documentation updated (required for API changes) - [ ] official documentation updated ### official documentation info <!-- If you have updated the official documentation, please provide PR # and URL of the updated pages -->
2 parents b025c50 + 7a2c9b0 commit b6237cb

22 files changed

+994
-243
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ Valid environment variables for the .env file. See [.env.example](/.env.example)
125125
| `ACCESS_GROUPS_STATIC_VALUES` | string | Yes | Comma-separated list of access groups automatically assigned to all users. Example: "scicat, user". | |
126126
| `ACCESS_GROUPS_OIDCPAYLOAD_ENABLED` | string | Yes | Flag to enable/disable fetching access groups directly from OIDC response. Requires specifying a field via `OIDC_ACCESS_GROUPS_PROPERTY` to extract access groups. | false |
127127
| `DOI_PREFIX` | string | | The facility DOI prefix, with trailing slash. | |
128-
| `EXPRESS_SESSION_SECRET` | string | Yes | Secret used to set up express session. | |
128+
| `EXPRESS_SESSION_SECRET` | string | No | Secret used to set up express session. Required if using OIDC authentication | |
129129
| `HTTP_MAX_REDIRECTS` | number | Yes | Max redirects for HTTP requests. | 5 |
130130
| `HTTP_TIMEOUT` | number | Yes | Timeout for HTTP requests in ms. | 5000 |
131131
| `JWT_SECRET` | string | | The secret for your JWT token, used for authorization. | |
@@ -140,7 +140,9 @@ Valid environment variables for the .env file. See [.env.example](/.env.example)
140140
| `OIDC_CLIENT_SECRET` | string | Yes | Secret to provide to the OIDC service to obtain the user token. Example: Aa1JIw3kv3mQlGFWhRrE3gOdkH6xreAwro. | |
141141
| `OIDC_CALLBACK_URL` | string | Yes | SciCat callback URL to redirect to after a successful login. Example: http://myscicat/api/v3/oidc/callback. | |
142142
| `OIDC_SCOPE` | string | Yes | Space-separated list of info returned by the OIDC service. Example: "openid profile email". | |
143-
| `OIDC_SUCCESS_URL` | string | Yes | SciCat Frontend auth-callback URL. Required to pass user credentials to SciCat Frontend after OIDC login. Example: https://myscicatfrontend/auth-callback. | |
143+
| `OIDC_SUCCESS_URL` | string | Yes | SciCat Frontend auth-callback URL. Required to pass user credentials to SciCat Frontend after OIDC login. Example: https://myscicatfrontend/auth-callback. Must be `frontend-base-url/auth-callback` or `frontend-base-url/login` for the official SciCat frontend. | |
144+
| `OIDC_RETURN_URL` | string | Yes | The path segment within the SciCat Frontend to redirect to, passed as query param in `OIDC_SUCCESS_URL` and handled by frontend. Example: /datasets. | |
145+
| `OIDC_FRONTEND_CLIENTS` | string | Yes | Comma separated list of additional frontend OIDC clients for this backend. Example: scilog,maxiv. Their success and return URLs can be configured by setting `OIDC_${CLIENT}_SUCCESS_URL` (E.g. `OIDC_SCILOG_SUCCESS_URL`) and `OIDC_${CLIENT}_RETURN_URL` | |
144146
| `OIDC_ACCESS_GROUPS` | string | Yes | Functionality is still unclear. | |
145147
| `OIDC_ACCESS_GROUPS_PROPERTY` | string | Yes | Target field to get the access groups value from OIDC response. | |
146148
| `OIDC_USERINFO_MAPPING_FIELD_USERNAME` | string | Yes | Comma-separated list of fields from the OIDC response to use as the user's profile username. Example: `OIDC_USERINFO_MAPPING_FIELD_USERNAME="iss, sub"`. | "preferred_username" \|\| "name" |
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
# Dynamic Dataset Detail Component - Frontend Configuration Guide
2+
3+
## Overview
4+
5+
This guide provides details on configuring the **Dynamic Dataset Detail Component** on the frontend. This component can be customized to display dataset information in various templates and layouts based on your needs.
6+
The configuration needs to be provided or mounted in `/src/config/frontend.config.json`
7+
8+
## Configuration guide
9+
10+
The `datasetDetailComponent` field allows you to customize the display of dataset details using 4 template types. Each template type is rendered based on the order property, which determines the display priority. The available template types are listed in the Component Configuration Table.
11+
12+
You can define labels directly using the `label/source` property, or use them as keys for localization. If no localization configuration is provided, the template will fall back to using the `label/source` as the default value.
13+
14+
The `enableCustomizedComponent` flag enables or disables the dynamic component. If set to false, the default dataset detail component will be used. In the customization field, you can provide configuration for the components, including their types, labels, and other settings.
15+
16+
Below you can find the example configuration, but for more advanced customizations, refer to the Component Configuration Table for detailed options on each template type and field configuration.
17+
18+
```json
19+
"datasetDetailComponent": {
20+
"enableCustomizedComponent": true,
21+
"customization": [
22+
{
23+
"type": "regular",
24+
"label": "General Information",
25+
"order": 0,
26+
"fields": [
27+
{
28+
"element": "text",
29+
"source": "datasetName",
30+
"order": 0
31+
},
32+
{
33+
"element": "copy",
34+
"source": "pid",
35+
"order": 1
36+
},
37+
{
38+
"element": "text",
39+
"source": "description",
40+
"order": 2
41+
}
42+
]
43+
},
44+
{
45+
"type": "attachments",
46+
"label": "Scientific Metadata",
47+
"order": 1,
48+
"options": { "limit": 10, "size": "large" }
49+
},
50+
{
51+
"type": "scientificMetadata",
52+
"label": "Scientific Metadata",
53+
"viewMode": "table",
54+
"order": 2
55+
},
56+
{
57+
"type": "datasetJsonView",
58+
"label": "Metadata JSON view",
59+
"order": 3
60+
}
61+
]
62+
}
63+
```
64+
65+
## Component Configuration Table
66+
67+
| **Template Type** | **Configurable Fields** | **Field Description** | **Configurable Options** | **Example** |
68+
| ---------------------- | ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
69+
| **regular** | **label** | Title for the section that can be customized. | - `label`: Custom label for the section (e.g., "General Information") | `"label": "General Information"` |
70+
| | **order** | Controls the display order of the Regular section in the UI | - `order`: Integer, determines position in the UI | `"order": 0` |
71+
| | **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" ` |
73+
| | - **source** | Specifies the dataset property to display, and it must match a field in the `OutputDatasetDto` . | - `source`: Dataset property name | `"source": "datasetName"` |
74+
| | - **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` |
75+
| **attachments** | **label** | Custom label for the section that can be configured. | - `label`: Custom title for the attachments section (e.g., "Gallery") | `"label": "Scientific Metadata"` |
76+
| | **order** | Controls the display order of the attachments section in the UI. | - `order`: Integer, determines sequence within the template. | `"order": 1` |
77+
| | **options** | Allows configuration for the display of attachments. | | `{"options": {"limit": 10, "size": "large"}}` |
78+
| | **options.limit** | Limits the number of items to display in the attachment section. | - `limit`: Number of items to display (e.g., 10). | `"limit": 10` |
79+
| | **options.size** | Configures the display size of attachments (small, medium, or large). | - `size`: Display size (small, medium, large). | `"size": "small"` |
80+
| **scientificMetadata** | **label** | Customizable label for the scientific metadata section. | - `label`: Custom section title (e.g., "Scientific Metadata") | `"label": "Scientific Metadata"` |
81+
| | **viewMode** | Defines how the scientific metadata is rendered (as a table, JSON, or tree view). | - `viewMode`: `table`, `json`, or `tree` | `"viewMode": "table"` |
82+
| | **order** | Controls the display order of the scientific metadata section. | - `order`: Integer, determines position in the UI | `"order": 2` |
83+
| **datasetJsonView** | **label** | Label for the JSON view section. | - `label`: Custom section title (e.g., "Metadata JSON view") | `"label": "Metadata JSON view"` |
84+
| | **order** | Controls the display order of the dataset JSON view. | - `order`: Integer, determines position in the UI | `"order": 3` |
85+
86+
---
87+
88+
## Template Types Example Preview
89+
90+
- **regular:** Displays dataset properties in configurable rows.
91+
Can be customized with different elements.
92+
93+
- text: Displays a simple string
94+
95+
![alt text](./screenshots/regular-text.png)
96+
97+
- linky: Automatically transforms URLs or emails into clickable links.
98+
99+
![alt text](./screenshots/regular-linky.png)
100+
101+
- copy: Displays a copy-to-clipboard button
102+
103+
![alt text](./screenshots/regular-copy.png)
104+
105+
- date: Displays a formatted date based on the dateFormat value in the frontend config file
106+
107+
![alt text](./screenshots/regular-date.png)
108+
109+
- tag: Displays a list of items as tags
110+
111+
![alt text](./screenshots/regular-tag.png)
112+
113+
- **scientificMetadata:** Displays metadata in different views:
114+
115+
- table
116+
117+
![alt text](./screenshots/scientificMetadata-table.png)
118+
119+
- json
120+
121+
![alt text](./screenshots/scientificMetadata-json.png)
122+
123+
- tree
124+
125+
![alt text](./screenshots/scientificMetadata-tree.png)
126+
127+
- **datasetJsonView:** Displays the dataset as a JSON document as addition.
128+
- **attachments:** Displays the attachments associated with the dataset. You can configure options like display size and limit the number of items.
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading

0 commit comments

Comments
 (0)