🐛 Fix form validation and missing integration types

This commit is contained in:
Manuel Ruwe
2022-12-30 17:13:54 +01:00
parent c8d35f4aad
commit f7d3489938
3 changed files with 25 additions and 5 deletions

View File

@@ -21,7 +21,6 @@ export const GeneralTab = ({ form, openTab }: GeneralTabProps) => {
placeholder="My example app" placeholder="My example app"
variant="default" variant="default"
withAsterisk withAsterisk
required
{...form.getInputProps('name')} {...form.getInputProps('name')}
/> />
<TextInput <TextInput
@@ -31,7 +30,6 @@ export const GeneralTab = ({ form, openTab }: GeneralTabProps) => {
placeholder="https://google.com" placeholder="https://google.com"
variant="default" variant="default"
withAsterisk withAsterisk
required
{...form.getInputProps('url')} {...form.getInputProps('url')}
onChange={(e) => { onChange={(e) => {
form.setFieldValue('behaviour.externalUrl', e.target.value); form.setFieldValue('behaviour.externalUrl', e.target.value);
@@ -44,7 +42,6 @@ export const GeneralTab = ({ form, openTab }: GeneralTabProps) => {
description={t('general.externalAddress.description')} description={t('general.externalAddress.description')}
placeholder="https://homarr.mywebsite.com/" placeholder="https://homarr.mywebsite.com/"
variant="default" variant="default"
required
{...form.getInputProps('behaviour.externalUrl')} {...form.getInputProps('behaviour.externalUrl')}
/> />
</Tabs.Panel> </Tabs.Panel>

View File

@@ -56,7 +56,11 @@ export const GenericSecretInput = ({
{t('integration.secrets.clear')} {t('integration.secrets.clear')}
</Button> </Button>
{displayUpdateField === true ? ( {displayUpdateField === true ? (
<PasswordInput placeholder="new secret" width={200} {...props} /> <PasswordInput
placeholder="new secret"
styles={{ root: { width: 200 } }}
{...props}
/>
) : ( ) : (
<Button onClick={() => setDisplayUpdateField(true)} variant="light"> <Button onClick={() => setDisplayUpdateField(true)} variant="light">
{t('integration.secrets.update')} {t('integration.secrets.update')}

View File

@@ -19,7 +19,6 @@ interface IntegrationSelectorProps {
export const IntegrationSelector = ({ form }: IntegrationSelectorProps) => { export const IntegrationSelector = ({ form }: IntegrationSelectorProps) => {
const { t } = useTranslation('layout/modals/add-app'); const { t } = useTranslation('layout/modals/add-app');
// TODO: read this out from integrations dynamically.
const data: SelectItem[] = [ const data: SelectItem[] = [
{ {
value: 'sabnzbd', value: 'sabnzbd',
@@ -51,6 +50,26 @@ export const IntegrationSelector = ({ form }: IntegrationSelectorProps) => {
image: 'https://cdn.jsdelivr.net/gh/walkxhub/dashboard-icons/png/overseerr.png', image: 'https://cdn.jsdelivr.net/gh/walkxhub/dashboard-icons/png/overseerr.png',
label: 'Overseerr', label: 'Overseerr',
}, },
{
value: 'sonarr',
image: 'https://cdn.jsdelivr.net/gh/walkxhub/dashboard-icons/png/sonarr.png',
label: 'Sonarr',
},
{
value: 'radarr',
image: 'https://cdn.jsdelivr.net/gh/walkxhub/dashboard-icons/png/radarr.png',
label: 'Radarr',
},
{
value: 'lidarr',
image: 'https://cdn.jsdelivr.net/gh/walkxhub/dashboard-icons/png/lidarr.png',
label: 'Lidarr',
},
{
value: 'readarr',
image: 'https://cdn.jsdelivr.net/gh/walkxhub/dashboard-icons/png/readarr.png',
label: 'Readarr',
},
].filter((x) => Object.keys(integrationFieldProperties).includes(x.value)); ].filter((x) => Object.keys(integrationFieldProperties).includes(x.value));
const getNewProperties = (value: string | null): AppIntegrationPropertyType[] => { const getNewProperties = (value: string | null): AppIntegrationPropertyType[] => {