comments / notifications : improve abstraction

This commit is contained in:
isUnknown 2024-11-18 12:00:19 +01:00
parent f467012241
commit 32c026acfe
11 changed files with 92 additions and 65 deletions

View file

@ -5,12 +5,7 @@
<DialogWrapper v-if="dialog.content" />
<div class="kanban">
<ProjectStep
v-for="step in page.steps"
:key="step"
:step="step"
@update:dialog="updateDialog"
>
<ProjectStep v-for="step in page.steps" :key="step" :step="step">
</ProjectStep>
</div>
</main>
@ -37,10 +32,10 @@ if (route.query.dialog) {
watch(
() => route.query.dialog,
(targetStepId) => {
if (targetStepId) {
(targetStepSlug) => {
if (targetStepSlug) {
const targetStep = page.value.steps.find(
(step) => step.id === targetStepId
(step) => step.slug === targetStepSlug
);
dialog.content = targetStep;
} else {
@ -49,8 +44,10 @@ watch(
}
);
function openDialog(stepId) {
const targetStep = page.value.steps.find((step) => step.id === stepId);
function openDialog(targetStepSlug) {
const targetStep = page.value.steps.find(
(step) => step.slug === targetStepSlug
);
dialog.content = targetStep;
}
</script>

View file

@ -37,7 +37,7 @@
>
<router-link
v-if="currentTab === 'all' || !notification.isRead"
:to="notification.page.uri + '?notificationId=' + notification.id"
:to="notification.location.href"
>
<article
class="notification | bg-white rounded-lg | p-16 | flow"
@ -55,7 +55,7 @@
}}</strong
>
<span class="notification__client | text-grey-700">{{
notification.page.title
notification.location.project.title
}}</span>
<time
datetime=""