-
Notifications
You must be signed in to change notification settings - Fork 1
adds template for frontend configuration documentation #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
e378067
2fb9b99
d0c1d6f
93c7b60
b4770ef
aa939ca
4ca995b
ee73611
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| # SciCat jobs - how to use them | ||
|
|
||
| If you want to post a jobs, check the structure of the job's body. From swagger endpoints we see that there are 4 fields: | ||
|
|
||
| * types (mandatory) | ||
| * jobsParams (mandatory) | ||
| * ownerUser | ||
| * ownerGroup | ||
|
|
||
|
|
||
| ## **jobTypes** | ||
|
|
||
| Possible values can be seen from the [example config file](https://github.com/SciCatProject/scicat-backend-next/blob/master/jobConfig.example.yaml): | ||
|
|
||
| 1. jobType: template_job | ||
| 2. jobType: archive | ||
| 3. jobType: retrieve | ||
| 4. jobType: public | ||
| 5. jobType: email_demo | ||
| 6. jobType: url_demo | ||
| 7. jobType: rabbitmq_demo | ||
| 8. jobType: switch_demo | ||
| 9. jobType: validate_demo | ||
|
|
||
|
|
||
| ## **actionTypes** | ||
|
|
||
| Per job one can execute several actions. There are these actionTypes: | ||
|
|
||
| 1. actionType: log | ||
| 2. actionType: validate | ||
| 3. actionType: rabbitmq | ||
| 4. actionType: url | ||
| 5. actionType: switch | ||
| 6. actionType: email | ||
| 7. actionType: error |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| # Frontend configuration | ||
|
|
||
| In only two json files SciCat's frontend configuration is managed, both as part of the backend configuration: | ||
|
|
||
| 1. [frontend.config.json](https://github.com/SciCatProject/scicat-backend-next/blob/master/src/config/frontend.config.json) and | ||
| 2. [frontend.theme.json](https://github.com/SciCatProject/scicat-backend-next/blob/master/src/config/frontend.theme.json) | ||
|
|
||
| Please write about | ||
| - Why the frontend config is in the backend config? | ||
| - What the scope is of these two files? | ||
| - Please provide code snippets examples for enabling/disabling buttons. Add ideally screenshots. | ||
|
|
||
| # Default List & Filter Configuration Pattern - Frontend Configuration Guide | ||
|
|
||
| ## Overview | ||
|
|
||
| This guide explains how to configure the List & Side-Panel Configuration Pattern used on the frontend. | ||
| It allows customizing how list-based components (e.g., datasets, proposals) display table columns, side-panel filters, and optional query conditions. | ||
|
|
||
| The configuration should be defined or mounted at the location specified by the environment variable `FRONTEND_CONFIG_FILE` (default: `src/config/frontend.config.json`). | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this for both documents - Also how does this work with the FRONTEND_CONFIG_FILE environment variable? I am trying to use this:
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also it seems we need a FRONTEND_THEME_CONFIG file as well. Perhaps we could include this in the docs? |
||
|
|
||
| ## Configuration Details | ||
|
|
||
| ### **Columns** | ||
|
|
||
| Defines how each field is displayed in the list table. | ||
|
|
||
| | **Property** | **Type** | **Description** | **Example / Notes** | | ||
| | ------------ | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------- | | ||
| | `name` | `string` | Object key whose value will be displayed in the column. | `"datasetName"` | | ||
| | `order` | `number` | Position of the column in the table. | `2` | | ||
| | `type` | `string` | How the value is rendered:<br>• `standard` – plain text (default)<br>• `hoverContent` – shows icon with popup/modal when mouseover (for long text)<br>• `date` – formats ISO date strings; can include a `format` (e.g. `yyyy-MM-dd`) | `"date"` | | ||
| | `width` | `number` | Default width of the column. | `200` | | ||
| | `format` | `string` | Optional property used **only** when `type` is set to `date`. Defines how ISO date strings are displayed (e.g. `yyyy-MM-dd`). <br> it fallsback to `dateFormat` or `yyyy-MM-dd HH:mm` for dataset and `yyyy-MM-dd` for proposal | `"yyyy-MM-dd"` | | ||
| | `enabled` | `boolean` | Whether the column is displayed by default. | `true` | | ||
|
|
||
| --- | ||
|
|
||
| ### **Filters** | ||
|
|
||
| Defines which filters appear in the side panel and how they behave. | ||
|
|
||
| | **Property** | **Type** | **Description** | **Example / Notes** | | ||
| | ------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------- | | ||
| | `key` | `string` | Object key used for filtering. | `"creationTime"` | | ||
| | `label` | `string` | Custom label for the filter. If not provided, it falls back to `labelLocalization` or `key`. | `"Creation Time"` | | ||
| | `type` | `string` | Filter input type:<br>• `text` – _deprecated_ (use search box)<br>• `multiSelect` – dropdown with multiple options; supports `checkBoxFilterClickTrigger` for auto-apply<br>• `dateRange` – calendar or manual from–to input<br>• `checkbox` – pre-populated list; supports `checkBoxFilterClickTrigger` for auto-apply | `"multiSelect"` | | ||
| | `description` | `string` | Tooltip text for the filter. | `"Filter by dataset type"` | | ||
| | `enabled` | `boolean` | Whether the filter is active by default. | `true` | | ||
|
|
||
| --- | ||
|
|
||
| ### **Conditions** | ||
|
|
||
| Defines predefined condition filter in the side panel (currently supported only for the dataset table) | ||
|
|
||
| | **Property** | **Type** | **Description** | **Example / Notes** | | ||
| | ------------ | -------- | ------------------------------------------------- | ------------------- | | ||
| | _–_ | _–_ | Currently supported **only for dataset filters**. | — | | ||
| | `lhs` | `string` | Metadata key to filter on | `"outgassing_values_after_1h"` | | ||
| | `relation` | `string` | Comparison operator:<br>• `GREATER_THAN`<br>• `GREATER_THAN_OR_EQUAL`<br>• `LESS_THAN`<br>• `LESS_THAN_OR_EQUAL`<br>• `EQUAL_TO`<br>• `RANGE` | `"EQUAL_TO"` | | ||
| | `rhs` | `string` | Value to compare against | `"3.1e4"` | | ||
| | `unit` | `string` | **Optional** unit for the value | `"mbar l/s/cm^2"` | | ||
| | `unitsOptions`| `string[]`| **Optional** A list of allowed units for this condition. When provided, the unit dropdown will be restricted to only these options | `["mbar l/s/cm^2", "Pa m^3/s/m^2"]` | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we add something about where to mount these files in the backend container - or point to this in SciCat live?