Skip to content

Commit c808e2b

Browse files
committed
update with commons-ui GsLangUser and PARAM constants
Signed-off-by: David BRAQUART <[email protected]>
1 parent 75e8a4e commit c808e2b

File tree

8 files changed

+21
-14
lines changed

8 files changed

+21
-14
lines changed

src/components/App/App.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,16 @@ import {
1818
getPreLoginPath,
1919
initializeAuthenticationProd,
2020
NotificationsUrlKeys,
21+
PARAM_LANGUAGE,
22+
PARAM_THEME,
2123
useNotificationsListener,
2224
UserManagerState,
2325
useSnackMessage,
2426
} from '@gridsuite/commons-ui';
2527
import { selectComputedLanguage, selectLanguage, selectTheme } from '../../redux/actions';
2628
import { AppState } from '../../redux/reducer';
2729
import { AppsMetadataSrv, ConfigParameters } from '../../services';
28-
import { APP_NAME, COMMON_APP_NAME, PARAM_LANGUAGE, PARAM_THEME } from '../../utils/config-params';
30+
import { APP_NAME, COMMON_APP_NAME } from '../../utils/config-params';
2931
import AppTopBar from './AppTopBar';
3032
import { useDebugRender } from '../../utils/hooks';
3133
import { AppDispatch } from '../../redux/store';

src/components/App/AppTopBar.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,17 @@
88
import { type AnchorHTMLAttributes, forwardRef, type ReactElement, SyntheticEvent, useEffect, useState } from 'react';
99
import { capitalize, Tab, Tabs, TabsProps, useTheme } from '@mui/material';
1010
import { Groups, ManageAccounts, NotificationImportant, PeopleAlt } from '@mui/icons-material';
11-
import { fetchAppsMetadata, logout, Metadata, TopBar, UserManagerState } from '@gridsuite/commons-ui';
11+
import {
12+
fetchAppsMetadata,
13+
logout,
14+
Metadata,
15+
PARAM_LANGUAGE,
16+
PARAM_THEME,
17+
TopBar,
18+
UserManagerState,
19+
} from '@gridsuite/commons-ui';
1220
import { useParameterState } from '../parameters';
13-
import { APP_NAME, PARAM_LANGUAGE, PARAM_THEME } from '../../utils/config-params';
21+
import { APP_NAME } from '../../utils/config-params';
1422
import { NavLink, type To, useNavigate } from 'react-router';
1523
import { useDispatch, useSelector } from 'react-redux';
1624
import { FormattedMessage } from 'react-intl';

src/components/App/AppWrapper.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ import {
3333
topBarFr,
3434
errorsEn,
3535
errorsFr,
36+
PARAM_THEME,
3637
} from '@gridsuite/commons-ui';
3738
import { type IntlConfig, IntlProvider } from 'react-intl';
3839
import { Provider, useSelector } from 'react-redux';
3940
import messages_en from '../../translations/en.json';
4041
import messages_fr from '../../translations/fr.json';
4142
import { store } from '../../redux/store';
42-
import { PARAM_THEME } from '../../utils/config-params';
4343
import { AppState } from '../../redux/reducer';
4444
import { useNotificationsUrlGenerator } from '../../utils/notifications-provider';
4545
import { AllCommunityModule, ModuleRegistry, provideGlobalGridOptions } from 'ag-grid-community';

src/pages/common/use-csv-export.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77

88
import { useMemo, RefObject } from 'react';
9-
import { CsvExport, GsLang } from '@gridsuite/commons-ui';
9+
import { CsvExport, GsLangUser } from '@gridsuite/commons-ui';
1010
import { IntlShape } from 'react-intl';
1111
import { GridTableRef } from '../../components/Grid';
1212
import { ColDef } from 'ag-grid-community';
@@ -22,7 +22,7 @@ export function useCsvExport<TData>({
2222
columns: ColDef[];
2323
tableNameId: string;
2424
intl: IntlShape;
25-
language: GsLang;
25+
language: GsLangUser;
2626
}) {
2727
return useMemo(
2828
() => (

src/redux/actions.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
66
*/
77

8-
import { GsTheme, UserManagerState } from '@gridsuite/commons-ui';
9-
import { PARAM_LANGUAGE } from '../utils/config-params';
8+
import { GsTheme, PARAM_LANGUAGE, UserManagerState } from '@gridsuite/commons-ui';
109
import { Action } from 'redux';
1110
import type { AppState } from './reducer';
1211

src/redux/reducer.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ import {
3434
GsTheme,
3535
LOGOUT_ERROR,
3636
LogoutErrorAction,
37+
PARAM_LANGUAGE,
38+
PARAM_THEME,
3739
RESET_AUTHENTICATION_ROUTER_ERROR,
3840
SHOW_AUTH_INFO_LOGIN,
3941
ShowAuthenticationRouterLoginAction,
@@ -47,7 +49,6 @@ import {
4749
UserManagerState,
4850
UserValidationErrorAction,
4951
} from '@gridsuite/commons-ui';
50-
import { PARAM_LANGUAGE, PARAM_THEME } from '../utils/config-params';
5152

5253
export type AppState = CommonStoreState & {
5354
computedLanguage: GsLangUser;

src/services/config.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
66
*/
77

8-
import { GsLang, GsTheme } from '@gridsuite/commons-ui';
9-
import { PARAM_LANGUAGE, PARAM_THEME } from '../utils/config-params';
8+
import { GsLang, GsTheme, PARAM_LANGUAGE, PARAM_THEME } from '@gridsuite/commons-ui';
109

1110
// https://github.com/gridsuite/config-server/blob/main/src/main/java/org/gridsuite/config/server/dto/ParameterInfos.java
1211
export type ConfigParameter =

src/utils/config-params.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,11 @@
66
*/
77

88
import type { LiteralUnion } from 'type-fest';
9+
import { PARAM_LANGUAGE, PARAM_THEME } from '@gridsuite/commons-ui';
910

1011
export const COMMON_APP_NAME = 'common';
1112
export const APP_NAME = 'admin';
1213

13-
export const PARAM_THEME = 'theme';
14-
export const PARAM_LANGUAGE = 'language';
15-
1614
const COMMON_CONFIG_PARAMS_NAMES = new Set([PARAM_THEME, PARAM_LANGUAGE]);
1715

1816
export type AppConfigParameter = LiteralUnion<typeof PARAM_THEME | typeof PARAM_LANGUAGE, string>;

0 commit comments

Comments
 (0)