feat: group activities into boards with their own stages, like sales pipelines

Existing stages and activities move into a default board per environment; new activities pick a board in the form.
This commit is contained in:
2026-10-20 17:23:27 +03:30
parent 9127fa334b
commit e6aa4c64f0
11 changed files with 769 additions and 58 deletions
@@ -380,7 +380,7 @@ async function onAddStage(name: string) {
if (stageBusy.value) return;
stageBusy.value = true;
try {
await api.post('/activities/stages', { name, kind: 'open' });
await api.post('/activities/stages', { name, kind: 'open', boardId: props.params.boardId });
emit('stagesChanged');
} catch (e) {
emit('error', apiMessage(e, 'افزودن ستون ناموفق بود.'));
@@ -20,6 +20,9 @@ import UiIcon from '@/components/UiIcon.vue';
const props = defineProps<{
open: boolean;
stages: ActivityStageDto[];
/** ستون‌های جدید در همین گروه ساخته می‌شوند */
boardId?: string;
boardName?: string;
}>();
const emit = defineEmits<{
@@ -34,7 +37,7 @@ type Draft = { name: string; color: ActivityStageColor; kind: ActivityStatus };
const drafts = ref<Record<string, Draft>>({});
const busyId = ref('');
const error = ref('');
const createForm = reactive<Required<CreateActivityStageRequest>>({
const createForm = reactive<Required<Omit<CreateActivityStageRequest, 'boardId'>>>({
name: '',
color: 'blue',
kind: 'open',
@@ -140,7 +143,11 @@ async function create() {
busyId.value = 'create';
error.value = '';
try {
await api.post('/activities/stages', { ...createForm, name: createForm.name.trim() });
await api.post('/activities/stages', {
...createForm,
name: createForm.name.trim(),
boardId: props.boardId,
});
createForm.name = '';
emit('changed');
} catch (e) {
@@ -152,7 +159,11 @@ async function create() {
</script>
<template>
<UiModal :open="open" title="مدیریت ستون‌ها و تب‌های فعالیت" @close="emit('close')">
<UiModal
:open="open"
:title="boardName ? `مدیریت ستون‌های گروه «${boardName}»` : 'مدیریت ستون‌ها و تب‌های فعالیت'"
@close="emit('close')"
>
<div class="manager">
<p class="hint">
هر ستون یک «نوع» دارد: فعالیتی که به ستون <b>انجام‌شده</b> کشیده شود خودکار انجام‌شده ثبت