fix: 创建版本时自动将创建者加入 members
确保新创建的版本 members 中包含当前用户, 否则创建后自己就看不到这个版本了。 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -373,7 +373,7 @@ export default function VersionsPage() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{showModal && <NewVersionModal overview={overview} onClose={() => setShowModal(false)} onCreate={createVersion} />}
|
{showModal && <NewVersionModal overview={overview} onClose={() => setShowModal(false)} onCreate={createVersion} currentUserName={currentUserName} />}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -547,7 +547,8 @@ type IterationType = 'major' | 'minor' | 'patch';
|
|||||||
interface NewVersionModalProps {
|
interface NewVersionModalProps {
|
||||||
overview: any[];
|
overview: any[];
|
||||||
onClose: () => void;
|
onClose: () => void;
|
||||||
onCreate: (productId: string, data: { name: string; status: VersionStatus; priority?: Priority; expectedReleaseDate?: string }) => void;
|
onCreate: (productId: string, data: { name: string; status: VersionStatus; priority?: Priority; expectedReleaseDate?: string; members?: any[] }) => void;
|
||||||
|
currentUserName: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getNextVersion(existingVersions: any[], projectName: string, type: IterationType): string {
|
function getNextVersion(existingVersions: any[], projectName: string, type: IterationType): string {
|
||||||
@@ -588,7 +589,7 @@ function getNextVersion(existingVersions: any[], projectName: string, type: Iter
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function NewVersionModal({ overview, onClose, onCreate }: NewVersionModalProps) {
|
function NewVersionModal({ overview, onClose, onCreate, currentUserName }: NewVersionModalProps) {
|
||||||
const [productId, setProductId] = useState('');
|
const [productId, setProductId] = useState('');
|
||||||
const [projectId, setProjectId] = useState('');
|
const [projectId, setProjectId] = useState('');
|
||||||
const [projectName, setProjectName] = useState('');
|
const [projectName, setProjectName] = useState('');
|
||||||
@@ -647,6 +648,7 @@ function NewVersionModal({ overview, onClose, onCreate }: NewVersionModalProps)
|
|||||||
status,
|
status,
|
||||||
priority,
|
priority,
|
||||||
...(expectedReleaseDate ? { expectedReleaseDate } : {}),
|
...(expectedReleaseDate ? { expectedReleaseDate } : {}),
|
||||||
|
members: currentUserName ? [{ role: 'product', name: currentUserName }] : [],
|
||||||
});
|
});
|
||||||
onClose();
|
onClose();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user