* chore: components restructuring and minor UI improvements. * chore: minor UI improvements fro icons and member dropdown. * chore: update issue identifier. * chore: rename `Issue Extra Property` to `Issue Additional Property` * chore: fix popovers placement issue on components with overflow. * chore: add `scrollbar-xs` * chore: add `xs` size for input and textarea components. * chore: update `sortable` to return back `movedItem` in the onChange callback. * chore: minor UI adjustments for radio-select. * chore: update outside click delay to 1ms.
82 lines
2.4 KiB
TypeScript
82 lines
2.4 KiB
TypeScript
// icons
|
|
import { SettingIcon } from "@/components/icons/attachment";
|
|
// types
|
|
import { Props } from "@/components/icons/types";
|
|
// constants
|
|
import { EUserProjectRoles } from "@/constants/project";
|
|
|
|
export const PROJECT_SETTINGS = {
|
|
general: {
|
|
key: "general",
|
|
label: "General",
|
|
href: `/settings`,
|
|
access: EUserProjectRoles.MEMBER,
|
|
highlight: (pathname: string, baseUrl: string) => pathname === `${baseUrl}/settings/`,
|
|
Icon: SettingIcon,
|
|
},
|
|
members: {
|
|
key: "members",
|
|
label: "Members",
|
|
href: `/settings/members`,
|
|
access: EUserProjectRoles.MEMBER,
|
|
highlight: (pathname: string, baseUrl: string) => pathname === `${baseUrl}/settings/members/`,
|
|
Icon: SettingIcon,
|
|
},
|
|
features: {
|
|
key: "features",
|
|
label: "Features",
|
|
href: `/settings/features`,
|
|
access: EUserProjectRoles.ADMIN,
|
|
highlight: (pathname: string, baseUrl: string) => pathname === `${baseUrl}/settings/features/`,
|
|
Icon: SettingIcon,
|
|
},
|
|
states: {
|
|
key: "states",
|
|
label: "States",
|
|
href: `/settings/states`,
|
|
access: EUserProjectRoles.MEMBER,
|
|
highlight: (pathname: string, baseUrl: string) => pathname === `${baseUrl}/settings/states/`,
|
|
Icon: SettingIcon,
|
|
},
|
|
labels: {
|
|
key: "labels",
|
|
label: "Labels",
|
|
href: `/settings/labels`,
|
|
access: EUserProjectRoles.MEMBER,
|
|
highlight: (pathname: string, baseUrl: string) => pathname === `${baseUrl}/settings/labels/`,
|
|
Icon: SettingIcon,
|
|
},
|
|
estimates: {
|
|
key: "estimates",
|
|
label: "Estimates",
|
|
href: `/settings/estimates`,
|
|
access: EUserProjectRoles.ADMIN,
|
|
highlight: (pathname: string, baseUrl: string) => pathname === `${baseUrl}/settings/estimates/`,
|
|
Icon: SettingIcon,
|
|
},
|
|
automations: {
|
|
key: "automations",
|
|
label: "Automations",
|
|
href: `/settings/automations`,
|
|
access: EUserProjectRoles.ADMIN,
|
|
highlight: (pathname: string, baseUrl: string) => pathname === `${baseUrl}/settings/automations/`,
|
|
Icon: SettingIcon,
|
|
},
|
|
};
|
|
|
|
export const PROJECT_SETTINGS_LINKS: {
|
|
key: string;
|
|
label: string;
|
|
href: string;
|
|
access: EUserProjectRoles;
|
|
highlight: (pathname: string, baseUrl: string) => boolean;
|
|
Icon: React.FC<Props>;
|
|
}[] = [
|
|
PROJECT_SETTINGS["general"],
|
|
PROJECT_SETTINGS["members"],
|
|
PROJECT_SETTINGS["features"],
|
|
PROJECT_SETTINGS["states"],
|
|
PROJECT_SETTINGS["labels"],
|
|
PROJECT_SETTINGS["estimates"],
|
|
PROJECT_SETTINGS["automations"],
|
|
];
|