chore: empty state action button validation (#3094)
This commit is contained in:
parent
b4f51cb5af
commit
2605b938f0
9 changed files with 63 additions and 16 deletions
|
|
@ -8,6 +8,8 @@ import { useMobxStore } from "lib/mobx/store-provider";
|
|||
import { TourRoot } from "components/onboarding";
|
||||
import { UserGreetingsView } from "components/user";
|
||||
import { CompletedIssuesGraph, IssuesList, IssuesPieChart, IssuesStats } from "components/workspace";
|
||||
// constants
|
||||
import { EUserWorkspaceRoles } from "constants/workspace";
|
||||
// images
|
||||
import { NewEmptyState } from "components/common/new-empty-state";
|
||||
import emptyProject from "public/empty-state/dashboard_empty_project.webp";
|
||||
|
|
@ -36,6 +38,8 @@ export const WorkspaceDashboardView = observer(() => {
|
|||
workspaceSlug ? () => userStore.fetchUserDashboardInfo(workspaceSlug.toString(), month) : null
|
||||
);
|
||||
|
||||
const isEditingAllowed = !!userStore.currentProjectRole && userStore.currentProjectRole >= EUserWorkspaceRoles.MEMBER;
|
||||
|
||||
const handleTourCompleted = () => {
|
||||
userStore
|
||||
.updateTourCompleted()
|
||||
|
|
@ -96,6 +100,7 @@ export const WorkspaceDashboardView = observer(() => {
|
|||
commandPaletteStore.toggleCreateProjectModal(true);
|
||||
},
|
||||
}}
|
||||
disabled={!isEditingAllowed}
|
||||
/>
|
||||
)
|
||||
) : null}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue