Skip to content

Commit

Permalink
Merge pull request #247 from lcnetdev/fix-broken-lookup-labels
Browse files Browse the repository at this point in the history
Fix Broken Lookups
  • Loading branch information
f-osorio authored Feb 27, 2025
2 parents 0ae50f0 + c0e734d commit 35ca748
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 15 deletions.
15 changes: 6 additions & 9 deletions src/components/panels/edit/modals/ComplexLookupModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@
// do a bunch of diacritic checks to see if they are trying to trigger a diacrtiic macro
// This mode is they press Crtl+e to enter diacritic macro mode, so they did that on the last kedown and now we need to act on the next keystroke and interpret it as a macro code
if (this.nextInputIsVoyagerModeDiacritics){
Expand Down Expand Up @@ -541,7 +541,6 @@
returnContextTitle(title){
if (!Array.isArray(title)){
title=[title]
}
Expand All @@ -550,7 +549,6 @@
//let noLang = title.filter((v)=>{ if (v['@language']){return false}else{return true} })
//GenreForm seem to have the lang tag even when there is only English values
let noLang = title.filter((v)=> typeof v['@language'] == "undefined" || (v['@language'] && v['@language'] == "en") )
if (noLang && noLang[0] && noLang[0]['@value']){ return noLang[0]['@value']}
return 'ERROR - Cannot find label'
Expand Down Expand Up @@ -641,7 +639,7 @@
"genreForm": null,
"nodeMap": {},
"precoordinated" : false,
"literal": true,
"literal": (toLoad && toLoad.literal) ? true : false,
"loading":true,
}
Expand All @@ -653,7 +651,7 @@
try {
results = await utilsNetwork.returnContext(toLoad.uri)
results.loading = false
} catch {
} catch(err) {
results = this.activeContext
}
Expand All @@ -671,7 +669,7 @@
this.activeContext = results
},
isStaging(){
isStaging(){
if (useConfigStore().returnUrls.env == "staging"){
return true
}else{
Expand All @@ -682,14 +680,14 @@
loadNacoStubModal(){
this.$emit('hideComplexModal')
this.$nextTick(() => {
this.showNacoStubCreateModal = true
})
// this.displayCo/
},
Expand Down Expand Up @@ -943,7 +941,6 @@
<div ref="complexLookupModalDisplay" class="complex-lookup-modal-display" :style="`${this.preferenceStore.styleModalTextColor()};`">

<template v-if="activeContext !== null">

<h3><span class="modal-context-icon simptip-position-top" :data-tooltip="'Type: ' + activeContext.type"><AuthTypeIcon v-if="activeContext.type" :type="activeContext.type"></AuthTypeIcon></span>{{returnContextTitle(activeContext.title)}}</h3>


Expand Down
5 changes: 2 additions & 3 deletions src/lib/utils_network.js
Original file line number Diff line number Diff line change
Expand Up @@ -570,9 +570,6 @@ const utilsNetwork = {
try {
d = await this.fetchContextData(uri)
d.uri = uri
if (returnUrls.env == 'production'){
d.uri = uri.replace('http://id.', 'https://preprod-8080.id.')
}
} catch {
return false
}
Expand Down Expand Up @@ -921,6 +918,8 @@ const utilsNetwork = {
* @return {array} - An array of {@link contextResult} results
*/
extractContextData: function(data){
data.uri = data.uri.replace("https://preprod-8080.", "http://id.loc.gov/")

var results = {
contextValue: true,
source: [],
Expand Down
6 changes: 3 additions & 3 deletions 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: 18,
versionPatch: 6,
versionPatch: 7,

regionUrls: {

Expand All @@ -30,8 +30,8 @@ export const useConfigStore = defineStore('config', {
starting: 'https://raw.githubusercontent.com/lcnetdev/bfe-profiles/main/starting-prod/data.json',

id: 'https://id.loc.gov/',
env : 'staging',
dev: true,
env : 'production',
dev: false,
displayLCOnlyFeatures: true,
},

Expand Down

0 comments on commit 35ca748

Please sign in to comment.