-
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.
feat(key-management-service): add guides in header page template
ref: MANAGER-13983 Signed-off-by: David Arsène <david.arsene.ext@ovhcloud.com>
- Loading branch information
Showing
12 changed files
with
85 additions
and
30 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
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
9 changes: 9 additions & 0 deletions
9
packages/manager/apps/key-management-service/src/components/Guide/KmsGuidesHeader.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,9 @@ | ||
import React from 'react'; | ||
import { GuideButton } from '@ovhcloud/manager-components'; | ||
import { useKmsGuides } from '@/hooks/useKmsGuides'; | ||
|
||
export default function KmsGuidesHeader() { | ||
const { kmsGuides } = useKmsGuides(); | ||
|
||
return <GuideButton items={kmsGuides} />; | ||
} |
40 changes: 40 additions & 0 deletions
40
packages/manager/apps/key-management-service/src/hooks/useKmsGuides.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,40 @@ | ||
import { useEnvironment } from '@ovh-ux/manager-react-shell-client'; | ||
import { GuideItem } from '@ovhcloud/manager-components'; | ||
import { OdsHTMLAnchorElementTarget } from '@ovhcloud/ods-common-core'; | ||
import { useEffect, useState } from 'react'; | ||
import { useTranslation } from 'react-i18next'; | ||
|
||
type GuideLinks = Record<string, GuideItem[]>; | ||
|
||
export function useKmsGuides() { | ||
const { ovhSubsidiary } = useEnvironment().getUser(); | ||
const { t } = useTranslation('key-management-service/guide'); | ||
const [kmsGuides, setKmsGuides] = useState<GuideItem[]>([]); | ||
|
||
const KMS_GUIDES: GuideLinks = { | ||
FR: [ | ||
{ | ||
id: 1, | ||
href: | ||
'https://help.ovhcloud.com/csm/fr-documentation-manage-operate?id=kb_browse_cat&kb_id=3d4a8129a884a950f07829d7d5c75243', | ||
target: OdsHTMLAnchorElementTarget._blank, | ||
label: t('guides_header_find_out_more'), | ||
}, | ||
], | ||
DEFAULT: [ | ||
{ | ||
id: 1, | ||
href: | ||
'https://help.ovhcloud.com/csm/en-gb-documentation-manage-operate?id=kb_browse_cat&kb_id=3d4a8129a884a950f07829d7d5c75243', | ||
target: OdsHTMLAnchorElementTarget._blank, | ||
label: t('guides_header_find_out_more'), | ||
}, | ||
], | ||
}; | ||
|
||
useEffect(() => { | ||
setKmsGuides(KMS_GUIDES[ovhSubsidiary] ?? KMS_GUIDES.DEFAULT); | ||
}, [ovhSubsidiary]); | ||
|
||
return { kmsGuides, kmsOnboardingGuide: kmsGuides[0] }; | ||
} |
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
3 changes: 3 additions & 0 deletions
3
...nagement-service/src/public/translations/key-management-service/guide/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 @@ | ||
{ | ||
"guides_header_find_out_more": "En savoir plus" | ||
} |
11 changes: 0 additions & 11 deletions
11
packages/manager/apps/key-management-service/src/query.client.ts
This file was deleted.
Oops, something went wrong.
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