Skip to content

Commit

Permalink
Merge pull request #143 from lcnetdev/hubs-stub-creation
Browse files Browse the repository at this point in the history
Hubs stub creation
  • Loading branch information
thisismattmiller authored Nov 26, 2024
2 parents 1afcc06 + f8054d9 commit f8baacb
Show file tree
Hide file tree
Showing 10 changed files with 709 additions and 12 deletions.
7 changes: 7 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"@jobinsjp/vue3-datatable": "^1.0.15",
"edtf": "^4.6.0",
"floating-vue": "^2.0.0-beta.20",
"hash-wasm": "^4.12.0",
"html-escaper": "^3.0.3",
"javascript-time-ago": "^2.5.10",
"object-scan": "^18.5.1",
Expand Down
13 changes: 9 additions & 4 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import TextMacroModal from "@/components/panels/edit/modals/TextMacroModal.vue";
import NonLatinBulkModal from "@/components/panels/edit/modals/NonLatinBulkModal.vue";
import NonLatinAgentModal from "@/components/panels/edit/modals/NonLatinAgentModal.vue";
import FieldColorsModal from "@/components/panels/edit/modals/FieldColorsModal.vue";
import HubStubCreateModal from "@/components/panels/edit/modals/HubStubCreateModal.vue";
Expand Down Expand Up @@ -42,7 +44,8 @@ export default {
TextMacroModal,
NonLatinBulkModal,
NonLatinAgentModal,
FieldColorsModal
FieldColorsModal,
HubStubCreateModal
},
data() {
Expand All @@ -57,7 +60,7 @@ export default {
...mapStores(useConfigStore, useProfileStore, usePreferenceStore),
// // gives read access to this.count and this.double
...mapState(useProfileStore, ['profilesLoaded', 'showValidateModal','profilesLoaded', 'showPostModal']),
...mapWritableState(useProfileStore, ['showShelfListingModal']),
...mapWritableState(useProfileStore, ['showShelfListingModal','showHubStubCreateModal']),
...mapState(usePreferenceStore, ['showPrefModal','catCode']),
...mapWritableState(usePreferenceStore, ['showLoginModal','showScriptshifterConfigModal','showDiacriticConfigModal','showTextMacroModal','showFieldColorsModal']),
Expand Down Expand Up @@ -160,10 +163,12 @@ export default {
<template v-if="showFieldColorsModal==true">
<FieldColorsModal v-model="showFieldColorsModal" />
</template>

<template v-if="showHubStubCreateModal==true">
<HubStubCreateModal v-model="showHubStubCreateModal" />
</template>




</template>


Expand Down
1 change: 0 additions & 1 deletion src/components/panels/edit/fields/LookupComplex.vue
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@
</template>
<ComplexLookupModal ref="complexLookupModal" :searchValue="searchValue" :authorityLookup="authorityLookup" @emitComplexValue="setComplexValue" @hideComplexModal="searchValue='';displayModal=false;" :structure="structure" v-model="displayModal"/>
<SubjectEditor ref="subjectEditorModal" :profileData="profileData" :searchValue="searchValue" :authorityLookup="authorityLookup" :isLiteral="isLiteral" @subjectAdded="subjectAdded" @hideSubjectModal="hideSubjectModal()" :structure="structure" v-model="displaySubjectModal"/>
Expand Down
30 changes: 30 additions & 0 deletions src/components/panels/edit/fields/helpers/ActionButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@

</template>


<template v-if="type=='lookupComplex'">
<!-- template v-if="(structure.propertyURI == 'http://id.loc.gov/ontologies/bibframe/subject' || structure.parent.includes(':Agents:') || structure.parentId.includes(':Form') || structure.propertyURI == 'http://www.loc.gov/mads/rdf/v1#Topic') && showUpDownButtons()[0]" -->
<template v-if="showUpDownButtons()[0]">
Expand All @@ -89,6 +90,13 @@
</template>
</template>

<template v-if="showBuildHubStub()">
<button style="width:100%" class="" :id="`action-button-command-${fieldGuid}-d`" @click="buildHubStub()">
Create Hub
</button>
</template>


<button style="width:100%" :id="`action-button-command-${fieldGuid}-0`" class="" @click="showDebug()">
<span class="button-shortcut-label">0</span>
Debug
Expand All @@ -99,6 +107,7 @@
View Documentation<span class="material-icons action-button-icon">open_in_new</span>
</button>
</template>


<template v-if="catInitals.toLowerCase().indexOf('matt') > -1">
<button style="width:100%" class="" :id="`action-button-command-${fieldGuid}-2`" @click="breakRecord()">
Expand Down Expand Up @@ -228,6 +237,27 @@
methods: {
showBuildHubStub(){
let pt = this.profileStore.returnStructureByComponentGuid(this.guid)
if (pt && pt.propertyURI && pt.propertyURI == "http://id.loc.gov/ontologies/bibframe/relation"){
return true
}
return false
},
buildHubStub(){
console.log(this.guid)
let info = this.profileStore.returnLccInfo(this.guid)
this.profileStore.activeHubStubData = info
this.profileStore.showHubStubCreateModal = true
},
shortCutPressed: function(){
Expand Down
1 change: 1 addition & 0 deletions src/components/panels/edit/modals/ComplexLookupModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
let options = []
// add in the the defaul search ALL of everything possible
//options.push({label: 'All', urls:null, processor:null})
console.log("this.structure.valueConstraint",this.structure.valueConstraint)
this.structure.valueConstraint.useValuesFrom.forEach((l)=>{
if (this.lookupConfig[l]){
this.lookupConfig[l].modes.forEach((mode)=>{
Expand Down
Loading

0 comments on commit f8baacb

Please sign in to comment.