Skip to content

Commit

Permalink
Merge pull request #774 from libris/feature/lxl-2483-external-data
Browse files Browse the repository at this point in the history
Fixes for external data.
  • Loading branch information
olovy authored Oct 20, 2021
2 parents 8a9917c + 1b34fae commit dd553c3
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 6 deletions.
5 changes: 5 additions & 0 deletions vue-client/src/components/inspector/entity-header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ export default {
type: Object,
default: null,
},
recordData: {
type: Object,
default: null,
},
},
data() {
return {
Expand Down Expand Up @@ -108,6 +112,7 @@ export default {
@hiddenDetailsNumber="setHiddenDetailsNumber"
:show-all-keys="showAllKeys || hiddenDetailsNumber === 1"
:focus-data="focusData"
:record-data="recordData"
:should-link="false"
:exclude-components="inspector.status.isNew ? ['id'] : []"
:valueDisplayLimit=3>
Expand Down
13 changes: 12 additions & 1 deletion vue-client/src/components/inspector/toolbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -373,9 +373,13 @@ export default {
},
userIsPermittedToEdit() {
const mainEntity = this.inspector.data.mainEntity;
const record = this.inspector.data.record;
if (this.user.isLoggedIn === false) {
return false;
}
if (record['@type'] !== 'Record') {
return false;
}
if (mainEntity['@type'] === 'Item') {
if (this.isMyHolding || this.user.isGlobalRegistrant()) {
return true;
Expand All @@ -395,6 +399,13 @@ export default {
}
return true;
},
userIsPermittedToRemove() {
const record = this.inspector.data.record;
if (record['@type'] === 'CacheRecord' || record['@type'] === 'PlaceholderRecord') {
return true;
}
return this.userIsPermittedToEdit;
},
showRecord() {
return this.status.showRecord;
},
Expand Down Expand Up @@ -599,7 +610,7 @@ export default {
{{ "Preview MARC21" | translatePhrase }} {{ getKeybindText('preview-marc') ? ` (${getKeybindText('preview-marc')})` : ''}}
</a>
</li>
<li class="Toolbar-menuItem remove-option" v-if="user.isLoggedIn && !inspector.status.isNew && userIsPermittedToEdit">
<li class="Toolbar-menuItem remove-option" v-if="user.isLoggedIn && !inspector.status.isNew && userIsPermittedToRemove">
<a class="Toolbar-menuLink" @click="postControl('remove-post')">
<i class="fa fa-fw fa-trash" aria-hidden="true"></i>
{{"Remove" | translatePhrase}} {{ recordType | labelByLang | lowercase }}
Expand Down
16 changes: 14 additions & 2 deletions vue-client/src/components/mixins/lens-mixin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,26 @@ export default {
return card;
},
getSummary() {
const summary = DisplayUtil.getItemSummary(
const mainSummary = DisplayUtil.getItemSummary(
this.focusData,
this.resources,
this.inspector.data.quoted,
this.settings,
this.excludeProperties,
);
return summary;
const record = this.focusData.meta || this.recordData || {};
const recordSummary = DisplayUtil.getItemSummary(
record,
this.resources,
this.inspector.data.quoted,
this.settings,
this.excludeProperties,
);
return {
categorization: mainSummary.categorization.concat(recordSummary.categorization),
header: mainSummary.header,
info: mainSummary.info,
};
},
},
};
Expand Down
2 changes: 1 addition & 1 deletion vue-client/src/components/search/panel-search-item.vue
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ export default {
}
&-linkCount {
border: 2px solid #29A1A2;
border: 2px solid @brand-primary;
width: 100%;
text-align: center;
margin-top: -4px;
Expand Down
4 changes: 4 additions & 0 deletions vue-client/src/components/shared/entity-summary.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ export default {
type: Object,
default: null,
},
recordData: {
type: Object,
default: null,
},
animate: {
type: Boolean,
default: false,
Expand Down
3 changes: 2 additions & 1 deletion vue-client/src/resources/json/displayGroups.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"inCollection",
"inScheme",
"mediaType",
"carrierType"
"carrierType",
"inDataset"
],
"header": [
"hasTitle",
Expand Down
3 changes: 2 additions & 1 deletion vue-client/src/views/Inspector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -937,7 +937,8 @@ export default {
</div>
<entity-header id="main-header"
:full="true"
:focus-data="inspector.data.mainEntity"
:focus-data="inspector.data.mainEntity"
:record-data="inspector.data.record"
v-if="!isItem">
</entity-header>
<validation-summary v-if="user.settings.appTech" />
Expand Down

0 comments on commit dd553c3

Please sign in to comment.