mirror of
https://github.com/Unleash/unleash.git
synced 2025-10-27 11:02:16 +01:00
fix: use source milestone
This commit is contained in:
parent
dc5d7a89b3
commit
2330ae9532
@ -54,12 +54,7 @@ const getMilestonesWithAutomation = (
|
|||||||
change.action === 'createMilestoneProgression' ||
|
change.action === 'createMilestoneProgression' ||
|
||||||
change.action === 'updateMilestoneProgression',
|
change.action === 'updateMilestoneProgression',
|
||||||
)
|
)
|
||||||
.map((change) =>
|
.map((change) => change.payload.sourceMilestone)
|
||||||
change.action === 'createMilestoneProgression'
|
|
||||||
? change.payload.sourceMilestone
|
|
||||||
: change.payload.sourceMilestoneId ||
|
|
||||||
change.payload.sourceMilestone,
|
|
||||||
)
|
|
||||||
.filter((id): id is string => Boolean(id)),
|
.filter((id): id is string => Boolean(id)),
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@ -70,11 +65,7 @@ const getMilestonesWithDeletedAutomation = (
|
|||||||
return new Set(
|
return new Set(
|
||||||
progressionChanges
|
progressionChanges
|
||||||
.filter((change) => change.action === 'deleteMilestoneProgression')
|
.filter((change) => change.action === 'deleteMilestoneProgression')
|
||||||
.map(
|
.map((change) => change.payload.sourceMilestone)
|
||||||
(change) =>
|
|
||||||
change.payload.sourceMilestoneId ||
|
|
||||||
change.payload.sourceMilestone,
|
|
||||||
)
|
|
||||||
.filter((id): id is string => Boolean(id)),
|
.filter((id): id is string => Boolean(id)),
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@ -84,11 +75,7 @@ const getChangeDescriptions = (
|
|||||||
basePlan: IReleasePlan,
|
basePlan: IReleasePlan,
|
||||||
): string[] => {
|
): string[] => {
|
||||||
return progressionChanges.map((change) => {
|
return progressionChanges.map((change) => {
|
||||||
const sourceId =
|
const sourceId = change.payload.sourceMilestone;
|
||||||
change.action === 'createMilestoneProgression'
|
|
||||||
? change.payload.sourceMilestone
|
|
||||||
: change.payload.sourceMilestoneId ||
|
|
||||||
change.payload.sourceMilestone;
|
|
||||||
const sourceName =
|
const sourceName =
|
||||||
basePlan.milestones.find((milestone) => milestone.id === sourceId)
|
basePlan.milestones.find((milestone) => milestone.id === sourceId)
|
||||||
?.name || sourceId;
|
?.name || sourceId;
|
||||||
|
|||||||
@ -51,10 +51,7 @@ export const ProgressionChange: FC<ProgressionChangeProps> = ({
|
|||||||
if (!basePlan) return null;
|
if (!basePlan) return null;
|
||||||
|
|
||||||
const isCreate = change.action === 'createMilestoneProgression';
|
const isCreate = change.action === 'createMilestoneProgression';
|
||||||
|
const sourceId = change.payload.sourceMilestone;
|
||||||
const sourceId = isCreate
|
|
||||||
? change.payload.sourceMilestone
|
|
||||||
: change.payload.sourceMilestoneId || change.payload.sourceMilestone;
|
|
||||||
|
|
||||||
if (!sourceId) return null;
|
if (!sourceId) return null;
|
||||||
|
|
||||||
|
|||||||
@ -25,14 +25,12 @@ export const applyProgressionChanges = (
|
|||||||
const updateChange = progressionChanges.find(
|
const updateChange = progressionChanges.find(
|
||||||
(change): change is IChangeRequestUpdateMilestoneProgression =>
|
(change): change is IChangeRequestUpdateMilestoneProgression =>
|
||||||
change.action === 'updateMilestoneProgression' &&
|
change.action === 'updateMilestoneProgression' &&
|
||||||
(change.payload.sourceMilestoneId === milestone.id ||
|
change.payload.sourceMilestone === milestone.id,
|
||||||
change.payload.sourceMilestone === milestone.id),
|
|
||||||
);
|
);
|
||||||
const deleteChange = progressionChanges.find(
|
const deleteChange = progressionChanges.find(
|
||||||
(change): change is IChangeRequestDeleteMilestoneProgression =>
|
(change): change is IChangeRequestDeleteMilestoneProgression =>
|
||||||
change.action === 'deleteMilestoneProgression' &&
|
change.action === 'deleteMilestoneProgression' &&
|
||||||
(change.payload.sourceMilestoneId === milestone.id ||
|
change.payload.sourceMilestone === milestone.id,
|
||||||
change.payload.sourceMilestone === milestone.id),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
if (deleteChange) {
|
if (deleteChange) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user