Skip to content

Commit

Permalink
Update website fe
Browse files Browse the repository at this point in the history
  • Loading branch information
vhande committed May 22, 2024
1 parent 83b0e97 commit 5309521
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
17 changes: 17 additions & 0 deletions resources/ts/Components/Integrations/Detail/BasicInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,20 @@ import { Heading } from "../../Heading";
type Props = {
name: string;
description: string;
website: string;
errors: Record<string, string | undefined>;
onChangeName: (val: string) => void;
onChangeDescription: (val: string) => void;
onChangeWebsite: (val: string) => void;
};
export const BasicInfo = ({
name,
description,
website,
errors,
onChangeName,
onChangeDescription,
onChangeWebsite,
}: Props) => {
const { t } = useTranslation();

Expand Down Expand Up @@ -55,6 +59,19 @@ export const BasicInfo = ({
/>
}
/>
<FormElement
label={`${t("details.basic_info.website")}`}
error={errors["website"]}
component={
<Input
type="text"
name="website"
value={website}
onChange={(e) => onChangeWebsite(e.target.value)}
className="md:min-w-[40rem]"
/>
}
/>
</div>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ export const IntegrationSettings = ({
name,
type,
description,
website,
urls,
keyVisibility,
onChangeIsFormDirty,
Expand All @@ -113,6 +114,7 @@ export const IntegrationSettings = ({
const basicInfoForm = useBasicInfoForm({
integrationName: name,
description,
website,
});

const urlsForm = useUrlsForm({
Expand Down Expand Up @@ -192,7 +194,7 @@ export const IntegrationSettings = ({
resolve(undefined);
basicInfoForm.setDefaults();
},
only: ["name", "description", "errors"],
only: ["name", "description", "website", "errors"],
});
});
};
Expand Down Expand Up @@ -242,10 +244,12 @@ export const IntegrationSettings = ({
<BasicInfo
name={basicInfoForm.data.integrationName}
description={basicInfoForm.data.description}
website={basicInfoForm.data.website}
onChangeName={(name) => basicInfoForm.setData("integrationName", name)}
onChangeDescription={(description) =>
basicInfoForm.setData("description", description)
}
onChangeWebsite={(website) => basicInfoForm.setData("website", website)}
errors={basicInfoForm.errors}
/>

Expand Down

0 comments on commit 5309521

Please sign in to comment.