Skip to content
Merged
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
1 change: 0 additions & 1 deletion src/components/panels/edit/fields/helpers/ActionButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,6 @@

//does this have defaults, or are the defaults higher up?
let defaults = this.structure.valueConstraint.defaults
console.info("structure: ", this.structure)

if (defaults.length > 0 && !["lc:RT:bf2:SeriesHub", "lc:RT:bf2:SeriesHubInput"].includes(this.structure.parentId ) ){
if ( ['id_loc_gov_ontologies_bibframe_status__status', 'id_loc_gov_ontologies_bibframe_relationship__relationship'].includes(this.structure.id) && ["lc:RT:bf2:SeriesHub", "lc:RT:bf2:SeriesHubInput"].includes(this.structure.parentId)){
Expand Down
21 changes: 19 additions & 2 deletions src/components/panels/edit/modals/NacoStubCreateModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@

validating: false,
validationResult: null,

tagMap: { // Map between tag and expected indicators
'053': '#0',
}
}
},
computed: {
Expand Down Expand Up @@ -777,8 +781,9 @@

if (dollarKey.a){
// Check for compound last names: hyphenated ("Jacobsen-Smith, Alejandro") or spaced ("Jacobsen Smith, Alejandro")
// Aguirre Rodríguez, Julio, $d 1966-
let isHyphenated = /[A-Z][a-z]+\-[A-Z][a-z]+/.test(dollarKey.a)
let isSpacedCompound = !isHyphenated && /[A-Z][a-z]+ [A-Z][a-z]+,/.test(dollarKey.a)
let isSpacedCompound = !isHyphenated && /[A-Za-zÀ-ž]+ [A-Za-zÀ-ž]+,/.test(dollarKey.a)

if (isHyphenated || isSpacedCompound){
let separator = isHyphenated ? '-' : ' '
Expand All @@ -800,7 +805,11 @@
let subfields = ""
for (let key in compound4xx){
if (key.length==1){
subfields = subfields + '$'+key+' '+compound4xx[key] + ' '
if (key == 'd'){
subfields = subfields.trim() + ', $'+key+' '+compound4xx[key] + ' '
} else {
subfields = subfields + '$'+key+' '+compound4xx[key] + ' '
}
}
}
compound4xx.preview = `${compound4xx.fieldTag} ${compound4xx.indicators.replace(/\s/g,'#')} ${subfields}`
Expand Down Expand Up @@ -1811,6 +1820,13 @@
}
},

setIndicators: function(row){
let tag = row.fieldTag
if (tag.length == 3 && this.tagMap[tag]){
row.indicators = this.tagMap[tag]
}
},

},


Expand Down Expand Up @@ -2230,6 +2246,7 @@
v-model="row.fieldTag"
maxlength="3"
placeholder="TAG"
@input="setIndicators(row)"
:class="['extra-marc-tag', {'literal-bold': preferenceStore.returnValue('--b-edit-main-literal-bold-font'), 'missing-indicators': row.fieldTag.length != 3}]"
:style="`margin-right: 1em; width: 50px; font-size: ${preferenceStore.returnValue('--n-edit-main-literal-font-size')}; color: ${preferenceStore.returnValue('--c-edit-main-literal-font-color')};`"
/>
Expand Down
Loading