-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(pci-block-storage): redirections
Signed-off-by: Florian Renaut <florian.renaut@corp.ovh.com>
- Loading branch information
Showing
10 changed files
with
87 additions
and
40 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
packages/manager/apps/pci-block-storage/src/components/StorageActionRedirect.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,14 @@ | ||
import { Navigate, useParams, useSearchParams } from 'react-router-dom'; | ||
|
||
export const StorageActionRedirect = ({ action }: { action: string }) => { | ||
const { projectId } = useParams(); | ||
const [searchParams] = useSearchParams(); | ||
return ( | ||
<Navigate | ||
to={`/pci/projects/${projectId}/storages/blocks/${action}/${searchParams.get( | ||
'storageId', | ||
)}`} | ||
replace={true} | ||
/> | ||
); | ||
}; |
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
36 changes: 36 additions & 0 deletions
36
...ges/manager/apps/pci-block-storage/src/pages/attach/NoInstanceAvailableWarningMessage.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,36 @@ | ||
import { OsdsMessage, OsdsText } from '@ovhcloud/ods-components/react'; | ||
import { ODS_ICON_NAME, ODS_TEXT_SIZE } from '@ovhcloud/ods-components'; | ||
import { | ||
ODS_THEME_COLOR_INTENT, | ||
ODS_THEME_TYPOGRAPHY_LEVEL, | ||
ODS_THEME_TYPOGRAPHY_SIZE, | ||
} from '@ovhcloud/ods-common-theming'; | ||
import { useTranslation } from 'react-i18next'; | ||
|
||
export default function NoInstanceWarningMessage() { | ||
const { t } = useTranslation('attach'); | ||
return ( | ||
<OsdsText | ||
level={ODS_THEME_TYPOGRAPHY_LEVEL.body} | ||
color={ODS_THEME_COLOR_INTENT.text} | ||
size={ODS_TEXT_SIZE._400} | ||
className={'block mt-6'} | ||
> | ||
<OsdsMessage | ||
color={ODS_THEME_COLOR_INTENT.warning} | ||
icon={ODS_ICON_NAME.WARNING} | ||
className="mt-6" | ||
> | ||
<OsdsText | ||
level={ODS_THEME_TYPOGRAPHY_LEVEL.body} | ||
size={ODS_THEME_TYPOGRAPHY_SIZE._400} | ||
color={ODS_THEME_COLOR_INTENT.text} | ||
> | ||
{t( | ||
'pci_projects_project_storages_blocks_block_attach_error_no_compatible_instance', | ||
)} | ||
</OsdsText> | ||
</OsdsMessage> | ||
</OsdsText> | ||
); | ||
} |
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