Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 28 additions & 6 deletions src/components/panels/edit/fields/LookupComplex.vue
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@

<template v-if="preferenceStore.returnValue('--b-edit-main-splitpane-edit-shortcode-display-mode') == false">
<div class="lookup-fake-input-entities" v-if="marcDeliminatedLCSHMode == false">

<div v-for="(avl,idx) in complexLookupValues" class="selected-value-container">
<div class="selected-value-container-auth">
<AuthTypeIcon passClass="complex-lookup-inline" v-if="avl.type && preferenceStore.returnValue('--b-edit-complex-use-value-icons')" :type="avl.type"/>
Expand Down Expand Up @@ -147,14 +146,37 @@
<template v-if="configStore.useSubjectEditor.includes(structure.propertyURI)">

<div class="marc-deliminated-lcsh-mode-container" v-if="marcDeliminatedLCSHModeResults && marcDeliminatedLCSHModeResults.hit && Array.isArray(marcDeliminatedLCSHModeResults.hit)">
<template v-for="heading in marcDeliminatedLCSHModeResults.hit">
<div class="selected-value-container">
<AuthTypeIcon passClass="complex-lookup-inline" :type="marcDeliminatedLCSHModeResults.hit[0].heading.rdfType"/>
<a href="#" @click="openAuthority()" ref="el">
{{ marcDeliminatedLCSHModeResults.hit.map((item)=>item.label).join("--") }}
</a>
<template v-if="marcDeliminatedLCSHModeResults.hit.length == 1">
<ValidationIcon :value="{
'@guid': profileStore.returnStructureByGUID(guid).userValue[propertyPath[0].propertyURI][0]['@guid'],
'URI': marcDeliminatedLCSHModeResults.hit[0].uri,
}" />
</template>
<template v-else>
<ValidationIcon :value="{'@guid': profileStore.returnStructureByGUID(guid).userValue[propertyPath[0].propertyURI][0]['@guid']}" />
</template>
</div>

<!-- <template v-for="heading in marcDeliminatedLCSHModeResults.hit">
<span v-if="heading.literal==false" class="marc-deliminated-lcsh-mode-entity"> <span class="material-icons marc-deliminated-lcsh-mode-icon">check_circle</span> <a :href="heading.uri" target="_blank">{{ heading.label }}</a></span>
<span v-if="heading.literal==true" class="marc-deliminated-lcsh-mode-entity"> <span class="material-icons marc-deliminated-lcsh-mode-icon-warning">warning</span> {{ heading.label }} </span>
</template>
</template> -->
</div>

<div class="marc-deliminated-lcsh-mode-container" v-else-if="marcDeliminatedLCSHModeResults && marcDeliminatedLCSHModeResults.resultType == 'COMPLEX'">
<span class="marc-deliminated-lcsh-mode-entity"> <span class="material-icons marc-deliminated-lcsh-mode-icon">check_circle</span> <a :href="marcDeliminatedLCSHModeResults.hit.uri" target="_blank">{{ marcDeliminatedLCSHModeResults.hit.label }}</a></span>
<div class="selected-value-container">
<AuthTypeIcon passClass="complex-lookup-inline" :type="marcDeliminatedLCSHModeResults.hit.heading.rdfType"/>
<a href="#" @click="openAuthority()" ref="el">
{{ marcDeliminatedLCSHModeResults.hit.label }}
</a>
<ValidationIcon :value="marcDeliminatedLCSHModeResults.hit" />
</div>
<!-- <span class="marc-deliminated-lcsh-mode-entity"> <span class="material-icons marc-deliminated-lcsh-mode-icon">check_circle</span> <a :href="marcDeliminatedLCSHModeResults.hit.uri" target="_blank">{{ marcDeliminatedLCSHModeResults.hit.label }}</a></span> -->
</div>

