Skip to content

Commit

Permalink
fix(cataloging-bulkchanges): match subtypes checkbox
Browse files Browse the repository at this point in the history
  • Loading branch information
lrosenstrom committed Oct 24, 2024
1 parent c5868ae commit eaa296d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
19 changes: 12 additions & 7 deletions cataloging/src/components/inspector/field.vue
Original file line number Diff line number Diff line change
Expand Up @@ -439,14 +439,19 @@ export default {
fieldRdfType() {
return DisplayUtil.rdfDisplayType(this.fieldKey, this.resources);
},
matchSubTypes() {
if (this.showBulkchangeActions) {
const data = get(this.inspector.data, this.parentPath);
return typeof data['_match'] !== 'undefined' && data['_match'].includes('Subtypes');
} else {
return false;
}
}
},
methods: {
translatePhrase,
labelByLang,
capitalize,
matchSubClasses(item) {
return typeof item['_match'] !== 'undefined' && item['_match'].includes('Subclasses');
},
onLabelClick() {
this.$store.dispatch('pushInspectorEvent', {
name: 'field-label-clicked',
Expand Down Expand Up @@ -607,7 +612,7 @@ export default {
});
}
},
toggleMatchSubClasses() {
toggleMatchSubtypes() {
let update = cloneDeep(get(this.inspector.data, this.parentPath))
if (typeof update['_match'] !== 'undefined') {
delete update['_match'];
Expand Down Expand Up @@ -868,13 +873,13 @@ export default {
:parent-path="path"/>
<div class="Field-matchSubClasses" v-if="this.parentPath === 'mainEntity' && showBulkchangeActions">
<span class="Field-matchSubClassesLabel">
{{ translatePhrase('Match subclasses') }}
{{ translatePhrase('Match subtypes') }}
</span>
<input
:checked="matchSubClasses(item)"
:checked="matchSubTypes"
type="checkbox"
:disabled="isLocked"
@change="toggleMatchSubClasses()"/>
@change="toggleMatchSubtypes()"/>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion cataloging/src/resources/json/i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,6 @@
"Save bulk change to preview" : "Spara massändring för att förhandsgranska",
"No matching records" : "Inga matchande poster",
"Selection from ID list" : "Urval från ID-lista",
"Match subclasses" : "Matcha subklasser"
"Match subtypes" : "Matcha subtyper"
}
}

0 comments on commit eaa296d

Please sign in to comment.