Skip to content

Commit

Permalink
Merge pull request #113 from ConductionNL/feature/PC108-108/multiple-…
Browse files Browse the repository at this point in the history
…contactmomenten

Added tooltip
  • Loading branch information
remko48 authored Dec 18, 2024
2 parents 695119c + 4a05f81 commit f67e5ee
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/contactmomentenWidget.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import Vue from 'vue'
import ContactMomentenWidget from './views/widgets/ContactMomentenWidget.vue'
import Tooltip from '@nextcloud/vue/dist/Directives/Tooltip.js'

OCA.Dashboard.register('zaakAfhandelApp_contactmomenten_widget', async (el, { widget }) => {
Vue.mixin({ methods: { t, n } })

Vue.directive('tooltip', Tooltip)

const View = Vue.extend(ContactMomentenWidget)
new View({
propsData: { title: widget.title },
Expand Down
4 changes: 4 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@ import Vue from 'vue'
import { PiniaVuePlugin } from 'pinia'
import pinia from './pinia.js'
import App from './App.vue'
import Tooltip from '@nextcloud/vue/dist/Directives/Tooltip.js'

Vue.mixin({ methods: { t, n } })

Vue.use(PiniaVuePlugin)

Vue.directive('tooltip', Tooltip)

new Vue(
{
pinia,
Expand Down
22 changes: 20 additions & 2 deletions src/modals/contactMomenten/ContactMomentenForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -477,19 +477,27 @@ import { contactMomentStore, navigationStore, taakStore, zaakStore } from '../..
<template #icon>
<DotsHorizontal :size="20" />
</template>
<NcActionButton v-if="!isView" @click="openTaakForm('medewerker')">
<NcActionButton v-if="!isView" :close-after-click="true" @click="openTaakForm('medewerker')">
<template #icon>
<CalendarMonthOutline :size="20" />
</template>
Medewerker taak aanmaken
</NcActionButton>
<NcActionButton v-if="!isView" @click="openTaakForm('klant')">
<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 }"
:close-after-click="true"
:disabled="!contactMomenten[selectedContactMoment].klant?.id"
@click="openTaakForm('klant')">
<template #icon>
<CalendarMonthOutline :size="20" />
</template>
Klant taak aanmaken
</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 }"
:close-after-click="true"
:disabled="!contactMomenten[selectedContactMoment].klant?.id"
@click="openZaakForm()">
<template #icon>
Expand Down Expand Up @@ -1055,6 +1063,11 @@ export default {
div[class='modal-container']:has(.ContactMomentenForm) {
width: clamp(1000px, 100%, 1200px) !important;
}
.actionButtonDisabled > button > span {
cursor: default !important;
}
</style>
<style scoped>
Expand Down Expand Up @@ -1115,4 +1128,9 @@ div[class='modal-container']:has(.ContactMomentenForm) {
.statusContainer {
align-items: center;
}
.actionButtonDisabled {
pointer-events: all !important;
}
</style>

0 comments on commit f67e5ee

Please sign in to comment.