Skip to content

Commit

Permalink
delete no longer useful Authorization button (#1113)
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreVasseur authored Jan 9, 2025
1 parent 5ff044c commit 820c4f0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 39 deletions.
35 changes: 6 additions & 29 deletions src/packages/application/router/index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import { PropsWithChildren } from 'react';
import 'react-app-polyfill/stable';
import { useLocation } from 'react-router-dom';

import Auth from '../../auth/components/auth';
import { useOidc } from '../../auth/create-oidc';
import { ADMIN } from '../../auth/roles';
import D from '../../i18n';
import { useAppContext } from '../app-context';
import Routes from './routes';
Expand All @@ -21,15 +18,9 @@ export const RBACLink = ({ children }: PropsWithChildren<unknown>) => {
}
};

const location = useLocation();
const {
properties: { authorizationHost },
} = useAppContext();
const { version } = useAppContext();
const footer = `${import.meta.env.VITE_NAME} - IHM ${import.meta.env.VITE_VERSION} - API ${version}`;

const isHomePage = location.pathname === '/';

return (
<>
<div id="root-app">{children}</div>
Expand All @@ -39,26 +30,12 @@ export const RBACLink = ({ children }: PropsWithChildren<unknown>) => {
<img width="100" src="/img/logo_noir.svg" alt="application logo" />
{footer}
</p>
<div style={{ display: 'flex', justifyContent: 'center', gap: '5px' }}>
<button
onClick={logoutAndRemoveFromStorage}
className="btn btn-primary"
>
{D.authentication.logout}
</button>
<Auth roles={[ADMIN]}>
{isHomePage && (
<a
className="btn btn-primary"
rel="noreferrer noopener"
target="_blank"
href={authorizationHost}
>
{D.authentication.title}
</a>
)}
</Auth>
</div>
<button
onClick={logoutAndRemoveFromStorage}
className="btn btn-primary"
>
{D.authentication.logout}
</button>
</footer>
</>
);
Expand Down
6 changes: 0 additions & 6 deletions src/packages/deprecated-locales/dictionary/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -355,12 +355,6 @@ const dictionary = {
fr: 'Sélectionner un rôle...',
en: 'Select a role...',
},

authorizationManagementTitle: {
fr: 'Habilitations',
en: 'Authorization',
},

pickedUserAddTitle: {
fr: 'Agents à ajouter',
en: 'User to add',
Expand Down
4 changes: 0 additions & 4 deletions src/packages/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ const dictionary = {
fr: 'Se connecter',
en: 'Login',
},
title: {
fr: 'Habilitations',
en: 'Authorizations',
},
},
validationState: {
validated: {
Expand Down
1 change: 1 addition & 0 deletions src/vite-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ type ImportMetaEnv = {
VITE_CONCEPTS_DOCUMENTATION: string
VITE_OPERATIONS_DOCUMENTATION: string
VITE_VALIDATION_OPERATION_SERIES_EXTRA_MANDATORY_FIELDS: string
VITE_DEV_TOOLS_ENABLED: string
BASE_URL: string
MODE: string
DEV: boolean
Expand Down

0 comments on commit 820c4f0

Please sign in to comment.