Skip to content

Commit

Permalink
Merge pull request #119 from lcnetdev/show-subject-title-in-builder
Browse files Browse the repository at this point in the history
Show subject title in builder
  • Loading branch information
f-osorio authored Nov 7, 2024
2 parents 448f058 + 1492e23 commit 89ddf08
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
20 changes: 16 additions & 4 deletions src/components/panels/edit/modals/SubjectEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,12 @@
<div :class="['subject-editor-container-right', {'subject-editor-container-right-lowres':lowResMode}]">
<div v-if="contextRequestInProgress" style="font-weight: bold;">Retrieving data...</div>
<div class="modal-context" :style="{ }" v-if="Object.keys(contextData).length>0">
<h3><span class="modal-context-icon simptip-position-top" :data-tooltip="'Type: ' + contextData.type"><AuthTypeIcon v-if="contextData.type" :type="contextData.type"></AuthTypeIcon></span>{{contextData.title}}</h3>
<h3 v-if="contextData.title">
<span class="modal-context-icon simptip-position-top" :data-tooltip="'Type: ' + contextData.type">
<AuthTypeIcon v-if="contextData.type" :type="contextData.type"></AuthTypeIcon>
</span>
{{Array.isArray(contextData.title) ? contextData.title[0]["@value"] : contextData.title }}
</h3>
<div class="modal-context-data-title">{{contextData.type}}</div>
<a style="color:#2c3e50" :href="contextData.uri" target="_blank" v-if="contextData.literal != true">view on id.loc.gov</a>

Expand Down Expand Up @@ -172,6 +177,13 @@
<li class="modal-context-data-li" v-for="v in contextData.source" v-bind:key="v">{{v}}</li>
</ul>
</div>

<div v-if="contextData.marcKey && contextData.marcKey.length>0">
<div class="modal-context-data-title">MARC Key:</div>
<ul>
<li class="modal-context-data-li" v-bind:key="contextData.marcKey">{{ Array.isArray(contextData.marcKey) ? contextData.marcKey[0]["@value"] : contextData.marcKey }}</li>
</ul>
</div>

<div v-if="this.pickCurrent != null">
<div class="clear-selected">
Expand Down Expand Up @@ -1490,7 +1502,7 @@ methods: {
this.contextRequestInProgress = true
this.contextData = await utilsNetwork.returnContext(this.pickLookup[this.pickPostion].uri)
// for backwards compability
if (this.contextData.nodeMap.marcKey && this.contextData.nodeMap.marcKey[0]){
this.pickLookup[this.pickPostion].marcKey = this.contextData.nodeMap.marcKey[0]
Expand All @@ -1499,11 +1511,11 @@ methods: {
// we will modify our local context data here to make things easier
if (Array.isArray(this.contextData.title)){
// first grab the non-latin auth labels
this.contextData.nonLatinTitle = JSON.parse(JSON.stringify(this.contextData.title.filter((v)=>{ return (v['@language']) })))
this.contextData.nonLatinTitle = JSON.parse(JSON.stringify(this.contextData.title.filter((v)=>{ return (v['@language'] != "en" ? v['@language'] : "") })))
this.pickLookup[this.pickPostion].nonLatinTitle = this.contextData.nonLatinTitle
// return the first label with no language tag
this.contextData.title = this.contextData.title.filter((v)=>{ return (!v['@language']) })[0]
this.contextData.title = this.contextData.title.filter((v)=>{ return (v['@language'] == "en" || !v['@language']) })[0]
if (this.contextData.title && this.contextData.title['@value']){
this.contextData.title = this.contextData.title['@value']
}
Expand Down
7 changes: 1 addition & 6 deletions src/lib/utils_network.js
Original file line number Diff line number Diff line change
Expand Up @@ -1039,7 +1039,6 @@ const utilsNetwork = {


data.forEach((n)=>{

var citation = '';
var variant = '';
// var seeAlso = '';
Expand Down Expand Up @@ -1151,7 +1150,7 @@ const utilsNetwork = {
delete results.nodeMap[k]
}
})

return results;
},

Expand Down Expand Up @@ -2663,16 +2662,12 @@ const utilsNetwork = {
* @return {array} - results from API
*/
searchShelfList: async function(search, details, dir){
console.info("search: ", search)
if (!dir){
dir ='ascending'
}

let urlSearch = "lds/browse.xqy?bq=" + search +"&browse-order=" + dir + "&browse=class" + details + "&mime=json"

console.info("url: ", useConfigStore().returnUrls.shelfListing + urlSearch)


// try{
//let req = await fetch(useConfigStore().returnUrls.shelfListing + `browse/class/${dir}/${search}.json` )
let req = await fetch(useConfigStore().returnUrls.shelfListing + urlSearch )
Expand Down

0 comments on commit 89ddf08

Please sign in to comment.