-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ref:MANAGER-15312 Signed-off-by: Omar ALKABOUSS MOUSSANA <[email protected]>
- Loading branch information
Omar ALKABOUSS MOUSSANA
committed
Oct 8, 2024
1 parent
cb1d1bd
commit 35c61a0
Showing
30 changed files
with
218 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
packages/manager/apps/procedures/src/components/PageLayout/PageLayout.component.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React, { FunctionComponent } from 'react'; | ||
import ovhCloudLogo from '@/assets/logo-ovhcloud.png'; | ||
|
||
type Props = { | ||
children: JSX.Element | JSX.Element[]; | ||
}; | ||
|
||
export const PageLayout: FunctionComponent<Props> = ({ children }) => ( | ||
<div className="sm:container mx-auto px-6"> | ||
<div className="md:py-12 p-6"> | ||
<div className="inline-block pb-6 md:pb-12"> | ||
<img src={ovhCloudLogo} alt="ovh-cloud-logo" className="app-logo" /> | ||
</div> | ||
<div className="flex justify-center app-content lg:w-8/12 mx-auto min-h-[500px] sm:shadow sm:border-none border-t-[1px] border-gray-300 px-6"> | ||
<div className="md:p-8 w-full">{children}</div> | ||
</div> | ||
</div> | ||
</div> | ||
); |
35 changes: 35 additions & 0 deletions
35
packages/manager/apps/procedures/src/context/User/modals/SessionModals.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import React, { FunctionComponent, useCallback, useContext } from 'react'; | ||
import { useSessionModal } from '../useSessionModal'; | ||
import { getRedirectLoginUrl } from '@/utils/url-builder'; | ||
import { ExpiredSessionModal } from './ExpiredSessionModal'; | ||
import { WarningSessionModal } from './WarningSessionModal'; | ||
import userContext from '../context'; | ||
|
||
export const SessionModals: FunctionComponent = () => { | ||
const { user } = useContext(userContext); | ||
const { | ||
setShowExpiredModal, | ||
setShowWarningModal, | ||
showExpiredModal, | ||
showWarningModal, | ||
} = useSessionModal(user, 0.75); | ||
|
||
const handleCloseExpiredModal = useCallback(() => { | ||
setShowExpiredModal(false); | ||
const redirectUrl = getRedirectLoginUrl(user); | ||
window.location.assign(redirectUrl); | ||
}, [user]); | ||
|
||
const handleCloseWarningModal = () => setShowWarningModal(false); | ||
|
||
return ( | ||
<> | ||
{showExpiredModal && ( | ||
<ExpiredSessionModal onClose={handleCloseExpiredModal} /> | ||
)} | ||
{showWarningModal && ( | ||
<WarningSessionModal onClose={handleCloseWarningModal} /> | ||
)} | ||
</> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...ocedures/src/pages/create/Create.spec.tsx → ...c/pages/disableMFA/create/Create.spec.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
13 changes: 13 additions & 0 deletions
13
packages/manager/apps/procedures/src/pages/disableMFA/create/create.constants.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
export const LegalPolicyLinkByLanguage = { | ||
DEFAULT: | ||
'https://www.ovhcloud.com/en-ie/terms-and-conditions/privacy-policy/', | ||
en_CA: 'https://www.ovhcloud.com/en-ca/terms-and-conditions/privacy-policy/', | ||
de_DE: 'https://www.ovhcloud.com/de/terms-and-conditions/privacy-policy/', | ||
es_ES: 'https://www.ovhcloud.com/es-es/terms-and-conditions/privacy-policy/', | ||
fr_FR: 'https://www.ovhcloud.com/fr/terms-and-conditions/privacy-policy/', | ||
fr_CA: 'https://www.ovhcloud.com/fr-ca/terms-and-conditions/privacy-policy/', | ||
en_GB: 'https://www.ovhcloud.com/en-gb/terms-and-conditions/privacy-policy/', | ||
it_IT: 'https://www.ovhcloud.com/it/terms-and-conditions/privacy-policy/', | ||
pl_PL: 'https://www.ovhcloud.com/pl/terms-and-conditions/privacy-policy/', | ||
pt_PT: 'https://www.ovhcloud.com/pt/terms-and-conditions/privacy-policy/', | ||
}; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
33 changes: 33 additions & 0 deletions
33
packages/manager/apps/procedures/src/pages/rgdp/RGDP.page.page.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { render, screen } from '@testing-library/react'; | ||
import { describe, it, vi } from 'vitest'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { MemoryRouter } from 'react-router-dom'; | ||
import React from 'react'; | ||
import RGDP from './RGDP.page'; | ||
|
||
vi.mock('react-i18next', () => ({ | ||
useTranslation: () => ({ | ||
t: vi.fn((key) => key), | ||
}), | ||
})); | ||
|
||
vi.mock('@ovhcloud/ods-components/react', () => ({ | ||
OsdsText: ({ children, color, level, size, className }: any) => ( | ||
<div data-testid="osds-text" color={color} className={className}> | ||
{children} | ||
</div> | ||
), | ||
})); | ||
|
||
describe('RGDP Component', () => { | ||
it('renders the component correctly', () => { | ||
render( | ||
<MemoryRouter> | ||
<RGDP /> | ||
</MemoryRouter>, | ||
); | ||
|
||
const titleElement = screen.getByText('rgdp-title'); | ||
expect(titleElement).toBeInTheDocument(); | ||
}); | ||
}); |
28 changes: 28 additions & 0 deletions
28
packages/manager/apps/procedures/src/pages/rgdp/RGDP.page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { | ||
ODS_THEME_COLOR_INTENT, | ||
ODS_THEME_TYPOGRAPHY_LEVEL, | ||
} from '@ovhcloud/ods-common-theming'; | ||
import { OsdsText } from '@ovhcloud/ods-components/react'; | ||
import { ODS_TEXT_SIZE } from '@ovhcloud/ods-components'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { Outlet } from 'react-router-dom'; | ||
import React from 'react'; | ||
import { PageLayout } from '@/components/PageLayout/PageLayout.component'; | ||
|
||
export default function RGDP() { | ||
const { t } = useTranslation('rgdp'); | ||
|
||
return ( | ||
<PageLayout> | ||
<OsdsText | ||
color={ODS_THEME_COLOR_INTENT.info} | ||
level={ODS_THEME_TYPOGRAPHY_LEVEL.heading} | ||
className="block mb-6 text-center" | ||
size={ODS_TEXT_SIZE._500} | ||
> | ||
{t('rgdp-title')} | ||
</OsdsText> | ||
<Outlet /> | ||
</PageLayout> | ||
); | ||
} |
3 changes: 3 additions & 0 deletions
3
packages/manager/apps/procedures/src/public/translations/rgdp/Messages_fr_FR.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"rgdp-title": "Comment exercer vos droits ou contacter le DPO" | ||
} |
1 change: 1 addition & 0 deletions
1
packages/manager/apps/procedures/src/public/translations/rgdp/error/Messages_fr_FR.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
File renamed without changes.
Oops, something went wrong.