Skip to content

Commit 86d14be

Browse files
committed
Add Create NAR/Hub buttons when looking for Hubs
They should show up whenever "Hub" is in the selected Mode
1 parent f8d4438 commit 86d14be

3 files changed

Lines changed: 38 additions & 3 deletions

File tree

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

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,11 @@
117117
// array of the pssobile groups from the stlyes
118118
119119
...mapState(useConfigStore, ['lookupConfig']),
120-
...mapState(useProfileStore, ['returnComponentByPropertyLabel', 'duplicateComponentGetId', 'isEmptyComponent']),
120+
...mapState(useProfileStore, ['returnComponentByPropertyLabel', 'duplicateComponentGetId', 'isEmptyComponent', 'returnLccInfo']),
121121
122122
...mapState(usePreferenceStore, ['diacriticUseValues', 'diacriticUse','diacriticPacks', 'lastComplexLookupString']),
123123
124-
...mapWritableState(useProfileStore, ['lastComplexLookupString','showNacoStubCreateModal', 'activeNARStubComponent', 'activeProfile', 'setValueLiteral']),
124+
...mapWritableState(useProfileStore, ['lastComplexLookupString','showNacoStubCreateModal', 'activeNARStubComponent', 'activeProfile', 'setValueLiteral', 'activeHubStubData', 'activeHubStubComponent', 'showHubStubCreateModal']),
125125
126126
127127
@@ -884,15 +884,46 @@
884884
}
885885
},
886886
887-
displayProvisonalNAR(){
887+
displayHubButton(){
888+
if (this.modeSelect.includes('Hubs')){
889+
return true
890+
}
888891
892+
return false
893+
},
889894
895+
displayProvisonalNAR(){
890896
if (this.structure && this.structure.valueConstraint && this.structure.valueConstraint.useValuesFrom && this.structure.valueConstraint.useValuesFrom.length>0 && this.structure.valueConstraint.useValuesFrom.join(' ').indexOf('id.loc.gov/authorities/names')>-1){
891897
return true
892898
}
899+
if (this.modeSelect.includes('Hubs')){
900+
return true
901+
}
902+
893903
return false
894904
},
895905
906+
907+
loadHubStubModal(){
908+
// console.log(this.guid)
909+
let info = this.returnLccInfo(this.guid)
910+
console.log("info",info)
911+
this.activeHubStubData = info
912+
this.activeHubStubComponent = {
913+
type: this.type,
914+
guid: this.guid,
915+
fieldGuid: this.fieldGuid,
916+
structure: this.structure,
917+
type: this.type,
918+
propertyPath:this.propertyPath
919+
}
920+
921+
this.$emit('hideComplexModal')
922+
923+
this.showHubStubCreateModal = true
924+
925+
},
926+
896927
loadNacoStubModal(){
897928
// Set the current value for NAR creation
898929
this.lastComplexLookupString = this.searchValueLocal
@@ -1190,6 +1221,7 @@
11901221

11911222
<!-- REMOVE v-if BEFORE PROD USAGE -->
11921223
<button @click="loadNacoStubModal" style="float: right;" v-if="displayProvisonalNAR() == true">Create NAR</button>
1224+
<button @click="loadHubStubModal" style="float: right;" v-if="displayHubButton() == true">Create Hub</button>
11931225

11941226
<hr style="margin-top: 5px;">
11951227
<div>

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1952,6 +1952,8 @@
19521952
<option class="preset-option" value="1102#and 4102#">"1102 " &amp; "4102 "</option>
19531953
<option class="preset-option" value="1112#">"1112 "</option>
19541954
<option class="preset-option" value="1112#and 4112#">"1112 " &amp; "4112 "</option>
1955+
<option class="preset-option" value="130##">"130##"</option>
1956+
<option class="preset-option" value="430#and 430##">"130##" &amp; "430##"</option>
19551957
<option class="preset-option" value="151##">"151##"</option>
19561958
<option class="preset-option" value="151##and 451##">"151## &amp; 451##"</option>
19571959

src/lib/utils_network.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3387,6 +3387,7 @@ const utilsNetwork = {
33873387

33883388
let uuid = translator.toUUID(translator.new())
33893389

3390+
33903391
const rawResponse = await fetch(url, {
33913392
method: 'POST',
33923393
headers: {

0 commit comments

Comments
 (0)