@@ -376,7 +376,14 @@ export function ProductionListConfigManager({
|
|||||||
>
|
>
|
||||||
{t("general.actions.save")}
|
{t("general.actions.save")}
|
||||||
</Button>
|
</Button>
|
||||||
<Button onClick={() => setOpen(false)}>{t("general.actions.close")}</Button>
|
<Button
|
||||||
|
onClick={() => {
|
||||||
|
setIsAddingNewProfile(false);
|
||||||
|
setOpen(false);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{t("general.actions.close")}
|
||||||
|
</Button>
|
||||||
</Space>
|
</Space>
|
||||||
</Form>
|
</Form>
|
||||||
</div>
|
</div>
|
||||||
@@ -384,55 +391,55 @@ export function ProductionListConfigManager({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Space>
|
<Space>
|
||||||
<Popover open={open} content={popMenu}>
|
<Button loading={loading} onClick={() => setOpen(true)} disabled={isAddingNewProfile || !hasUnsavedChanges}>
|
||||||
<Button loading={loading} onClick={() => setOpen(true)} disabled={!isAddingNewProfile && !hasUnsavedChanges}>
|
{t("production.actions.saveconfig")}
|
||||||
{t("production.actions.saveconfig")}
|
</Button>
|
||||||
</Button>
|
<Popover open={open} content={popMenu} placement="bottom">
|
||||||
|
<Select
|
||||||
|
style={{
|
||||||
|
minWidth: "150px"
|
||||||
|
}}
|
||||||
|
onSelect={handleSelect}
|
||||||
|
placeholder={t("production.labels.selectview")}
|
||||||
|
optionLabelProp="label"
|
||||||
|
popupMatchSelectWidth={false}
|
||||||
|
value={activeView}
|
||||||
|
>
|
||||||
|
{bodyshop.production_config
|
||||||
|
.slice()
|
||||||
|
.sort((a, b) =>
|
||||||
|
a.name === t("production.constants.main_profile")
|
||||||
|
? -1
|
||||||
|
: b.name === t("production.constants.main_profile")
|
||||||
|
? 1
|
||||||
|
: 0
|
||||||
|
) //
|
||||||
|
.map((config) => (
|
||||||
|
<Select.Option key={config.name} label={config.name}>
|
||||||
|
<div style={{ display: "flex", justifyContent: "space-between", alignItems: "center" }}>
|
||||||
|
<span style={{ flex: 1, maxWidth: "80%", marginRight: "1rem", textOverflow: "ellipsis" }}>
|
||||||
|
{config.name}
|
||||||
|
</span>
|
||||||
|
{config.name !== t("production.constants.main_profile") && (
|
||||||
|
<Popconfirm
|
||||||
|
placement="right"
|
||||||
|
title={t("general.labels.areyousure")}
|
||||||
|
onConfirm={() => handleTrash(config.name)}
|
||||||
|
>
|
||||||
|
<DeleteOutlined onClick={(e) => e.stopPropagation()} />
|
||||||
|
</Popconfirm>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</Select.Option>
|
||||||
|
))}
|
||||||
|
<Select.Option key="add_new" label={t("production.labels.addnewprofile")}>
|
||||||
|
<div style={{ display: "flex", alignItems: "center" }}>
|
||||||
|
<PlusOutlined style={{ marginRight: "0.5rem" }} />
|
||||||
|
{t("production.labels.addnewprofile")}
|
||||||
|
</div>
|
||||||
|
</Select.Option>
|
||||||
|
</Select>
|
||||||
</Popover>
|
</Popover>
|
||||||
<Select
|
|
||||||
style={{
|
|
||||||
minWidth: "150px"
|
|
||||||
}}
|
|
||||||
onSelect={handleSelect}
|
|
||||||
placeholder={t("production.labels.selectview")}
|
|
||||||
optionLabelProp="label"
|
|
||||||
popupMatchSelectWidth={false}
|
|
||||||
value={activeView} // Ensure this only changes when appropriate
|
|
||||||
>
|
|
||||||
{bodyshop.production_config
|
|
||||||
.slice()
|
|
||||||
.sort((a, b) =>
|
|
||||||
a.name === t("production.constants.main_profile")
|
|
||||||
? -1
|
|
||||||
: b.name === t("production.constants.main_profile")
|
|
||||||
? 1
|
|
||||||
: 0
|
|
||||||
) //
|
|
||||||
.map((config) => (
|
|
||||||
<Select.Option key={config.name} label={config.name}>
|
|
||||||
<div style={{ display: "flex", justifyContent: "space-between", alignItems: "center" }}>
|
|
||||||
<span style={{ flex: 1, maxWidth: "80%", marginRight: "1rem", textOverflow: "ellipsis" }}>
|
|
||||||
{config.name}
|
|
||||||
</span>
|
|
||||||
{config.name !== t("production.constants.main_profile") && (
|
|
||||||
<Popconfirm
|
|
||||||
placement="right"
|
|
||||||
title={t("general.labels.areyousure")}
|
|
||||||
onConfirm={() => handleTrash(config.name)}
|
|
||||||
>
|
|
||||||
<DeleteOutlined onClick={(e) => e.stopPropagation()} />
|
|
||||||
</Popconfirm>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</Select.Option>
|
|
||||||
))}
|
|
||||||
<Select.Option key="add_new" label={t("production.labels.addnewprofile")}>
|
|
||||||
<div style={{ display: "flex", alignItems: "center" }}>
|
|
||||||
<PlusOutlined style={{ marginRight: "0.5rem" }} />
|
|
||||||
{t("production.labels.addnewprofile")}
|
|
||||||
</div>
|
|
||||||
</Select.Option>
|
|
||||||
</Select>
|
|
||||||
</Space>
|
</Space>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user