diff --git a/.github/workflows/build-npm-release.yml b/.github/workflows/build-npm-release.yml index 75d20a0a..d40064e8 100644 --- a/.github/workflows/build-npm-release.yml +++ b/.github/workflows/build-npm-release.yml @@ -151,7 +151,7 @@ jobs: comment_title: Jest Unit Test Statistics - name: Publish Jest coverage report - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 if: always() with: name: jest-coverage-report @@ -159,7 +159,7 @@ jobs: retention-days: 30 - name: Publish yarn.lock - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 if: failure() with: name: yarn.lock diff --git a/.github/workflows/build-npm.yml b/.github/workflows/build-npm.yml index afe48470..3a64b625 100644 --- a/.github/workflows/build-npm.yml +++ b/.github/workflows/build-npm.yml @@ -90,7 +90,7 @@ jobs: comment_title: Jest Unit Test Statistics - name: Publish Jest coverage report - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 if: always() with: name: jest-coverage-report @@ -98,7 +98,7 @@ jobs: retention-days: 30 - name: Publish yarn.lock - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 if: failure() with: name: yarn.lock diff --git a/CHANGELOG.md b/CHANGELOG.md index a7c31adb..a623c924 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Change history for ui-calendar +## In progress + +* Disable 'Actions' menu on DCB Calendar. Refs UICAL-285. + ## [11.0.1] (https://github.com/folio-org/ui-calendar/tree/v11.0.1) (2024-05-08) * Address empty fourth pane on open of 'Current calendar assignment'. Refs UICAL-283 diff --git a/src/test/data/Calendars.ts b/src/test/data/Calendars.ts index b8e94e20..752c903d 100644 --- a/src/test/data/Calendars.ts +++ b/src/test/data/Calendars.ts @@ -227,3 +227,13 @@ export const SUMMER_SP_4_245: CalendarDTO = { ], exceptions: [] }; + +export const DCB: CalendarDTO = { + id: 'f3fde29e-59f7-47a6-8109-af6cb92acde5', + name: 'DCB Calendar', + assignments: ['9d1b77e8-f02e-4b7f-b296-3f2042ddac54'], + startDate: '2000-01-01', + endDate: '2000-04-30', + normalHours: [], + exceptions: [] +}; diff --git a/src/views/panes/InfoPane.test.tsx b/src/views/panes/InfoPane.test.tsx index 34a9404f..dfd55765 100644 --- a/src/views/panes/InfoPane.test.tsx +++ b/src/views/panes/InfoPane.test.tsx @@ -285,6 +285,31 @@ describe('Calendar info pane', () => { expect(screen.getByRole('button', { name: 'Delete' })).toBeInTheDocument(); }); + it('should not render action buttons for DCB calendar', async () => { + const props = { + creationBasePath: '', + editBasePath: '', + calendar: Calendars.DCB, + onClose: jest.fn(), + dataRepository: new DataRepository(undefined, undefined, { + create: jest.fn(), + update: jest.fn(), + delete: jest.fn(), + dates: jest.fn(), + }), + }; + + render( + withEverything( + + + , + ), + ); + + expect(screen.queryByRole('button', { name: 'Actions' })).toBeNull(); + }); + it.skip('handles delete', async () => { const props = { creationBasePath: '', diff --git a/src/views/panes/InfoPane.tsx b/src/views/panes/InfoPane.tsx index c7fde3ac..7b34e6c7 100644 --- a/src/views/panes/InfoPane.tsx +++ b/src/views/panes/InfoPane.tsx @@ -32,6 +32,8 @@ import { generateExceptionalOpeningRows } from '../../utils/InfoPaneUtils'; import ifPermissionOr from '../../utils/ifPermissionOr'; import css from './InfoPane.css'; +const DCB_CALENDAR = 'DCB Calendar'; + export interface InfoPaneProps { creationBasePath: string; editBasePath: string; @@ -120,6 +122,9 @@ export const InfoPane: FunctionComponent = ( onClose={props.onClose} dismissible actionMenu={({ onToggle }) => { + if (calendar.name === DCB_CALENDAR) { + return null; + } return ifPermissionOr( stripes, [permissions.UPDATE, permissions.CREATE, permissions.DELETE],