Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ export const schema = () => {
type: 'string',
title: 'Physical location',
},
accessible_by_patrons: {
type: 'boolean',
title: 'Is this location accessible by patrons?',
default: true,
},
},
};
return _merge(_schema, invenioConfig.INTERNAL_LOCATIONS.editorSchema);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,9 @@ export const uiSchema = (title) => {
'ui:widget': 'textarea',
},
'custom:grid': [
{
name: 8,
location_pid: 8,
},
{
physical_location: 8,
notes: 8,
},
{ name: 8, location_pid: 8 },
{ physical_location: 8, notes: 8 },
{ accessible_by_patrons: 8 },
],
'custom:root': {
'custom:formTitle': title,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@ export default class InternalLocationList extends Component {
{ title: 'Name', field: 'metadata.name' },
{ title: 'Physical location', field: 'metadata.physical_location' },
{ title: 'Location e-mail', field: 'metadata.location.email' },
{
title: 'Accessible by patrons',
field: 'metadata.accessible_by_patrons',
formatter: ({ row }) =>
row.metadata.accessible_by_patrons ? (
<i className="check icon" />
) : null,
},
{ title: 'Actions', field: '', formatter: this.rowActions },
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,46 +34,55 @@ export default class DocumentItemBody extends Component {
identifiersToDisplayInFrontside,
} = this.props;

return items.map((item) => (
<Table.Row key={item.pid}>
<Table.Cell
data-label="Barcode"
className="document-item-table-itemCell"
>
{item.barcode}
</Table.Cell>
<Table.Cell data-label="Shelf" className="document-item-table-itemCell">
{shelfLink !== null
? shelfLink(item, documentDetails)
: _get(item, 'shelf')}
</Table.Cell>
return items.map((item) => {
const showShelfLink = item.internal_location.accessible_by_patrons;

{identifiersToDisplayInFrontside.map((identifier) => (
return (
<Table.Row key={item.pid}>
<Table.Cell
key={identifier}
data-label={identifier.text}
data-label="Barcode"
className="document-item-table-itemCell"
>
{
item.identifiers?.find((entry) => {
return entry.scheme === identifier.key;
})?.value
}
{item.barcode}
</Table.Cell>
<Table.Cell
data-label="Shelf"
className="document-item-table-itemCell"
>
{showShelfLink
? shelfLink !== null
? shelfLink(item, documentDetails)
: _get(item, 'shelf')
: 'Available on Request'}
</Table.Cell>
))}

<Table.Cell data-label="Status">{this.statusLabel(item)}</Table.Cell>
<Table.Cell data-label="Medium">
{getDisplayVal('ITEMS.mediums', item.medium)}
</Table.Cell>
<Table.Cell data-label="Restrictions">
{getDisplayVal(
'ITEMS.circulationRestrictions',
item.circulation_restriction
)}
</Table.Cell>
</Table.Row>
));
{identifiersToDisplayInFrontside.map((identifier) => (
<Table.Cell
key={identifier}
data-label={identifier.text}
className="document-item-table-itemCell"
>
{
item.identifiers?.find((entry) => {
return entry.scheme === identifier.key;
})?.value
}
</Table.Cell>
))}

<Table.Cell data-label="Status">{this.statusLabel(item)}</Table.Cell>
<Table.Cell data-label="Medium">
{getDisplayVal('ITEMS.mediums', item.medium)}
</Table.Cell>
<Table.Cell data-label="Restrictions">
{getDisplayVal(
'ITEMS.circulationRestrictions',
item.circulation_restriction
)}
</Table.Cell>
</Table.Row>
);
});
}
}

Expand Down
9 changes: 6 additions & 3 deletions src/testData/internal_locations.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,19 @@
{
"pid": "ilocid-1",
"location_pid": "locid-1",
"name": "Internal Library 1"
"name": "Internal Library 1",
"accessible_by_patrons": true
},
{
"pid": "ilocid-2",
"location_pid": "locid-1",
"name": "Internal Library 2"
"name": "Internal Library 2",
"accessible_by_patrons": true
},
{
"pid": "ilocid-3",
"location_pid": "locid-1",
"name": "Unused Internal Library"
"name": "Unused Internal Library",
"accessible_by_patrons": true
}
]
Loading