Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default {
this.URI = this.URI.slice(0, -1)
}

let URL = this.URI + '.madsrdf_raw.json' //'.nt'
let URL = this.URI + '.nt'
URL = URL.replace('http://','https://')

let cache = sessionStorage.getItem(URL);
Expand Down
21 changes: 17 additions & 4 deletions src/components/panels/edit/modals/SubjectEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1835,13 +1835,17 @@ export default {
},

getContext: async function () {
console.info("getContext:")
if (this.pickLookup[this.pickPostion].literal) {
this.contextData = this.pickLookup[this.pickPostion]
return false
}
//let temp = await utilsNetwork.returnContext(this.pickLookup[this.pickPostion].uri)
this.contextData = this.pickLookup[this.pickPostion].extra

console.info("this.pickLookup: ", this.pickLookup)
console.info("\t this.contextData: ", this.contextData)

if (this.pickLookup[this.pickPostion].uri) {
// Pull information into contextData from 1 level up
this.contextData.literal = false
Expand All @@ -1859,11 +1863,16 @@ export default {
this.contextData.typeFull = this.contextData.type.replace('madsrdf:', 'http://www.loc.gov/mads/rdf/v1#')

//Check if it's a Jurisdiction, and overwrite
if (this.pickLookup[this.pickPostion].extra['collections'].includes("http://id.loc.gov/authorities/names/collection_Jurisdictions")) {
if (this.pickLookup[this.pickPostion].extra['collections'] && this.pickLookup[this.pickPostion].extra['collections'].includes("http://id.loc.gov/authorities/names/collection_Jurisdictions")) {
this.contextData.type = "bf:Jursidiction"
this.contextData.typeFull = "http://id.loc.gov/ontologies/bibframe/Jurisdiction"
}

if (!Object.keys(this.pickLookup[this.pickPostion].extra).includes('collections')){
this.pickLookup[this.pickPostion].extra['collections'] = []
}


this.contextData.gacs = this.pickLookup[this.pickPostion].extra.gacs

} else {
Expand All @@ -1874,9 +1883,13 @@ export default {
this.contextData.variantLabels = [...new Set(this.contextData.variantLabels)]

// filter related, so it doesn't duplicate value from earlier/later, broader
this.contextData['relateds'] = this.contextData['relateds'].filter(n => !this.contextData['hasEarlierEstablishedForms'].includes(n))
this.contextData['relateds'] = this.contextData['relateds'].filter(n => !this.contextData['hasLaterEstablishedForms'].includes(n))
this.contextData['relateds'] = this.contextData['relateds'].filter(n => !this.contextData['broaders'].includes(n))
if (this.contextData['relateds']){
this.contextData['relateds'] = this.contextData['relateds'].filter(n => !this.contextData['hasEarlierEstablishedForms'].includes(n))
this.contextData['relateds'] = this.contextData['relateds'].filter(n => !this.contextData['hasLaterEstablishedForms'].includes(n))
this.contextData['relateds'] = this.contextData['relateds'].filter(n => !this.contextData['broaders'].includes(n))
} else {
this.contextData['relateds'] = []
}

this.contextRequestInProgress = false
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ test('Add Non-Latin Name', async ({ page }) => {
await page.locator('.child-elements > div > div > div > .caret').first().click();
await expect(page.locator('#app')).toContainText('<bf:Agentrdf:about="http://id.loc.gov/authorities/names/n97907734">');
await expect(page.locator('#app')).toContainText('<rdf:typerdf:resource="http://www.loc.gov/mads/rdf/v1#PersonalName" /><rdfs:labelxmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">ʻAqīl, ʻAqīl Ḥusayn</rdfs:label>');
await expect(page.locator('#app')).toContainText('<rdfs:labelxmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"xml:lang="und-arab">عقيل، عقيل حسين</rdfs:label>');
await expect(page.locator('#app')).toContainText('<bflc:marcKeyxmlns:bflc="http://id.loc.gov/ontologies/bflc/">1001 $aʻAqīl, ʻAqīl Ḥusayn</bflc:marcKey>');
await expect(page.locator('#app')).toContainText('<bflc:marcKeyxmlns:bflc="http://id.loc.gov/ontologies/bflc/"xml:lang="und-arab">4001 $aعقيل، عقيل حسين$7(bcp47)und-arab</bflc:marcKey>');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,15 +248,15 @@ test('add complex subdivision, type first part of subdivision and then select th
await page.getByRole('textbox', { name: 'Enter Subject Headings Here' }).fill('dogs');
await page.getByText('Dogs', { exact: true }).first().click();
await page.getByRole('textbox', { name: 'Enter Subject Headings Here' }).fill('Dogs--history');
await page.getByText('History--20th century').click();
await expect(page.getByRole('heading')).toContainText('sh2002006165');
await page.getByText('History--19th century').click();
await expect(page.getByRole('heading')).toContainText('sh2002006167');
await page.getByRole('button', { name: 'Add [SHIFT+Enter]' }).click();
await page.getByText('bf:Work').click();
await expect(page.locator('#app')).toContainText('Dogs--History--20th century');
await expect(page.locator('#app')).toContainText('Dogs--History--19th century');
await expect(page.locator('#app')).toContainText('150 $aDogs');
await expect(page.locator('#app')).toContainText('180 $xHistory');
await expect(page.locator('#app')).toContainText('182 $y20th century');
await expect(page.locator('#app')).toContainText('650 0 $a Dogs $x History $y 20th century');
await expect(page.locator('#app')).toContainText('182 $y19th century');
await expect(page.locator('#app')).toContainText('650 0 $a Dogs $x History $y 19th century');
});

// Test headings with Hierarchical Geographic
Expand Down
Loading