Skip to content
Merged
Show file tree
Hide file tree
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 Jun 4, 2025
63e0cb8
chore: implement base application layout
sKrzysieK Jun 10, 2025
82407cd
feat: implement getConfigurationByKey endpoint, refactor QCConfigurat…
piechnikk Jun 10, 2025
1e340a8
small code refactor
piechnikk Jun 11, 2025
2b9f004
feat: created section headers
sKrzysieK Jun 11, 2025
7a1b149
chore: minor component adjustments
sKrzysieK Jun 11, 2025
7e87f4f
Merge branch 'feature/CNF/OGUI-1698/implement-configuration-endpoint'…
sKrzysieK Jun 11, 2025
15c579b
Merge branch 'feature/CNF/OGUI-1698/implement-configuration-endpoint'…
sKrzysieK Jun 11, 2025
9f0b210
tmp commit
sKrzysieK Jun 15, 2025
2588750
chore: reorganize main layout
sKrzysieK Jun 15, 2025
7a29f9b
chore: implement tests
sKrzysieK Jun 15, 2025
cf1b1df
Merge branch 'feature/CNF/OGUI-1700/base-app-layout' into feature/CNF…
sKrzysieK Jun 16, 2025
e57933c
chore: add test for config keys list
sKrzysieK Jun 16, 2025
56db191
chore: adjust list styles
sKrzysieK Jun 16, 2025
d27c297
Merge branch 'dev' into feature/CNF/OGUI-1700/base-app-layout
sKrzysieK Jun 18, 2025
8770fae
chore: remove unused vars
sKrzysieK Jun 18, 2025
3d360cc
Merge branch 'feature/CNF/OGUI-1700/base-app-layout' into feature/CNF…
sKrzysieK Jun 18, 2025
c2664e3
chore: add license sections
sKrzysieK Jun 18, 2025
e873d57
Merge branch 'feature/CNF/OGUI-1700/base-app-layout' into feature/CNF…
sKrzysieK Jun 18, 2025
71b44b0
Merge branch 'dev' into feature/CNF/OGUI-1699/configuration-keys-display
sKrzysieK Aug 25, 2025
1c60f34
chore: add missing documentation and typefixes
sKrzysieK Aug 25, 2025
3c0843b
chore: eslint fixes
sKrzysieK Aug 25, 2025
4234c1e
chore: fix package-lock.json
sKrzysieK Aug 25, 2025
d08bc9e
chore: add config navigator test
sKrzysieK Aug 25, 2025
fae2b11
Merge branch 'dev' into feature/CNF/OGUI-1699/configuration-keys-display
sKrzysieK Aug 28, 2025
cd706d6
Merge branch 'dev' into feature/CNF/OGUI-1699/configuration-keys-display
sKrzysieK Aug 28, 2025
0dfdc6c
fix: remove old control changes
sKrzysieK Aug 28, 2025
7e1dcd1
Merge branch 'dev' into feature/CNF/OGUI-1699/configuration-keys-display
sKrzysieK Sep 3, 2025
57cbb61
Merge branch 'dev' into feature/CNF/OGUI-1699/configuration-keys-display
sKrzysieK Oct 1, 2025
c3be3f0
chore: add config keys fetching error handling
sKrzysieK Oct 5, 2025
0d1bd28
chore: adjust docs
sKrzysieK Oct 5, 2025
8ab1dc6
chore: adjust tests
sKrzysieK Oct 5, 2025
4b8cd52
Merge branch 'dev' into feature/CNF/OGUI-1699/configuration-keys-display
sKrzysieK Oct 5, 2025
9e1f60d
Merge branch 'dev' into feature/CNF/OGUI-1699/configuration-keys-display
sKrzysieK Oct 6, 2025
bd1012a
Merge branch 'dev' into feature/CNF/OGUI-1699/configuration-keys-display
sKrzysieK Oct 7, 2025
4ed2304
Merge branch 'dev' into feature/CNF/OGUI-1699/configuration-keys-display
sKrzysieK Oct 8, 2025
fe2ad92
Merge branch 'dev' into feature/CNF/OGUI-1699/configuration-keys-display
sKrzysieK Oct 10, 2025
e7762ee
Merge branch 'dev' into feature/CNF/OGUI-1699/configuration-keys-display
sKrzysieK Oct 13, 2025
6f0fed6
Merge branch 'dev' into feature/CNF/OGUI-1699/configuration-keys-display
sKrzysieK Oct 31, 2025
66977be
chore: fix tests
sKrzysieK Oct 31, 2025
3fe9490
chore: update tests
sKrzysieK Oct 31, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>
);
};
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;
10 changes: 3 additions & 7 deletions Configuration/webapp/app/components/layout/MainLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,21 @@

import { Box } from '@mui/material';
import { type FC, type PropsWithChildren } from 'react';
import { LeftDrawer } from './drawer/LeftDrawer';
import { Content } from './content/Content';

