Skip to content

Commit

Permalink
Update src from PHP Codesniffer
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Aug 5, 2024
1 parent c195d8c commit ff6cd38
Show file tree
Hide file tree
Showing 10 changed files with 89 additions and 89 deletions.
14 changes: 7 additions & 7 deletions src/store/modules/catalogi.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,18 @@ export const useCatalogiStore = defineStore(
)
.then(
(response) => {
response.json().then(
(data) => {
this.catalogiList = data.results.map(
(catalogiItem) => new Catalogi(catalogiItem),
)
response.json().then(
(data) => {
this.catalogiList = data.results.map(
(catalogiItem) => new Catalogi(catalogiItem),
)
}
)
)
}
)
.catch(
(err) => {
console.error(err)
console.error(err)
}
)
},
Expand Down
12 changes: 6 additions & 6 deletions src/store/modules/catalogi.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import { Catalogi } from '../../entities/index.js'

describe(
'Catalogi Store', () => {
beforeEach(
() => {
setActivePinia(createPinia())
beforeEach(
() => {
setActivePinia(createPinia())
}
)
)

it(
'sets catalogi item correctly', () => {
const store = useCatalogiStore()
const store = useCatalogiStore()

store.setCatalogiItem(testData[0])

Expand All @@ -27,7 +27,7 @@ describe(

it(
'sets catalogi list correctly', () => {
const store = useCatalogiStore()
const store = useCatalogiStore()

store.setCatalogiList(testData)

Expand Down
14 changes: 7 additions & 7 deletions src/store/modules/directory.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,18 @@ export const useDirectoryStore = defineStore(
)
.then(
(response) => {
response.json().then(
(data) => {
this.listingList = data.results.map(
(listingItem) => new Listing(listingItem),
)
response.json().then(
(data) => {
this.listingList = data.results.map(
(listingItem) => new Listing(listingItem),
)
}
)
)
}
)
.catch(
(err) => {
console.error(err)
console.error(err)
}
)
},
Expand Down
12 changes: 6 additions & 6 deletions src/store/modules/directory.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import { Listing } from '../../entities/index.js'

describe(
'Directory Store', () => {
beforeEach(
() => {
setActivePinia(createPinia())
beforeEach(
() => {
setActivePinia(createPinia())
}
)
)

it(
'sets listing item correctly', () => {
const store = useDirectoryStore()
const store = useDirectoryStore()

store.setListingItem(testData[0])

Expand All @@ -25,7 +25,7 @@ describe(

it(
'sets listings list correctly', () => {
const store = useDirectoryStore()
const store = useDirectoryStore()

store.setListingList(testData)

Expand Down
26 changes: 13 additions & 13 deletions src/store/modules/metadata.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ import { useMetadataStore } from './metadata.js'

describe(
'Metadata Store', () => {
beforeEach(
() => {
setActivePinia(createPinia())
beforeEach(
() => {
setActivePinia(createPinia())
}
)
)

it(
'sets metadata item correctly', () => {
const store = useMetadataStore()
const store = useMetadataStore()
const metadataItem = {
id: '1',
name: 'Test metadata name',
Expand All @@ -39,11 +39,11 @@ describe(

expect(store.metaDataItem).toEqual(metadataItem)
}
)
)

it(
'sets metadata item with string "properties" property', () => {
const store = useMetadataStore()
const store = useMetadataStore()
const metadataItem = {
id: '1',
name: 'Test metadata name',
Expand Down Expand Up @@ -76,7 +76,7 @@ describe(

it(
'sets metadata list correctly', () => {
const store = useMetadataStore()
const store = useMetadataStore()
const metadataList = [
{
id: '1',
Expand Down Expand Up @@ -124,15 +124,15 @@ describe(
expect(store.metaDataList).toHaveLength(metadataList.length)
store.metaDataList.forEach(
(item, index) => {
expect(item).toEqual(metadataList[index])
expect(item).toEqual(metadataList[index])
}
)
}
)
)

it(
'get metadata property from key', () => {
const store = useMetadataStore()
const store = useMetadataStore()
const metadataItem = {
id: '1',
name: 'Test metadata name',
Expand Down Expand Up @@ -175,6 +175,6 @@ describe(

expect(properties).toEqual(metadataItem.properties.sasds)
}
)
)
}
)
)
16 changes: 8 additions & 8 deletions src/store/modules/navigation.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ import { useNavigationStore } from './navigation.js'

describe(
'Navigation Store', () => {
beforeEach(
() => {
setActivePinia(createPinia())
beforeEach(
() => {
setActivePinia(createPinia())
}
)
)

it(
'set current selected view correctly', () => {
const store = useNavigationStore()
const store = useNavigationStore()

store.setSelected('publication')
expect(store.selected).toBe('publication')
Expand All @@ -28,7 +28,7 @@ describe(

it(
'set current selected publication catalogi correctly', () => {
const store = useNavigationStore()
const store = useNavigationStore()

store.setSelectedCatalogus('7a048bfd-210f-4e93-a1e8-5aa9261740b7')
expect(store.selectedCatalogus).toBe('7a048bfd-210f-4e93-a1e8-5aa9261740b7')
Expand All @@ -43,7 +43,7 @@ describe(

it(
'set modal correctly', () => {
const store = useNavigationStore()
const store = useNavigationStore()

store.setModal('editPublication')
expect(store.modal).toBe('editPublication')
Expand All @@ -58,7 +58,7 @@ describe(

it(
'set modal correctly', () => {
const store = useNavigationStore()
const store = useNavigationStore()

store.setDialog('deletePublication')
expect(store.dialog).toBe('deletePublication')
Expand Down
44 changes: 22 additions & 22 deletions src/store/modules/publication.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,17 @@ export const usePublicationStore = defineStore(
)
.then(
(response) => {
response.json().then(
(data) => {
this.setPublicationList(data?.results)
response.json().then(
(data) => {
this.setPublicationList(data?.results)
return data
}
)
)
}
)
.catch(
(err) => {
console.error(err)
console.error(err)
return err
}
)
Expand All @@ -61,19 +61,19 @@ export const usePublicationStore = defineStore(
)
.then(
(response) => {
response.json().then(
(data) => {
this.publicationAttachments = data.results.map(
(attachmentItem) => new Attachment(attachmentItem),
)
response.json().then(
(data) => {
this.publicationAttachments = data.results.map(
(attachmentItem) => new Attachment(attachmentItem),
)
return data
}
)
)
}
)
.catch(
(err) => {
console.error(err)
console.error(err)
return err
}
)
Expand All @@ -87,17 +87,17 @@ export const usePublicationStore = defineStore(
)
.then(
(response) => {
response.json().then(
(data) => {
this.conceptPublications = data
response.json().then(
(data) => {
this.conceptPublications = data
return data
}
)
)
}
)
.catch(
(err) => {
console.error(err)
console.error(err)
return err
}
)
Expand All @@ -111,17 +111,17 @@ export const usePublicationStore = defineStore(
)
.then(
(response) => {
response.json().then(
(data) => {
this.conceptAttachments = data
response.json().then(
(data) => {
this.conceptAttachments = data
return data
}
)
)
}
)
.catch(
(err) => {
console.error(err)
console.error(err)
return err
}
)
Expand Down
16 changes: 8 additions & 8 deletions src/store/modules/publication.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import { Attachment, Publication } from '../../entities/index.js'

describe(
'Metadata Store', () => {
beforeEach(
() => {
setActivePinia(createPinia())
beforeEach(
() => {
setActivePinia(createPinia())
}
)
)

it(
'sets publication item correctly', () => {
const store = usePublicationStore()
const store = usePublicationStore()

store.setPublicationItem(testData[0])

Expand All @@ -38,7 +38,7 @@ describe(

it(
'sets publication list correctly', () => {
const store = usePublicationStore()
const store = usePublicationStore()

store.setPublicationList(testData)

Expand All @@ -61,7 +61,7 @@ describe(
// TODO: fix this
it(
'set publication data.data property key correctly', () => {
const store = usePublicationStore()
const store = usePublicationStore()

store.setPublicationDataKey('contactPoint')

Expand All @@ -71,7 +71,7 @@ describe(

it(
'set attachment item correctly', () => {
const store = usePublicationStore()
const store = usePublicationStore()

store.setAttachmentItem(attachmentTestData[0])

Expand Down
10 changes: 5 additions & 5 deletions src/store/modules/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ export const useSearchStore = defineStore(
)
.then(
(response) => {
response.json().then(
(data) => {
this.searchResults = data
response.json().then(
(data) => {
this.searchResults = data
}
)
)
}
)
.catch(
(err) => {
console.error(err)
console.error(err)
}
)
},
Expand Down
Loading

0 comments on commit ff6cd38

Please sign in to comment.