comment out versions on code editor

remove configuration from install modal
This commit is contained in:
Davor 2022-08-05 19:57:07 +02:00
parent 198e926b4e
commit 94bd90486c
9 changed files with 84 additions and 104 deletions

View file

@ -1,9 +1,9 @@
import React, { useEffect, useState } from 'react';
import { useForm } from 'react-hook-form';
import _ from 'lodash';
import { AppForm, useApps } from 'src/services/apps';
import { Modal, Tabs } from 'src/components';
import { CodeEditor, Input } from 'src/components/Form';
import { App, useApps } from 'src/services/apps';
import { Modal } from 'src/components';
import { Input } from 'src/components/Form';
import { appAccessList } from 'src/components/UserModal/consts';
import { AppInstallModalProps } from './types';
import { initialAppForm, initialCode } from './consts';
@ -12,7 +12,7 @@ export const AppInstallModal = ({ open, onClose, appSlug }: AppInstallModalProps
const [appName, setAppName] = useState('');
const { app, appLoading, installApp, loadApp, clearSelectedApp } = useApps();
const { control, reset, handleSubmit } = useForm<AppForm>({
const { control, reset, handleSubmit } = useForm<App>({
defaultValues: initialAppForm,
});
@ -62,36 +62,6 @@ export const AppInstallModal = ({ open, onClose, appSlug }: AppInstallModalProps
}
};
const renderSubdomain = () => {
return (
<div className="mt-6 grid grid-cols-1 gap-y-6 gap-x-4 sm:grid-cols-6">
<div className="sm:col-span-3">
<Input control={control} name="subdomain" label="Subdomain" onKeyPress={handleKeyPress} required={false} />
</div>
</div>
);
};
const renderConfiguration = () => {
return (
<div>
<div className="bg-gray-100 overflow-hidden rounded-lg">
<div className="px-4 h-16 sm:px-6 bg-gray-200 flex items-center">
<span className="text-gray-600 text-lg leading-6 font-medium">App Configuration</span>
</div>
<div className="px-4 py-5 sm:p-6 overflow-x-auto">
<CodeEditor control={control} name="configuration" />
</div>
</div>
</div>
);
};
const tabs = [
{ name: 'Subdomain', component: renderSubdomain() },
{ name: 'Advanced Configuration', component: renderConfiguration() },
];
return (
<>
<Modal onClose={handleClose} open={open} onSave={handleSave} isLoading={appLoading} useCancelButton>
@ -102,8 +72,16 @@ export const AppInstallModal = ({ open, onClose, appSlug }: AppInstallModalProps
<h3 className="text-lg leading-6 font-medium text-gray-900">Install app {appName}</h3>
</div>
<div className="px-4 py-5 sm:p-6">
<Tabs tabs={tabs} />
<div className="mt-6 grid grid-cols-1 gap-y-6 gap-x-4 sm:grid-cols-6">
<div className="sm:col-span-3">
<Input
control={control}
name="subdomain"
label="Subdomain"
onKeyPress={handleKeyPress}
required={false}
/>
</div>
</div>
</div>
</div>