* 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.
66 lines
2.1 KiB
TypeScript
66 lines
2.1 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 { observer } from "mobx-react";
|
|
import Link from "next/link";
|
|
// icons
|
|
import { SettingsOutline } from "@makeplane/propel/icons";
|
|
// plane internal packages
|
|
import { AnchorButton } from "@makeplane/propel/components/anchor-button";
|
|
import { Button } from "@makeplane/propel/components/button";
|
|
import { Switch } from "@makeplane/propel/components/switch";
|
|
import type { TInstanceAuthenticationMethodKeys } from "@plane/types";
|
|
// hooks
|
|
import { useInstance } from "@/hooks/store";
|
|
|
|
type Props = {
|
|
disabled: boolean;
|
|
updateConfig: (key: TInstanceAuthenticationMethodKeys, value: string) => void;
|
|
};
|
|
|
|
export const GoogleConfiguration = observer(function GoogleConfiguration(props: Props) {
|
|
const { disabled, updateConfig } = props;
|
|
// store
|
|
const { formattedConfig } = useInstance();
|
|
// derived values
|
|
const enableGoogleConfig = formattedConfig?.IS_GOOGLE_ENABLED ?? "";
|
|
const isGoogleConfigured = !!formattedConfig?.GOOGLE_CLIENT_ID && !!formattedConfig?.GOOGLE_CLIENT_SECRET;
|
|
|
|
return (
|
|
<>
|
|
{isGoogleConfigured ? (
|
|
<div className="flex items-center gap-4">
|
|
<AnchorButton
|
|
variant="primary"
|
|
size="sm"
|
|
nativeButton={false}
|
|
render={<Link href="/authentication/google" />}
|
|
label="Edit"
|
|
/>
|
|
<Switch
|
|
checked={Boolean(parseInt(enableGoogleConfig))}
|
|
onCheckedChange={() => {
|
|
const newEnableGoogleConfig = Boolean(parseInt(enableGoogleConfig)) === true ? "0" : "1";
|
|
updateConfig("IS_GOOGLE_ENABLED", newEnableGoogleConfig);
|
|
}}
|
|
size="sm"
|
|
disabled={disabled}
|
|
/>
|
|
</div>
|
|
) : (
|
|
<Button
|
|
variant="secondary"
|
|
size="sm"
|
|
stretch="auto"
|
|
nativeButton={false}
|
|
render={<Link href="/authentication/google" />}
|
|
icon={<SettingsOutline className="h-4 w-4 p-0.5 text-tertiary" />}
|
|
label="Configure"
|
|
/>
|
|
)}
|
|
</>
|
|
);
|
|
});
|