Skip to content

Commit cf8d89a

Browse files
AbdelHedhiliTheMaskedTurtleTristan-WorkGH
authored
Add announcement management page & banner (#103)
Signed-off-by: Abdelsalem <[email protected]> Co-authored-by: Abdelsalem <[email protected]> Co-authored-by: Joris Mancini <[email protected]> Signed-off-by: Tristan Chuine <[email protected]> Co-authored-by: Tristan Chuine <[email protected]>
1 parent 62d0a56 commit cf8d89a

22 files changed

+778
-59
lines changed

package-lock.json

Lines changed: 177 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,24 @@
1616
"dependencies": {
1717
"@emotion/react": "^11.14.0",
1818
"@emotion/styled": "^11.14.0",
19-
"@gridsuite/commons-ui": "0.95.0",
19+
"@gridsuite/commons-ui": "0.100.0",
2020
"@hookform/resolvers": "^4.0.0",
2121
"@mui/icons-material": "^5.16.14",
2222
"@mui/lab": "5.0.0-alpha.175",
2323
"@mui/material": "^5.16.14",
24+
"@mui/x-date-pickers": "^7.29.3",
2425
"@mui/x-tree-view": "^7.28.1",
2526
"@reduxjs/toolkit": "^2.5.1",
2627
"ag-grid-community": "^33.1.0",
2728
"ag-grid-react": "^33.1.0",
2829
"core-js": "^3.40.0",
30+
"date-fns": "^4.1.0",
2931
"notistack": "^3.0.2",
3032
"oidc-client": "^1.11.5",
3133
"react": "^18.3.1",
3234
"react-dom": "^18.3.1",
3335
"react-hook-form": "^7.54.2",
36+
"react-hook-form-mui": "^7.6.0",
3437
"react-intl": "^7.1.6",
3538
"react-redux": "^9.2.0",
3639
"react-router": "^7.4.1",

src/components/App/app-top-bar.tsx

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
useState,
1616
} from 'react';
1717
import { capitalize, Tab, Tabs, useTheme } from '@mui/material';
18-
import { Groups, ManageAccounts, PeopleAlt } from '@mui/icons-material';
18+
import { Groups, ManageAccounts, NotificationImportant, PeopleAlt } from '@mui/icons-material';
1919
import { fetchAppsMetadata, logout, Metadata, TopBar } from '@gridsuite/commons-ui';
2020
import { useParameterState } from '../parameters';
2121
import { APP_NAME, PARAM_LANGUAGE, PARAM_THEME } from '../../utils/config-params';
@@ -73,6 +73,20 @@ const tabs = new Map<MainPaths, ReactElement>([
7373
))}
7474
/>,
7575
],
76+
[
77+
MainPaths.announcements,
78+
<Tab
79+
icon={<NotificationImportant />}
80+
label={<FormattedMessage id="appBar.tabs.warningBanner" />}
81+
href={`/${MainPaths.announcements}`}
82+
value={MainPaths.announcements}
83+
key={`tab-${MainPaths.announcements}`}
84+
iconPosition="start"
85+
LinkComponent={forwardRef<HTMLAnchorElement, AnchorHTMLAttributes<HTMLAnchorElement>>((props, ref) => (
86+
<NavLink ref={ref} to={props.href as To} {...props} />
87+
))}
88+
/>,
89+
],
7690
]);
7791

7892
const AppTopBar: FunctionComponent = () => {
@@ -96,6 +110,7 @@ const AppTopBar: FunctionComponent = () => {
96110
const [languageLocal, handleChangeLanguage] = useParameterState(PARAM_LANGUAGE);
97111

98112
const [appsAndUrls, setAppsAndUrls] = useState<Metadata[]>([]);
113+
99114
useEffect(() => {
100115
if (user !== null) {
101116
fetchAppsMetadata().then((res) => {

0 commit comments

Comments
 (0)