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