Skip to content

Commit 1322333

Browse files
authored
Merge pull request #759 from lcnetdev/nar-update-d-name-splitting
Updates for NAR creation
2 parents 2d20726 + 3f7bf75 commit 1322333

2 files changed

Lines changed: 19 additions & 3 deletions

File tree

src/components/panels/edit/fields/helpers/ActionButton.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,6 @@
579579
580580
//does this have defaults, or are the defaults higher up?
581581
let defaults = this.structure.valueConstraint.defaults
582-
console.info("structure: ", this.structure)
583582
584583
if (defaults.length > 0 && !["lc:RT:bf2:SeriesHub", "lc:RT:bf2:SeriesHubInput"].includes(this.structure.parentId ) ){
585584
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)){

src/components/panels/edit/modals/NacoStubCreateModal.vue

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@
9797
9898
validating: false,
9999
validationResult: null,
100+
101+
tagMap: { // Map between tag and expected indicators
102+
'053': '#0',
103+
}
100104
}
101105
},
102106
computed: {
@@ -777,8 +781,9 @@
777781
778782
if (dollarKey.a){
779783
// Check for compound last names: hyphenated ("Jacobsen-Smith, Alejandro") or spaced ("Jacobsen Smith, Alejandro")
784+
// Aguirre Rodríguez, Julio, $d 1966-
780785
let isHyphenated = /[A-Z][a-z]+\-[A-Z][a-z]+/.test(dollarKey.a)
781-
let isSpacedCompound = !isHyphenated && /[A-Z][a-z]+ [A-Z][a-z]+,/.test(dollarKey.a)
786+
let isSpacedCompound = !isHyphenated && /[A-Za-zÀ-ž]+ [A-Za-zÀ-ž]+,/.test(dollarKey.a)
782787
783788
if (isHyphenated || isSpacedCompound){
784789
let separator = isHyphenated ? '-' : ' '
@@ -800,7 +805,11 @@
800805
let subfields = ""
801806
for (let key in compound4xx){
802807
if (key.length==1){
803-
subfields = subfields + '$'+key+' '+compound4xx[key] + ' '
808+
if (key == 'd'){
809+
subfields = subfields.trim() + ', $'+key+' '+compound4xx[key] + ' '
810+
} else {
811+
subfields = subfields + '$'+key+' '+compound4xx[key] + ' '
812+
}
804813
}
805814
}
806815
compound4xx.preview = `${compound4xx.fieldTag} ${compound4xx.indicators.replace(/\s/g,'#')} ${subfields}`
@@ -1811,6 +1820,13 @@
18111820
}
18121821
},
18131822
1823+
setIndicators: function(row){
1824+
let tag = row.fieldTag
1825+
if (tag.length == 3 && this.tagMap[tag]){
1826+
row.indicators = this.tagMap[tag]
1827+
}
1828+
},
1829+
18141830
},
18151831
18161832
@@ -2230,6 +2246,7 @@
22302246
v-model="row.fieldTag"
22312247
maxlength="3"
22322248
placeholder="TAG"
2249+
@input="setIndicators(row)"
22332250
:class="['extra-marc-tag', {'literal-bold': preferenceStore.returnValue('--b-edit-main-literal-bold-font'), 'missing-indicators': row.fieldTag.length != 3}]"
22342251
: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')};`"
22352252
/>

0 commit comments

Comments
 (0)