Skip to content

Commit

Permalink
Merge pull request #76 from lcnetdev/bfp-103-load-improvments-and-add…
Browse files Browse the repository at this point in the history
…-literal-improvments

Bfp 103 load improvments and add literal improvments
  • Loading branch information
thisismattmiller authored Oct 3, 2024
2 parents 458954c + 61a72f7 commit 2886c64
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 33 deletions.
8 changes: 8 additions & 0 deletions src/components/panels/edit/fields/Literal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,14 @@ export default {
}
}
// if the value is empty then wait 2 seconds and check if it is empty again, if it is then continue with the removal
if (v == ''){
await new Promise(r => setTimeout(r, 2000));
if (event && event.target && event.target.value != ''){
return false
}
}
await this.profileStore.setValueLiteral(this.guid,event.target.dataset.guid,this.propertyPath,v,event.target.dataset.lang)
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: 14,
versionPatch: 32,
versionPatch: 33,

regionUrls: {

Expand Down
66 changes: 34 additions & 32 deletions src/views/Load.vue
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,33 @@
},
async refreshSavedRecords(){
let records = await utilsNetwork.searchSavedRecords(this.preferenceStore.returnUserNameForSaving)
let lccnLookup = {}
// in this view we want to remove any records that are repeats, so only show the latest LCCN being edited
this.continueRecords = []
for (let r of records){
if (r.lccn && r.lccn != '' && r.lccn !== null){
if (!lccnLookup[r.lccn]){
this.continueRecords.push(r)
lccnLookup[r.lccn]=true
}
}else{
// no LCCN just add it
this.continueRecords.push(r)
}
}
},
Expand All @@ -562,53 +589,28 @@
},
created: async function(){
mounted: async function(){
this.refreshSavedRecords()
let records = await utilsNetwork.searchSavedRecords(this.preferenceStore.returnUserNameForSaving)
},
let lccnLookup = {}
// in this view we want to remove any records that are repeats, so only show the latest LCCN being edited
this.continueRecords = []
for (let r of records){
if (r.lccn && r.lccn != '' && r.lccn !== null){
if (!lccnLookup[r.lccn]){
this.continueRecords.push(r)
lccnLookup[r.lccn]=true
}
}else{
// no LCCN just add it
this.continueRecords.push(r)
}
}
created: async function(){
let inerval = window.setInterval(()=>{
this.refreshSavedRecords()
// this is checking to see if the route is available to load the passed URL to it
let inerval = window.setInterval(()=>{
if (this.$route && this.$route.query && this.$route.query.url){
this.urlToLoad = this.$route.query.url
this.urlToLoadIsHttp=true
window.clearInterval(inerval)
}
// if (this.$router.currentRoute && this.$router.currentRoute.query && this.$router.currentRoute.query.url){
// let url = this.$router.currentRoute.query.url
// if (this.$router.currentRoute && this.$router.currentRoute.query && this.$router.currentRoute.query.action && this.$router.currentRoute.query.action == 'loadwork'){
// url = url.replace('.jsonld','.rdf')
// }
// if (this.$router.currentRoute && this.$router.currentRoute.query && this.$router.currentRoute.query.action && this.$router.currentRoute.query.action == 'loadibc'){
// url = url.replace('.jsonld','.xml')
// }
// this.instanceEditorLink = url
// this.testInstance()
// window.clearInterval(inerval)
// }
},500)
Expand Down

0 comments on commit 2886c64

Please sign in to comment.