feat(web): pipeline merge wizard
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -5,6 +5,7 @@ import { api } from '@/lib/api';
|
||||
import { toFaDigits } from '@/lib/jalali';
|
||||
import { UiButton, UiCard, UiEmptyState, UiField, UiInput, UiModal, UiPageHeader } from '@/components/ui';
|
||||
import UiIcon from '@/components/UiIcon.vue';
|
||||
import PipelineMergeWizard from '@/components/pipeline/PipelineMergeWizard.vue';
|
||||
import type { PipelineDto } from '@mento/shared';
|
||||
|
||||
type PipelineListItem = PipelineDto & {
|
||||
@@ -21,9 +22,6 @@ const mergeOpen = ref(false);
|
||||
const mergeSourceId = ref<string | null>(null);
|
||||
|
||||
const canMerge = computed(() => pipelines.value.length >= 2);
|
||||
const mergeSource = computed(() =>
|
||||
pipelines.value.find((pipeline) => pipeline.id === mergeSourceId.value) ?? null,
|
||||
);
|
||||
|
||||
function apiError(e: unknown, fallback: string) {
|
||||
if (axios.isAxiosError(e)) {
|
||||
@@ -77,6 +75,13 @@ function openMerge(pipeline: PipelineListItem) {
|
||||
|
||||
function closeMerge() {
|
||||
mergeOpen.value = false;
|
||||
mergeSourceId.value = null;
|
||||
}
|
||||
|
||||
async function onMergeDone() {
|
||||
okMsg.value = 'کاریز با موفقیت ادغام شد.';
|
||||
await load();
|
||||
closeMerge();
|
||||
}
|
||||
|
||||
onMounted(load);
|
||||
@@ -149,16 +154,13 @@ onMounted(load);
|
||||
/>
|
||||
|
||||
<UiModal :open="mergeOpen" title="ادغام کاریز" @close="closeMerge">
|
||||
<!-- TODO(Task 4): mount PipelineMergeWizard here with mergeSourceId and close events. -->
|
||||
<p class="modal-copy">
|
||||
ویزارد ادغام در مرحله بعد اضافه میشود.
|
||||
</p>
|
||||
<p v-if="mergeSource" class="muted">
|
||||
کاریز مبدا: {{ mergeSource.name }}
|
||||
</p>
|
||||
<template #footer>
|
||||
<UiButton variant="ghost" @click="closeMerge">بستن</UiButton>
|
||||
</template>
|
||||
<PipelineMergeWizard
|
||||
:open="mergeOpen"
|
||||
:source-id="mergeSourceId"
|
||||
:pipelines="pipelines"
|
||||
@close="closeMerge"
|
||||
@done="onMergeDone"
|
||||
/>
|
||||
</UiModal>
|
||||
</section>
|
||||
</template>
|
||||
@@ -241,10 +243,6 @@ onMounted(load);
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
|
||||
.modal-copy {
|
||||
margin: 0 0 0.5rem;
|
||||
}
|
||||
|
||||
.ok {
|
||||
color: #0f766e;
|
||||
margin: 0;
|
||||
|
||||
Reference in New Issue
Block a user