Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore(UI): remove private icon from apps in dashboard#6801

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Kira-Pilot merged 2 commits intomainfromdifferentiate-apps/kira-pilot
Mar 27, 2023
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 24 additions & 5 deletionssite/src/components/AppLink/AppLink.stories.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -25,8 +25,8 @@ WithIcon.args = {
agent: MockWorkspaceAgent,
}

export constWithIconExternal = Template.bind({})
WithIconExternal.args = {
export constExternalApp = Template.bind({})
ExternalApp.args = {
workspace: MockWorkspace,
app: {
...MockWorkspaceApp,
Expand All@@ -35,13 +35,32 @@ WithIconExternal.args = {
agent: MockWorkspaceAgent,
}

export constWithoutIcon = Template.bind({})
WithoutIcon.args = {
export constSharingLevelOwner = Template.bind({})
SharingLevelOwner.args = {
workspace: MockWorkspace,
app: {
...MockWorkspaceApp,
sharing_level: "owner",
health: "healthy",
},
agent: MockWorkspaceAgent,
}

export const SharingLevelAuthenticated = Template.bind({})
SharingLevelAuthenticated.args = {
workspace: MockWorkspace,
app: {
...MockWorkspaceApp,
sharing_level: "authenticated",
},
agent: MockWorkspaceAgent,
}

export const SharingLevelPublic = Template.bind({})
SharingLevelPublic.args = {
workspace: MockWorkspace,
app: {
...MockWorkspaceApp,
sharing_level: "public",
},
agent: MockWorkspaceAgent,
}
Expand Down
9 changes: 7 additions & 2 deletionssite/src/components/AppLink/AppLink.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,6 +5,7 @@ import { makeStyles } from "@material-ui/core/styles"
import Tooltip from "@material-ui/core/Tooltip"
import ErrorOutlineIcon from "@material-ui/icons/ErrorOutline"
import { FC } from "react"
import { combineClasses } from "util/combineClasses"
import * as TypesGen from "../../api/typesGenerated"
import { generateRandomString } from "../../util/random"
import { BaseIcon } from "./BaseIcon"
Expand DownExpand Up@@ -79,15 +80,19 @@ export const AppLink: FC<AppLinkProps> = ({
"Your admin has not configured subdomain application access"
}

const isPrivateApp = app.sharing_level === "owner"

const button = (
<Button
size="small"
startIcon={icon}
endIcon={<ShareIcon app={app} />}
endIcon={isPrivateApp ? undefined :<ShareIcon app={app} />}
className={styles.button}
disabled={!canClick}
>
<span className={styles.appName}>{appDisplayName}</span>
<span className={combineClasses({ [styles.appName]: !isPrivateApp })}>
{appDisplayName}
</span>
</Button>
)

Expand Down
View file
Open in desktop
Empty file.
34 changes: 19 additions & 15 deletionssite/src/components/AppLink/ShareIcon.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
import PublicOutlinedIcon from "@material-ui/icons/PublicOutlined"
import LockOutlinedIcon from "@material-ui/icons/LockOutlined"
import GroupOutlinedIcon from "@material-ui/icons/GroupOutlined"
import LaunchOutlinedIcon from "@material-ui/icons/LaunchOutlined"
import { FC } from "react"
import * as TypesGen from "../../api/typesGenerated"
import Tooltip from "@material-ui/core/Tooltip"
import { useTranslation } from "react-i18next"
Expand All@@ -11,23 +9,29 @@ export interface ShareIconProps {
app: TypesGen.WorkspaceApp
}

export const ShareIcon: FC<ShareIconProps>= ({ app }) => {
export const ShareIcon= ({ app }: ShareIconProps) => {
const { t } = useTranslation("agent")

let shareIcon = <LockOutlinedIcon />
let shareTooltip = t("shareTooltip.private")
if (app.external) {
return (
<Tooltip title={t("shareTooltip.external")}>
<LaunchOutlinedIcon />
</Tooltip>
)
}
if (app.sharing_level === "authenticated") {
shareIcon = <GroupOutlinedIcon />
shareTooltip = t("shareTooltip.authenticated")
return (
<Tooltip title={t("shareTooltip.authenticated")}>
<GroupOutlinedIcon />
</Tooltip>
)
}
if (app.sharing_level === "public") {
shareIcon = <PublicOutlinedIcon />
shareTooltip = t("shareTooltip.public")
}
if (app.external) {
shareIcon = <LaunchOutlinedIcon />
shareTooltip = t("shareTooltip.external")
return (
<Tooltip title={t("shareTooltip.public")}>
<PublicOutlinedIcon />
</Tooltip>
)
}

return<Tooltip title={shareTooltip}>{shareIcon}</Tooltip>
returnnull
}

[8]ページ先頭

©2009-2025 Movatter.jp