-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ui: prepare ui to be deployed as spa
- Loading branch information
Showing
9 changed files
with
210 additions
and
458 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
REACT_APP_JWT_TOKEN='token' | ||
REACT_APP_USER_ID=1 | ||
REACT_APP_LOCATION_ID=1 | ||
REACT_APP_USER_ROLE=librarian | ||
REACT_APP_JWT_TOKEN_EXPIRATION=11111111111111111111111 | ||
REACT_APP_JWT_USERNAME=librarian |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
205 changes: 199 additions & 6 deletions
205
invenio_app_ils/ui/src/invenio_app_ils/common/config/invenioConfig.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,200 @@ | ||
const getInvenioConfig = () => { | ||
const element = document.getElementById('invenio-config'); | ||
const jsonString = element ? element.getAttribute('data-config') : '{}'; | ||
return JSON.parse(jsonString); | ||
export const invenioConfig = { | ||
circulation: { | ||
deliveryMethods: { | ||
DELIVERY: 'Delivery', | ||
PICKUP: 'Pick it up at the library desk', | ||
}, | ||
loanActiveStates: [ | ||
'ITEM_AT_DESK', | ||
'ITEM_ON_LOAN', | ||
'ITEM_IN_TRANSIT_FOR_PICKUP', | ||
'ITEM_IN_TRANSIT_TO_HOUSE', | ||
], | ||
loanCancelledStates: ['CANCELLED'], | ||
loanCompletedStates: ['ITEM_RETURNED'], | ||
loanRequestStates: ['PENDING'], | ||
requestDuration: 60, | ||
}, | ||
default_results_size: 10, | ||
documentRequests: { | ||
search: { | ||
aggs: ['state'], | ||
sortBy: { | ||
onEmptyQuery: null, | ||
values: [], | ||
}, | ||
sortOrder: ['asc', 'desc'], | ||
}, | ||
}, | ||
documents: { | ||
search: { | ||
aggs: [ | ||
'tags', | ||
'languages', | ||
'document_type', | ||
'relations', | ||
'has_items', | ||
'has_eitems', | ||
'has_items_for_loan', | ||
], | ||
sortBy: { | ||
onEmptyQuery: 'mostrecent', | ||
values: [ | ||
{ | ||
default_order: 'asc', | ||
field: 'mostrecent', | ||
order: 1, | ||
title: 'Newest', | ||
}, | ||
{ | ||
default_order: 'asc', | ||
field: 'bestmatch', | ||
order: 2, | ||
title: 'Best match', | ||
}, | ||
{ | ||
default_order: 'asc', | ||
field: 'available_items', | ||
order: 3, | ||
title: 'Available Items', | ||
}, | ||
{ | ||
default_order: 'desc', | ||
field: 'mostloaned', | ||
order: 4, | ||
title: 'Most loaned', | ||
}, | ||
], | ||
}, | ||
sortOrder: ['asc', 'desc'], | ||
}, | ||
}, | ||
editor: { | ||
url: '/editor', | ||
}, | ||
eitems: { | ||
search: { | ||
aggs: [], | ||
sortBy: { | ||
onEmptyQuery: 'mostrecent', | ||
values: [ | ||
{ | ||
field: 'mostrecent', | ||
order: 1, | ||
title: 'Newest', | ||
}, | ||
{ | ||
field: 'bestmatch', | ||
order: 2, | ||
title: 'Best match', | ||
}, | ||
], | ||
}, | ||
sortOrder: ['asc', 'desc'], | ||
}, | ||
}, | ||
items: { | ||
canCirculateStates: ['CAN_CIRCULATE'], | ||
search: { | ||
aggs: ['status', 'medium', 'circulation'], | ||
sortBy: { | ||
onEmptyQuery: 'mostrecent', | ||
values: [ | ||
{ | ||
field: 'mostrecent', | ||
order: 1, | ||
title: 'Newest', | ||
}, | ||
{ | ||
field: 'bestmatch', | ||
order: 2, | ||
title: 'Best match', | ||
}, | ||
], | ||
}, | ||
sortOrder: ['asc', 'desc'], | ||
}, | ||
}, | ||
loans: { | ||
search: { | ||
aggs: ['state'], | ||
sortBy: { | ||
onEmptyQuery: 'mostrecent', | ||
values: [ | ||
{ | ||
field: 'mostrecent', | ||
order: 1, | ||
title: 'Newest', | ||
}, | ||
{ | ||
field: 'bestmatch', | ||
order: 2, | ||
title: 'Best match', | ||
}, | ||
], | ||
}, | ||
sortOrder: ['asc', 'desc'], | ||
}, | ||
}, | ||
max_results_window: 10000, | ||
patrons: { | ||
search: { | ||
aggs: [], | ||
sortBy: { | ||
onEmptyQuery: null, | ||
values: [], | ||
}, | ||
sortOrder: ['asc', 'desc'], | ||
}, | ||
}, | ||
relationTypes: [ | ||
{ | ||
id: 3, | ||
label: 'Multipart Monograph', | ||
name: 'multipart_monograph', | ||
}, | ||
{ | ||
id: 4, | ||
label: 'Serial', | ||
name: 'serial', | ||
}, | ||
{ | ||
id: 0, | ||
label: 'Language', | ||
name: 'language', | ||
}, | ||
{ | ||
id: 1, | ||
label: 'Edition', | ||
name: 'edition', | ||
}, | ||
{ | ||
id: 2, | ||
label: 'Other', | ||
name: 'other', | ||
}, | ||
], | ||
rest_mimetype_query_arg_name: 'format', | ||
series: { | ||
search: { | ||
aggs: ['moi'], | ||
sortBy: { | ||
onEmptyQuery: 'mostrecent', | ||
values: [ | ||
{ | ||
field: 'mostrecent', | ||
order: 1, | ||
title: 'Newest', | ||
}, | ||
{ | ||
field: 'bestmatch', | ||
order: 2, | ||
title: 'Best match', | ||
}, | ||
], | ||
}, | ||
sortOrder: ['asc', 'desc'], | ||
}, | ||
}, | ||
support_email: 'info@inveniosoftware.org', | ||
}; | ||
|
||
export const invenioConfig = getInvenioConfig(); |
Oops, something went wrong.