mirror of
https://github.com/makeplane/plane.git
synced 2026-09-02 03:59:00 +02:00
chore: added access tokens to workspace sidebar list item
This commit is contained in:
@@ -20,6 +20,7 @@ import { WORKSPACE_API_TOKENS_LIST } from "@/constants/fetch-keys";
|
||||
import { useWorkspace } from "@/hooks/store/use-workspace";
|
||||
import { useUserPermissions } from "@/hooks/store/user";
|
||||
import type { Route } from "./+types/page";
|
||||
import { Button } from "@plane/propel/button";
|
||||
|
||||
const workspaceApiTokenService = new WorkspaceAPITokenService();
|
||||
|
||||
@@ -64,12 +65,10 @@ function ApiTokensPage({ params }: Route.ComponentProps) {
|
||||
<SettingsHeading
|
||||
title={t("workspace_settings.settings.api_tokens.heading")}
|
||||
description={t("workspace_settings.settings.api_tokens.description")}
|
||||
button={{
|
||||
label: t("workspace_settings.settings.api_tokens.add_token"),
|
||||
onClick: () => {
|
||||
setIsCreateTokenModalOpen(true);
|
||||
},
|
||||
}}
|
||||
control={
|
||||
<Button variant="primary" size="lg" onClick={() => setIsCreateTokenModalOpen(true)}>
|
||||
{t("workspace_settings.settings.api_tokens.add_token")}
|
||||
</Button>}
|
||||
/>
|
||||
{tokens.length > 0 ? (
|
||||
<div className="flex h-full w-full flex-col">
|
||||
|
||||
@@ -31,7 +31,7 @@ export const APITokensProfileSettings = observer(function APITokensProfileSettin
|
||||
const { t } = useTranslation();
|
||||
|
||||
if (!tokens) {
|
||||
return <APITokenSettingsLoader />;
|
||||
return <APITokenSettingsLoader title={t("workspace_settings.settings.api_tokens.title")} />;
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
import type { LucideIcon } from "lucide-react";
|
||||
import { ArrowUpToLine, Building, CreditCard, Users, Webhook } from "lucide-react";
|
||||
import { ArrowUpToLine, Building, CreditCard, Users, Webhook, KeyRound } from "lucide-react";
|
||||
// plane imports
|
||||
import type { ISvgIcons } from "@plane/propel/icons";
|
||||
import type { TWorkspaceSettingsTabs } from "@plane/types";
|
||||
@@ -16,4 +16,5 @@ export const WORKSPACE_SETTINGS_ICONS: Record<TWorkspaceSettingsTabs, LucideIcon
|
||||
export: ArrowUpToLine,
|
||||
"billing-and-plans": CreditCard,
|
||||
webhooks: Webhook,
|
||||
"access-tokens": KeyRound
|
||||
};
|
||||
|
||||
@@ -56,6 +56,13 @@ export const WORKSPACE_SETTINGS: Record<TWorkspaceSettingsTabs, TWorkspaceSettin
|
||||
access: [EUserWorkspaceRoles.ADMIN],
|
||||
highlight: (pathname: string, baseUrl: string) => pathname === `${baseUrl}/settings/webhooks/`,
|
||||
},
|
||||
"access-tokens": {
|
||||
key: "access-tokens",
|
||||
i18n_label: "workspace_settings.settings.api_tokens.title",
|
||||
href: `/settings/access-tokens`,
|
||||
access: [EUserWorkspaceRoles.ADMIN],
|
||||
highlight: (pathname: string, baseUrl: string) => pathname === `${baseUrl}/settings/access-tokens/`,
|
||||
},
|
||||
};
|
||||
|
||||
export const WORKSPACE_SETTINGS_ACCESS = Object.fromEntries(
|
||||
@@ -70,5 +77,5 @@ export const GROUPED_WORKSPACE_SETTINGS: Record<WORKSPACE_SETTINGS_CATEGORY, TWo
|
||||
WORKSPACE_SETTINGS["export"],
|
||||
],
|
||||
[WORKSPACE_SETTINGS_CATEGORY.FEATURES]: [],
|
||||
[WORKSPACE_SETTINGS_CATEGORY.DEVELOPER]: [WORKSPACE_SETTINGS["webhooks"]],
|
||||
[WORKSPACE_SETTINGS_CATEGORY.DEVELOPER]: [WORKSPACE_SETTINGS["webhooks"],WORKSPACE_SETTINGS["access-tokens"]],
|
||||
};
|
||||
|
||||
@@ -10,7 +10,7 @@ import type { EUserWorkspaceRoles } from "./workspace";
|
||||
|
||||
export type TProfileSettingsTabs = "general" | "preferences" | "activity" | "notifications" | "security" | "api-tokens";
|
||||
|
||||
export type TWorkspaceSettingsTabs = "general" | "members" | "billing-and-plans" | "export" | "webhooks";
|
||||
export type TWorkspaceSettingsTabs = "general" | "members" | "billing-and-plans" | "export" | "webhooks" | "access-tokens";
|
||||
export type TWorkspaceSettingsItem = {
|
||||
key: TWorkspaceSettingsTabs;
|
||||
i18n_label: string;
|
||||
|
||||
Reference in New Issue
Block a user