Skip to content

Commit

Permalink
Merge branch 'master' into UITEN-281
Browse files Browse the repository at this point in the history
  • Loading branch information
artem-blazhko committed Jan 20, 2025
2 parents d3991c5 + eeba612 commit 6c006df
Show file tree
Hide file tree
Showing 42 changed files with 174 additions and 71 deletions.
3 changes: 3 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"extends": ["@folio/eslint-config-stripes"],
"parser": "@babel/eslint-parser",
"rules": {
"import/prefer-default-export": "off"
},
"overrides": [
{
"files": [
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
* [UITEN-294](https://folio-org.atlassian.net/browse/UITEN-294) Show routing service points on settings -> tenant -> servicePoints.
* [UITEN-292](https://folio-org.atlassian.net/browse/UITEN-292) Change visibility rules for routing service points.

* [UITEN-316](https://folio-org.atlassian.net/browse/UITEN-316) Fix code to pass ESLint successfully.
* [UITEN-314](https://folio-org.atlassian.net/browse/UITEN-314) Settings > Tenant > Locations setup > Locations. Enable and Display floating collection.

## [9.0.0](https://github.com/folio-org/ui-tenant-settings/tree/v9.0.0)(2024-10-30)

* [UITEN-274](https://folio-org.atlassian.net/browse/UITEN-274) Use Save & close button label stripes-component translation key.
Expand Down
14 changes: 14 additions & 0 deletions src/settings/LocationLocations/LocationForm/LocationForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
import {
Accordion,
Button,
Checkbox,
Col,
ExpandAllButton,
IconButton,
Expand Down Expand Up @@ -288,6 +289,19 @@ const LocationForm = ({
/>
</Col>
</Row>
<h3>Floating collection</h3>
<Row>
<Col xs={12}>
<Field
label={<FormattedMessage id="ui-tenant-settings.settings.location.locations.floating" />}
name="isFloatingCollection"
id="input-location-floating"
component={Checkbox}
type="checkbox"
/>
<br />
</Col>
</Row>
<Row>
<Col xs={12}>
<Field
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ const initialValuesMock = {
detailsArray: [],
institutionId: '',
isActive: true,
isFloatingCollection: false,
metadata: {
createdDate: '2021-10-28T03:23:16.718+00:00',
updatedDate: '2021-10-28T03:23:16.718+00:00',
Expand Down Expand Up @@ -226,6 +227,17 @@ describe('LocationFormContainer', () => {
expect(checkbox).toBeChecked();
});

it('should render floating collection checkbox', () => {
const { container } = renderLocationFormContainer();

const elem = container.querySelector('#input-location-floating');
expect(elem).not.toBeChecked();
userEvent.click(elem);
expect(elem).toBeChecked();
userEvent.click(elem);
expect(elem).not.toBeChecked();
});

it('should render ', () => {
renderLocationFormContainer();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const RemoteStorageField = ({ initialValues, checkLocationHasHoldingsOrIt
setIsReadOnly(true);
checkLocationHasHoldingsOrItems(locationId).then(setIsReadOnly);
},
[locationId, noInterfaces]
[locationId, noInterfaces] // eslint-disable-line react-hooks/exhaustive-deps
);

if (noInterfaces) return null;
Expand Down
6 changes: 4 additions & 2 deletions src/settings/LocationLocations/LocationManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,19 +70,21 @@ const initialSort = (location) => {
return { sort, sortDir };
};

const locationListVisibleColumns = ['isActive', 'name', 'code'];
const locationListVisibleColumns = ['isActive', 'name', 'code', 'isFloatingCollection'];

const locationListColumnMapping = {
isActive: <FormattedMessage id="ui-tenant-settings.settings.location.locations.status" />,
name: <FormattedMessage id="ui-tenant-settings.settings.location.locations.detailsName" />,
code: <FormattedMessage id="ui-tenant-settings.settings.location.code" />,
isFloatingCollection: <FormattedMessage id="ui-tenant-settings.settings.location.floating" />,
};

const locationListFormatter = {
isActive: item => {
const locationId = item.isActive ? 'active' : 'inactive';
return <FormattedMessage id={`ui-tenant-settings.settings.location.locations.${locationId}`} />;
}
},
isFloatingCollection: r => (r.isFloatingCollection ? '✓' : ''),
};

const LocationManager = ({ label }) => {
Expand Down
2 changes: 1 addition & 1 deletion src/settings/ServicePoints/ServicePointForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const ServicePointForm = ({
const [isConfirmPickupLocationChangeModal, setIsConfirmPickupLocationChangeModal] = useState(false);
const stripes = useStripes();
const intl = useIntl();
const CViewMetaData = useMemo(() => stripes.connect(ViewMetaData), []);
const CViewMetaData = useMemo(() => stripes.connect(ViewMetaData), []); // eslint-disable-line react-hooks/exhaustive-deps

const servicePoint = initialValues || {};
const locations = servicePoint.id
Expand Down
2 changes: 1 addition & 1 deletion src/settings/ServicePoints/ServicePointFormContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const ServicePointFormContainer = ({

useEffect(() => {
setInitialValues(getServicePoint());
}, [servicePoint.id, parentResources.staffSlips.hasLoaded]);
}, [servicePoint.id, parentResources.staffSlips.hasLoaded]); // eslint-disable-line react-hooks/exhaustive-deps

const transformStaffSlipsData = useCallback((staffSlips) => {
const currentSlips = parentResources?.staffSlips?.records || [];
Expand Down
9 changes: 6 additions & 3 deletions test/jest/__mocks__/stripesCore.mock.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,12 @@ const mockStripesCore = {
},

// eslint-disable-next-line react/prop-types
Pluggable: props => <><button onClick={props.entityTypeDataSource}>Get query</button>
<button onClick={props.cancelQueryDataSource}>Cancel query</button>
</>,
Pluggable: props => (
<>
<button type="button" onClick={props.entityTypeDataSource}>Get query</button>
<button type="button" onClick={props.cancelQueryDataSource}>Cancel query</button>
</>
),

// eslint-disable-next-line react/prop-types
IfPermission: jest.fn(props => <>{props.children}</>),
Expand Down
4 changes: 3 additions & 1 deletion translations/ui-tenant-settings/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,5 +211,7 @@
"settings.reading-room-access.deleteEntry": "Delete reading room access",
"settings.reading-room-access.termDeleted": "The reading room access <b>{term}</b> was successfully <b>deleted</b>",
"settings.reading-room-access.termWillBeDeleted": "The reading room <b>{term}</b> will be <b>deleted</b>",
"settings.servicePoints.placeholder": "Select service point"
"settings.servicePoints.placeholder": "Select service point",
"settings.location.floating": "Floating collection",
"settings.location.locations.floating": "Enable floating collection"
}
4 changes: 3 additions & 1 deletion translations/ui-tenant-settings/ber.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,5 +211,7 @@
"settings.reading-room-access.deleteEntry": "Delete reading room access",
"settings.reading-room-access.termDeleted": "The reading room access <b>{term}</b> was successfully <b>deleted</b>",
"settings.reading-room-access.termWillBeDeleted": "The reading room <b>{term}</b> will be <b>deleted</b>",
"settings.servicePoints.placeholder": "Select service point"
"settings.servicePoints.placeholder": "Select service point",
"settings.location.floating": "Floating collection",
"settings.location.locations.floating": "Enable floating collection"
}
4 changes: 3 additions & 1 deletion translations/ui-tenant-settings/ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,5 +211,7 @@
"settings.reading-room-access.deleteEntry": "Delete reading room access",
"settings.reading-room-access.termDeleted": "The reading room access <b>{term}</b> was successfully <b>deleted</b>",
"settings.reading-room-access.termWillBeDeleted": "The reading room <b>{term}</b> will be <b>deleted</b>",
"settings.servicePoints.placeholder": "Select service point"
"settings.servicePoints.placeholder": "Select service point",
"settings.location.floating": "Floating collection",
"settings.location.locations.floating": "Enable floating collection"
}
4 changes: 3 additions & 1 deletion translations/ui-tenant-settings/cs_CZ.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,5 +211,7 @@
"settings.reading-room-access.deleteEntry": "Smazat přístup do čítárny",
"settings.reading-room-access.termDeleted": "Přístup do čítárny <b>{term}</b> byl úspěšně <b>smazán</b>",
"settings.reading-room-access.termWillBeDeleted": "Čítárna <b>{term}</b> bude <b>smazána</b>",
"settings.servicePoints.placeholder": "Výběr pultu služeb"
"settings.servicePoints.placeholder": "Výběr pultu služeb",
"settings.location.floating": "Floating collection",
"settings.location.locations.floating": "Enable floating collection"
}
4 changes: 3 additions & 1 deletion translations/ui-tenant-settings/da.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,5 +211,7 @@
"settings.reading-room-access.deleteEntry": "Delete reading room access",
"settings.reading-room-access.termDeleted": "The reading room access <b>{term}</b> was successfully <b>deleted</b>",
"settings.reading-room-access.termWillBeDeleted": "The reading room <b>{term}</b> will be <b>deleted</b>",
"settings.servicePoints.placeholder": "Select service point"
"settings.servicePoints.placeholder": "Select service point",
"settings.location.floating": "Floating collection",
"settings.location.locations.floating": "Enable floating collection"
}
4 changes: 3 additions & 1 deletion translations/ui-tenant-settings/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,5 +211,7 @@
"settings.reading-room-access.deleteEntry": "Delete reading room access",
"settings.reading-room-access.termDeleted": "The reading room access <b>{term}</b> was successfully <b>deleted</b>",
"settings.reading-room-access.termWillBeDeleted": "The reading room <b>{term}</b> will be <b>deleted</b>",
"settings.servicePoints.placeholder": "Select service point"
"settings.servicePoints.placeholder": "Select service point",
"settings.location.floating": "Floating collection",
"settings.location.locations.floating": "Enable floating collection"
}
2 changes: 2 additions & 0 deletions translations/ui-tenant-settings/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@

"settings.location.label": "Location setup",
"settings.location.code": "Code",
"settings.location.floating": "Floating collection",

"settings.location.institutions": "Institutions",
"settings.location.institutions.institution": "Institution",
Expand Down Expand Up @@ -104,6 +105,7 @@
"settings.location.locations.discoveryDisplayName": "Discovery display name",
"settings.location.locations.servicePoints": "Service point(s)",
"settings.location.locations.primary": "Primary",
"settings.location.locations.floating": "Enable floating collection",
"settings.location.locations.status": "Status",
"settings.location.locations.active": "Active",
"settings.location.locations.inactive": "Inactive",
Expand Down
4 changes: 3 additions & 1 deletion translations/ui-tenant-settings/en_GB.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,5 +211,7 @@
"settings.reading-room-access.deleteEntry": "Delete reading room access",
"settings.reading-room-access.termDeleted": "The reading room access <b>{term}</b> was successfully <b>deleted</b>",
"settings.reading-room-access.termWillBeDeleted": "The reading room <b>{term}</b> will be <b>deleted</b>",
"settings.servicePoints.placeholder": "Select service point"
"settings.servicePoints.placeholder": "Select service point",
"settings.location.floating": "Floating collection",
"settings.location.locations.floating": "Enable floating collection"
}
4 changes: 3 additions & 1 deletion translations/ui-tenant-settings/en_SE.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,5 +211,7 @@
"settings.reading-room-access.deleteEntry": "Delete reading room access",
"settings.reading-room-access.termDeleted": "The reading room access <b>{term}</b> was successfully <b>deleted</b>",
"settings.reading-room-access.termWillBeDeleted": "The reading room <b>{term}</b> will be <b>deleted</b>",
"settings.servicePoints.placeholder": "Select service point"
"settings.servicePoints.placeholder": "Select service point",
"settings.location.floating": "Floating collection",
"settings.location.locations.floating": "Enable floating collection"
}
4 changes: 3 additions & 1 deletion translations/ui-tenant-settings/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,5 +211,7 @@
"settings.reading-room-access.deleteEntry": "Delete reading room access",
"settings.reading-room-access.termDeleted": "The reading room access <b>{term}</b> was successfully <b>deleted</b>",
"settings.reading-room-access.termWillBeDeleted": "The reading room <b>{term}</b> will be <b>deleted</b>",
"settings.servicePoints.placeholder": "Select service point"
"settings.servicePoints.placeholder": "Select service point",
"settings.location.floating": "Floating collection",
"settings.location.locations.floating": "Enable floating collection"
}
4 changes: 3 additions & 1 deletion translations/ui-tenant-settings/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,5 +211,7 @@
"settings.reading-room-access.deleteEntry": "Delete reading room access",
"settings.reading-room-access.termDeleted": "The reading room access <b>{term}</b> was successfully <b>deleted</b>",
"settings.reading-room-access.termWillBeDeleted": "The reading room <b>{term}</b> will be <b>deleted</b>",
"settings.servicePoints.placeholder": "Select service point"
"settings.servicePoints.placeholder": "Select service point",
"settings.location.floating": "Floating collection",
"settings.location.locations.floating": "Enable floating collection"
}
4 changes: 3 additions & 1 deletion translations/ui-tenant-settings/es_419.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,5 +211,7 @@
"settings.reading-room-access.deleteEntry": "Delete reading room access",
"settings.reading-room-access.termDeleted": "The reading room access <b>{term}</b> was successfully <b>deleted</b>",
"settings.reading-room-access.termWillBeDeleted": "The reading room <b>{term}</b> will be <b>deleted</b>",
"settings.servicePoints.placeholder": "Select service point"
"settings.servicePoints.placeholder": "Select service point",
"settings.location.floating": "Floating collection",
"settings.location.locations.floating": "Enable floating collection"
}
4 changes: 3 additions & 1 deletion translations/ui-tenant-settings/es_ES.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,5 +211,7 @@
"settings.reading-room-access.deleteEntry": "Delete reading room access",
"settings.reading-room-access.termDeleted": "The reading room access <b>{term}</b> was successfully <b>deleted</b>",
"settings.reading-room-access.termWillBeDeleted": "The reading room <b>{term}</b> will be <b>deleted</b>",
"settings.servicePoints.placeholder": "Select service point"
"settings.servicePoints.placeholder": "Select service point",
"settings.location.floating": "Floating collection",
"settings.location.locations.floating": "Enable floating collection"
}
4 changes: 3 additions & 1 deletion translations/ui-tenant-settings/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,5 +211,7 @@
"settings.reading-room-access.deleteEntry": "Delete reading room access",
"settings.reading-room-access.termDeleted": "The reading room access <b>{term}</b> was successfully <b>deleted</b>",
"settings.reading-room-access.termWillBeDeleted": "The reading room <b>{term}</b> will be <b>deleted</b>",
"settings.servicePoints.placeholder": "Select service point"
"settings.servicePoints.placeholder": "Select service point",
"settings.location.floating": "Floating collection",
"settings.location.locations.floating": "Enable floating collection"
}
4 changes: 3 additions & 1 deletion translations/ui-tenant-settings/fr_FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,5 +211,7 @@
"settings.reading-room-access.deleteEntry": "Delete reading room access",
"settings.reading-room-access.termDeleted": "The reading room access <b>{term}</b> was successfully <b>deleted</b>",
"settings.reading-room-access.termWillBeDeleted": "The reading room <b>{term}</b> will be <b>deleted</b>",
"settings.servicePoints.placeholder": "Select service point"
"settings.servicePoints.placeholder": "Select service point",
"settings.location.floating": "Floating collection",
"settings.location.locations.floating": "Enable floating collection"
}
4 changes: 3 additions & 1 deletion translations/ui-tenant-settings/he.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,5 +211,7 @@
"settings.reading-room-access.deleteEntry": "Delete reading room access",
"settings.reading-room-access.termDeleted": "The reading room access <b>{term}</b> was successfully <b>deleted</b>",
"settings.reading-room-access.termWillBeDeleted": "The reading room <b>{term}</b> will be <b>deleted</b>",
"settings.servicePoints.placeholder": "Select service point"
"settings.servicePoints.placeholder": "Select service point",
"settings.location.floating": "Floating collection",
"settings.location.locations.floating": "Enable floating collection"
}
4 changes: 3 additions & 1 deletion translations/ui-tenant-settings/hi_IN.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,5 +211,7 @@
"settings.reading-room-access.deleteEntry": "Delete reading room access",
"settings.reading-room-access.termDeleted": "The reading room access <b>{term}</b> was successfully <b>deleted</b>",
"settings.reading-room-access.termWillBeDeleted": "The reading room <b>{term}</b> will be <b>deleted</b>",
"settings.servicePoints.placeholder": "Select service point"
"settings.servicePoints.placeholder": "Select service point",
"settings.location.floating": "Floating collection",
"settings.location.locations.floating": "Enable floating collection"
}
4 changes: 3 additions & 1 deletion translations/ui-tenant-settings/hu.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,5 +211,7 @@
"settings.reading-room-access.deleteEntry": "Delete reading room access",
"settings.reading-room-access.termDeleted": "The reading room access <b>{term}</b> was successfully <b>deleted</b>",
"settings.reading-room-access.termWillBeDeleted": "The reading room <b>{term}</b> will be <b>deleted</b>",
"settings.servicePoints.placeholder": "Select service point"
"settings.servicePoints.placeholder": "Select service point",
"settings.location.floating": "Floating collection",
"settings.location.locations.floating": "Enable floating collection"
}
4 changes: 3 additions & 1 deletion translations/ui-tenant-settings/it_IT.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,5 +211,7 @@
"settings.reading-room-access.deleteEntry": "Delete reading room access",
"settings.reading-room-access.termDeleted": "The reading room access <b>{term}</b> was successfully <b>deleted</b>",
"settings.reading-room-access.termWillBeDeleted": "The reading room <b>{term}</b> will be <b>deleted</b>",
"settings.servicePoints.placeholder": "Select service point"
"settings.servicePoints.placeholder": "Select service point",
"settings.location.floating": "Floating collection",
"settings.location.locations.floating": "Enable floating collection"
}
4 changes: 3 additions & 1 deletion translations/ui-tenant-settings/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,5 +211,7 @@
"settings.reading-room-access.deleteEntry": "Delete reading room access",
"settings.reading-room-access.termDeleted": "The reading room access <b>{term}</b> was successfully <b>deleted</b>",
"settings.reading-room-access.termWillBeDeleted": "The reading room <b>{term}</b> will be <b>deleted</b>",
"settings.servicePoints.placeholder": "サービスポイントの選択"
"settings.servicePoints.placeholder": "サービスポイントの選択",
"settings.location.floating": "Floating collection",
"settings.location.locations.floating": "Enable floating collection"
}
4 changes: 3 additions & 1 deletion translations/ui-tenant-settings/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,5 +211,7 @@
"settings.reading-room-access.deleteEntry": "Delete reading room access",
"settings.reading-room-access.termDeleted": "The reading room access <b>{term}</b> was successfully <b>deleted</b>",
"settings.reading-room-access.termWillBeDeleted": "The reading room <b>{term}</b> will be <b>deleted</b>",
"settings.servicePoints.placeholder": "Select service point"
"settings.servicePoints.placeholder": "Select service point",
"settings.location.floating": "Floating collection",
"settings.location.locations.floating": "Enable floating collection"
}
4 changes: 3 additions & 1 deletion translations/ui-tenant-settings/nb.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,5 +211,7 @@
"settings.reading-room-access.deleteEntry": "Delete reading room access",
"settings.reading-room-access.termDeleted": "The reading room access <b>{term}</b> was successfully <b>deleted</b>",
"settings.reading-room-access.termWillBeDeleted": "The reading room <b>{term}</b> will be <b>deleted</b>",
"settings.servicePoints.placeholder": "Select service point"
"settings.servicePoints.placeholder": "Select service point",
"settings.location.floating": "Floating collection",
"settings.location.locations.floating": "Enable floating collection"
}
4 changes: 3 additions & 1 deletion translations/ui-tenant-settings/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,5 +211,7 @@
"settings.reading-room-access.deleteEntry": "Leeszaaltoegang verwijderen",
"settings.reading-room-access.termDeleted": "De leeszaaltoegang <b>{term}</b> is <b>verwijderd</b>",
"settings.reading-room-access.termWillBeDeleted": "De leeszaaltoegang <b>{term}</b> wordt <b>verwijderd</b>",
"settings.servicePoints.placeholder": "Servicepunt selecteren"
"settings.servicePoints.placeholder": "Servicepunt selecteren",
"settings.location.floating": "Floating collection",
"settings.location.locations.floating": "Enable floating collection"
}
Loading

0 comments on commit 6c006df

Please sign in to comment.