-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
244 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
<?php | ||
|
||
|
||
namespace OCA\ZaakAfhandelApp\Dashboard; | ||
|
||
use OCP\Dashboard\IWidget; | ||
use OCP\IL10N; | ||
use OCP\IURLGenerator; | ||
use OCP\Util; | ||
|
||
use OCA\ZaakAfhandelApp\AppInfo\Application; | ||
|
||
class ContactmomentenWidget implements IWidget | ||
{ | ||
|
||
public function __construct( | ||
private IL10N $l10n, | ||
private IURLGenerator $url | ||
) {} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function getId(): string | ||
{ | ||
return 'zaakAfhandelApp_contactmomenten_widget'; | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function getTitle(): string | ||
{ | ||
return $this->l10n->t('Contact momenten'); | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function getOrder(): int | ||
{ | ||
return 10; | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function getIconClass(): string | ||
{ | ||
return 'icon-zaken-widget'; | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function getUrl(): ?string | ||
{ | ||
return null; | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function load(): void | ||
{ | ||
Util::addScript(Application::APP_ID, Application::APP_ID . '-contactmomentenWidget'); | ||
Util::addStyle(Application::APP_ID, 'dashboardWidgets'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import Vue from 'vue' | ||
import ContactMomentenWidget from './views/widgets/ContactMomentenWidget.vue' | ||
|
||
OCA.Dashboard.register('zaakAfhandelApp_contactmomenten_widget', async (el, { widget }) => { | ||
Vue.mixin({ methods: { t, n } }) | ||
const View = Vue.extend(ContactMomentenWidget) | ||
new View({ | ||
propsData: { title: widget.title }, | ||
}).$mount(el) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,4 +11,4 @@ new Vue( | |
pinia, | ||
render: h => h(App), | ||
}, | ||
).$mount('#content') | ||
).$mount('#content') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
<script setup> | ||
import { berichtStore, navigationStore } from '../../store/store.js' | ||
</script> | ||
|
||
<template> | ||
<div class="contactmomentenContainer"> | ||
<div class="itemContainer"> | ||
<NcDashboardWidget :items="items" | ||
:loading="loading" | ||
@show="onShow"> | ||
<template #empty-content> | ||
<NcEmptyContent :title="t('Geen contact momenten')"> | ||
<template #icon> | ||
<ChatOutline /> | ||
</template> | ||
</NcEmptyContent> | ||
</template> | ||
</NcDashboardWidget> | ||
</div> | ||
|
||
<NcButton type="primary" @click="openModal"> | ||
<template #icon> | ||
<Plus :size="20" /> | ||
</template> | ||
Contact moment starten | ||
</NcButton> | ||
|
||
<BerichtForm v-if="isModalOpen" | ||
:dashboard-widget="true" | ||
@save-success="fetchBerichtItems" | ||
@close="closeModal" /> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
// Components | ||
import { NcDashboardWidget, NcEmptyContent, NcButton } from '@nextcloud/vue' | ||
import Plus from 'vue-material-design-icons/Plus.vue' | ||
import ChatOutline from 'vue-material-design-icons/ChatOutline.vue' | ||
import BerichtForm from '../../modals/berichten/EditBericht.vue' | ||
export default { | ||
name: 'ContactMomentenWidget', | ||
components: { | ||
NcDashboardWidget, | ||
NcEmptyContent, | ||
NcButton, | ||
Plus, | ||
}, | ||
data() { | ||
return { | ||
loading: false, | ||
isModalOpen: false, | ||
berichtItems: [], | ||
} | ||
}, | ||
computed: { | ||
items() { | ||
return this.berichtItems | ||
}, | ||
}, | ||
mounted() { | ||
this.fetchBerichtItems() | ||
}, | ||
methods: { | ||
fetchBerichtItems() { | ||
this.loading = true | ||
berichtStore.refreshBerichtenList() | ||
.then(() => { | ||
this.berichtItems = berichtStore.berichtenList.map(bericht => ({ | ||
id: bericht.id, | ||
mainText: bericht.title, | ||
subText: bericht.aanmaakDatum, | ||
avatarUrl: '/apps-extra/zaakafhandelapp/img/chat-outline.svg', | ||
})) | ||
this.loading = false | ||
}) | ||
}, | ||
openModal() { | ||
this.isModalOpen = true | ||
berichtStore.setBerichtItem(null) | ||
navigationStore.setModal('editBericht') | ||
}, | ||
closeModal() { | ||
this.isModalOpen = false | ||
navigationStore.setModal(null) | ||
}, | ||
onShow() { | ||
window.open('/apps/opencatalogi/catalogi', '_self') | ||
}, | ||
}, | ||
} | ||
</script> | ||
<style> | ||
.contactmomentenContainer{ | ||
display: flex; | ||
justify-content: space-between; | ||
flex-direction: column; | ||
height: 100%; | ||
} | ||
.itemContainer{ | ||
overflow: auto; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters