comments / notifications : improve abstraction
This commit is contained in:
parent
f467012241
commit
32c026acfe
11 changed files with 92 additions and 65 deletions
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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=""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue