1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-02-09 00:18:00 +01:00

feat: send the add release plan change request from dialog when submitted (#9174)

This commit is contained in:
David Leek 2025-01-30 10:56:31 +01:00 committed by GitHub
parent 07d4693f6d
commit b04079c82d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 15 additions and 1 deletions

View File

@ -188,6 +188,7 @@ export const FeatureStrategyMenu = ({
/>
</Popover>
<ReleasePlanAddChangeRequestDialog
projectId={projectId}
onClosing={() => setTemplateForChangeRequestDialog(undefined)}
featureId={featureId}
environmentId={environmentId}

View File

@ -2,12 +2,14 @@ import { Dialogue } from 'component/common/Dialogue/Dialogue';
import useToast from 'hooks/useToast';
import { styled, Button } from '@mui/material';
import type { IReleasePlanTemplate } from 'interfaces/releasePlans';
import { useChangeRequestApi } from 'hooks/api/actions/useChangeRequestApi/useChangeRequestApi';
const StyledBoldSpan = styled('span')(({ theme }) => ({
fontWeight: theme.typography.fontWeightBold,
}));
interface IReleasePlanAddChangeRequestDialogProps {
projectId: string;
featureId: string;
environmentId: string;
releaseTemplate: IReleasePlanTemplate | undefined;
@ -15,14 +17,24 @@ interface IReleasePlanAddChangeRequestDialogProps {
}
export const ReleasePlanAddChangeRequestDialog = ({
projectId,
featureId,
environmentId,
releaseTemplate,
onClosing,
}: IReleasePlanAddChangeRequestDialogProps) => {
const { setToastData } = useToast();
const { addChange } = useChangeRequestApi();
const addReleasePlanToChangeRequest = async () => {
addChange(projectId, environmentId, {
feature: featureId,
action: 'addReleasePlan',
payload: {
templateId: releaseTemplate?.id,
},
});
setToastData({
type: 'success',
text: 'Added to draft',

View File

@ -17,7 +17,8 @@ export interface IChangeSchema {
| 'archiveFeature'
| 'updateSegment'
| 'addDependency'
| 'deleteDependency';
| 'deleteDependency'
| 'addReleasePlan';
payload: string | boolean | object | number | undefined;
}