-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
*DO NOT MERGE* UIIN-3162 *BREAKING* Use browse
1.5
interface that provides new Call Number Browse endpoints.
#2698
Open
BogdanDenis
wants to merge
14
commits into
master
Choose a base branch
from
UIIN-3162
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 8 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
3b6f21c
UIIN-3162 *BREAKING* Use `browse` `1.5` interface that provides new C…
BogdanDenis 1e5b72a
Merge remote-tracking branch 'origin/master' into UIIN-3162
BogdanDenis 70e2943
UIIN-3162 update search parameters for new call numbers browse
BogdanDenis 7a10026
UIIN-3162 Added Sudoc and Other call number browse options
BogdanDenis 5bdfaa5
UIIN-3162 update call numbers browse results list
BogdanDenis 18cd885
Merge remote-tracking branch 'origin/master' into UIIN-3162
BogdanDenis 1d1101a
UIIN-3162 apply call number prefix and suffix separately
BogdanDenis 6439b8b
UIIN-3162 use prefix+callnumber+suffix instead of fullCallNumber
BogdanDenis c70bdca
UIIN-3162 reorder Call number browse options
BogdanDenis 4f8c1ec
Merge remote-tracking branch 'origin/master' into UIIN-3162
BogdanDenis 957f4e7
change the useSearchForShadowInstanceTenants endpoint from 'search/ca…
Dmytro-Melnyshyn cf84b18
change effection location facet name for call numbers
Dmytro-Melnyshyn abd0cb8
refactor getSearchParams function to remove repeating
Dmytro-Melnyshyn e751d08
Merge branch 'master' into UIIN-3162
Dmytro-Melnyshyn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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 |
---|---|---|
|
@@ -7,6 +7,7 @@ import { | |
browseClassificationIndexToId, | ||
FACETS, | ||
queryIndexes, | ||
segments, | ||
} from '@folio/stripes-inventory-components'; | ||
|
||
export const isRowPreventsClick = (row, browseOption) => { | ||
|
@@ -21,7 +22,6 @@ export const isRowPreventsClick = (row, browseOption) => { | |
const isItemHasNoRecords = row.totalRecords === 0; | ||
|
||
return isItemHasNoRecords || ( | ||
(browseOption === browseModeOptions.CALL_NUMBERS && !row.shelfKey) || | ||
(browseOption === browseModeOptions.CONTRIBUTORS && !row.contributorNameTypeId) || | ||
(browseOption === browseModeOptions.SUBJECTS && !row.totalRecords) | ||
); | ||
|
@@ -97,6 +97,12 @@ const getClassificationQuery = (qindex, data, row) => { | |
return query; | ||
}; | ||
|
||
export const getFullCallNumber = (row) => { | ||
const fullCallNumber = [row.callNumberPrefix, row.callNumber, row.callNumberSuffix].filter(Boolean).join(' '); | ||
|
||
return fullCallNumber; | ||
}; | ||
|
||
export const getSearchParams = (row, qindex, allFilters, data) => { | ||
const filters = getExtraFilters(row, qindex, allFilters); | ||
const classificationQuery = getClassificationQuery(qindex, data, row); | ||
|
@@ -107,40 +113,49 @@ export const getSearchParams = (row, qindex, allFilters, data) => { | |
...filters, | ||
}; | ||
|
||
const fullCallNumber = getFullCallNumber(row); | ||
|
||
const optionsMap = { | ||
[browseModeOptions.CALL_NUMBERS]: { | ||
qindex: queryIndexes.CALL_NUMBER, | ||
query: row.shelfKey, | ||
qindex: queryIndexes.ITEM_NORMALIZED_CALL_NUMBERS, | ||
query: fullCallNumber, | ||
segment: segments.items, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is repeating, let's move it to a variable, like |
||
...filters, | ||
}, | ||
[browseModeOptions.DEWEY]: { | ||
qindex: queryIndexes.CALL_NUMBER, | ||
query: row.shelfKey, | ||
qindex: queryIndexes.ITEM_NORMALIZED_CALL_NUMBERS, | ||
query: fullCallNumber, | ||
segment: segments.items, | ||
...filters, | ||
}, | ||
[browseModeOptions.LIBRARY_OF_CONGRESS]: { | ||
qindex: queryIndexes.CALL_NUMBER, | ||
query: row.shelfKey, | ||
qindex: queryIndexes.ITEM_NORMALIZED_CALL_NUMBERS, | ||
query: fullCallNumber, | ||
segment: segments.items, | ||
...filters, | ||
}, | ||
[browseModeOptions.LOCAL]: { | ||
qindex: queryIndexes.CALL_NUMBER, | ||
query: row.shelfKey, | ||
qindex: queryIndexes.ITEM_NORMALIZED_CALL_NUMBERS, | ||
query: fullCallNumber, | ||
segment: segments.items, | ||
...filters, | ||
}, | ||
[browseModeOptions.NATIONAL_LIBRARY_OF_MEDICINE]: { | ||
qindex: queryIndexes.CALL_NUMBER, | ||
query: row.shelfKey, | ||
qindex: queryIndexes.ITEM_NORMALIZED_CALL_NUMBERS, | ||
query: fullCallNumber, | ||
segment: segments.items, | ||
...filters, | ||
}, | ||
[browseModeOptions.OTHER]: { | ||
qindex: queryIndexes.CALL_NUMBER, | ||
query: row.shelfKey, | ||
qindex: queryIndexes.ITEM_NORMALIZED_CALL_NUMBERS, | ||
query: fullCallNumber, | ||
segment: segments.items, | ||
...filters, | ||
}, | ||
[browseModeOptions.SUPERINTENDENT]: { | ||
qindex: queryIndexes.CALL_NUMBER, | ||
query: row.shelfKey, | ||
qindex: queryIndexes.ITEM_NORMALIZED_CALL_NUMBERS, | ||
query: fullCallNumber, | ||
segment: segments.items, | ||
...filters, | ||
}, | ||
[browseModeOptions.CLASSIFICATION_ALL]: classificationOption, | ||
|
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
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 |
---|---|---|
|
@@ -16,7 +16,7 @@ const useSearchForShadowInstanceTenants = ({ instanceId } = {}) => { | |
|
||
const { isLoading, data = {} } = useQuery({ | ||
queryKey: [namespace, consortium, instanceId], | ||
queryFn: () => ky.get('search/instances/facets', | ||
queryFn: () => ky.get('search/call-numbers/facets', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this necessary for |
||
{ | ||
searchParams: { | ||
facet: 'holdings.tenantId', | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should
<MissedMatchItem query={r.fullCallNumber} />
also be changed?