Skip to content

Commit 4ec73d6

Browse files
committed
fix: OU-1195 CodeRabbit Suggestions to fix create btn tooltip and gracefully check editableProjects?.some
1 parent cbf3aa6 commit 4ec73d6

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

web/src/components/dashboards/perses/dashboard-create-dialog.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export const DashboardCreateDialog: React.FunctionComponent = () => {
5252
return [];
5353
}
5454

55-
return editableProjects.map((project) => ({
55+
return editableProjects?.map((project) => ({
5656
content: project,
5757
value: project,
5858
selected: project === selectedProject,
@@ -96,7 +96,7 @@ export const DashboardCreateDialog: React.FunctionComponent = () => {
9696
return;
9797
}
9898

99-
const projectExists = editableProjects.some((project) => project === selectedProject);
99+
const projectExists = editableProjects?.some((project) => project === selectedProject);
100100

101101
if (!projectExists) {
102102
try {
@@ -172,7 +172,7 @@ export const DashboardCreateDialog: React.FunctionComponent = () => {
172172

173173
return (
174174
<>
175-
{disabled ? (
175+
{!hasEditableProject ? (
176176
<Tooltip
177177
content={t('To create dashboards, contact your cluster administrator for permission.')}
178178
>

0 commit comments

Comments
 (0)