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

uniquitous language cleanup (#2564)

This commit is contained in:
Mateusz Kwasniewski 2022-11-30 08:55:40 +01:00 committed by GitHub
parent 0d58371f11
commit 6ae2c9a165
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 14 deletions

View File

@ -147,15 +147,11 @@ export const ChangeRequest: VFC<IChangeRequestProps> = ({
onRefetch,
onNavigate,
}) => {
const { discardChangeRequestEvent } = useChangeRequestApi();
const { discardChange } = useChangeRequestApi();
const { setToastData, setToastApiError } = useToast();
const onDiscard = (id: number) => async () => {
try {
await discardChangeRequestEvent(
changeRequest.project,
changeRequest.id,
id
);
await discardChange(changeRequest.project, changeRequest.id, id);
setToastData({
title: 'Change discarded from change request draft.',
type: 'success',

View File

@ -25,7 +25,7 @@ export interface IChangeRequestEnvironmentConfig {
export interface IChangeRequestFeature {
name: string;
conflict?: string;
changes: IChangeRequestEvent[];
changes: IChange[];
}
export interface IChangeRequestApproval {
@ -82,7 +82,7 @@ export interface IChangeRequestEnabled extends IChangeRequestBase {
payload: ChangeRequestEnabled;
}
export type IChangeRequestEvent =
export type IChange =
| IChangeRequestAddStrategy
| IChangeRequestDeleteStrategy
| IChangeRequestUpdateStrategy

View File

@ -7,7 +7,7 @@ import { IFeatureStrategy } from 'interfaces/strategy';
import { StrategyItem } from './StrategyItem/StrategyItem';
import { useRequiredPathParam } from 'hooks/useRequiredPathParam';
import { Badge } from 'component/common/Badge/Badge';
import { IChangeRequestEvent } from 'component/changeRequest/changeRequest.types';
import { IChange } from 'component/changeRequest/changeRequest.types';
import { useStrategyChangeFromRequest } from './StrategyItem/useStrategyChangeFromRequest';
interface IStrategyDraggableItemProps {
@ -74,7 +74,7 @@ export const StrategyDraggableItem = ({
const ChangeRequestStatusBadge = ({
change,
}: {
change: IChangeRequestEvent | undefined;
change: IChange | undefined;
}) => {
const theme = useTheme();
const isSmallScreen = useMediaQuery(theme.breakpoints.down('sm'));

View File

@ -58,7 +58,7 @@ export const useChangeRequestApi = () => {
}
};
const discardChangeRequestEvent = async (
const discardChange = async (
project: string,
changeRequestId: number,
changeRequestEventId: number
@ -111,10 +111,10 @@ export const useChangeRequestApi = () => {
const addComment = async (
projectId: string,
changeSetId: string,
changeRequestId: string,
text: string
) => {
const path = `/api/admin/projects/${projectId}/change-requests/${changeSetId}/comments`;
const path = `/api/admin/projects/${projectId}/change-requests/${changeRequestId}/comments`;
const req = createRequest(path, {
method: 'POST',
body: JSON.stringify({ text }),
@ -130,7 +130,7 @@ export const useChangeRequestApi = () => {
return {
addChangeRequest,
changeState,
discardChangeRequestEvent,
discardChange,
updateChangeRequestEnvironmentConfig,
discardDraft,
addComment,