1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-25 00:07:47 +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, onRefetch,
onNavigate, onNavigate,
}) => { }) => {
const { discardChangeRequestEvent } = useChangeRequestApi(); const { discardChange } = useChangeRequestApi();
const { setToastData, setToastApiError } = useToast(); const { setToastData, setToastApiError } = useToast();
const onDiscard = (id: number) => async () => { const onDiscard = (id: number) => async () => {
try { try {
await discardChangeRequestEvent( await discardChange(changeRequest.project, changeRequest.id, id);
changeRequest.project,
changeRequest.id,
id
);
setToastData({ setToastData({
title: 'Change discarded from change request draft.', title: 'Change discarded from change request draft.',
type: 'success', type: 'success',

View File

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

View File

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

View File

@ -58,7 +58,7 @@ export const useChangeRequestApi = () => {
} }
}; };
const discardChangeRequestEvent = async ( const discardChange = async (
project: string, project: string,
changeRequestId: number, changeRequestId: number,
changeRequestEventId: number changeRequestEventId: number
@ -111,10 +111,10 @@ export const useChangeRequestApi = () => {
const addComment = async ( const addComment = async (
projectId: string, projectId: string,
changeSetId: string, changeRequestId: string,
text: 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, { const req = createRequest(path, {
method: 'POST', method: 'POST',
body: JSON.stringify({ text }), body: JSON.stringify({ text }),
@ -130,7 +130,7 @@ export const useChangeRequestApi = () => {
return { return {
addChangeRequest, addChangeRequest,
changeState, changeState,
discardChangeRequestEvent, discardChange,
updateChangeRequestEnvironmentConfig, updateChangeRequestEnvironmentConfig,
discardDraft, discardDraft,
addComment, addComment,