From 247e4e6f421b7d2d72d75b55b489410a476e9a6a Mon Sep 17 00:00:00 2001 From: fo Date: Tue, 9 Jun 2026 17:19:53 +0000 Subject: [PATCH 01/94] Initial bcp work TODO: - build the new marc key correctly, not working with subfields. They don't update - duplicate - add additional 4XX - Adjust the marc recrd - Post the marc record --- .../panels/edit/modals/ComplexLookupModal.vue | 350 ++++++++++++++---- src/lib/utils_network.js | 20 + 2 files changed, 292 insertions(+), 78 deletions(-) diff --git a/src/components/panels/edit/modals/ComplexLookupModal.vue b/src/components/panels/edit/modals/ComplexLookupModal.vue index f33361d9..b4717af6 100644 --- a/src/components/panels/edit/modals/ComplexLookupModal.vue +++ b/src/components/panels/edit/modals/ComplexLookupModal.vue @@ -104,6 +104,17 @@ "identifiers","broaders", "collections", "genres", "subjects", "marcKeys", "vernacularMarcKeys", "vernacularLabels", "rdftypes", "hasRelatedAuthoritys", "useFors" ], + + // editing 4XX + showEdit4xxPanel: false, + marcDoc: {}, + associatedLang: null, + targetName: '', + bcpCodes: {}, + bcpSelection: [], + marcData: [], + newMarcKeys: [], + newMarcKey: '' } }, computed: { @@ -117,7 +128,7 @@ // array of the pssobile groups from the stlyes ...mapState(useConfigStore, ['lookupConfig']), - ...mapState(useProfileStore, ['returnComponentByPropertyLabel', 'duplicateComponentGetId', 'isEmptyComponent']), + ...mapState(useProfileStore, ['returnComponentByPropertyLabel', 'duplicateComponentGetId', 'isEmptyComponent', 'isLatin']), ...mapState(usePreferenceStore, ['diacriticUseValues', 'diacriticUse','diacriticPacks', 'lastComplexLookupString']), @@ -170,6 +181,11 @@ modeSelect: async function(){ this.activeComplexSearch = [] this.doSearch() + }, + + targetName: function(){ + console.info("name change?", this.marcData) + this.buildNewMarcKey() } @@ -177,6 +193,103 @@ }, methods: { + edit4XX: async function(data, idx){ + console.info("data: ", data) + let marcKey = data.extra.marcKeys[0] + let tag = marcKey.slice(0,3) + let indicators = marcKey.slice(3,5) + + // get the MARCxml + let marcXML = await this.fetchAuthXML(data.uri.split('/').at(-1)) + let parser = new DOMParser(); + this.xmlDoc = parser.parseFromString(marcXML, "text/xml") + this.associatedLang = this.xmlDoc.querySelectorAll('[tag="377"]'); + + if (this.associatedLang.length == 1){ + this.associatedLang = this.associatedLang[0].textContent.trim() + } + console.info("associatedLang: ", this.associatedLang) + + + // get the initial bcp47 API results + let variants = data.extra.variantLabels + // this.targetName = variants[idx] + + console.info("variants: ", variants) + console.info("target: ", this.targetName) + + let targetTag = "4" + tag.slice(1,3) + this.marcData.tag = targetTag + this.marcData.indicators = indicators + + let targetName = this.xmlDoc.querySelectorAll('[tag="' + targetTag +'"]')[idx] + + for (let child of targetName.children){ + + let subfield = child.getAttribute("code") + let value = child.innerHTML + this.marcData["subfield_" + subfield] = value + } + + this.bcpCodes = await utilsNetwork.fetchBCP47Codes(targetName, this.associatedLang) + console.info("codes: ", this.bcpCodes) + + for (let c of this.bcpSelection){ + this.marcData.dollar7 = "(bcp47)" + this.bcpCodes[c].bcp47code + } + + // console.info("target: ", variants[idx]) + this.targetName = variants[idx] + + // swap out left panel for form + this.showEdit4xxPanel = true + + }, + + hideBCP: function(){ + console.info('hide:', this.showEdit4xxPanel) + this.showEdit4xxPanel = false + }, + + buildNewMarcKey: function(idx=0){ + console.info("build") + if (this.bcpSelection.includes(idx)){ // remove it + console.info("remove") + this.bcpSelection = this.bcpSelection.filter(item => item != idx) + } else { // add it + console.info("add") + this.bcpSelection.push(idx) + } + + console.info("this.bcpCodes: ", this.bcpCodes) + console.info("this.bcpSelection: ", this.bcpSelection) + this.marcData.dollar7 = '' + for (let c of this.bcpSelection){ + this.marcData.dollar7 = this.marcData.dollar7 + "(bcp47)" + this.bcpCodes[c].bcp47code + } + + let key = this.marcData.tag + this.marcData.indicators + for (let sub of Object.keys(this.marcData)) { + if (sub.startsWith("subfield_")){ + if (sub == 'subfield_a'){ + console.info("subfieldA: ", this.targetName) + key = key + " $" + sub.split("_")[1] + this.targetName + } else { + key = key + " $" + sub.split("_")[1] + this.marcData[sub] + } + } + } + key = key + " $7" + this.marcData["dollar7"] + + this.newMarcKey = key + }, + + fetchAuthXML: async function(lccn){ + let r = await utilsNetwork.fetchAuthMarc(lccn) + return r + }, + + sortResults: function(a,b){ if (a.label.includes('Literal')){ return -1 @@ -316,6 +429,7 @@ }, generateLabel: function(data){ + console.info("data: ", data) let label = !data.literal ? data.suggestLabel : data.label + ((data.literal) ? ' [Literal]' : '') if (label.includes("(USE ")){ @@ -330,6 +444,7 @@ // label = label.slice(0, start) + "" + label.slice(start, end+1) + "" + label.slice(end+1) // } + console.info("\t", label) return label }, truncate: function(string){ @@ -828,9 +943,9 @@ } // filter the Authorized NonLatin from the variants - if (this.activeContext && this.activeContext.extra && this.activeContext.extra['variantLabels'] && this.activeContext.extra['nonlatinLabels']){ - this.activeContext.extra['variantLabels'] = this.activeContext.extra['variantLabels'].filter(n => !this.activeContext.extra['nonlatinLabels'].includes(n)) - } + // if (this.activeContext && this.activeContext.extra && this.activeContext.extra['variantLabels'] && this.activeContext.extra['nonlatinLabels']){ + // this.activeContext.extra['variantLabels'] = this.activeContext.extra['variantLabels'].filter(n => !this.activeContext.extra['nonlatinLabels'].includes(n)) + // } // Filter earlier/later forms of name from releated if (this.activeContext && this.activeContext.extra && this.activeContext.extra['relateds'] && this.activeContext.extra['hasEarlierEstablishedForms']){ this.activeContext.extra['relateds'] = this.activeContext.extra['relateds'].filter(n => !this.activeContext.extra['hasEarlierEstablishedForms'].includes(n)) @@ -1130,92 +1245,132 @@
- @@ -1506,38 +1510,40 @@
- New Value(s):

