mirror of
https://github.com/Unleash/unleash.git
synced 2025-10-27 11:02:16 +01:00
fix: show draft badges for milestone progression changes (#10851)
This commit is contained in:
parent
c5ac1ef81f
commit
32a950763b
@ -51,9 +51,14 @@ const MilestoneListRendererCore = ({
|
|||||||
const hasPendingDelete = milestonesWithDeletedAutomation.has(
|
const hasPendingDelete = milestonesWithDeletedAutomation.has(
|
||||||
milestone.id,
|
milestone.id,
|
||||||
);
|
);
|
||||||
|
const hasPendingModification = milestonesWithAutomation.has(
|
||||||
|
milestone.id,
|
||||||
|
);
|
||||||
|
|
||||||
const badge = hasPendingDelete ? (
|
const badge = hasPendingDelete ? (
|
||||||
<Badge color='error'>Deleted in draft</Badge>
|
<Badge color='error'>Deleted in draft</Badge>
|
||||||
|
) : hasPendingModification ? (
|
||||||
|
<Badge color='warning'>Modified in draft</Badge>
|
||||||
) : undefined;
|
) : undefined;
|
||||||
|
|
||||||
const automationSection =
|
const automationSection =
|
||||||
|
|||||||
@ -17,6 +17,10 @@ import { useChangeRequestsEnabled } from 'hooks/useChangeRequestsEnabled';
|
|||||||
import { useChangeRequestApi } from 'hooks/api/actions/useChangeRequestApi/useChangeRequestApi';
|
import { useChangeRequestApi } from 'hooks/api/actions/useChangeRequestApi/useChangeRequestApi';
|
||||||
import { usePendingChangeRequests } from 'hooks/api/getters/usePendingChangeRequests/usePendingChangeRequests';
|
import { usePendingChangeRequests } from 'hooks/api/getters/usePendingChangeRequests/usePendingChangeRequests';
|
||||||
import { ReleasePlanChangeRequestDialog } from './ChangeRequest/ReleasePlanChangeRequestDialog.tsx';
|
import { ReleasePlanChangeRequestDialog } from './ChangeRequest/ReleasePlanChangeRequestDialog.tsx';
|
||||||
|
import type {
|
||||||
|
IChangeRequestChangeMilestoneProgression,
|
||||||
|
IChangeRequestDeleteMilestoneProgression,
|
||||||
|
} from 'component/changeRequest/changeRequest.types';
|
||||||
import { usePlausibleTracker } from 'hooks/usePlausibleTracker';
|
import { usePlausibleTracker } from 'hooks/usePlausibleTracker';
|
||||||
import { Truncator } from 'component/common/Truncator/Truncator';
|
import { Truncator } from 'component/common/Truncator/Truncator';
|
||||||
import { useUiFlag } from 'hooks/useUiFlag';
|
import { useUiFlag } from 'hooks/useUiFlag';
|
||||||
@ -134,19 +138,17 @@ export const ReleasePlan = ({
|
|||||||
);
|
);
|
||||||
if (!featureInChangeRequest) continue;
|
if (!featureInChangeRequest) continue;
|
||||||
|
|
||||||
// Look for update or delete progression changes
|
// Look for change or delete progression changes
|
||||||
const progressionChange = featureInChangeRequest.changes.find(
|
const progressionChange = featureInChangeRequest.changes.find(
|
||||||
(change: any) =>
|
(
|
||||||
(change.action === 'updateMilestoneProgression' &&
|
change,
|
||||||
(change.payload.sourceMilestoneId ===
|
): change is
|
||||||
sourceMilestoneId ||
|
| IChangeRequestChangeMilestoneProgression
|
||||||
change.payload.sourceMilestone ===
|
| IChangeRequestDeleteMilestoneProgression =>
|
||||||
sourceMilestoneId)) ||
|
(change.action === 'changeMilestoneProgression' &&
|
||||||
|
change.payload.sourceMilestone === sourceMilestoneId) ||
|
||||||
(change.action === 'deleteMilestoneProgression' &&
|
(change.action === 'deleteMilestoneProgression' &&
|
||||||
(change.payload.sourceMilestoneId ===
|
change.payload.sourceMilestone === sourceMilestoneId),
|
||||||
sourceMilestoneId ||
|
|
||||||
change.payload.sourceMilestone ===
|
|
||||||
sourceMilestoneId)),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
if (progressionChange) {
|
if (progressionChange) {
|
||||||
|
|||||||
@ -84,14 +84,14 @@ export const MilestoneAutomation = ({
|
|||||||
|
|
||||||
const hasPendingCreate =
|
const hasPendingCreate =
|
||||||
pendingProgressionChange?.action === 'createMilestoneProgression';
|
pendingProgressionChange?.action === 'createMilestoneProgression';
|
||||||
const hasPendingUpdate =
|
const hasPendingChange =
|
||||||
pendingProgressionChange?.action === 'updateMilestoneProgression';
|
pendingProgressionChange?.action === 'changeMilestoneProgression';
|
||||||
const hasPendingDelete =
|
const hasPendingDelete =
|
||||||
pendingProgressionChange?.action === 'deleteMilestoneProgression';
|
pendingProgressionChange?.action === 'deleteMilestoneProgression';
|
||||||
|
|
||||||
const badge = hasPendingDelete ? (
|
const badge = hasPendingDelete ? (
|
||||||
<Badge color='error'>Deleted in draft</Badge>
|
<Badge color='error'>Deleted in draft</Badge>
|
||||||
) : hasPendingUpdate ? (
|
) : hasPendingChange ? (
|
||||||
<Badge color='warning'>Modified in draft</Badge>
|
<Badge color='warning'>Modified in draft</Badge>
|
||||||
) : undefined;
|
) : undefined;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user