* refactor: migrate admin icons to @makeplane/propel Replace confirmed icon symbols in apps/admin with their audited @makeplane/propel/icons targets, merging into the imports the six already-migrated files declared. Unresolved symbols (Menu, BrainCog) and the LucideIcon type stay on lucide-react. Lucide size props become explicit width/height. Loader keeps its LoaderIcon alias so the call site is unchanged. apps/admin already declared @makeplane/propel, so no dependency change was needed. * fix: restore Settings breadcrumb label after icon rename The migration's identifier rename also rewrote the string literal, so the breadcrumb displayed the icon component name instead of the label.
92 lines
3.8 KiB
TypeScript
92 lines
3.8 KiB
TypeScript
/**
|
|
* Copyright (c) 2023-present Plane Software, Inc. and contributors
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
* See the LICENSE file for details.
|
|
*/
|
|
|
|
import { KeyOutline, MailOutline } from "@makeplane/propel/icons";
|
|
// types
|
|
import type {
|
|
TCoreInstanceAuthenticationModeKeys,
|
|
TGetBaseAuthenticationModeProps,
|
|
TInstanceAuthenticationModes,
|
|
} from "@plane/types";
|
|
// assets
|
|
import giteaLogo from "@/app/assets/logos/gitea-logo.svg?url";
|
|
import githubLightModeImage from "@/app/assets/logos/github-black.png?url";
|
|
import githubDarkModeImage from "@/app/assets/logos/github-white.png?url";
|
|
import gitlabLogo from "@/app/assets/logos/gitlab-logo.svg?url";
|
|
import googleLogo from "@/app/assets/logos/google-logo.svg?url";
|
|
// components
|
|
import { EmailCodesConfiguration } from "@/components/authentication/email-config-switch";
|
|
import { GiteaConfiguration } from "@/components/authentication/gitea-config";
|
|
import { GithubConfiguration } from "@/components/authentication/github-config";
|
|
import { GitlabConfiguration } from "@/components/authentication/gitlab-config";
|
|
import { GoogleConfiguration } from "@/components/authentication/google-config";
|
|
import { PasswordLoginConfiguration } from "@/components/authentication/password-config-switch";
|
|
|
|
// Authentication methods
|
|
export const getCoreAuthenticationModesMap: (
|
|
props: TGetBaseAuthenticationModeProps
|
|
) => Record<TCoreInstanceAuthenticationModeKeys, TInstanceAuthenticationModes> = ({
|
|
disabled,
|
|
updateConfig,
|
|
resolvedTheme,
|
|
}) => ({
|
|
"unique-codes": {
|
|
key: "unique-codes",
|
|
name: "Unique codes",
|
|
description:
|
|
"Log in or sign up for Plane using codes sent via email. You need to have set up SMTP to use this method.",
|
|
icon: <MailOutline className="h-6 w-6 p-0.5 text-tertiary" />,
|
|
config: <EmailCodesConfiguration disabled={disabled} updateConfig={updateConfig} />,
|
|
enabledConfigKey: "ENABLE_MAGIC_LINK_LOGIN",
|
|
},
|
|
"passwords-login": {
|
|
key: "passwords-login",
|
|
name: "Passwords",
|
|
description: "Allow members to create accounts with passwords and use it with their email addresses to sign in.",
|
|
icon: <KeyOutline className="h-6 w-6 p-0.5 text-tertiary" />,
|
|
config: <PasswordLoginConfiguration disabled={disabled} updateConfig={updateConfig} />,
|
|
enabledConfigKey: "ENABLE_EMAIL_PASSWORD",
|
|
},
|
|
google: {
|
|
key: "google",
|
|
name: "Google",
|
|
description: "Allow members to log in or sign up for Plane with their Google accounts.",
|
|
icon: <img src={googleLogo} height={20} width={20} alt="Google Logo" />,
|
|
config: <GoogleConfiguration disabled={disabled} updateConfig={updateConfig} />,
|
|
enabledConfigKey: "IS_GOOGLE_ENABLED",
|
|
},
|
|
github: {
|
|
key: "github",
|
|
name: "GitHub",
|
|
description: "Allow members to log in or sign up for Plane with their GitHub accounts.",
|
|
icon: (
|
|
<img
|
|
src={resolvedTheme === "dark" ? githubDarkModeImage : githubLightModeImage}
|
|
height={20}
|
|
width={20}
|
|
alt="GitHub Logo"
|
|
/>
|
|
),
|
|
config: <GithubConfiguration disabled={disabled} updateConfig={updateConfig} />,
|
|
enabledConfigKey: "IS_GITHUB_ENABLED",
|
|
},
|
|
gitlab: {
|
|
key: "gitlab",
|
|
name: "GitLab",
|
|
description: "Allow members to log in or sign up to plane with their GitLab accounts.",
|
|
icon: <img src={gitlabLogo} height={20} width={20} alt="GitLab Logo" />,
|
|
config: <GitlabConfiguration disabled={disabled} updateConfig={updateConfig} />,
|
|
enabledConfigKey: "IS_GITLAB_ENABLED",
|
|
},
|
|
gitea: {
|
|
key: "gitea",
|
|
name: "Gitea",
|
|
description: "Allow members to log in or sign up to plane with their Gitea accounts.",
|
|
icon: <img src={giteaLogo} height={20} width={20} alt="Gitea Logo" />,
|
|
config: <GiteaConfiguration disabled={disabled} updateConfig={updateConfig} />,
|
|
enabledConfigKey: "IS_GITEA_ENABLED",
|
|
},
|
|
});
|