/**
* MainLayout component
* Represents the main layout of the application, including the left drawer and content area.
* @param {PropsWithChildren} props - Component props.
Comment thread
sKrzysieK marked this conversation as resolved.
* @param {ReactElement} props.children - The children elements to render inside main layout.
* @returns {React.ReactElement} MainLayout
*/
const MainLayout: FC<PropsWithChildren> = ({ children }) => (
export const MainLayout: FC<PropsWithChildren> = ({ children }) => (
<Box
sx={{
display: 'flex',
height: '100vh',
}}
>
<LeftDrawer />
<Content>{children}</Content>
{children}
</Box>
);

export default MainLayout;
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ interface ContentHeaderProps {
}

/**
* ContentHeader component
* Represents the header of the content area in the application layout.
* It displays the current path and includes a user section.
* @param {ContentHeaderProps} props - Component props.
* @returns {React.ReactElement} ContentHeader
* Content component
* Represents the header of the content area.
* @param {ContentHeaderProps} props - The props of the component.
* @param {string} props.currentPath - Current configuration path.
* @returns {React.ReactElement} Content
*/
export const ContentHeader: FC<ContentHeaderProps> = ({ currentPath }) => (
<Toolbar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,21 @@
* or submit itself to any jurisdiction.
*/

import { Box, Drawer, List, ListItem, ListItemText } from '@mui/material';
import { type FC, type PropsWithChildren } from 'react';
import { Box, Drawer } from '@mui/material';
import { LeftDrawerFooter } from './LeftDrawerFooter';
import { LeftDrawerHeader } from './LeftDrawerHeader';

const DRAWER_WIDTH = 250;
const DRAWER_WIDTH = 300;

/**
* LeftDrawer component
* Represents the left sidebar of the application layout.
* @param {PropsWithChildren} props - The props of the component.
* @param {ReactElement} props.children - The children elements to render inside the drawer.
* @returns {ReactElement} LeftDrawer
*/
export const LeftDrawer = () => (
export const LeftDrawer: FC<PropsWithChildren> = ({ children }) => (
Comment thread
sKrzysieK marked this conversation as resolved.
<Drawer
sx={{
width: DRAWER_WIDTH,
Expand All @@ -40,15 +43,7 @@ export const LeftDrawer = () => (
className="left-drawer"
>
<LeftDrawerHeader />
<Box sx={{ overflow: 'auto', flexGrow: 1 }}>
<List>
{['Item 1', 'Item 2', 'Item 3', 'Item 4'].map((text) => (
<ListItem key={text}>
<ListItemText primary={text} />
</ListItem>
))}
</List>
</Box>
<Box sx={{ overflow: 'auto', flexGrow: 1 }}>{children}</Box>
<LeftDrawerFooter />
</Drawer>
);
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* or submit itself to any jurisdiction.
*/

import { useState, type FC, type MouseEvent } from 'react';
import { Box, IconButton, Menu, MenuItem, Avatar } from '@mui/material';
import { useState, type FC, type MouseEvent } from 'react';
import { getSessionData } from '~/services/session';

interface UserSectionProps {
Expand Down
13 changes: 10 additions & 3 deletions Configuration/webapp/app/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@ import {
import type { Route } from './+types/root';
import './app.css';
import '@aliceo2/web-ui/Frontend/css/src/bootstrap.css';

import { Spinner } from '~/ui/spinner';

import MainLayout from './components/layout/MainLayout';
import { MainLayout } from './components/layout/MainLayout';
import { LeftDrawer } from './components/layout/drawer/LeftDrawer';
import { Content } from './components/layout/content/Content';
import { ConfigNavigator } from './components/config-navigator/ConfigNavigator';

/**
* Root component
Expand All @@ -45,7 +47,12 @@ export function Layout({ children }: { children: React.ReactNode }) {
<Links />
</head>
<body>
<MainLayout>{children}</MainLayout>
<MainLayout>
<LeftDrawer>
<ConfigNavigator />
</LeftDrawer>
<Content>{children}</Content>
</MainLayout>
<ScrollRestoration />
<Scripts />
</body>
Expand Down
49 changes: 49 additions & 0 deletions Configuration/webapp/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Configuration/webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
"@aliceo2/web-ui": "^2.7.4",
"@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.0",
"@fortawesome/fontawesome-svg-core": "^6.7.2",
Comment thread
sKrzysieK marked this conversation as resolved.
"@fortawesome/free-solid-svg-icons": "^6.7.2",
"@fortawesome/react-fontawesome": "^0.2.2",
"@mui/material": "^7.1.1",
"@react-router/node": "7.5.3",
"isbot": "^5",
Expand Down
36 changes: 36 additions & 0 deletions Configuration/webapp/test/public/page-root-mocha.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,40 @@ describe('`pageRoot` test-suite', function () {
const userSectionMenu = await page.$$('.user-section__menu');
assert.strictEqual(userSectionMenu.length, 1);
});

it('should successfully display configurations list', async function () {
if (page === null) {
assert.equal('Page is null', 'test suite failed');
return;
}

const configNavigator = await page.$$('.config_navigator');
assert.strictEqual(configNavigator.length, 1);
});

it('should successfully display configurations list items', async function () {
if (page === null || url === null) {
assert.equal('Page is null', 'test suite failed');
return;
}

const res = await fetch('http://localhost:8080/control/api/configurations');
const data = await res.json();

const configNavigatorItems = await page.$$('.config_navigator__item');
assert.strictEqual(configNavigatorItems.length, data?.length ?? 0);
});

it('should display configurations list', async function () {
if (page === null || url === null) {
assert.equal('Page is null', 'test suite failed');
return;
}

const res = await fetch('http://localhost:8080/control/api/configurations');
const data = await res.json();

const configNavigatorItems = await page.$$('.config_navigator__item');
assert.strictEqual(configNavigatorItems.length, data?.length ?? 0);
});
});