<div class="marc-deliminated-lcsh-mode-container" v-else-if="marcDeliminatedLCSHModeResults && marcDeliminatedLCSHModeResults.resultType == 'ERROR'">
Expand Down Expand Up @@ -749,10 +771,10 @@ export default {
this.searchType = selected
} catch {}

let label = this.$refs.el[0].innerHTML
let label = this.$refs.el[0] ? this.$refs.el[0].innerHTML : this.$refs.el.innerHTML
this.profileData = this.profileStore.returnStructureByGUID(this.guid)

let sibling = this.$refs.el[0].parentNode.childNodes[2]
let sibling = this.$refs.el[0] ? this.$refs.el[0].parentNode.childNodes[2] : this.$refs.el.parentNode.childNodes[2]
if (sibling.className == "uncontrolled") {
this.isLiteral = true
} else {
Expand Down
9 changes: 4 additions & 5 deletions src/components/panels/edit/fields/helpers/ValidationIcon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,17 @@ export default {


useIcon(){

if (this.value && this.value.URI){
if (this.value && (this.value.URI || this.value.uri)){
return ['verified','Linked']
}else{
return this.profileStore.returnValidationType( this.value['@guid'])
}

return [null,null]

},
},





},
Expand Down Expand Up @@ -133,7 +132,7 @@ export default {
padding: 2px;
font-size: 13px;


content: attr(data-tooltip);
white-space: nowrap;
}
Expand Down
3 changes: 2 additions & 1 deletion src/components/panels/edit/modals/SubjectEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -974,6 +974,7 @@ methods: {
console.error(err)
}
}

},

