@@ -362,7 +362,25 @@ export function ProductionListConfigManager({
|
||||
<div>
|
||||
<Form layout="vertical" form={form} onFinish={handleSaveConfig}>
|
||||
{isAddingNewProfile && (
|
||||
<Form.Item label={t("production.labels.viewname")} name="name" rules={[{ required: true }]}>
|
||||
<Form.Item
|
||||
label={t("production.labels.viewname")}
|
||||
name="name"
|
||||
rules={[
|
||||
{ required: true, message: t("production.errors.name_required") },
|
||||
{
|
||||
validator: (_, value) => {
|
||||
if (!value) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
const nameExists = bodyshop.production_config.some((pc) => pc.name === value);
|
||||
if (nameExists) {
|
||||
return Promise.reject(new Error(t("production.errors.name_exists")));
|
||||
}
|
||||
return Promise.resolve();
|
||||
}
|
||||
}
|
||||
]}
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
)}
|
||||
@@ -376,13 +394,22 @@ export function ProductionListConfigManager({
|
||||
>
|
||||
{t("general.actions.save")}
|
||||
</Button>
|
||||
<Button
|
||||
type="default"
|
||||
onClick={() => {
|
||||
setIsAddingNewProfile(true);
|
||||
setOpen(true);
|
||||
}}
|
||||
>
|
||||
{t("general.actions.saveas")}
|
||||
</Button>
|
||||
<Button
|
||||
onClick={() => {
|
||||
setIsAddingNewProfile(false);
|
||||
setOpen(false);
|
||||
}}
|
||||
>
|
||||
{t("general.actions.close")}
|
||||
{t("general.actions.cancel")}
|
||||
</Button>
|
||||
</Space>
|
||||
</Form>
|
||||
@@ -417,7 +444,14 @@ export function ProductionListConfigManager({
|
||||
.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" }}>
|
||||
<span
|
||||
style={{
|
||||
flex: 1,
|
||||
maxWidth: "80%",
|
||||
marginRight: "1rem",
|
||||
textOverflow: "ellipsis"
|
||||
}}
|
||||
>
|
||||
{config.name}
|
||||
</span>
|
||||
{config.name !== t("production.constants.main_profile") && (
|
||||
|
||||
@@ -1165,7 +1165,8 @@
|
||||
"tryagain": "Try Again",
|
||||
"view": "View",
|
||||
"viewreleasenotes": "See What's Changed",
|
||||
"remove_alert": "Are you sure you want to dismiss the alert?"
|
||||
"remove_alert": "Are you sure you want to dismiss the alert?",
|
||||
"saveas": "Save As"
|
||||
},
|
||||
"errors": {
|
||||
"fcm": "You must allow notification permissions to have real time messaging. Click to try again.",
|
||||
@@ -2788,7 +2789,9 @@
|
||||
"errors": {
|
||||
"boardupdate": "Error encountered updating Job. {{message}}",
|
||||
"removing": "Error removing from production board. {{error}}",
|
||||
"settings": "Error saving board settings: {{error}}"
|
||||
"settings": "Error saving board settings: {{error}}",
|
||||
"name_exists": "A Profile with this name already exists. Please choose a different name.",
|
||||
"name_required": "Profile name is required."
|
||||
},
|
||||
"labels": {
|
||||
"kiosk_mode": "Kiosk Mode",
|
||||
|
||||
@@ -1165,7 +1165,8 @@
|
||||
"tryagain": "",
|
||||
"view": "",
|
||||
"viewreleasenotes": "",
|
||||
"remove_alert": ""
|
||||
"remove_alert": "",
|
||||
"saveas": ""
|
||||
},
|
||||
"errors": {
|
||||
"fcm": "",
|
||||
@@ -2788,7 +2789,9 @@
|
||||
"errors": {
|
||||
"boardupdate": "",
|
||||
"removing": "",
|
||||
"settings": ""
|
||||
"settings": "",
|
||||
"name_exists": "",
|
||||
"name_required": ""
|
||||
},
|
||||
"labels": {
|
||||
"kiosk_mode": "",
|
||||
|
||||
@@ -1165,7 +1165,8 @@
|
||||
"tryagain": "",
|
||||
"view": "",
|
||||
"viewreleasenotes": "",
|
||||
"remove_alert": ""
|
||||
"remove_alert": "",
|
||||
"saveas": ""
|
||||
},
|
||||
"errors": {
|
||||
"fcm": "",
|
||||
@@ -2788,7 +2789,9 @@
|
||||
"errors": {
|
||||
"boardupdate": "",
|
||||
"removing": "",
|
||||
"settings": ""
|
||||
"settings": "",
|
||||
"name_exists": "",
|
||||
"name_required": ""
|
||||
},
|
||||
"labels": {
|
||||
"kiosk_mode": "",
|
||||
|
||||
Reference in New Issue
Block a user