🐛 Fix some issues with change position modal

This commit is contained in:
Meierschlumpf
2022-12-19 19:55:42 +01:00
parent 25fd3a1594
commit f240d29f7e
8 changed files with 31 additions and 39 deletions

View File

@@ -55,13 +55,13 @@ export const IntegrationSelector = ({ form }: IntegrationSelectorProps) => {
const getNewProperties = (value: string | null): AppIntegrationPropertyType[] => {
if (!value) return [];
const integrationType = value as AppIntegrationType['type'];
const integrationType = value as Exclude<AppIntegrationType['type'], null>;
if (integrationType === null) {
return [];
}
const requiredProperties = Object.entries(integrationFieldDefinitions).filter(([k, v]) => {
const val = integrationFieldProperties[integrationType['type']];
const val = integrationFieldProperties[integrationType];
return val.includes(k as IntegrationField);
})!;
return requiredProperties.map(([k, value]) => ({
@@ -97,7 +97,6 @@ export const IntegrationSelector = ({ form }: IntegrationSelectorProps) => {
}
onChange={(value) => {
form.setFieldValue('integration.properties', getNewProperties(value));
console.log(`changed to value ${value}`);
inputProps.onChange(value);
}}
{...inputProps}