Describe snapshot source revisions
This commit is contained in:
@@ -49,8 +49,15 @@ export function getProjectRevisionSourceLabel(
|
||||
export function getProjectRevisionDescription(
|
||||
revision: ProjectRevisionSummaryDto
|
||||
) {
|
||||
const description = revision.description?.trim();
|
||||
if (
|
||||
description === `Undo ${revision.commandType}` ||
|
||||
description === `Redo ${revision.commandType}`
|
||||
) {
|
||||
return commandTypeLabels[revision.commandType] || revision.commandType;
|
||||
}
|
||||
return (
|
||||
revision.description?.trim() ||
|
||||
description ||
|
||||
commandTypeLabels[revision.commandType] ||
|
||||
revision.commandType
|
||||
);
|
||||
@@ -62,6 +69,26 @@ export function getProjectSnapshotKindLabel(
|
||||
return kind === "automatic" ? "Automatisch" : "Benannt";
|
||||
}
|
||||
|
||||
export function getProjectSnapshotRevisionDescription(
|
||||
snapshot: ProjectSnapshotMetadataDto
|
||||
) {
|
||||
if (snapshot.sourceRevision === 0) {
|
||||
return "Projektstart";
|
||||
}
|
||||
if (
|
||||
!snapshot.sourceRevisionMetadata ||
|
||||
snapshot.sourceRevisionMetadata.revisionNumber !==
|
||||
snapshot.sourceRevision
|
||||
) {
|
||||
return "Änderungsdetails nicht verfügbar";
|
||||
}
|
||||
return `${getProjectRevisionSourceLabel(
|
||||
snapshot.sourceRevisionMetadata.source
|
||||
)}: ${getProjectRevisionDescription(
|
||||
snapshot.sourceRevisionMetadata
|
||||
)}`;
|
||||
}
|
||||
|
||||
export function mergeProjectRevisionPages(
|
||||
current: ProjectRevisionSummaryDto[],
|
||||
next: ProjectRevisionSummaryDto[]
|
||||
|
||||
Reference in New Issue
Block a user