IO-1394 Disable delete on vendor create.
This commit is contained in:
@@ -25,6 +25,7 @@ export default function VendorsFormComponent({
|
||||
formLoading,
|
||||
handleDelete,
|
||||
responsibilityCenters,
|
||||
selectedvendor,
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
const client = useApolloClient();
|
||||
@@ -52,7 +53,12 @@ export default function VendorsFormComponent({
|
||||
>
|
||||
{t("general.actions.save")}
|
||||
</Button>
|
||||
<Button type="danger" onClick={handleDelete} loading={formLoading}>
|
||||
<Button
|
||||
type="danger"
|
||||
disabled={selectedvendor === "new"}
|
||||
onClick={handleDelete}
|
||||
loading={formLoading}
|
||||
>
|
||||
{t("general.actions.delete")}
|
||||
</Button>
|
||||
|
||||
|
||||
@@ -139,6 +139,7 @@ function VendorsFormContainer({ refetch, bodyshop }) {
|
||||
formLoading={formLoading}
|
||||
handleDelete={handleDelete}
|
||||
responsibilityCenters={bodyshop.md_responsibility_centers || null}
|
||||
selectedvendor={selectedvendor}
|
||||
/>
|
||||
) : (
|
||||
t("vendors.labels.noneselected")
|
||||
|
||||
Reference in New Issue
Block a user