Skip to content

Commit

Permalink
Merge pull request #143 from ConductionNL/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
remko48 authored Jan 8, 2025
2 parents 77834b7 + bea191f commit 73b3b52
Show file tree
Hide file tree
Showing 43 changed files with 156 additions and 158 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');
}
}
14 changes: 7 additions & 7 deletions src/modals/contactMomenten/ContactMomentenForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,8 @@ import { contactMomentStore, navigationStore, taakStore, zaakStore } from '../..
</template>
</NcEmptyContent>
</BTab>
<BTab :title="`Producten ${contactMomenten[selectedContactMoment].klant ? (contactMomenten[selectedContactMoment].klant?.producten?.length ? `(${contactMomenten[selectedContactMoment].klant?.producten?.length})` : '(0)') : ''}`">
<div v-if="contactMomenten[selectedContactMoment].klant?.producten?.length">
<BTab :title="`Producten ${contactMomenten[selectedContactMoment]?.klant ? (contactMomenten[selectedContactMoment].klant?.producten?.length ? `(${contactMomenten[selectedContactMoment].klant?.producten?.length})` : '(0)') : ''}`">
<div v-if="contactMomenten[selectedContactMoment]?.klant?.producten?.length">
<NcListItem
v-for="(product, key) in contactMomenten[selectedContactMoment].klant.producten"
:key="key"
Expand Down Expand Up @@ -528,9 +528,9 @@ import { contactMomentStore, navigationStore, taakStore, zaakStore } from '../..
</NcActionButton>
<NcActionButton v-if="!isView"
v-tooltip="'Een klant taak kan alleen worden aangemaakt als er een klant is geselecteerd.'"
:class="{ 'actionButtonDisabled': !contactMomenten[selectedContactMoment].klant?.id }"
:class="{ 'actionButtonDisabled': !contactMomenten[selectedContactMoment]?.klant?.id }"
:close-after-click="true"
:disabled="!contactMomenten[selectedContactMoment].klant?.id"
:disabled="!contactMomenten[selectedContactMoment]?.klant?.id"
@click="openTaakForm('klant')">
<template #icon>
<CalendarMonthOutline :size="20" />
Expand All @@ -539,9 +539,9 @@ import { contactMomentStore, navigationStore, taakStore, zaakStore } from '../..
</NcActionButton>
<NcActionButton v-if="!isView"
v-tooltip="'Een zaak kan alleen worden gestart als er een klant is geselecteerd.'"
:class="{ 'actionButtonDisabled': !contactMomenten[selectedContactMoment].klant?.id }"
:class="{ 'actionButtonDisabled': !contactMomenten[selectedContactMoment]?.klant?.id }"
:close-after-click="true"
:disabled="!contactMomenten[selectedContactMoment].klant?.id"
:disabled="!contactMomenten[selectedContactMoment]?.klant?.id"
@click="openZaakForm()">
<template #icon>
<BriefcaseAccountOutline :size="20" />
Expand All @@ -560,7 +560,7 @@ import { contactMomentStore, navigationStore, taakStore, zaakStore } from '../..
</NcActions>
<NcButton v-if="!isView"
type="primary"
:disabled="!contactMomenten[selectedContactMoment].klant || !medewerkers.values[selectedContactMoment - 1]?.id || !channels.values[selectedContactMoment - 1]?.value || loading || success || fetchLoading"
:disabled="!contactMomenten[selectedContactMoment]?.klant || !medewerkers.values[selectedContactMoment - 1]?.id || !channels.values[selectedContactMoment - 1]?.value || loading || success || fetchLoading"
:loading="loading"
@click="addContactMoment(selectedContactMoment)">
<template #icon>
Expand Down
3 changes: 2 additions & 1 deletion src/modals/klanten/ViewKlant.vue
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,8 @@ import { taakStore, navigationStore, zaakStore, klantStore, contactMomentStore }
<EditTaakForm v-if="taakModalOpen"
:dashboard-widget="true"
:selected-klant-from-widget="klant"
@save-success="fetchTaakItems" />
@save-success="fetchTaakItems"
@close-modal="() => (taakModalOpen = false)" />
</NcDialog>
</template>

Expand Down
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
2 changes: 1 addition & 1 deletion src/modals/taken/EditTaak.vue
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ export default {
closeModal() {
navigationStore.setModal(null)
if (this.dashboardWidget === true) {
if (this.dashboardWidget) {
this.$emit('close-modal')
}
},
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
Loading

0 comments on commit 73b3b52

Please sign in to comment.