- Address changes to profile from call
Signed-off-by: Dave Richer <dave@imexsystems.ca>
This commit is contained in:
@@ -59,11 +59,30 @@ export function ProductionListConfigManager({
|
|||||||
const defaultConfig = {
|
const defaultConfig = {
|
||||||
name: t("production.constants.main_profile"),
|
name: t("production.constants.main_profile"),
|
||||||
columns: {
|
columns: {
|
||||||
columnKeys: columns.map((i) => ({ key: i.key, width: i.width })),
|
columnKeys: [
|
||||||
|
{ key: "ro_number", width: 100 },
|
||||||
|
{ key: "ownr", width: 100 },
|
||||||
|
{ key: "vehicle", width: 100 },
|
||||||
|
{ key: "ins_co_nm", width: 100 },
|
||||||
|
{ key: "actual_in", width: 100 },
|
||||||
|
{ key: "scheduled_completion", width: 100 },
|
||||||
|
{ key: "labhrs", width: 100 },
|
||||||
|
{ key: "employee_body", width: 100 },
|
||||||
|
{ key: "larhrs", width: 100 },
|
||||||
|
{ key: "employee_refinish", width: 100 },
|
||||||
|
{ key: "tt", width: 100 },
|
||||||
|
{ key: "status", width: 100 },
|
||||||
|
{ key: "sublets", width: 100 },
|
||||||
|
{ key: "viewdetail", width: 100 }
|
||||||
|
],
|
||||||
tableState: ensureDefaultState(state)
|
tableState: ensureDefaultState(state)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Immediately update the columns and state to reflect the new default view
|
||||||
|
setColumns(defaultConfig.columns.columnKeys);
|
||||||
|
setState(defaultConfig.columns.tableState);
|
||||||
|
|
||||||
const result = await updateShop({
|
const result = await updateShop({
|
||||||
variables: {
|
variables: {
|
||||||
id: bodyshop.id,
|
id: bodyshop.id,
|
||||||
@@ -75,9 +94,7 @@ export function ProductionListConfigManager({
|
|||||||
|
|
||||||
if (!result.errors) {
|
if (!result.errors) {
|
||||||
await updateActiveProdView(t("production.constants.main_profile"));
|
await updateActiveProdView(t("production.constants.main_profile"));
|
||||||
setColumns(defaultConfig.columns.columnKeys);
|
window.location.reload(); // Reload the page
|
||||||
setState(defaultConfig.columns.tableState);
|
|
||||||
notification.success({ message: t("bodyshop.successes.defaultviewcreated") });
|
|
||||||
} else {
|
} else {
|
||||||
notification.error({
|
notification.error({
|
||||||
message: t("bodyshop.errors.creatingdefaultview", {
|
message: t("bodyshop.errors.creatingdefaultview", {
|
||||||
|
|||||||
@@ -2737,7 +2737,7 @@
|
|||||||
},
|
},
|
||||||
"production": {
|
"production": {
|
||||||
"constants":{
|
"constants":{
|
||||||
"main_profile": "Main"
|
"main_profile": "Default"
|
||||||
},
|
},
|
||||||
"options": {
|
"options": {
|
||||||
"small": "Small",
|
"small": "Small",
|
||||||
|
|||||||
Reference in New Issue
Block a user