@opengeoweb/authentication 9.22.0 → 9.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.esm.js CHANGED
@@ -2,8 +2,8 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
2
  import React, { useRef } from 'react';
3
3
  import axios from 'axios';
4
4
  import { Navigate, useLocation, Link } from 'react-router-dom';
5
- import { useIsMounted, AlertBanner } from '@opengeoweb/shared';
6
- import { KEEP_ALIVE_POLLER_IN_SECONDS, MILLISECOND_TO_SECOND, getCurrentTimeInSeconds, refreshAccessTokenAndSetAuthContext, makeCredentialsFromTokenResponse, GEOWEB_ROLE_PRESETS_ADMIN, GEOWEB_ROLE_USER } from '@opengeoweb/api';
5
+ import { useIsMounted, SHARED_NAMESPACE, AlertBanner } from '@opengeoweb/shared';
6
+ import { KEEP_ALIVE_POLLER_IN_SECONDS, MILLISECOND_TO_SECOND, getCurrentTimeInSeconds, refreshAccessTokenAndSetAuthContext, makeCredentialsFromTokenResponse, API_NAMESPACE, GEOWEB_ROLE_PRESETS_ADMIN, GEOWEB_ROLE_USER } from '@opengeoweb/api';
7
7
  import { ThemeWrapper } from '@opengeoweb/theme';
8
8
  import { useTranslation, Trans } from 'react-i18next';
9
9
  import 'i18next';
@@ -24,10 +24,10 @@ var fi = {
24
24
  "auth-role-message-assigned": "🚧 ei käännetty"
25
25
  };
26
26
  var no = {
27
- "auth-logout-go-back-to-home-page": "🚧 ikke oversatt. Go back to the <1>Home Page</1>",
28
- "auth-logout-you-are-logged-out": "🚧 ikke oversatt",
29
- "auth-role-title": "🚧 ikke oversatt",
30
- "auth-role-message-assigned": "🚧 ikke oversatt"
27
+ "auth-logout-go-back-to-home-page": " tilbake til <1>Hjemmesiden</1>",
28
+ "auth-logout-you-are-logged-out": "Du er logget ut",
29
+ "auth-role-title": "Rolle",
30
+ "auth-role-message-assigned": "Rolle {{role}} har blitt tildelt"
31
31
  };
32
32
  var nl = {
33
33
  "auth-logout-go-back-to-home-page": "Ga terug naar de <1>Startpagina</1>",
@@ -5881,7 +5881,8 @@ const OAuth2Login = () => {
5881
5881
  };
5882
5882
 
5883
5883
  const AUTH_NAMESPACE = 'auth';
5884
- const useAuthenticationTranslation = () => useTranslation(AUTH_NAMESPACE);
5884
+ const ns = [AUTH_NAMESPACE, API_NAMESPACE, SHARED_NAMESPACE];
5885
+ const useAuthenticationTranslation = () => useTranslation(ns);
5885
5886
 
5886
5887
  const OAuth2Logout = () => {
5887
5888
  const {
@@ -5962,7 +5963,7 @@ const UserMenuRoles = ({
5962
5963
  disabled: isLoading,
5963
5964
  checked: _currentRole === role.name
5964
5965
  }),
5965
- label: role.title,
5966
+ label: role.getTitle(t),
5966
5967
  onChange: () => onChangeRole(role)
5967
5968
  }, role.name))]
5968
5969
  })]
@@ -6742,7 +6743,7 @@ const UserMenuRolesConnect = ({
6742
6743
  setCurrentRole(role.name);
6743
6744
  _temporaryOnChangeRoleForDemo(role);
6744
6745
  const message = t('auth-role-message-assigned', {
6745
- role: role.title
6746
+ role: role.getTitle(t)
6746
6747
  });
6747
6748
  dispatch(snackbarActions.openSnackbar({
6748
6749
  message
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/authentication",
3
- "version": "9.22.0",
3
+ "version": "9.24.0",
4
4
  "description": "GeoWeb authentication library for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -10,15 +10,14 @@
10
10
  "dependencies": {
11
11
  "axios": "1.5.0",
12
12
  "@opengeoweb/api": "*",
13
- "react-router-dom": "^6.21.0",
13
+ "react-router-dom": "^6.23.1",
14
14
  "@opengeoweb/shared": "*",
15
15
  "@opengeoweb/theme": "*",
16
16
  "i18next": "^23.11.5",
17
17
  "react-i18next": "^14.1.2",
18
- "@opengeoweb/snackbar": "9.22.0",
18
+ "@opengeoweb/snackbar": "9.24.0",
19
19
  "react-redux": "^8.1.3",
20
- "@reduxjs/toolkit": "^1.9.7",
21
- "@mui/material": "^5.16.0"
20
+ "@reduxjs/toolkit": "^1.9.7"
22
21
  },
23
22
  "peerDependencies": {
24
23
  "react": "18"
@@ -1,8 +1,5 @@
1
1
  import React from 'react';
2
- export interface Role {
3
- name: string;
4
- title: string;
5
- }
2
+ import { Role } from '@opengeoweb/api';
6
3
  export declare const UserMenuRoles: React.FC<{
7
4
  roles?: Role[];
8
5
  currentRole?: string;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { Role } from './UserMenuRoles';
2
+ import { Role } from '@opengeoweb/api';
3
3
  export declare const UserMenuRolesConnect: React.FC<{
4
4
  temporaryOnChangeRoleForDemo?: (role: Role) => void;
5
5
  roles?: Role[];
@@ -1,3 +1,2 @@
1
1
  export { UserMenuRoles } from './UserMenuRoles';
2
- export type { Role } from './UserMenuRoles';
3
2
  export * from './UserMenuRolesConnect';