Skip to content

Commit

Permalink
ui: rename holdingpen to bakcoffice
Browse files Browse the repository at this point in the history
* ref: cern-sis/issues-inspire/issues#550
  • Loading branch information
karolina-siemieniuk-morawska committed Sep 2, 2024
1 parent 3f3108c commit 2ea8902
Show file tree
Hide file tree
Showing 63 changed files with 400 additions and 425 deletions.
12 changes: 6 additions & 6 deletions ui/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
HOME,
USER,
HOLDINGPEN,
HOLDINGPEN_NEW,
BACKOFFICE,
LITERATURE,
AUTHORS,
SUBMISSIONS,
Expand Down Expand Up @@ -54,8 +54,8 @@ const Holdingpen$ = Loadable({
loader: () => import('./holdingpen'),
loading: Loading,
});
const HoldingpenNew$ = Loadable({
loader: () => import('./holdingpen-new'),
const Backoffice$ = Loadable({
loader: () => import('./backoffice'),
loading: Loading,
});
const Submissions$ = Loadable({
Expand Down Expand Up @@ -95,10 +95,10 @@ function App({ userRoles, dispatch, guideModalVisibility }) {
<Route path={USER} component={User} />
<PrivateRoute path={HOLDINGPEN} component={Holdingpen$} />
<PrivateRoute
path={HOLDINGPEN_NEW}
component={HoldingpenNew$}
path={BACKOFFICE}
component={Backoffice$}
authorizedRoles={SUPERUSER_OR_CATALOGER}
holdingpen
backoffice
/>
<Route path={LITERATURE} component={Literature} />
<Route path={AUTHORS} component={Authors} />
Expand Down
18 changes: 9 additions & 9 deletions ui/src/__tests__/App.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
import App from '../App';
import { setUserCategoryFromRoles } from '../tracker';
import { userSignUp, fetchLoggedInUser } from '../actions/user';
import { HOLDINGPEN_NEW } from '../common/routes';
import { BACKOFFICE } from '../common/routes';

jest.mock('../tracker');
jest.mock('../actions/user');
Expand Down Expand Up @@ -111,7 +111,7 @@ describe('App', () => {
expect(holdingpen).not.toBeInTheDocument();
});

it('navigates to new Holdingpen when /holdingpen-new if superuser logged in', async () => {
it('navigates to Backoffice when /backoffice if superuser logged in', async () => {
const store = getStoreWithState({
user: fromJS({
loggedIn: true,
Expand All @@ -122,20 +122,20 @@ describe('App', () => {
});
const { getByTestId } = render(
<Provider store={store}>
<MemoryRouter initialEntries={[HOLDINGPEN_NEW]} initialIndex={0}>
<MemoryRouter initialEntries={[BACKOFFICE]} initialIndex={0}>
<App />
</MemoryRouter>
</Provider>
);
await Loadable.preloadAll();

const app = getByTestId('app');
const holdingpen = within(app).getByTestId('holdingpen-new');
const backoffice = within(app).getByTestId('backoffice');

expect(holdingpen).toBeInTheDocument();
expect(backoffice).toBeInTheDocument();
});

it('does not navigate to Holdingpen when /holdingpen-new if not logged in', async () => {
it('does not navigate to backoffice when /backoffice if not logged in', async () => {
const store = getStoreWithState({
user: fromJS({
loggedIn: false,
Expand All @@ -146,16 +146,16 @@ describe('App', () => {
});
const { getByTestId } = render(
<Provider store={store}>
<MemoryRouter initialEntries={[HOLDINGPEN_NEW]} initialIndex={0}>
<MemoryRouter initialEntries={[BACKOFFICE]} initialIndex={0}>
<App />
</MemoryRouter>
</Provider>
);
await Loadable.preloadAll();
const app = getByTestId('app');
const holdingpen = within(app).queryByTestId('holdingpen-new');
const backoffice = within(app).queryByTestId('backoffice');

expect(holdingpen).not.toBeInTheDocument();
expect(backoffice).not.toBeInTheDocument();
});

it('navigates to User when /user', () => {
Expand Down
42 changes: 21 additions & 21 deletions ui/src/actions/actionTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,24 +133,24 @@ export const LITERATURE_SET_ASSIGN_LITERATURE_ITEM_DRAWER_VISIBILITY =
export const LITERATURE_SET_CURATE_DRAWER_VISIBILITY =
'LITERATURE_SET_CURATE_DRAWER_VISIBILITY';

export const HOLDINGPEN_LOGIN_REQUEST = 'HOLDINGPEN_LOGIN_REQUEST';
export const HOLDINGPEN_LOGIN_ERROR = 'HOLDINGPEN_LOGIN_ERROR';
export const HOLDINGPEN_LOGIN_SUCCESS = 'HOLDINGPEN_LOGIN_SUCCESS';
export const HOLDINGPEN_LOGOUT_SUCCESS = 'HOLDINGPEN_LOGOUT_SUCCESS';
export const HOLDINGPEN_SEARCH_REQUEST = 'HOLDINGPEN_SEARCH_REQUEST';
export const HOLDINGPEN_SEARCH_ERROR = 'HOLDINGPEN_SEARCH_ERROR';
export const HOLDINGPEN_SEARCH_SUCCESS = 'HOLDINGPEN_SEARCH_SUCCESS';
export const HOLDINGPEN_SEARCH_QUERY_UPDATE = 'HOLDINGPEN_SEARCH_QUERY_UPDATE';
export const HOLDINGPEN_SEARCH_QUERY_RESET = 'HOLDINGPEN_SEARCH_QUERY_RESET';
export const HOLDINGPEN_AUTHOR_REQUEST = 'HOLDINGPEN_AUTHOR_REQUEST';
export const HOLDINGPEN_AUTHOR_ERROR = 'HOLDINGPEN_AUTHOR_ERROR';
export const HOLDINGPEN_AUTHOR_SUCCESS = 'HOLDINGPEN_AUTHOR_SUCCESS';
export const HOLDINGPEN_RESOLVE_ACTION_REQUEST =
'HOLDINGPEN_RESOLVE_ACTION_REQUEST';
export const HOLDINGPEN_RESOLVE_ACTION_SUCCESS =
'HOLDINGPEN_RESOLVE_ACTION_SUCCESS';
export const HOLDINGPEN_RESOLVE_ACTION_ERROR =
'HOLDINGPEN_RESOLVE_ACTION_ERROR';
export const HOLDINGPEN_DELETE_REQUEST = 'HOLDINGPEN_DELETE_REQUEST';
export const HOLDINGPEN_DELETE_SUCCESS = 'HOLDINGPEN_DELETE_SUCCESS';
export const HOLDINGPEN_DELETE_ERROR = 'HOLDINGPEN_DELETE_ERROR';
export const BACKOFFICE_LOGIN_REQUEST = 'BACKOFFICE_LOGIN_REQUEST';
export const BACKOFFICE_LOGIN_ERROR = 'BACKOFFICE_LOGIN_ERROR';
export const BACKOFFICE_LOGIN_SUCCESS = 'BACKOFFICE_LOGIN_SUCCESS';
export const BACKOFFICE_LOGOUT_SUCCESS = 'BACKOFFICE_LOGOUT_SUCCESS';
export const BACKOFFICE_SEARCH_REQUEST = 'BACKOFFICE_SEARCH_REQUEST';
export const BACKOFFICE_SEARCH_ERROR = 'BACKOFFICE_SEARCH_ERROR';
export const BACKOFFICE_SEARCH_SUCCESS = 'BACKOFFICE_SEARCH_SUCCESS';
export const BACKOFFICE_SEARCH_QUERY_UPDATE = 'BACKOFFICE_SEARCH_QUERY_UPDATE';
export const BACKOFFICE_SEARCH_QUERY_RESET = 'BACKOFFICE_SEARCH_QUERY_RESET';
export const BACKOFFICE_AUTHOR_REQUEST = 'BACKOFFICE_AUTHOR_REQUEST';
export const BACKOFFICE_AUTHOR_ERROR = 'BACKOFFICE_AUTHOR_ERROR';
export const BACKOFFICE_AUTHOR_SUCCESS = 'BACKOFFICE_AUTHOR_SUCCESS';
export const BACKOFFICE_RESOLVE_ACTION_REQUEST =
'BACKOFFICE_RESOLVE_ACTION_REQUEST';
export const BACKOFFICE_RESOLVE_ACTION_SUCCESS =
'BACKOFFICE_RESOLVE_ACTION_SUCCESS';
export const BACKOFFICE_RESOLVE_ACTION_ERROR =
'BACKOFFICE_RESOLVE_ACTION_ERROR';
export const BACKOFFICE_DELETE_REQUEST = 'BACKOFFICE_DELETE_REQUEST';
export const BACKOFFICE_DELETE_SUCCESS = 'BACKOFFICE_DELETE_SUCCESS';
export const BACKOFFICE_DELETE_ERROR = 'BACKOFFICE_DELETE_ERROR';
Loading

0 comments on commit 2ea8902

Please sign in to comment.