1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-04-24 01:18:01 +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; onChange: (e: any) => any;
onFocus?: (e: any) => any; onFocus?: (e: any) => any;
onBlur?: (e: any) => any; onBlur?: (e: any) => any;
multiline?: boolean;
rows?: number;
} }
const Input = ({ const Input = ({

View File

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

View File

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

View File

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

View File

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

View File

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