From 9dd8c8ba14942bc4d6f209269259534735be20cd Mon Sep 17 00:00:00 2001 From: Prateek Shourya Date: Fri, 5 Jan 2024 14:13:04 +0530 Subject: [PATCH] chore: UI/UX improvements (#3319) * chore: add proper message for cycle/ module having start & end date but isn't active yet. * fix: infinite loader after updating workspace settings. * fix: user profile icon dropdown doesn't closes automatically. * style: fix inconsistent padding in cycle empty state. * chore: remove multiple `empty state` in labels settings and improve add label logic. * style: fix inconsistent padding in project label, integration and estimates empty state. * style: fix integrations settings breadcrumb title. * style: add proper `disabled` styles for email field in profile settings. * style: fix cycle layout height. --- web/components/common/new-empty-state.tsx | 2 +- web/components/cycles/sidebar.tsx | 4 ++- web/components/estimates/estimates-list.tsx | 2 +- .../labels/project-setting-label-list.tsx | 33 +++++++------------ web/components/modules/sidebar.tsx | 4 ++- web/components/workspace/sidebar-dropdown.tsx | 16 ++++----- .../projects/[projectId]/cycles/index.tsx | 6 ++-- .../[projectId]/settings/integrations.tsx | 22 +++++++------ .../[workspaceSlug]/settings/integrations.tsx | 2 +- web/pages/profile/index.tsx | 7 ++-- web/services/workspace.service.ts | 3 +- web/store/workspace/index.ts | 2 +- 12 files changed, 48 insertions(+), 55 deletions(-) diff --git a/web/components/common/new-empty-state.tsx b/web/components/common/new-empty-state.tsx index dbe654e11..efbab8249 100644 --- a/web/components/common/new-empty-state.tsx +++ b/web/components/common/new-empty-state.tsx @@ -43,7 +43,7 @@ export const NewEmptyState: React.FC = ({ return (
-
+

{title}

{description &&

{description}

}
diff --git a/web/components/cycles/sidebar.tsx b/web/components/cycles/sidebar.tsx index f2f7792f6..81cefac50 100644 --- a/web/components/cycles/sidebar.tsx +++ b/web/components/cycles/sidebar.tsx @@ -539,7 +539,9 @@ export const CycleDetailsSidebar: React.FC = observer((props) => {
- Invalid date. Please enter valid date. + {cycleDetails?.start_date && cycleDetails?.end_date + ? "This cycle isn't active yet." + : "Invalid date. Please enter valid date."}
)} diff --git a/web/components/estimates/estimates-list.tsx b/web/components/estimates/estimates-list.tsx index 323cbe888..05b174461 100644 --- a/web/components/estimates/estimates-list.tsx +++ b/web/components/estimates/estimates-list.tsx @@ -102,7 +102,7 @@ export const EstimatesList: React.FC = observer(() => { ))} ) : ( -
+
{ Add label
-
+
{showLabelForm && ( -
+
{
)} {projectLabels ? ( - projectLabels.length === 0 ? ( + projectLabels.length === 0 && !showLabelForm ? ( { ) ) ) : ( - - - - - - - )} - - {/* empty state */} - {projectLabels && projectLabels.length === 0 && ( - newLabel(), - }} - /> + !showLabelForm && ( + + + + + + + ) )}
diff --git a/web/components/modules/sidebar.tsx b/web/components/modules/sidebar.tsx index 303dcbd2b..5b6456207 100644 --- a/web/components/modules/sidebar.tsx +++ b/web/components/modules/sidebar.tsx @@ -550,7 +550,9 @@ export const ModuleDetailsSidebar: React.FC = observer((props) => {
- Invalid date. Please enter valid date. + {moduleDetails?.start_date && moduleDetails?.target_date + ? "This module isn't active yet." + : "Invalid date. Please enter valid date."}
)} diff --git a/web/components/workspace/sidebar-dropdown.tsx b/web/components/workspace/sidebar-dropdown.tsx index 614356c21..616562f27 100644 --- a/web/components/workspace/sidebar-dropdown.tsx +++ b/web/components/workspace/sidebar-dropdown.tsx @@ -278,14 +278,14 @@ export const WorkspaceSidebarDropdown = observer(() => {
{currentUser?.email} {profileLinks(workspaceSlug?.toString() ?? "", currentUser?.id ?? "").map((link, index) => ( - - + + {link.name} - - + + ))}
@@ -301,13 +301,13 @@ export const WorkspaceSidebarDropdown = observer(() => {
{isUserInstanceAdmin && (
- - + + Enter God Mode - - + +
)} diff --git a/web/pages/[workspaceSlug]/projects/[projectId]/cycles/index.tsx b/web/pages/[workspaceSlug]/projects/[projectId]/cycles/index.tsx index 13373b886..e35f0c341 100644 --- a/web/pages/[workspaceSlug]/projects/[projectId]/cycles/index.tsx +++ b/web/pages/[workspaceSlug]/projects/[projectId]/cycles/index.tsx @@ -59,7 +59,7 @@ const ProjectCyclesPage: NextPageWithLayout = observer(() => { if (!workspaceSlug || !projectId) return null; return ( - <> +
{ handleClose={() => setCreateModal(false)} /> {totalCycles === 0 ? ( -
+
{ )} - +
); }); diff --git a/web/pages/[workspaceSlug]/projects/[projectId]/settings/integrations.tsx b/web/pages/[workspaceSlug]/projects/[projectId]/settings/integrations.tsx index aae6f4670..bc0163464 100644 --- a/web/pages/[workspaceSlug]/projects/[projectId]/settings/integrations.tsx +++ b/web/pages/[workspaceSlug]/projects/[projectId]/settings/integrations.tsx @@ -54,16 +54,18 @@ const ProjectIntegrationsPage: NextPageWithLayout = () => { ))}
) : ( - router.push(`/${workspaceSlug}/settings/integrations`), - }} - disabled={!isAdmin} - /> +
+ router.push(`/${workspaceSlug}/settings/integrations`), + }} + disabled={!isAdmin} + /> +
) ) : ( diff --git a/web/pages/[workspaceSlug]/settings/integrations.tsx b/web/pages/[workspaceSlug]/settings/integrations.tsx index 378cc232d..70147c312 100644 --- a/web/pages/[workspaceSlug]/settings/integrations.tsx +++ b/web/pages/[workspaceSlug]/settings/integrations.tsx @@ -65,7 +65,7 @@ const WorkspaceIntegrationsPage: NextPageWithLayout = observer(() => { WorkspaceIntegrationsPage.getLayout = function getLayout(page: ReactElement) { return ( - }> + }> {page} ); diff --git a/web/pages/profile/index.tsx b/web/pages/profile/index.tsx index 5ac1c02d1..88333388a 100644 --- a/web/pages/profile/index.tsx +++ b/web/pages/profile/index.tsx @@ -218,7 +218,7 @@ const ProfileSettingsPage: NextPageWithLayout = observer(() => {

- First name * + First name*

{ rules={{ required: "Email is required.", }} - render={({ field: { value, onChange, ref } }) => ( + render={({ field: { value, ref } }) => ( )} diff --git a/web/services/workspace.service.ts b/web/services/workspace.service.ts index 21b9f7c49..2515853f5 100644 --- a/web/services/workspace.service.ts +++ b/web/services/workspace.service.ts @@ -14,10 +14,9 @@ import { IWorkspaceBulkInviteFormData, IWorkspaceViewProps, IUserProjectsRole, - TIssueMap, TIssue, + IWorkspaceView, } from "@plane/types"; -import { IWorkspaceView } from "@plane/types"; export class WorkspaceService extends APIService { constructor() { diff --git a/web/store/workspace/index.ts b/web/store/workspace/index.ts index b05e6da34..4020aaef7 100644 --- a/web/store/workspace/index.ts +++ b/web/store/workspace/index.ts @@ -135,7 +135,7 @@ export class WorkspaceRootStore implements IWorkspaceRootStore { updateWorkspace = async (workspaceSlug: string, data: Partial) => await this.workspaceService.updateWorkspace(workspaceSlug, data).then((response) => { runInAction(() => { - set(this.workspaces, response.id, data); + set(this.workspaces, response.id, response); }); return response; });