Skip to content

Commit

Permalink
geosolutions-it#9932: On Binary dashboard public dashboard have + button
Browse files Browse the repository at this point in the history
Description:
- fix showing add dashboard button for guest users
  • Loading branch information
mahmoudadel54 committed May 6, 2024
1 parent 9203e24 commit 8e2d4ef
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions web/client/selectors/__tests__/dashboard-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,13 @@ describe('dashboard selectors', () => {
}
}
})).toBe(false);
expect(buttonCanEdit({
router: {
location: {
pathname: '/dashboard/1'
}
}
})).toBe(false);
});

it("test dashboardServicesSelector", () => {
Expand Down
2 changes: 1 addition & 1 deletion web/client/selectors/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const isDashboardLoading = state => state && state.dashboard && state.das
export const getDashboardSaveErrors = state => state && state.dashboard && state.dashboard.saveErrors;
export const isBrowserMobile = state => state && state.browser && state.browser.mobile;
export const buttonCanEdit = createSelector(pathnameSelector, dashboardResource, isBrowserMobile,
(path, resource, isMobile) => isMobile ? !isMobile : (resource && resource.canEdit || isNaN(path.substr(-4))));
(path, resource, isMobile) => isMobile ? !isMobile : (resource && resource.canEdit || isNaN(path.substr(-1))));
export const originalDataSelector = state => state?.dashboard?.originalData;

export const dashboardServicesSelector = state => state && state.dashboard && state.dashboard.services;
Expand Down

0 comments on commit 8e2d4ef

Please sign in to comment.