-
Notifications
You must be signed in to change notification settings - Fork 14
[OGUI-1699] Display configuration keys #2946
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
Merged
graduta
merged 41 commits into
dev
from
feature/CNF/OGUI-1699/configuration-keys-display
Oct 31, 2025
Merged
Changes from all commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
f2631ea
feat: add configuration endpoint
piechnikk 63e0cb8
chore: implement base application layout
sKrzysieK 82407cd
feat: implement getConfigurationByKey endpoint, refactor QCConfigurat…
piechnikk 1e340a8
small code refactor
piechnikk 2b9f004
feat: created section headers
sKrzysieK 7a1b149
chore: minor component adjustments
sKrzysieK 7e87f4f
Merge branch 'feature/CNF/OGUI-1698/implement-configuration-endpoint'…
sKrzysieK 15c579b
Merge branch 'feature/CNF/OGUI-1698/implement-configuration-endpoint'…
sKrzysieK 9f0b210
tmp commit
sKrzysieK 2588750
chore: reorganize main layout
sKrzysieK 7a29f9b
chore: implement tests
sKrzysieK cf1b1df
Merge branch 'feature/CNF/OGUI-1700/base-app-layout' into feature/CNF…
sKrzysieK e57933c
chore: add test for config keys list
sKrzysieK 56db191
chore: adjust list styles
sKrzysieK d27c297
Merge branch 'dev' into feature/CNF/OGUI-1700/base-app-layout
sKrzysieK 8770fae
chore: remove unused vars
sKrzysieK 3d360cc
Merge branch 'feature/CNF/OGUI-1700/base-app-layout' into feature/CNF…
sKrzysieK c2664e3
chore: add license sections
sKrzysieK e873d57
Merge branch 'feature/CNF/OGUI-1700/base-app-layout' into feature/CNF…
sKrzysieK 71b44b0
Merge branch 'dev' into feature/CNF/OGUI-1699/configuration-keys-display
sKrzysieK 1c60f34
chore: add missing documentation and typefixes
sKrzysieK 3c0843b
chore: eslint fixes
sKrzysieK 4234c1e
chore: fix package-lock.json
sKrzysieK d08bc9e
chore: add config navigator test
sKrzysieK fae2b11
Merge branch 'dev' into feature/CNF/OGUI-1699/configuration-keys-display
sKrzysieK cd706d6
Merge branch 'dev' into feature/CNF/OGUI-1699/configuration-keys-display
sKrzysieK 0dfdc6c
fix: remove old control changes
sKrzysieK 7e1dcd1
Merge branch 'dev' into feature/CNF/OGUI-1699/configuration-keys-display
sKrzysieK 57cbb61
Merge branch 'dev' into feature/CNF/OGUI-1699/configuration-keys-display
sKrzysieK c3be3f0
chore: add config keys fetching error handling
sKrzysieK 0d1bd28
chore: adjust docs
sKrzysieK 8ab1dc6
chore: adjust tests
sKrzysieK 4b8cd52
Merge branch 'dev' into feature/CNF/OGUI-1699/configuration-keys-display
sKrzysieK 9e1f60d
Merge branch 'dev' into feature/CNF/OGUI-1699/configuration-keys-display
sKrzysieK bd1012a
Merge branch 'dev' into feature/CNF/OGUI-1699/configuration-keys-display
sKrzysieK 4ed2304
Merge branch 'dev' into feature/CNF/OGUI-1699/configuration-keys-display
sKrzysieK fe2ad92
Merge branch 'dev' into feature/CNF/OGUI-1699/configuration-keys-display
sKrzysieK e7762ee
Merge branch 'dev' into feature/CNF/OGUI-1699/configuration-keys-display
sKrzysieK 6f0fed6
Merge branch 'dev' into feature/CNF/OGUI-1699/configuration-keys-display
sKrzysieK 66977be
chore: fix tests
sKrzysieK 3fe9490
chore: update tests
sKrzysieK File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
56 changes: 56 additions & 0 deletions
56
Configuration/webapp/app/components/config-navigator/ConfigNavigator.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| /** | ||
| * @license | ||
| * Copyright 2019-2020 CERN and copyright holders of ALICE O2. | ||
| * See http://alice-o2.web.cern.ch/copyright for details of the copyright holders. | ||
| * All rights not expressly granted are reserved. | ||
| * | ||
| * This software is distributed under the terms of the GNU General Public | ||
| * License v3 (GPL Version 3), copied verbatim in the file "COPYING". | ||
| * | ||
| * In applying this license CERN does not waive the privileges and immunities | ||
| * granted to it by virtue of its status as an Intergovernmental Organization | ||
| * or submit itself to any jurisdiction. | ||
| */ | ||
|
|
||
| import { List } from '@mui/material'; | ||
| import { useEffect, useState } from 'react'; | ||
| import ConfigNavigatorItem from './ConfigNavigatorItem'; | ||
|
|
||
| /** | ||
| * ConfigNavigator component | ||
| * Represents the configuration navigator sidebar. | ||
| * @returns {React.ReactElement} ConfigNavigator | ||
| */ | ||
| export const ConfigNavigator = () => { | ||
| const [configKeys, setConfigKeys] = useState<string[]>([]); | ||
| const [isError, setIsError] = useState(false); | ||
|
|
||
| const fetchConfigurationKeys = async () => { | ||
| try { | ||
| const res = await fetch('http://localhost:8080/control/api/configurations'); | ||
| const data = (await res.json()) as string[]; | ||
| const newConfigKeys = data?.map((key) => key.split('/').pop() ?? ''); | ||
| setConfigKeys(newConfigKeys); | ||
| } catch (_error) { | ||
| // temporarily disable the linting rule for this line | ||
| // fetching will be refactored once Tanstack Query is introduced | ||
| // eslint-disable-next-line no-console | ||
| console.error('Error while fetching configuration keys', _error); | ||
| setIsError(true); | ||
| } | ||
| }; | ||
|
|
||
| useEffect(() => { | ||
| void fetchConfigurationKeys(); | ||
| }, []); | ||
|
|
||
| return ( | ||
| <List className="config_navigator"> | ||
| {isError ? ( | ||
| <p>Error while fetching configuration keys</p> | ||
| ) : ( | ||
| configKeys?.map((text) => <ConfigNavigatorItem key={text} title={text} />) | ||
| )} | ||
| </List> | ||
| ); | ||
| }; |
45 changes: 45 additions & 0 deletions
45
Configuration/webapp/app/components/config-navigator/ConfigNavigatorItem.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| /** | ||
| * @license | ||
| * Copyright 2019-2020 CERN and copyright holders of ALICE O2. | ||
| * See http://alice-o2.web.cern.ch/copyright for details of the copyright holders. | ||
| * All rights not expressly granted are reserved. | ||
| * | ||
| * This software is distributed under the terms of the GNU General Public | ||
| * License v3 (GPL Version 3), copied verbatim in the file "COPYING". | ||
| * | ||
| * In applying this license CERN does not waive the privileges and immunities | ||
| * granted to it by virtue of its status as an Intergovernmental Organization | ||
| * or submit itself to any jurisdiction. | ||
| */ | ||
|
|
||
| import { type FC } from 'react'; | ||
| import { ListItem, ListItemButton, ListItemIcon, ListItemText } from '@mui/material'; | ||
|
|
||
| import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; | ||
| import { faFile } from '@fortawesome/free-solid-svg-icons'; | ||
|
|
||
| interface ConfigNavigatorItemProps { | ||
| title: string; | ||
| onClick?: () => void; | ||
| } | ||
|
|
||
| /** | ||
| * ConfigNavigatorItem component | ||
| * Represents an item in the configuration navigator. | ||
| * @param {ConfigNavigatorItemProps} props - The props of the component. | ||
| * @param {string} props.title - The title of the configuration item. | ||
| * @param {Function} props.onClick - Callback function to handle item click. | ||
| * @returns {React.ReactElement} ConfigNavigatorItem | ||
| */ | ||
| const ConfigNavigatorItem: FC<ConfigNavigatorItemProps> = ({ title, onClick }) => ( | ||
| <ListItem style={{ paddingTop: 5, paddingBottom: 5 }} className="config_navigator__item"> | ||
| <ListItemButton onClick={onClick} color="red" sx={{ borderRadius: 2, padding: 0 }}> | ||
| <ListItemIcon> | ||
| <FontAwesomeIcon icon={faFile} style={{ margin: 'auto' }} /> | ||
| </ListItemIcon> | ||
| <ListItemText primary={title} /> | ||
| </ListItemButton> | ||
| </ListItem> | ||
| ); | ||
|
|
||
| export default ConfigNavigatorItem; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.