1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-04-15 01:16:22 +02:00

fix: ts issues

This commit is contained in:
Fredrik Oseberg 2022-01-24 15:17:27 +01:00
parent e5a9825871
commit 125e7de91e
6 changed files with 14 additions and 9 deletions

View File

@ -11,6 +11,8 @@ interface IInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
onChange: (e: any) => any;
onFocus?: (e: any) => any;
onBlur?: (e: any) => any;
multiline?: boolean;
rows?: number;
}
const Input = ({

View File

@ -68,7 +68,7 @@ const EditFeature = () => {
}/api/admin/projects/${projectId}/features/${featureId}' \\
--header 'Authorization: INSERT_API_KEY' \\
--header 'Content-Type: application/json' \\
--data-raw '${JSON.stringify(getTogglePayload(), undefined, 2)}'`;
--data-raw '${JSON.stringify(createPatch(), undefined, 2)}'`;
};
const handleCancel = () => {

View File

@ -29,7 +29,7 @@ export const useStyles = makeStyles(theme => ({
justifyContent: 'flex-end',
},
cancelButton: {
marginRight: '1.5rem',
marginLeft: '1.5rem',
},
inputDescription: {
marginBottom: '0.5rem',

View File

@ -130,10 +130,10 @@ const FeatureForm: React.FC<IFeatureToggleForm> = ({
</div>
<div className={styles.buttonContainer}>
{children}
<Button onClick={handleCancel} className={styles.cancelButton}>
Cancel
</Button>
{children}
</div>
</form>
);

View File

@ -134,6 +134,7 @@ const FeatureOverviewEnvironment = ({
name
)}
arrow
key={name}
>
<div
className={

View File

@ -8,9 +8,7 @@ const useFeatureApi = () => {
propagateErrors: true,
});
const validateFeatureToggleName = async (
name: string,
) => {
const validateFeatureToggleName = async (name: string) => {
const path = `api/admin/features/validate`;
const req = createRequest(path, {
method: 'POST',
@ -26,10 +24,9 @@ const useFeatureApi = () => {
}
};
const createFeatureToggle = async (
projectId: string,
featureToggle: IFeatureToggleDTO,
featureToggle: IFeatureToggleDTO
) => {
const path = `api/admin/projects/${projectId}/features`;
const req = createRequest(path, {
@ -168,6 +165,7 @@ const useFeatureApi = () => {
featureId: string,
patchPayload: any
) => {
console.log(patchPayload);
const path = `api/admin/projects/${projectId}/features/${featureId}`;
const req = createRequest(path, {
method: 'PATCH',
@ -183,7 +181,11 @@ const useFeatureApi = () => {
}
};
const patchFeatureVariants = async (projectId: string, featureId: string, patchPayload: Operation[]) => {
const patchFeatureVariants = async (
projectId: string,
featureId: string,
patchPayload: Operation[]
) => {
const path = `api/admin/projects/${projectId}/features/${featureId}/variants`;
const req = createRequest(path, {
method: 'PATCH',