Skip to content

Commit

Permalink
Merge pull request #79 from ConductionNL/feature/PC108-91/taak-dialog
Browse files Browse the repository at this point in the history
improved taak modal code
  • Loading branch information
RalkeyOfficial authored Dec 6, 2024
2 parents dd0b976 + 21b728d commit 1617fa7
Show file tree
Hide file tree
Showing 14 changed files with 391 additions and 487 deletions.
1 change: 1 addition & 0 deletions src/entities/taak/taak.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export const mockTaakData = (): TTaak[] => [
toelichting: 'Deze taak omvat het uitvoeren van een gedetailleerde interne audit van de bedrijfsprocessen om te controleren of alle afdelingen voldoen aan de vastgestelde kwaliteitsnormen. De bevindingen worden gedocumenteerd en er worden aanbevelingen gedaan voor verbeteringen.',
actie: 'Voorbereiden van auditchecklist, uitvoeren van audits, rapporteren van bevindingen, aanbevelen van verbeteringen.',
klant: 'urn:uuid:6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b',
medewerker: 'urn:uuid:6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b',
},
]

Expand Down
4 changes: 3 additions & 1 deletion src/entities/taak/taak.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class Taak implements TTaak {
public toelichting: string
public actie: string
public klant: string

public medewerker: string
constructor(source: TTaak) {
this.id = source.id || ''
this.title = source.title || ''
Expand All @@ -26,6 +26,7 @@ export class Taak implements TTaak {
this.toelichting = source.toelichting || ''
this.actie = source.actie || ''
this.klant = source.klant || ''
this.medewerker = source.medewerker || ''
}

public validate(): SafeParseReturnType<TTaak, unknown> {
Expand All @@ -40,6 +41,7 @@ export class Taak implements TTaak {
toelichting: z.string(),
actie: z.string(),
klant: z.string(),
medewerker: z.string(),
})

return schema.safeParse(this)
Expand Down
3 changes: 2 additions & 1 deletion src/entities/taak/taak.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ export type TTaak = {
onderwerp: string;
toelichting: string;
actie: string;
klant: string;
klant: string
medewerker: string
}
3 changes: 0 additions & 3 deletions src/modals/Modals.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { navigationStore } from '../store/store.js'
<EditBericht />
<ViewBerichtAuditTrail v-if="navigationStore.modal === 'viewBerichtAuditTrail'" />
<EditTaak v-if="navigationStore.modal === 'editTaak'" />
<WidgetTaakForm v-if="navigationStore.modal === 'widgetTaakForm'" />
<ViewTaakAuditTrail v-if="navigationStore.modal === 'viewTaakAuditTrail'" />
<EditRol />
<ViewZaakAuditTrail v-if="navigationStore.modal === 'viewZaakAuditTrail'" />
Expand All @@ -33,7 +32,6 @@ import EditBericht from './berichten/EditBericht.vue'
import ViewBerichtAuditTrail from './berichten/ViewBerichtAuditTrail.vue'
import EditTaak from './taken/EditTaak.vue'
import ViewTaakAuditTrail from './taken/ViewTaakAuditTrail.vue'
import WidgetTaakForm from './taken/WidgetTaakForm.vue'
import EditRol from './rollen/EditRol.vue'
import ViewZaakAuditTrail from './zaken/ViewZaakAuditTrail.vue'
import ViewKlantRegister from './klantRegister/ViewKlantRegister.vue'
Expand All @@ -50,7 +48,6 @@ export default {
EditBericht,
ViewBerichtAuditTrail,
EditTaak,
WidgetTaakForm,
ViewTaakAuditTrail,
EditRol,
ViewZaakAuditTrail,
Expand Down
23 changes: 17 additions & 6 deletions src/modals/contactMomenten/ContactMomentenForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ import { contactMomentStore, navigationStore, taakStore, zaakStore } from '../..
</div>

<div v-if="!success" class="form-group">
<NcTextArea v-model="contactMoment.notitie"
<NcTextArea :value.sync="contactMoment.notitie"
label="Notitie"
:disabled="loading"
:loading="fetchLoading"
Expand Down Expand Up @@ -193,11 +193,17 @@ import { contactMomentStore, navigationStore, taakStore, zaakStore } from '../..
<template #icon>
<DotsHorizontal :size="20" />
</template>
<NcActionButton @click="openTaakForm">
<NcActionButton @click="openTaakForm('medewerker')">
<template #icon>
<CalendarMonthOutline :size="20" />
</template>
Taak aanmaken
Medewerker taak aanmaken
</NcActionButton>
<NcActionButton @click="openTaakForm('klant')">
<template #icon>
<CalendarMonthOutline :size="20" />
</template>
Klant taak aanmaken
</NcActionButton>
<NcActionButton :disabled="true" @click="zaakStore.setZaakItem(); navigationStore.setModal('editZaak')">
<template #icon>
Expand All @@ -220,8 +226,10 @@ import { contactMomentStore, navigationStore, taakStore, zaakStore } from '../..
</NcButton>
</template>

<TakenForm v-if="taakFormOpen"
<EditTaakForm v-if="taakFormOpen"
:dashboard-widget="true"
:client-type="taakClientType"
:klant-id="klant?.id"
@close-modal="closeTaakForm"
@save-success="closeTaakForm" />
</NcDialog>
Expand All @@ -234,7 +242,7 @@ import { NcButton, NcActions, NcLoadingIcon, NcDialog, NcTextArea, NcNoteCard, N
// Forms
import SearchKlantModal from '../../modals/klanten/SearchKlantModal.vue'
import TakenForm from '../../modals/taken/WidgetTaakForm.vue'
import EditTaak from '../../modals/taken/EditTaak.vue'
// Icons
import Plus from 'vue-material-design-icons/Plus.vue'
Expand All @@ -256,6 +264,7 @@ export default {
NcListItem,
NcActionButton,
NcEmptyContent,
EditTaakForm: EditTaak,
// Icons
Plus,
BriefcaseAccountOutline,
Expand Down Expand Up @@ -308,6 +317,7 @@ export default {
selectedProduct: null,
startingType: 'all',
taakFormOpen: false,
taakClientType: 'both',
}
},
mounted() {
Expand Down Expand Up @@ -403,8 +413,9 @@ export default {
this.searchKlantModalOpen = false
},
openTaakForm() {
openTaakForm(clientType = 'both') {
this.taakFormOpen = true
this.taakClientType = clientType
taakStore.setTaakItem(null)
},
Expand Down
6 changes: 3 additions & 3 deletions src/modals/klantRegister/ViewKlantRegister.vue
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ import { taakStore, navigationStore, zaakStore, klantStore } from '../../store/s
:selected-klant-from-widget="klant"
@save-success="fetchZaakItems" />

<WidgetTaakForm v-if="taakModalOpen"
<EditTaakForm v-if="taakModalOpen"
:dashboard-widget="true"
:selected-klant-from-widget="klant"
@save-success="fetchTaakItems" />
Expand All @@ -220,7 +220,7 @@ import ChatOutline from 'vue-material-design-icons/ChatOutline.vue'
import AccountOutline from 'vue-material-design-icons/AccountOutline.vue'
import Eye from 'vue-material-design-icons/Eye.vue'
import DotsHorizontal from 'vue-material-design-icons/DotsHorizontal.vue'
import WidgetTaakForm from '../../modals/taken/WidgetTaakForm.vue'
import EditTaak from '../../modals/taken/EditTaak.vue'
import WidgetZaakForm from '../../modals/zaken/WidgetZaakForm.vue'
export default {
Expand All @@ -240,7 +240,7 @@ export default {
AccountOutline,
Eye,
DotsHorizontal,
WidgetTaakForm,
EditTaakForm: EditTaak,
WidgetZaakForm,
},
props: {
Expand Down
13 changes: 12 additions & 1 deletion src/modals/medewerkers/EditMedewerker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import { medewerkerStore, navigationStore } from '../../store/store.js'
<NcTextField :disabled="loading"
label="Email adres"
maxlength="255"
:value.sync="medewerkerItem.emailadres" />
:value.sync="medewerkerItem.email" />
</div>

<template #actions>
Expand Down Expand Up @@ -119,6 +119,17 @@ export default {
return this.medewerkerItems
},
},
mounted() {
if (medewerkerStore.medewerkerItem?.id) {
this.medewerkerItem = {
...medewerkerStore.medewerkerItem,
voornaam: medewerkerStore.medewerkerItem.voornaam || '',
tussenvoegsel: medewerkerStore.medewerkerItem.tussenvoegsel || '',
achternaam: medewerkerStore.medewerkerItem.achternaam || '',
email: medewerkerStore.medewerkerItem.email || '',
}
}
},
updated() {
if (navigationStore.modal === 'editMedewerker' && !this.hasUpdated) {
Expand Down
Loading

0 comments on commit 1617fa7

Please sign in to comment.