mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
chore: typos and refactor
This commit is contained in:
parent
e75947a5f4
commit
58de5bfd6a
@ -47,7 +47,7 @@ export const ActiveCycleHeader: FC<ActiveCycleHeaderProps> = (props) => {
|
||||
</div>
|
||||
<div className="flex items-center gap-4">
|
||||
<div className="rounded-sm text-sm">
|
||||
<div className="flex gap-2 divide-x spac divide-x-border-300 text-sm whitespace-nowrap text-custom-text-300 font-medium">
|
||||
<div className="flex gap-2 divide-x divide-x-border-300 text-sm whitespace-nowrap text-custom-text-300 font-medium">
|
||||
<Avatar name={cycleOwnerDetails?.display_name} src={cycleOwnerDetails?.avatar} />
|
||||
{cycleAssignee.length > 0 && (
|
||||
<span className="pl-2">
|
||||
|
@ -98,7 +98,7 @@ export const DeleteEstimateModal: React.FC<Props> = observer((props) => {
|
||||
<p className="break-words text-sm leading-7 text-custom-text-200">
|
||||
Are you sure you want to delete estimate-{" "}
|
||||
<span className="break-words font-medium text-custom-text-100">{data?.name}</span>
|
||||
{""}? All of the data related to the estiamte will be permanently removed. This action cannot be
|
||||
{""}? All of the data related to the estimate will be permanently removed. This action cannot be
|
||||
undone.
|
||||
</p>
|
||||
</span>
|
||||
|
@ -122,7 +122,7 @@ export const IssueDetailsSidebar: React.FC<Props> = observer((props) => {
|
||||
const stateDetails = getStateById(issue.state_id);
|
||||
// auth
|
||||
const isArchivingAllowed = !is_archived && issueOperations.archive && isEditable;
|
||||
const isInArchivableGroup =
|
||||
const isInArchiveGroup =
|
||||
!!stateDetails && [STATE_GROUPS.completed.key, STATE_GROUPS.cancelled.key].includes(stateDetails?.group);
|
||||
|
||||
const minDate = issue.start_date ? getDate(issue.start_date) : null;
|
||||
@ -164,19 +164,19 @@ export const IssueDetailsSidebar: React.FC<Props> = observer((props) => {
|
||||
{isArchivingAllowed && (
|
||||
<Tooltip
|
||||
isMobile={isMobile}
|
||||
tooltipContent={isInArchivableGroup ? "Archive" : "Only completed or canceled issues can be archived"}
|
||||
tooltipContent={isInArchiveGroup ? "Archive" : "Only completed or canceled issues can be archived"}
|
||||
>
|
||||
<button
|
||||
type="button"
|
||||
className={cn(
|
||||
"grid h-5 w-5 place-items-center rounded focus:outline-none focus:ring-2 focus:ring-custom-primary",
|
||||
{
|
||||
"hover:text-custom-text-200": isInArchivableGroup,
|
||||
"cursor-not-allowed text-custom-text-400": !isInArchivableGroup,
|
||||
"hover:text-custom-text-200": isInArchiveGroup,
|
||||
"cursor-not-allowed text-custom-text-400": !isInArchiveGroup,
|
||||
}
|
||||
)}
|
||||
onClick={() => {
|
||||
if (!isInArchivableGroup) return;
|
||||
if (!isInArchiveGroup) return;
|
||||
setArchiveIssueModal(true);
|
||||
}}
|
||||
>
|
||||
|
@ -45,7 +45,7 @@ export const AllIssueQuickActions: React.FC<IQuickActionProps> = observer((props
|
||||
const isEditingAllowed = !readOnly;
|
||||
// auth
|
||||
const isArchivingAllowed = handleArchive && isEditingAllowed;
|
||||
const isInArchivableGroup =
|
||||
const isInArchiveGroup =
|
||||
!!stateDetails && [STATE_GROUPS.completed.key, STATE_GROUPS.cancelled.key].includes(stateDetails?.group);
|
||||
|
||||
const issueLink = `${workspaceSlug}/projects/${issue.project_id}/issues/${issue.id}`;
|
||||
@ -143,8 +143,8 @@ export const AllIssueQuickActions: React.FC<IQuickActionProps> = observer((props
|
||||
</CustomMenu.MenuItem>
|
||||
)}
|
||||
{isArchivingAllowed && (
|
||||
<CustomMenu.MenuItem onClick={() => setArchiveIssueModal(true)} disabled={!isInArchivableGroup}>
|
||||
{isInArchivableGroup ? (
|
||||
<CustomMenu.MenuItem onClick={() => setArchiveIssueModal(true)} disabled={!isInArchiveGroup}>
|
||||
{isInArchiveGroup ? (
|
||||
<div className="flex items-center gap-2">
|
||||
<ArchiveIcon className="h-3 w-3" />
|
||||
Archive
|
||||
|
@ -53,7 +53,7 @@ export const CycleIssueQuickActions: React.FC<IQuickActionProps> = observer((pro
|
||||
// auth
|
||||
const isEditingAllowed = !!currentProjectRole && currentProjectRole >= EUserProjectRoles.MEMBER && !readOnly;
|
||||
const isArchivingAllowed = handleArchive && isEditingAllowed;
|
||||
const isInArchivableGroup =
|
||||
const isInArchiveGroup =
|
||||
!!stateDetails && [STATE_GROUPS.completed.key, STATE_GROUPS.cancelled.key].includes(stateDetails?.group);
|
||||
const isDeletingAllowed = isEditingAllowed;
|
||||
|
||||
@ -170,8 +170,8 @@ export const CycleIssueQuickActions: React.FC<IQuickActionProps> = observer((pro
|
||||
</CustomMenu.MenuItem>
|
||||
)}
|
||||
{isArchivingAllowed && (
|
||||
<CustomMenu.MenuItem onClick={() => setArchiveIssueModal(true)} disabled={!isInArchivableGroup}>
|
||||
{isInArchivableGroup ? (
|
||||
<CustomMenu.MenuItem onClick={() => setArchiveIssueModal(true)} disabled={!isInArchiveGroup}>
|
||||
{isInArchiveGroup ? (
|
||||
<div className="flex items-center gap-2">
|
||||
<ArchiveIcon className="h-3 w-3" />
|
||||
Archive
|
||||
|
@ -52,7 +52,7 @@ export const ModuleIssueQuickActions: React.FC<IQuickActionProps> = observer((pr
|
||||
// auth
|
||||
const isEditingAllowed = !!currentProjectRole && currentProjectRole >= EUserProjectRoles.MEMBER && !readOnly;
|
||||
const isArchivingAllowed = handleArchive && isEditingAllowed;
|
||||
const isInArchivableGroup =
|
||||
const isInArchiveGroup =
|
||||
!!stateDetails && [STATE_GROUPS.completed.key, STATE_GROUPS.cancelled.key].includes(stateDetails?.group);
|
||||
const isDeletingAllowed = isEditingAllowed;
|
||||
|
||||
@ -166,8 +166,8 @@ export const ModuleIssueQuickActions: React.FC<IQuickActionProps> = observer((pr
|
||||
</CustomMenu.MenuItem>
|
||||
)}
|
||||
{isArchivingAllowed && (
|
||||
<CustomMenu.MenuItem onClick={() => setArchiveIssueModal(true)} disabled={!isInArchivableGroup}>
|
||||
{isInArchivableGroup ? (
|
||||
<CustomMenu.MenuItem onClick={() => setArchiveIssueModal(true)} disabled={!isInArchiveGroup}>
|
||||
{isInArchiveGroup ? (
|
||||
<div className="flex items-center gap-2">
|
||||
<ArchiveIcon className="h-3 w-3" />
|
||||
Archive
|
||||
|
@ -51,7 +51,7 @@ export const ProjectIssueQuickActions: React.FC<IQuickActionProps> = observer((p
|
||||
// auth
|
||||
const isEditingAllowed = !!currentProjectRole && currentProjectRole >= EUserProjectRoles.MEMBER && !readOnly;
|
||||
const isArchivingAllowed = handleArchive && isEditingAllowed;
|
||||
const isInArchivableGroup =
|
||||
const isInArchiveGroup =
|
||||
!!stateDetails && [STATE_GROUPS.completed.key, STATE_GROUPS.cancelled.key].includes(stateDetails?.group);
|
||||
const isDeletingAllowed = isEditingAllowed;
|
||||
|
||||
@ -155,8 +155,8 @@ export const ProjectIssueQuickActions: React.FC<IQuickActionProps> = observer((p
|
||||
</CustomMenu.MenuItem>
|
||||
)}
|
||||
{isArchivingAllowed && (
|
||||
<CustomMenu.MenuItem onClick={() => setArchiveIssueModal(true)} disabled={!isInArchivableGroup}>
|
||||
{isInArchivableGroup ? (
|
||||
<CustomMenu.MenuItem onClick={() => setArchiveIssueModal(true)} disabled={!isInArchiveGroup}>
|
||||
{isInArchiveGroup ? (
|
||||
<div className="flex items-center gap-2">
|
||||
<ArchiveIcon className="h-3 w-3" />
|
||||
Archive
|
||||
|
@ -101,7 +101,7 @@ export const IssuePeekOverviewHeader: FC<PeekOverviewHeaderProps> = observer((pr
|
||||
};
|
||||
// auth
|
||||
const isArchivingAllowed = !isArchived && !disabled;
|
||||
const isInArchivableGroup =
|
||||
const isInArchiveGroup =
|
||||
!!stateDetails && [STATE_GROUPS.completed.key, STATE_GROUPS.cancelled.key].includes(stateDetails?.group);
|
||||
const isRestoringAllowed = isArchived && !disabled;
|
||||
|
||||
@ -168,16 +168,16 @@ export const IssuePeekOverviewHeader: FC<PeekOverviewHeaderProps> = observer((pr
|
||||
{isArchivingAllowed && (
|
||||
<Tooltip
|
||||
isMobile={isMobile}
|
||||
tooltipContent={isInArchivableGroup ? "Archive" : "Only completed or canceled issues can be archived"}
|
||||
tooltipContent={isInArchiveGroup ? "Archive" : "Only completed or canceled issues can be archived"}
|
||||
>
|
||||
<button
|
||||
type="button"
|
||||
className={cn("text-custom-text-300", {
|
||||
"hover:text-custom-text-200": isInArchivableGroup,
|
||||
"cursor-not-allowed text-custom-text-400": !isInArchivableGroup,
|
||||
"hover:text-custom-text-200": isInArchiveGroup,
|
||||
"cursor-not-allowed text-custom-text-400": !isInArchiveGroup,
|
||||
})}
|
||||
onClick={() => {
|
||||
if (!isInArchivableGroup) return;
|
||||
if (!isInArchiveGroup) return;
|
||||
toggleArchiveIssueModal(true);
|
||||
}}
|
||||
>
|
||||
|
@ -42,7 +42,7 @@ export const ModuleQuickActions: React.FC<Props> = observer((props) => {
|
||||
!!currentWorkspaceAllProjectsRole && currentWorkspaceAllProjectsRole[projectId] >= EUserProjectRoles.MEMBER;
|
||||
|
||||
const moduleState = moduleDetails?.status?.toLocaleLowerCase();
|
||||
const isInArchivableGroup = !!moduleState && ["completed", "cancelled"].includes(moduleState);
|
||||
const isInArchiveGroup = !!moduleState && ["completed", "cancelled"].includes(moduleState);
|
||||
|
||||
const handleCopyText = (e: React.MouseEvent<HTMLButtonElement>) => {
|
||||
e.stopPropagation();
|
||||
@ -128,8 +128,8 @@ export const ModuleQuickActions: React.FC<Props> = observer((props) => {
|
||||
</CustomMenu.MenuItem>
|
||||
)}
|
||||
{isEditingAllowed && !isArchived && (
|
||||
<CustomMenu.MenuItem onClick={handleArchiveModule} disabled={!isInArchivableGroup}>
|
||||
{isInArchivableGroup ? (
|
||||
<CustomMenu.MenuItem onClick={handleArchiveModule} disabled={!isInArchiveGroup}>
|
||||
{isInArchiveGroup ? (
|
||||
<div className="flex items-center gap-2">
|
||||
<ArchiveIcon className="h-3 w-3" />
|
||||
Archive module
|
||||
|
@ -89,7 +89,7 @@ export const ModuleDetailsSidebar: React.FC<Props> = observer((props) => {
|
||||
const moduleDetails = getModuleById(moduleId);
|
||||
|
||||
const moduleState = moduleDetails?.status?.toLocaleLowerCase();
|
||||
const isInArchivableGroup = !!moduleState && ["completed", "cancelled"].includes(moduleState);
|
||||
const isInArchiveGroup = !!moduleState && ["completed", "cancelled"].includes(moduleState);
|
||||
|
||||
const { reset, control } = useForm({
|
||||
defaultValues,
|
||||
@ -354,8 +354,8 @@ export const ModuleDetailsSidebar: React.FC<Props> = observer((props) => {
|
||||
{isEditingAllowed && (
|
||||
<CustomMenu placement="bottom-end" ellipsis>
|
||||
{!isArchived && (
|
||||
<CustomMenu.MenuItem onClick={() => setArchiveModuleModal(true)} disabled={!isInArchivableGroup}>
|
||||
{isInArchivableGroup ? (
|
||||
<CustomMenu.MenuItem onClick={() => setArchiveModuleModal(true)} disabled={!isInArchiveGroup}>
|
||||
{isInArchiveGroup ? (
|
||||
<div className="flex items-center gap-2">
|
||||
<ArchiveIcon className="h-3 w-3" />
|
||||
Archive module
|
||||
|
@ -29,7 +29,7 @@ const PROJECT_FEATURES_LIST = [
|
||||
},
|
||||
{
|
||||
title: "Views",
|
||||
description: "Apply filters to issues and save them to analyse and investigate work.",
|
||||
description: "Apply filters to issues and save them to analyze and investigate work.",
|
||||
icon: <PhotoFilterIcon className="h-4 w-4 flex-shrink-0 text-cyan-500" />,
|
||||
property: "issue_views_view",
|
||||
},
|
||||
|
@ -19,26 +19,25 @@ export const ProfilePreferenceSettingsLayout: FC<IProfilePreferenceSettingsLayou
|
||||
const router = useRouter();
|
||||
const { theme: themeStore } = useApplication();
|
||||
|
||||
const showMenuItem = () => {
|
||||
const item = router.asPath.split("/");
|
||||
let splittedItem = item[item.length - 1];
|
||||
splittedItem = splittedItem.replace(splittedItem[0], splittedItem[0].toUpperCase());
|
||||
return splittedItem;
|
||||
const showMenuLabel = () => {
|
||||
const path = router.asPath.split("/");
|
||||
const menuLabel = path[path.length - 1];
|
||||
return menuLabel;
|
||||
};
|
||||
|
||||
const profilePreferenceLinks: Array<{
|
||||
label: string;
|
||||
href: string;
|
||||
}> = [
|
||||
{
|
||||
label: "Theme",
|
||||
href: `/profile/preferences/theme`,
|
||||
},
|
||||
{
|
||||
label: "Email",
|
||||
href: `/profile/preferences/email`,
|
||||
},
|
||||
];
|
||||
{
|
||||
label: "Theme",
|
||||
href: `/profile/preferences/theme`,
|
||||
},
|
||||
{
|
||||
label: "Email",
|
||||
href: `/profile/preferences/email`,
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<ProfileSettingsLayout
|
||||
@ -51,15 +50,15 @@ export const ProfilePreferenceSettingsLayout: FC<IProfilePreferenceSettingsLayou
|
||||
placement="bottom-start"
|
||||
customButton={
|
||||
<div className="flex gap-2 items-center px-2 py-1.5 border rounded-md border-custom-border-400">
|
||||
<span className="flex flex-grow justify-center text-custom-text-200 text-sm">{showMenuItem()}</span>
|
||||
<span className="flex flex-grow justify-center text-custom-text-200 text-sm capitalize">{showMenuLabel()}</span>
|
||||
<ChevronDown className="w-4 h-4 text-custom-text-400" />
|
||||
</div>
|
||||
}
|
||||
customButtonClassName="flex flex-grow justify-start text-custom-text-200 text-sm"
|
||||
>
|
||||
<></>
|
||||
{profilePreferenceLinks.map((link) => (
|
||||
<CustomMenu.MenuItem className="flex items-center gap-2">
|
||||
{profilePreferenceLinks.map((link, index) => (
|
||||
<CustomMenu.MenuItem className="flex items-center gap-2" key={index}>
|
||||
<Link key={link.href} href={link.href} className="text-custom-text-300 w-full">
|
||||
{link.label}
|
||||
</Link>
|
||||
|
@ -10,7 +10,7 @@ import { ModulesListHeader } from "@/components/headers";
|
||||
import { ModuleAppliedFiltersList, ModulesListView } from "@/components/modules";
|
||||
// types
|
||||
// hooks
|
||||
import ModulesListMobileHeader from "@/components/modules/moduels-list-mobile-header";
|
||||
import ModulesListMobileHeader from "@/components/modules/modules-list-mobile-header";
|
||||
import { EmptyStateType } from "@/constants/empty-state";
|
||||
import { calculateTotalFilters } from "@/helpers/filter.helper";
|
||||
import { useModuleFilter, useProject } from "@/hooks/store";
|
||||
|
@ -52,7 +52,7 @@ const ProfilePreferencesThemePage: NextPageWithLayout = observer(() => {
|
||||
|
||||
return (
|
||||
<>
|
||||
<PageHead title="Profile - Theme Prefrence" />
|
||||
<PageHead title="Profile - Theme Preference" />
|
||||
{currentUser ? (
|
||||
<div className="mx-auto mt-10 h-full w-full overflow-y-auto px-6 pb-8 md:mt-14 lg:px-20 vertical-scrollbar scrollbar-md">
|
||||
<div className="flex items-center border-b border-custom-border-100 pb-3.5">
|
||||
|
Loading…
Reference in New Issue
Block a user