Skip to content

Commit

Permalink
Merge pull request #139 from ConductionNL/feature/cleanup
Browse files Browse the repository at this point in the history
feature/cleanup
  • Loading branch information
remko48 authored Jan 7, 2025
2 parents c542b95 + 1ed1c50 commit bea191f
Show file tree
Hide file tree
Showing 36 changed files with 117 additions and 133 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pull-request-lint-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Lint Check
on:
pull_request:
branches:
- never
- develop

jobs:
lint-check:
Expand Down
2 changes: 0 additions & 2 deletions css/dashboardWidgets.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/* import icons css file */
@import "../src/services/icons/icons.css";

.icon-zaken-widget {
background-image: url("../img/app-dark.svg");
filter: var(--background-invert-if-dark);
Expand Down
52 changes: 26 additions & 26 deletions src/services/icons/icons.css → css/icons.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/Dashboard/ContactmomentenWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,6 @@ public function load(): void
{
Util::addScript(Application::APP_ID, Application::APP_ID . '-contactmomentenWidget');
Util::addStyle(Application::APP_ID, 'dashboardWidgets');
Util::addStyle(Application::APP_ID, 'icons');
}
}
1 change: 1 addition & 0 deletions lib/Dashboard/OpenZakenWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,6 @@ public function load(): void
{
Util::addScript(Application::APP_ID, Application::APP_ID . '-openZakenWidget');
Util::addStyle(Application::APP_ID, 'dashboardWidgets');
Util::addStyle(Application::APP_ID, 'icons');
}
}
1 change: 1 addition & 0 deletions lib/Dashboard/OrganisatiesWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,6 @@ public function load(): void
{
Util::addScript(Application::APP_ID, Application::APP_ID . '-organisatiesWidget');
Util::addStyle(Application::APP_ID, 'dashboardWidgets');
Util::addStyle(Application::APP_ID, 'icons');
}
}
1 change: 1 addition & 0 deletions lib/Dashboard/PersonenWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,6 @@ public function load(): void
{
Util::addScript(Application::APP_ID, Application::APP_ID . '-personenWidget');
Util::addStyle(Application::APP_ID, 'dashboardWidgets');
Util::addStyle(Application::APP_ID, 'icons');
}
}
1 change: 1 addition & 0 deletions lib/Dashboard/TakenWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,6 @@ public function load(): void
{
Util::addScript(Application::APP_ID, Application::APP_ID . '-takenWidget');
Util::addStyle(Application::APP_ID, 'dashboardWidgets');
Util::addStyle(Application::APP_ID, 'icons');
}
}
1 change: 1 addition & 0 deletions lib/Dashboard/ZakenWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,6 @@ public function load(): void
{
Util::addScript(Application::APP_ID, Application::APP_ID . '-zakenWidget');
Util::addStyle(Application::APP_ID, 'dashboardWidgets');
Util::addStyle(Application::APP_ID, 'icons');
}
}
2 changes: 1 addition & 1 deletion src/modals/rollen/AddRol.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export default {
const self = this
setTimeout(function() {
self.succes = false
store.setModal(false)
navigationStore.setModal(false)
}, 2000)
})
.catch((err) => {
Expand Down
12 changes: 6 additions & 6 deletions src/modals/rollen/EditRol.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
import { navigationStore } from '../../store/store.js'
import { navigationStore, rolStore } from '../../store/store.js'
</script>

<template>
Expand Down Expand Up @@ -59,13 +59,13 @@ export default {
},
updated() {
if (navigationStore.modal === 'editRol' && this.hasUpdated) {
if (this.rol === store.rolItem) return
if (this.rol === rolStore.rolItem) return
this.hasUpdated = false
}
if (navigationStore.modal === 'editRol' && !this.hasUpdated) {
this.fetchData(store.rolId)
this.fetchData(rolStore.rolId)
this.hasUpdated = true
this.rol = store.rolItem
this.rol = rolStore.rolItem
}
},
methods: {
Expand All @@ -87,7 +87,7 @@ export default {
const self = this
setTimeout(function() {
self.succes = false
store.setModal(false)
navigationStore.setModal(false)
}, 2000)
})
.catch((err) => {
Expand All @@ -101,7 +101,7 @@ export default {
},
editRol() {
fetch(
`/index.php/apps/zaakafhandelapp/api/objects/rollen/${store.rolId}`,
`/index.php/apps/zaakafhandelapp/api/objects/rollen/${rolStore.rolId}`,
{
method: 'PUT',
headers: {
Expand Down
28 changes: 14 additions & 14 deletions src/store/modules/berichten.spec.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
/* eslint-disable no-console */
import { setActivePinia, createPinia } from 'pinia'

import { useZaakStore } from './zaken.js'
import { Zaak, mockZaak } from '../../entities/index.js'
import { useBerichtStore } from './berichten.js'
import { Bericht, mockBericht } from '../../entities/index.js'

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

it('sets zaak item correctly', () => {
const store = useZaakStore()
const store = useBerichtStore()

store.setZaakItem(mockZaak()[0])
store.setBerichtItem(mockBericht()[0])

expect(store.zaakItem).toBeInstanceOf(Zaak)
expect(store.zaakItem).toEqual(mockZaak()[0])
expect(store.berichtItem).toBeInstanceOf(Bericht)
expect(store.berichtItem).toEqual(mockBericht()[0])

expect(store.zaakItem.validate().success).toBe(true)
expect(store.berichtItem.validate().success).toBe(true)
})

it('sets zaken list correctly', () => {
const store = useZaakStore()
const store = useBerichtStore()

store.setZakenList(mockZaak())
store.setBerichtList(mockBericht())

expect(store.zakenList).toHaveLength(mockZaak().length)
expect(store.berichtList).toHaveLength(mockBericht().length)

store.zakenList.forEach((item, index) => {
expect(item).toBeInstanceOf(Zaak)
expect(item).toEqual(mockZaak()[index])
store.berichtList.forEach((item, index) => {
expect(item).toBeInstanceOf(Bericht)
expect(item).toEqual(mockBericht()[index])
expect(item.validate().success).toBe(true)
})
})
Expand Down
1 change: 0 additions & 1 deletion src/store/modules/besluiten.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ export const useBesluitStore = defineStore('besluiten', {
/**
* Fetch a single besluit item by its ID.
*
* @param zaakId - The ID of the zaak the besluit belongs to
* @param id - The ID of the besluit item to fetch.
* @param options - Options for fetching the besluit item. (default: `{}`)
* @throws If the HTTP request fails.
Expand Down
2 changes: 1 addition & 1 deletion src/store/modules/contactmoment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const useContactMomentStore = defineStore('contactmomenten', {
*
* @param search - Optional search query to filter the contact moments list. (default: `null`)
* @param notClosed - Optional boolean to filter out closed contact moments from the contact moments list. (default: `false`)
* @param user
* @param user - Optional user ID to filter the contact moments list. (default: `null`)
* @throws If the HTTP request fails.
* @return {Promise<{ response: Response, data: TContactMoment[], entities: ContactMoment[] }>} The response, raw data, and entities.
*/
Expand Down
30 changes: 15 additions & 15 deletions src/store/modules/klanten.spec.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
/* eslint-disable no-console */
import { setActivePinia, createPinia } from 'pinia'

import { useZaakStore } from './zaken.js'
import { Zaak, mockZaak } from '../../entities/index.js'
import { useKlantStore } from './klanten.js'
import { Klant, mockKlant } from '../../entities/index.js'

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

it('sets zaak item correctly', () => {
const store = useZaakStore()
it('sets klant item correctly', () => {
const store = useKlantStore()

store.setZaakItem(mockZaak()[0])
store.setKlantItem(mockKlant()[0])

expect(store.zaakItem).toBeInstanceOf(Zaak)
expect(store.zaakItem).toEqual(mockZaak()[0])
expect(store.klantItem).toBeInstanceOf(Klant)
expect(store.klantItem).toEqual(mockKlant()[0])

expect(store.zaakItem.validate().success).toBe(true)
expect(store.klantItem.validate().success).toBe(true)
})

it('sets zaken list correctly', () => {
const store = useZaakStore()
const store = useKlantStore()

store.setZakenList(mockZaak())
store.setKlantList(mockKlant())

expect(store.zakenList).toHaveLength(mockZaak().length)
expect(store.klantList).toHaveLength(mockKlant().length)

store.zakenList.forEach((item, index) => {
expect(item).toBeInstanceOf(Zaak)
expect(item).toEqual(mockZaak()[index])
store.klantList.forEach((item, index) => {
expect(item).toBeInstanceOf(Klant)
expect(item).toEqual(mockKlant()[index])
expect(item.validate().success).toBe(true)
})
})
Expand Down
2 changes: 1 addition & 1 deletion src/store/modules/navigation.spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable no-console */
import { setActivePinia, createPinia } from 'pinia'

import { useNavigationStore } from './navigation.js'
import { useNavigationStore } from './navigation.ts'

describe('Navigation Store', () => {
beforeEach(() => {
Expand Down
1 change: 0 additions & 1 deletion src/views/berichten/ZaakBerichten.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ import { NcListItem, NcActionButton, NcLoadingIcon } from '@nextcloud/vue'
// Icons
import ChatOutline from 'vue-material-design-icons/ChatOutline.vue'
import Eye from 'vue-material-design-icons/Eye.vue'
import Pencil from 'vue-material-design-icons/Pencil.vue'
import TrashCanOutline from 'vue-material-design-icons/TrashCanOutline.vue'
export default {
Expand Down
4 changes: 2 additions & 2 deletions src/views/besluiten/BesluitDetails.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
import { navigationStore } from '../../store/store.js'
import { besluitStore } from '../../store/store.js'
</script>

<template>
Expand Down Expand Up @@ -55,7 +55,7 @@ export default {
},
// First time the is no emit so lets grap it directly
mounted() {
this.fetchData(store.besluitItem)
this.fetchData(besluitStore.besluitItem)
},
methods: {
fetchData(besluitId) {
Expand Down
3 changes: 1 addition & 2 deletions src/views/besluiten/BesluitenIndex.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ import { navigationStore } from '../../store/store.js'
import { NcAppContent, NcEmptyContent, NcButton } from '@nextcloud/vue'
import BesluitenList from './BesluitenList.vue'
import BesluitDetails from './BesluitDetails.vue'
// eslint-disable-next-line n/no-missing-import
import BriefcaseAccountOutline from 'vue-material-design-icons/BriefcaseAccountOutline'
import BriefcaseAccountOutline from 'vue-material-design-icons/BriefcaseAccountOutline.vue'
export default {
name: 'BesluitenIndex',
Expand Down
12 changes: 4 additions & 8 deletions src/views/besluiten/BesluitenList.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
<script setup>
import { navigationStore } from '../../store/store.js'
</script>

<template>
<NcAppContentList>
<ul>
Expand Down Expand Up @@ -70,10 +66,10 @@ import { navigationStore } from '../../store/store.js'
</template>
<script>
import { NcListItem, NcActionButton, NcAppContentList, NcTextField, NcLoadingIcon } from '@nextcloud/vue'
// eslint-disable-next-line n/no-missing-import
import Magnify from 'vue-material-design-icons/Magnify'
// eslint-disable-next-line n/no-missing-import
import BriefcaseAccountOutline from 'vue-material-design-icons/BriefcaseAccountOutline'
import Magnify from 'vue-material-design-icons/Magnify.vue'
import BriefcaseAccountOutline from 'vue-material-design-icons/BriefcaseAccountOutline.vue'
export default {
name: 'BesluitenList',
Expand Down
4 changes: 2 additions & 2 deletions src/views/documenten/DocumentDetails.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
import { navigationStore } from '../../store/store.js'
import { documentStore } from '../../store/store.js'
</script>

<template>
Expand Down Expand Up @@ -55,7 +55,7 @@ export default {
},
// First time the is no emit so lets grap it directly
mounted() {
this.fetchData(store.documentItem)
this.fetchData(documentStore.documentItem)
},
methods: {
fetchData(documentId) {
Expand Down
4 changes: 2 additions & 2 deletions src/views/documenten/DocumentenIndex.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ import { navigationStore } from '../../store/store.js'
import { NcAppContent, NcEmptyContent, NcButton } from '@nextcloud/vue'
import DocumentenList from './DocumentenList.vue'
import DocumentDetails from './DocumentDetails.vue'
// eslint-disable-next-line n/no-missing-import
import BriefcaseAccountOutline from 'vue-material-design-icons/BriefcaseAccountOutline'
import BriefcaseAccountOutline from 'vue-material-design-icons/BriefcaseAccountOutline.vue'
export default {
name: 'DocumentenIndex',
Expand Down
8 changes: 4 additions & 4 deletions src/views/documenten/DocumentenList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ import { navigationStore, berichtStore } from '../../store/store.js'
</template>
<script>
import { NcListItem, NcActionButton, NcAppContentList, NcTextField, NcLoadingIcon } from '@nextcloud/vue'
// eslint-disable-next-line n/no-missing-import
import Magnify from 'vue-material-design-icons/Magnify'
// eslint-disable-next-line n/no-missing-import
import BriefcaseAccountOutline from 'vue-material-design-icons/BriefcaseAccountOutline'
import Magnify from 'vue-material-design-icons/Magnify.vue'
import BriefcaseAccountOutline from 'vue-material-design-icons/BriefcaseAccountOutline.vue'
export default {
name: 'DocumentenList',
Expand Down
4 changes: 2 additions & 2 deletions src/views/documenten/ZaakDocumenten.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ import { navigationStore, documentStore } from '../../store/store.js'

<script>
import { NcListItem, NcActionButton, NcLoadingIcon } from '@nextcloud/vue'
// eslint-disable-next-line n/no-missing-import
import FileDocumentOutline from 'vue-material-design-icons/FileDocumentOutline'
import FileDocumentOutline from 'vue-material-design-icons/FileDocumentOutline.vue'
import TrashCanOutline from 'vue-material-design-icons/TrashCanOutline.vue'
import Pencil from 'vue-material-design-icons/Pencil.vue'
Expand Down
Loading

0 comments on commit bea191f

Please sign in to comment.