-
{{ row.marcKey }}
+
+ New Value(s):

+
{{ row.marcKey }}
- + +
-


- - -

- - +
+ + +

+ + +
Original
-  {{ data }}
+  {{ data.replace('xmlns:marcxml="http://www.loc.gov/MARC21/slim"', "") }}
 
Updated
-  {{ data}}
+  {{ data.replace('xmlns:marcxml="http://www.loc.gov/MARC21/slim"', "")  }}
 
@@ -2223,10 +2229,8 @@ td { } .record-comp { - width: 100%; + /* max-width: 80%; */ height: 200px; - margin: auto; - } .old-data { @@ -2255,9 +2259,12 @@ pre { overflow: scroll; margin-bottom: 5px; + /* max-width: 80%; */ + line-height: 20px; } .new-marc-data{ + width: fit-content; padding: 5px; border-radius: 25px; @@ -2286,4 +2293,11 @@ pre { border-color: #c3e6cb; } +.button-container, +.new-value-container { + margin-top: 5px; + background-color: rgb(201, 199, 199); + padding: 5px; +} + From 54b489f9137f50aeadfb67a7cbdd90a8170a82de Mon Sep 17 00:00:00 2001 From: fo Date: Thu, 18 Jun 2026 11:25:55 +0000 Subject: [PATCH 19/94] Capture `667` incase something needs to happen with it. --- .../panels/edit/modals/ComplexLookupModal.vue | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/components/panels/edit/modals/ComplexLookupModal.vue b/src/components/panels/edit/modals/ComplexLookupModal.vue index 6ecf7679..a2c8296f 100644 --- a/src/components/panels/edit/modals/ComplexLookupModal.vue +++ b/src/components/panels/edit/modals/ComplexLookupModal.vue @@ -243,8 +243,15 @@ let targetNameXML = this.xmlDoc.querySelectorAll('[tag="' + targetTag +'"]')[idx] this.xmlTarget = [targetTag, idx, targetNameXML.children[0].innerHTML] + // Get the 667s, do these need adjustment? let marc667List = this.xmlDoc.querySelectorAll('[tag="667"]') - console.info("marc667List: ", marc667List) + let target667 = false + for (let sixSixSeven of marc667List){ + if (sixSixSeven.innerHTML.includes('Non-Latin script references not evaluated.')){ + target667 = sixSixSeven + } + } + console.info("target667: ", target667) // get the $d for the 1XX, as long as there is no $t let childFields = [].slice.call(targetNameXML.children).map(field => field.getAttribute('code')) @@ -400,7 +407,7 @@ }, addDateFromOneXX: function(){ - this.marcData[this.activeIndex].displayName += "$d" + this.oneXXdollarD + this.marcData[this.activeIndex].displayName += ", $d" + this.oneXXdollarD this.buildNewMarcKey() }, @@ -1581,9 +1588,6 @@
view on ID - -
- view MARCXML
From a0533ad41a975fd9a864c07391291210cf5a242f Mon Sep 17 00:00:00 2001 From: fo Date: Tue, 23 Jun 2026 14:01:44 +0000 Subject: [PATCH 20/94] Fix date from 1xx, address existing $7 - Pasting the $d was coming from the variant instead of the 1xx - If there is existing $7 information, delete it --- .../panels/edit/modals/ComplexLookupModal.vue | 22 +++++++-- src/stores/profile.js | 46 ++++++++++++++----- 2 files changed, 52 insertions(+), 16 deletions(-) diff --git a/src/components/panels/edit/modals/ComplexLookupModal.vue b/src/components/panels/edit/modals/ComplexLookupModal.vue index a2c8296f..7d94cc89 100644 --- a/src/components/panels/edit/modals/ComplexLookupModal.vue +++ b/src/components/panels/edit/modals/ComplexLookupModal.vue @@ -241,8 +241,19 @@ this.marcData[0].indicators = this.indicators let targetNameXML = this.xmlDoc.querySelectorAll('[tag="' + targetTag +'"]')[idx] + let oneXX = this.xmlDoc.querySelectorAll('[tag="' + this.tag +'"]')[0] this.xmlTarget = [targetTag, idx, targetNameXML.children[0].innerHTML] + let hasBcp = false + for (let child of targetNameXML.children){ + if (child.getAttribute('code') == '7' && child.innerHTML.includes('bcp47')){ + hasBcp = true + this.marcData[0]["hasBCP"] = true //child.innerHTML + } + } + + console.info("BCP? this.marcData: ", JSON.parse(JSON.stringify(this.marcData))) + // Get the 667s, do these need adjustment? let marc667List = this.xmlDoc.querySelectorAll('[tag="667"]') let target667 = false @@ -254,8 +265,8 @@ console.info("target667: ", target667) // get the $d for the 1XX, as long as there is no $t - let childFields = [].slice.call(targetNameXML.children).map(field => field.getAttribute('code')) - for (let child of targetNameXML.children){ + let childFields = [].slice.call(oneXX.children).map(field => field.getAttribute('code')) + for (let child of oneXX.children){ if (child.getAttribute('code') == 'd' && !childFields.includes('t')){ this.oneXXdollarD = child.innerHTML } @@ -302,7 +313,7 @@ let updates = this.marcData let target = this.xmlTarget - console.info("this.marcData: ", this.marcData) + console.info("this.marcData: ", JSON.parse(JSON.stringify(this.marcData))) this.updatedRecord = this.adjustAuthRecord(this.xmlDoc, this.marcData, this.xmlTarget) @@ -344,7 +355,8 @@ 'indicators': this.indicators, 'bcpSelection': this.marcData[this.activeIndex].bcpSelection, 'marcKey': this.marcData[this.activeIndex].marcKey, - 'displayName': this.marcData[this.activeIndex].displayName + 'displayName': this.marcData[this.activeIndex].displayName, + 'hasBCP': this.marcData[this.activeIndex].hasBCP, } let key = '' @@ -2241,6 +2253,7 @@ td { /* width: 45%; */ height: 100px; /* float: left; */ + overflow: scroll; } .new-data { @@ -2248,6 +2261,7 @@ td { /* margin-left: 5%; */ height: 200px; /* float: right; */ + overflow: scroll; } .record-data { diff --git a/src/stores/profile.js b/src/stores/profile.js index 9675bfaa..c49314c8 100644 --- a/src/stores/profile.js +++ b/src/stores/profile.js @@ -8840,17 +8840,21 @@ export const useProfileStore = defineStore('profile', { // for (let child of targetNameXML.children){ for (let child of targetNameXML.children){ let code = child.getAttribute("code") - existingCodes[code] = child + if (existingCodes[code]){ + existingCodes[code].push(child) + } else { + existingCodes[code] = [child] + } } /** * TODO: * - remove 667? under what conditions? $a >Non-Latin script references not evaluated.? - * - flag for preferred? */ for (let [idx, update] of updates.entries()){ + console.info("\t\tupdate: ", update) if (update.refEval){ console.info("UPDATE 008") let zeroZeroEight = record.querySelectorAll('[tag="008"]')[0] @@ -8874,6 +8878,14 @@ export const useProfileStore = defineStore('profile', { } }) + if (update.hasBCP){ + // delete existing $7 + for (let existing7 of existingCodes['7']){ + targetNameXML.removeChild(existing7) + } + delete existingCodes['7'] + } + console.info("deleteCodes: ", deleteCodes) if (idx == 0){ @@ -8882,17 +8894,26 @@ export const useProfileStore = defineStore('profile', { let subfield = key.split("_")[1] let value = update[key] + console.info("existingCodes: ", existingCodes) + // if we're looking at the first update - let target = existingCodes[subfield] - if (target){ // if the subfield is existing update it - target.innerHTML = value - console.info("\t\tsetting Value: ", value) - for (let code of deleteCodes){ - if (code){ - targetNameXML.removeChild(existingCodes[code]) - console.info("\t\tDeleting: ", code) - console.info("\t\t existingCodes[code]: ", existingCodes[code]) - console.info("\t\t targetNameXML: ", targetNameXML) + let targets = existingCodes[subfield] + + if (targets){ // if the subfield is existing update it + for (let target of targets){ + target.innerHTML = value + console.info("\t\tsetting Value: ", value) + for (let code of deleteCodes){ + if (code){ + for (let element of existingCodes[code]){ + console.info("\t\tDeleting: ", code) + console.info("\t\t element: ", element) + console.info("\t\t targetNameXML: ", targetNameXML) + if (targetNameXML.contains(element)){ + targetNameXML.removeChild(element) + } + } + } } } }else { // otherwise, create it @@ -8903,6 +8924,7 @@ export const useProfileStore = defineStore('profile', { // targetNameXML.appendChild(newSubField) this.indentedAppend(targetNameXML, newSubField) } else { + console.info("working on BCPs") for (let bcp of value){ let newSubField = document.createElementNS('http://www.loc.gov/MARC21/slim', 'marcxml:subfield'); newSubField.setAttribute("code", subfield) From 05b203ac2a9af58fa0d00d64d3025b1823c03a09 Mon Sep 17 00:00:00 2001 From: fo Date: Tue, 23 Jun 2026 18:37:25 +0000 Subject: [PATCH 21/94] Update layout All variantes loaded at once --- .../panels/edit/modals/ComplexLookupModal.vue | 187 +++++++++++------- 1 file changed, 117 insertions(+), 70 deletions(-) diff --git a/src/components/panels/edit/modals/ComplexLookupModal.vue b/src/components/panels/edit/modals/ComplexLookupModal.vue index 7d94cc89..fec2d075 100644 --- a/src/components/panels/edit/modals/ComplexLookupModal.vue +++ b/src/components/panels/edit/modals/ComplexLookupModal.vue @@ -108,7 +108,7 @@ showEdit4xxPanel: false, associatedLang: null, bcpCodes: {}, - marcData: [{}], + marcData: {}, activeIndex: 0, xmlTarget: [], refEval: false, @@ -186,6 +186,10 @@ this.activeComplexSearch = [] this.doSearch() }, + + activeIndex: async function(){ + await this.getBcpSuggestions() + } }, methods: { @@ -198,7 +202,7 @@ this.showEdit4xxPanel = false this.associatedLang = null this.bcpCodes = {} - this.marcData = [{}] + this.marcData = {} this.activeIndex = 0 this.xmlTarget = [] this.refEval = false @@ -209,8 +213,10 @@ }, // initial 4XX - edit4XX: async function(data, idx){ + edit4XX: async function(data){ this.resetBcp() + console.info("data: ", data) + // Get MarcKey for 1XX let marcKey = data.extra.marcKeys[0] this.tag = marcKey.slice(0,3) @@ -230,6 +236,15 @@ this.originalMarc = this.xmlDoc.cloneNode(true) this.associatedLang = this.xmlDoc.querySelectorAll('[tag="377"]') + // get the $d for the 1XX, as long as there is no $t + let oneXX = this.xmlDoc.querySelectorAll('[tag="' + this.tag +'"]')[0] + let childFields = [].slice.call(oneXX.children).map(field => field.getAttribute('code')) + for (let child of oneXX.children){ + if (child.getAttribute('code') == 'd' && !childFields.includes('t')){ + this.oneXXdollarD = child.innerHTML + } + } + if (this.associatedLang.length == 1){ this.associatedLang = this.associatedLang[0].textContent.trim() } @@ -237,22 +252,46 @@ let targetTag = "4" + this.tag.slice(1,3) this.tag = targetTag - this.marcData[0].tag = targetTag - this.marcData[0].indicators = this.indicators - let targetNameXML = this.xmlDoc.querySelectorAll('[tag="' + targetTag +'"]')[idx] - let oneXX = this.xmlDoc.querySelectorAll('[tag="' + this.tag +'"]')[0] - this.xmlTarget = [targetTag, idx, targetNameXML.children[0].innerHTML] + for (let varIdx in variants){ + let variant = variants[varIdx] + if (!this.isLatin(variant)){ + let localMarc = {} + // if (!localMarc) { this.marcData[varIdx] = {}} + localMarc.tag = targetTag + localMarc.indicators = this.indicators + localMarc.bcpSelection = [] + + let targetNameXML = this.xmlDoc.querySelectorAll('[tag="' + targetTag +'"]')[varIdx] + this.xmlTarget = [targetTag, varIdx, targetNameXML.children[0].innerHTML] + + let hasBcp = false + for (let child of targetNameXML.children){ + if (child.getAttribute('code') == '7' && child.innerHTML.includes('bcp47')){ + hasBcp = true + localMarc["hasBCP"] = true //child.innerHTML + } + } + + for (let sub of targetNameXML.children){ + let subfield = sub.getAttribute("code") + let value = sub.innerHTML + localMarc["subfield_" + subfield] = value + } - let hasBcp = false - for (let child of targetNameXML.children){ - if (child.getAttribute('code') == '7' && child.innerHTML.includes('bcp47')){ - hasBcp = true - this.marcData[0]["hasBCP"] = true //child.innerHTML + localMarc.displayName = '' + for (let sf of Object.keys(localMarc)){ + if (sf.startsWith('subfield_')){ + localMarc.displayName = localMarc.displayName + "$" + sf.split("_")[1] + localMarc[sf] + } + } + localMarc.idx = varIdx + this.marcData[varIdx] = localMarc + this.activeIndex = varIdx + this.buildNewMarcKey() } } - console.info("BCP? this.marcData: ", JSON.parse(JSON.stringify(this.marcData))) // Get the 667s, do these need adjustment? let marc667List = this.xmlDoc.querySelectorAll('[tag="667"]') @@ -262,37 +301,6 @@ target667 = sixSixSeven } } - console.info("target667: ", target667) - - // get the $d for the 1XX, as long as there is no $t - let childFields = [].slice.call(oneXX.children).map(field => field.getAttribute('code')) - for (let child of oneXX.children){ - if (child.getAttribute('code') == 'd' && !childFields.includes('t')){ - this.oneXXdollarD = child.innerHTML - } - } - - for (let sub of targetNameXML.children){ - let subfield = sub.getAttribute("code") - let value = sub.innerHTML - this.marcData[0]["subfield_" + subfield] = value - } - - // BCP suggestions - this.bcpCodes = await utilsNetwork.fetchBCP47Codes(this.marcData[0]["subfield_a"], this.associatedLang) - this.marcData[this.activeIndex].bcpSelection = [0] - for (let c of this.marcData[this.activeIndex].bcpSelection){ - this.marcData[0]['subfield_7'] = "(bcp47)" + this.bcpCodes[c].bcp47code - } - - this.marcData[0].displayName = '' - for (let sf of Object.keys(this.marcData[0])){ - if (sf.startsWith('subfield_')){ - this.marcData[0].displayName = this.marcData[0].displayName + "$" + sf.split("_")[1] + this.marcData[0][sf] - } - } - - this.buildNewMarcKey() // swap out left panel for form this.showEdit4xxPanel = true @@ -303,6 +311,7 @@ this.showEdit4xxPanel = false }, submitEdit: async function(){ + return if (this.marcData.some(d => {return d.bcpSelection.length == 0})){ alert("A name is missing a language Selection. Add one before continuing.") return @@ -337,12 +346,20 @@ console.info("comparison: ", comparison) }, + getBcpSuggestions: async function(){ + this.bcpCodes = await utilsNetwork.fetchBCP47Codes(this.marcData[this.activeIndex]["subfield_a"], this.associatedLang) + if (!this.marcData[this.activeIndex].bcpSelection){ + this.marcData[this.activeIndex].bcpSelection = [] + } + }, + addBcpCode: function(idx){ - // activeIndex + console.info("add BCP to ", this.marcData[this.activeIndex], "--", this.activeIndex) + console.info("\t", idx) if (!this.marcData[this.activeIndex].bcpSelection){ this.marcData[this.activeIndex].bcpSelection = [] } - if (this.marcData[this.activeIndex].bcpSelection.includes(idx)){ // remove it + if (this.marcData[this.activeIndex].bcpSelection && this.marcData[this.activeIndex].bcpSelection.includes(idx)){ // remove it this.marcData[this.activeIndex].bcpSelection = this.marcData[this.activeIndex].bcpSelection.filter(item => item != idx) } else { this.marcData[this.activeIndex].bcpSelection.push(idx) @@ -350,7 +367,9 @@ }, buildNewMarcKey: function(){ - this.marcData[this.activeIndex] = { // reset to make deletions easier to handle + console.info("BUILD: ", this.marcData[this.activeIndex]) + // reset to make deletions easier to handle + this.marcData[this.activeIndex] = { 'tag': this.tag, 'indicators': this.indicators, 'bcpSelection': this.marcData[this.activeIndex].bcpSelection, @@ -359,6 +378,7 @@ 'hasBCP': this.marcData[this.activeIndex].hasBCP, } + let key = '' let marcKey = this.marcData[this.activeIndex].tag + this.marcData[this.activeIndex].indicators let userInput = this.marcData[this.activeIndex].displayName @@ -373,32 +393,55 @@ } for (let sub of subfields){ + console.info("sub: ", sub) let field = sub.slice(1,2) let value = sub.slice(2) this.marcData[this.activeIndex]["subfield_" + field] = value } - // this.marcData[this.activeIndex]['subfield_7'] = '' - this.marcData[this.activeIndex]['subfield_7'] = [] - for (let c of this.marcData[this.activeIndex].bcpSelection){ - //this.marcData[this.activeIndex]['subfield_7'] = this.marcData[this.activeIndex]['subfield_7'] + "(bcp47)" + this.bcpCodes[c].bcp47code - this.marcData[this.activeIndex]['subfield_7'].push("(bcp47)" + this.bcpCodes[c].bcp47code) + // this.marcData[this.activeIndex]['subfield_7'] = [] + // for (let c of this.marcData[this.activeIndex].bcpSelection){ + // this.marcData[this.activeIndex]['subfield_7'].push("(bcp47)" + this.bcpCodes[c].bcp47code) + // } + + + this.marcData[this.activeIndex]['subfield_7'] = '' + if (this.marcData[this.activeIndex].bcpSelection.length > 0){ + for (let c of this.marcData[this.activeIndex].bcpSelection){ + this.marcData[this.activeIndex]['subfield_7'] = this.marcData[this.activeIndex]['subfield_7'] + "$7(bcp47)" + this.bcpCodes[c].bcp47code + } } + // else if (this.marcData[this.activeIndex]['subfield_7'] != undefined) { + // console.info("else: ", this.marcData[this.activeIndex]) + // this.marcData[this.activeIndex]['subfield_7'] = "$7" + this.marcData[this.activeIndex]['subfield_7'] + // } + //$7test for (let sub of Object.keys(this.marcData[this.activeIndex])) { if (sub.startsWith("subfield_") && sub != "subfield_7"){ key = key + "$" + sub.split("_")[1] + this.marcData[this.activeIndex][sub] + } else if (sub == "subfield_7" && this.marcData[this.activeIndex][sub] != ""){ + key = key + this.marcData[this.activeIndex][sub] + + + // if (this.marcData[this.activeIndex][sub].length > 0){ + // for (let val of this.marcData[this.activeIndex][sub]){ + // key = key + "$" + sub.split("_")[1] + val + // } + // } else if (this.marcData[this.activeIndex].displayName.includes('$7')) { + // key = key + "$" + sub.split("_")[1] + // } } } - if (this.marcData[this.activeIndex]['subfield_7'].length > 1){ - marcKey = marcKey + key + this.marcData[this.activeIndex]['subfield_7'].join(" $7 ") - } else { - marcKey = marcKey + key + " $7 " + this.marcData[this.activeIndex]['subfield_7'] - } + // if (this.marcData[this.activeIndex]['subfield_7'].length > 1){ + // marcKey = marcKey + key + this.marcData[this.activeIndex]['subfield_7'].join(" $7 ") + // } else { + // marcKey = marcKey + key + " $7 " + this.marcData[this.activeIndex]['subfield_7'] + // } this.marcData[this.activeIndex]['displayName'] = key - this.marcData[this.activeIndex]['marcKey'] = marcKey + // this.marcData[this.activeIndex]['marcKey'] = marcKey + key console.info("this.marcData: ", this.marcData) }, @@ -418,8 +461,8 @@ ) }, - addDateFromOneXX: function(){ - this.marcData[this.activeIndex].displayName += ", $d" + this.oneXXdollarD + addDateFromOneXX: function(idx){ + this.marcData[idx].displayName += ", $d" + this.oneXXdollarD this.buildNewMarcKey() }, @@ -434,6 +477,7 @@ }, handleInput: function(event){ + console.info("handleInput: ", event.target.value) this.marcData[this.activeIndex].displayName = event.target.value this.buildNewMarcKey() }, @@ -1499,8 +1543,8 @@ - - + +
@@ -1514,7 +1558,7 @@ - + {{ code["bcp47code"] }} @@ -1530,8 +1574,8 @@
- New Value(s):

-
{{ row.marcKey }}
+