/**
Expand Down Expand Up @@ -2956,7 +2957,7 @@ updated: function() {

//When there is existing data, we need to make sure that the number of components matches
// the number subjects in the searchValue
if (this.searchValue && this.components.length != this.searchValue.split("--").length && !this.searchValue.endsWith('-')){
if (this.searchValue && (this.components.length != this.searchValue.split("--").length || this.components[0].label != this.searchValue) && !this.searchValue.endsWith('-')){
this.buildLookupComponents(incomingSubjects)
this.buildComponents(this.searchValue)

Expand Down
1 change: 0 additions & 1 deletion src/lib/utils_network.js
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,6 @@ const utilsNetwork = {
url = url.replace('https://preprod-8288.id.loc.gov','https://id.loc.gov')
}


url = url + "&blastdacache=" + Date.now()

// don't allow a ? in the keyword if it is already marked as keyword search
Expand Down
1 change: 0 additions & 1 deletion src/lib/utils_profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ const utilsProfile = {
returnGuidLocation: function(obj,guid){
// use a pattern that looks at many possible levels down for a @guid
let foundPos = objectScan(['*.**.@guid,*.**.@guid.**.@guid,*.**.@guid.**.@guid.**.@guid,*.**.@guid.**.@guid.**.@guid.**.@guid'])(obj);

for (let fp of foundPos){
// eventuall pointer will point to the @guid value
let pointer = obj
Expand Down
20 changes: 10 additions & 10 deletions src/lib/utils_rdf.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const utilsRDF = {
* @return {bolean}
*/
isUriALiteral: function(URI){
if (this.LITERAL_TYPES.map((v) => {return v.toLowerCase()}).indexOf(URI.toLowerCase()) > -1){
if (URI && this.LITERAL_TYPES.map((v) => {return v.toLowerCase()}).indexOf(URI.toLowerCase()) > -1){
return true
}
return false
Expand All @@ -82,7 +82,7 @@ const utilsRDF = {
// grab the rtLookup from the profile store
if (!rtLookup){
rtLookup= useProfileStore().rtLookup
}
}

// if the component itself has it set then just return it we dont need to dig around
if (propertyURI == pt.propertyURI){
Expand Down Expand Up @@ -129,7 +129,7 @@ const utilsRDF = {
if (!pt.userValue[pt.propertyURI]){
lookForResourceURI = true
}else{
if (pt.userValue[pt.propertyURI] && pt.userValue[pt.propertyURI][0]){
if (pt.userValue[pt.propertyURI] && pt.userValue[pt.propertyURI][0]){
if (!pt.userValue[pt.propertyURI][0]['@type']){
lookForResourceURI = true
}
Expand All @@ -152,14 +152,14 @@ const utilsRDF = {
}
}


return false

},

/**
*
*
*
*
* @param {string} propertyURI - the string URI to test
* @param {obj} pt - the pt template from the profile
* @return {string} URI - the uri of the type
Expand All @@ -169,7 +169,7 @@ const utilsRDF = {
// grab the rtLookup from the profile store
if (!rtLookup){
rtLookup= useProfileStore().rtLookup
}
}
// only do this on templates that have one reference templates for now (may need to expand)
if (pt.valueConstraint && pt.valueConstraint.valueTemplateRefs && pt.valueConstraint.valueTemplateRefs.length==1){
let valueTemplateRef = pt.valueConstraint.valueTemplateRefs[0]
Expand All @@ -195,7 +195,7 @@ const utilsRDF = {
// grab the rtLookup from the profile store
if (!rtLookup){
rtLookup= useProfileStore().rtLookup
}
}

let template = rtLookup[valueTemplateRef]
let foundProperty = null
Expand Down Expand Up @@ -255,7 +255,7 @@ const utilsRDF = {
return 'http://www.w3.org/2000/01/rdf-schema#Resource'
}




// at this point we have a well cached lookup of the whole onotlogy in localstorage
Expand All @@ -275,7 +275,7 @@ const utilsRDF = {
// check if it has a rdfs:subPropertyOf, if it does then we can ask for that
let subPropertyOf = prop.getElementsByTagName("rdfs:subPropertyOf")
if (subPropertyOf.length>0){
if (subPropertyOf[0].attributes['rdf:resource']){
if (subPropertyOf[0].attributes['rdf:resource']){
let subPropertyResult = await this.suggestTypeNetwork(subPropertyOf[0].attributes['rdf:resource'].value)
if (subPropertyResult){
return subPropertyResult
Expand Down
2 changes: 1 addition & 1 deletion src/stores/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const useConfigStore = defineStore('config', {

versionMajor: 0,
versionMinor: 17,
versionPatch: 27,
versionPatch: 28,

regionUrls: {

Expand Down
10 changes: 4 additions & 6 deletions src/stores/profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ export const useProfileStore = defineStore('profile', {

}

// now go through and see if there are the the same group being used in multiple profiles if so
// now go through and see if there are the the same group being used in multiple profiles if so
// that means they have cross profile components (2 fields in Work 1 in instance for exmaple)


Expand All @@ -268,7 +268,7 @@ export const useProfileStore = defineStore('profile', {
}
}

}
}
}
}

Expand All @@ -285,7 +285,7 @@ export const useProfileStore = defineStore('profile', {
groupsOrder: [],
label: 'Multi',
profileId: 'Multi'
}
}

for (let groupName of groupsToMerge){

Expand Down Expand Up @@ -318,7 +318,7 @@ export const useProfileStore = defineStore('profile', {


results.push(multiProfile)



}
Expand Down Expand Up @@ -2050,7 +2050,6 @@ export const useProfileStore = defineStore('profile', {
* @return {array} - an array of objs representing the simple lookup values
*/
returnComplexLookupValueFromProfile: function(componentGuid, propertyPath){

// TODO: reconcile this to how the profiles are built, or dont..
// remove the sameAs from this property path, which will be the last one, we don't need it
propertyPath = propertyPath.filter((v)=> { return (v.propertyURI!=='http://www.w3.org/2002/07/owl#sameAs') })
Expand Down Expand Up @@ -4476,7 +4475,6 @@ export const useProfileStore = defineStore('profile', {
* @param {string} fieldGuid - the guid of the field
*/
returnValidationType: function(fieldGuid){

let fieldValue=null

for (let rt of this.activeProfile.rtOrder){
Expand Down