|
117 | 117 | // array of the pssobile groups from the stlyes |
118 | 118 |
|
119 | 119 | ...mapState(useConfigStore, ['lookupConfig']), |
120 | | - ...mapState(useProfileStore, ['returnComponentByPropertyLabel', 'duplicateComponentGetId', 'isEmptyComponent']), |
| 120 | + ...mapState(useProfileStore, ['returnComponentByPropertyLabel', 'duplicateComponentGetId', 'isEmptyComponent', 'returnLccInfo']), |
121 | 121 |
|
122 | 122 | ...mapState(usePreferenceStore, ['diacriticUseValues', 'diacriticUse','diacriticPacks', 'lastComplexLookupString']), |
123 | 123 |
|
124 | | - ...mapWritableState(useProfileStore, ['lastComplexLookupString','showNacoStubCreateModal', 'activeNARStubComponent', 'activeProfile', 'setValueLiteral']), |
| 124 | + ...mapWritableState(useProfileStore, ['lastComplexLookupString','showNacoStubCreateModal', 'activeNARStubComponent', 'activeProfile', 'setValueLiteral', 'activeHubStubData', 'activeHubStubComponent', 'showHubStubCreateModal']), |
125 | 125 |
|
126 | 126 |
|
127 | 127 |
|
|
884 | 884 | } |
885 | 885 | }, |
886 | 886 |
|
887 | | - displayProvisonalNAR(){ |
| 887 | + displayHubButton(){ |
| 888 | + if (this.modeSelect.includes('Hubs')){ |
| 889 | + return true |
| 890 | + } |
888 | 891 |
|
| 892 | + return false |
| 893 | + }, |
889 | 894 |
|
| 895 | + displayProvisonalNAR(){ |
890 | 896 | 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){ |
891 | 897 | return true |
892 | 898 | } |
| 899 | + if (this.modeSelect.includes('Hubs')){ |
| 900 | + return true |
| 901 | + } |
| 902 | +
|
893 | 903 | return false |
894 | 904 | }, |
895 | 905 |
|
| 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 | +
|
896 | 927 | loadNacoStubModal(){ |
897 | 928 | // Set the current value for NAR creation |
898 | 929 | this.lastComplexLookupString = this.searchValueLocal |
|
1190 | 1221 |
|
1191 | 1222 | <!-- REMOVE v-if BEFORE PROD USAGE --> |
1192 | 1223 | <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> |
1193 | 1225 |
|
1194 | 1226 | <hr style="margin-top: 5px;"> |
1195 | 1227 | <div> |
|
0 commit comments