-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix s3 releated features always shown when user not logged in
- Loading branch information
Showing
14 changed files
with
143 additions
and
2 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
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
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
15 changes: 15 additions & 0 deletions
15
web/src/ui/pages/myFiles/MyFilesDisabledDialog.stories.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,15 @@ | ||
import type { Meta, StoryObj } from "@storybook/react"; | ||
import { MyFilesDisabledDialog } from "./MyFilesDisabledDialog"; | ||
|
||
const meta = { | ||
title: "Pages/MyFiles/MyFilesDisabledDialog", | ||
component: MyFilesDisabledDialog | ||
} satisfies Meta<typeof MyFilesDisabledDialog>; | ||
|
||
export default meta; | ||
|
||
type Story = StoryObj<typeof meta>; | ||
|
||
export const Default: Story = { | ||
args: {} | ||
}; |
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,50 @@ | ||
import { memo } from "react"; | ||
import { Dialog } from "onyxia-ui/Dialog"; | ||
import { Button } from "onyxia-ui/Button"; | ||
import { routes } from "ui/routes"; | ||
import { declareComponentKeys, useTranslation } from "ui/i18n"; | ||
|
||
export const MyFilesDisabledDialog = memo(() => { | ||
const onClose = () => routes.home().push(); | ||
const { t } = useTranslation({ MyFilesDisabledDialog }); | ||
|
||
return ( | ||
<Dialog | ||
title={t("dialog title")} | ||
isOpen={true} | ||
onClose={onClose} | ||
body={t("dialog body")} | ||
buttons={ | ||
<> | ||
<Button variant="secondary" onClick={onClose}> | ||
{t("cancel")} | ||
</Button> | ||
<Button | ||
autoFocus | ||
doOpenNewTabIfHref={false} | ||
{...(() => { | ||
const link = routes.projectSettings({ | ||
tabId: "s3-configs" | ||
}).link; | ||
return { | ||
...link, | ||
onClick: e => { | ||
onClose(); | ||
return link.onClick(e); | ||
} | ||
}; | ||
})()} | ||
> | ||
{t("go to settings")} | ||
</Button> | ||
</> | ||
} | ||
/> | ||
); | ||
}); | ||
|
||
const { i18n } = declareComponentKeys< | ||
"dialog title" | "dialog body" | "cancel" | "go to settings" | ||
>()({ MyFilesDisabledDialog }); | ||
|
||
export type I18n = typeof i18n; |