url duplication cleanup
parent
c33e52102e
commit
3fd07bea6f
|
|
@ -15,8 +15,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
if (responseJSON.success) {
|
if (responseJSON.success) {
|
||||||
los.clearUnsavedChanges();
|
los.clearUnsavedChanges();
|
||||||
if (isCreate || refreshAfterSave) {
|
if (isCreate || refreshAfterSave) {
|
||||||
window.location.href =
|
window.location.href = los.getLotURL(responseJSON.lotId, true, true);
|
||||||
los.urlPrefix + "/lots/" + responseJSON.lotId + "/edit?t=" + Date.now();
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
bulmaJS.alert({
|
bulmaJS.alert({
|
||||||
|
|
@ -48,7 +47,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
}, (responseJSON) => {
|
}, (responseJSON) => {
|
||||||
if (responseJSON.success) {
|
if (responseJSON.success) {
|
||||||
cityssm.disableNavBlocker();
|
cityssm.disableNavBlocker();
|
||||||
window.location.href = los.urlPrefix + "/lots/?t=" + Date.now();
|
window.location.href = los.getLotURL();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
bulmaJS.alert({
|
bulmaJS.alert({
|
||||||
|
|
|
||||||
|
|
@ -33,8 +33,7 @@ declare const bulmaJS: BulmaJS;
|
||||||
los.clearUnsavedChanges();
|
los.clearUnsavedChanges();
|
||||||
|
|
||||||
if (isCreate || refreshAfterSave) {
|
if (isCreate || refreshAfterSave) {
|
||||||
window.location.href =
|
window.location.href = los.getLotURL(responseJSON.lotId, true, true);
|
||||||
los.urlPrefix + "/lots/" + responseJSON.lotId + "/edit?t=" + Date.now();
|
|
||||||
} else {
|
} else {
|
||||||
bulmaJS.alert({
|
bulmaJS.alert({
|
||||||
message: exports.aliases.lot + " Updated Successfully",
|
message: exports.aliases.lot + " Updated Successfully",
|
||||||
|
|
@ -74,7 +73,7 @@ declare const bulmaJS: BulmaJS;
|
||||||
(responseJSON: { success: boolean; errorMessage?: string }) => {
|
(responseJSON: { success: boolean; errorMessage?: string }) => {
|
||||||
if (responseJSON.success) {
|
if (responseJSON.success) {
|
||||||
cityssm.disableNavBlocker();
|
cityssm.disableNavBlocker();
|
||||||
window.location.href = los.urlPrefix + "/lots/?t=" + Date.now();
|
window.location.href = los.getLotURL();
|
||||||
} else {
|
} else {
|
||||||
bulmaJS.alert({
|
bulmaJS.alert({
|
||||||
title: `Error Deleting ${los.escapedAliases.Lot}`,
|
title: `Error Deleting ${los.escapedAliases.Lot}`,
|
||||||
|
|
|
||||||
|
|
@ -18,16 +18,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
if (responseJSON.success) {
|
if (responseJSON.success) {
|
||||||
los.clearUnsavedChanges();
|
los.clearUnsavedChanges();
|
||||||
if (isCreate || refreshAfterSave) {
|
if (isCreate || refreshAfterSave) {
|
||||||
window.location.href =
|
window.location.href = los.getLotOccupancyURL(responseJSON.lotOccupancyId, true, true);
|
||||||
los.urlPrefix +
|
|
||||||
"/lotOccupancies/" +
|
|
||||||
responseJSON.lotOccupancyId +
|
|
||||||
"/edit?t=" +
|
|
||||||
Date.now();
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
bulmaJS.alert({
|
bulmaJS.alert({
|
||||||
message: exports.aliases.occupancy + " Updated Successfully",
|
message: `${los.escapedAliases.Occupancy} Updated Successfully`,
|
||||||
contextualColorName: "success"
|
contextualColorName: "success"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -49,14 +44,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
cityssm.postJSON(los.urlPrefix + "/lotOccupancies/doCopyLotOccupancy", {
|
cityssm.postJSON(los.urlPrefix + "/lotOccupancies/doCopyLotOccupancy", {
|
||||||
lotOccupancyId
|
lotOccupancyId
|
||||||
}, (responseJSON) => {
|
}, (responseJSON) => {
|
||||||
var _a;
|
|
||||||
if (responseJSON.success) {
|
if (responseJSON.success) {
|
||||||
cityssm.disableNavBlocker();
|
cityssm.disableNavBlocker();
|
||||||
window.location.href =
|
window.location.href = los.getLotOccupancyURL(responseJSON.lotOccupancyId, true);
|
||||||
los.urlPrefix +
|
|
||||||
"/lotOccupancies/" +
|
|
||||||
((_a = responseJSON.lotOccupancyId) === null || _a === void 0 ? void 0 : _a.toString()) +
|
|
||||||
"/edit";
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
bulmaJS.alert({
|
bulmaJS.alert({
|
||||||
|
|
@ -96,7 +86,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
}, (responseJSON) => {
|
}, (responseJSON) => {
|
||||||
if (responseJSON.success) {
|
if (responseJSON.success) {
|
||||||
cityssm.disableNavBlocker();
|
cityssm.disableNavBlocker();
|
||||||
window.location.href = los.urlPrefix + "/lotOccupancies?t=" + Date.now();
|
window.location.href = los.getLotOccupancyURL();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
bulmaJS.alert({
|
bulmaJS.alert({
|
||||||
|
|
|
||||||
|
|
@ -18,16 +18,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
if (responseJSON.success) {
|
if (responseJSON.success) {
|
||||||
los.clearUnsavedChanges();
|
los.clearUnsavedChanges();
|
||||||
if (isCreate || refreshAfterSave) {
|
if (isCreate || refreshAfterSave) {
|
||||||
window.location.href =
|
window.location.href = los.getLotOccupancyURL(responseJSON.lotOccupancyId, true, true);
|
||||||
los.urlPrefix +
|
|
||||||
"/lotOccupancies/" +
|
|
||||||
responseJSON.lotOccupancyId +
|
|
||||||
"/edit?t=" +
|
|
||||||
Date.now();
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
bulmaJS.alert({
|
bulmaJS.alert({
|
||||||
message: exports.aliases.occupancy + " Updated Successfully",
|
message: `${los.escapedAliases.Occupancy} Updated Successfully`,
|
||||||
contextualColorName: "success"
|
contextualColorName: "success"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -49,14 +44,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
cityssm.postJSON(los.urlPrefix + "/lotOccupancies/doCopyLotOccupancy", {
|
cityssm.postJSON(los.urlPrefix + "/lotOccupancies/doCopyLotOccupancy", {
|
||||||
lotOccupancyId
|
lotOccupancyId
|
||||||
}, (responseJSON) => {
|
}, (responseJSON) => {
|
||||||
var _a;
|
|
||||||
if (responseJSON.success) {
|
if (responseJSON.success) {
|
||||||
cityssm.disableNavBlocker();
|
cityssm.disableNavBlocker();
|
||||||
window.location.href =
|
window.location.href = los.getLotOccupancyURL(responseJSON.lotOccupancyId, true);
|
||||||
los.urlPrefix +
|
|
||||||
"/lotOccupancies/" +
|
|
||||||
((_a = responseJSON.lotOccupancyId) === null || _a === void 0 ? void 0 : _a.toString()) +
|
|
||||||
"/edit";
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
bulmaJS.alert({
|
bulmaJS.alert({
|
||||||
|
|
@ -96,7 +86,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
}, (responseJSON) => {
|
}, (responseJSON) => {
|
||||||
if (responseJSON.success) {
|
if (responseJSON.success) {
|
||||||
cityssm.disableNavBlocker();
|
cityssm.disableNavBlocker();
|
||||||
window.location.href = los.urlPrefix + "/lotOccupancies?t=" + Date.now();
|
window.location.href = los.getLotOccupancyURL();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
bulmaJS.alert({
|
bulmaJS.alert({
|
||||||
|
|
|
||||||
|
|
@ -36,15 +36,14 @@ declare const bulmaJS: BulmaJS;
|
||||||
los.clearUnsavedChanges();
|
los.clearUnsavedChanges();
|
||||||
|
|
||||||
if (isCreate || refreshAfterSave) {
|
if (isCreate || refreshAfterSave) {
|
||||||
window.location.href =
|
window.location.href = los.getLotOccupancyURL(
|
||||||
los.urlPrefix +
|
responseJSON.lotOccupancyId,
|
||||||
"/lotOccupancies/" +
|
true,
|
||||||
responseJSON.lotOccupancyId +
|
true
|
||||||
"/edit?t=" +
|
);
|
||||||
Date.now();
|
|
||||||
} else {
|
} else {
|
||||||
bulmaJS.alert({
|
bulmaJS.alert({
|
||||||
message: exports.aliases.occupancy + " Updated Successfully",
|
message: `${los.escapedAliases.Occupancy} Updated Successfully`,
|
||||||
contextualColorName: "success"
|
contextualColorName: "success"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -74,11 +73,7 @@ declare const bulmaJS: BulmaJS;
|
||||||
(responseJSON: { success: boolean; errorMessage?: string; lotOccupancyId?: number }) => {
|
(responseJSON: { success: boolean; errorMessage?: string; lotOccupancyId?: number }) => {
|
||||||
if (responseJSON.success) {
|
if (responseJSON.success) {
|
||||||
cityssm.disableNavBlocker();
|
cityssm.disableNavBlocker();
|
||||||
window.location.href =
|
window.location.href = los.getLotOccupancyURL(responseJSON.lotOccupancyId, true);
|
||||||
los.urlPrefix +
|
|
||||||
"/lotOccupancies/" +
|
|
||||||
responseJSON.lotOccupancyId?.toString() +
|
|
||||||
"/edit";
|
|
||||||
} else {
|
} else {
|
||||||
bulmaJS.alert({
|
bulmaJS.alert({
|
||||||
title: "Error Copying Record",
|
title: "Error Copying Record",
|
||||||
|
|
@ -124,7 +119,7 @@ declare const bulmaJS: BulmaJS;
|
||||||
(responseJSON: { success: boolean; errorMessage?: string }) => {
|
(responseJSON: { success: boolean; errorMessage?: string }) => {
|
||||||
if (responseJSON.success) {
|
if (responseJSON.success) {
|
||||||
cityssm.disableNavBlocker();
|
cityssm.disableNavBlocker();
|
||||||
window.location.href = los.urlPrefix + "/lotOccupancies?t=" + Date.now();
|
window.location.href = los.getLotOccupancyURL();
|
||||||
} else {
|
} else {
|
||||||
bulmaJS.alert({
|
bulmaJS.alert({
|
||||||
title: "Error Deleting Record",
|
title: "Error Deleting Record",
|
||||||
|
|
|
||||||
|
|
@ -357,21 +357,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
return (urlPrefix +
|
return (urlPrefix +
|
||||||
"/" +
|
"/" +
|
||||||
recordTypePlural +
|
recordTypePlural +
|
||||||
"/" +
|
(recordId ? "/" + recordId : "") +
|
||||||
recordId +
|
(recordId && edit ? "/edit" : "") +
|
||||||
(edit ? "/edit" : "") +
|
|
||||||
(time ? "/?t=" + Date.now() : ""));
|
(time ? "/?t=" + Date.now() : ""));
|
||||||
}
|
}
|
||||||
function getMapURL(mapId, edit = false, time = false) {
|
function getMapURL(mapId = "", edit = false, time = false) {
|
||||||
return getRecordURL("maps", mapId, edit, time);
|
return getRecordURL("maps", mapId, edit, time);
|
||||||
}
|
}
|
||||||
function getLotURL(lotId, edit = false, time = false) {
|
function getLotURL(lotId = "", edit = false, time = false) {
|
||||||
return getRecordURL("lots", lotId, edit, time);
|
return getRecordURL("lots", lotId, edit, time);
|
||||||
}
|
}
|
||||||
function getLotOccupancyURL(lotOccupancyId, edit = false, time = false) {
|
function getLotOccupancyURL(lotOccupancyId = "", edit = false, time = false) {
|
||||||
return getRecordURL("lotOccupancies", lotOccupancyId, edit, time);
|
return getRecordURL("lotOccupancies", lotOccupancyId, edit, time);
|
||||||
}
|
}
|
||||||
function getWorkOrderURL(workOrderId, edit = false, time = false) {
|
function getWorkOrderURL(workOrderId = "", edit = false, time = false) {
|
||||||
return getRecordURL("workOrders", workOrderId, edit, time);
|
return getRecordURL("workOrders", workOrderId, edit, time);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
|
|
@ -448,26 +448,25 @@ declare const bulmaJS: BulmaJS;
|
||||||
urlPrefix +
|
urlPrefix +
|
||||||
"/" +
|
"/" +
|
||||||
recordTypePlural +
|
recordTypePlural +
|
||||||
"/" +
|
(recordId ? "/" + recordId : "") +
|
||||||
recordId +
|
(recordId && edit ? "/edit" : "") +
|
||||||
(edit ? "/edit" : "") +
|
|
||||||
(time ? "/?t=" + Date.now() : "")
|
(time ? "/?t=" + Date.now() : "")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getMapURL(mapId: number | string, edit = false, time = false) {
|
function getMapURL(mapId: number | string = "", edit = false, time = false) {
|
||||||
return getRecordURL("maps", mapId, edit, time);
|
return getRecordURL("maps", mapId, edit, time);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getLotURL(lotId: number | string, edit = false, time = false) {
|
function getLotURL(lotId: number | string = "", edit = false, time = false) {
|
||||||
return getRecordURL("lots", lotId, edit, time);
|
return getRecordURL("lots", lotId, edit, time);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getLotOccupancyURL(lotOccupancyId: number | string, edit = false, time = false) {
|
function getLotOccupancyURL(lotOccupancyId: number | string = "", edit = false, time = false) {
|
||||||
return getRecordURL("lotOccupancies", lotOccupancyId, edit, time);
|
return getRecordURL("lotOccupancies", lotOccupancyId, edit, time);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getWorkOrderURL(workOrderId: number | string, edit = false, time = false) {
|
function getWorkOrderURL(workOrderId: number | string = "", edit = false, time = false) {
|
||||||
return getRecordURL("workOrders", workOrderId, edit, time);
|
return getRecordURL("workOrders", workOrderId, edit, time);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
mapId
|
mapId
|
||||||
}, (responseJSON) => {
|
}, (responseJSON) => {
|
||||||
if (responseJSON.success) {
|
if (responseJSON.success) {
|
||||||
window.location.href = los.urlPrefix + "/maps?t=" + Date.now();
|
window.location.href = los.getMapURL();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
bulmaJS.alert({
|
bulmaJS.alert({
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ declare const bulmaJS: BulmaJS;
|
||||||
},
|
},
|
||||||
(responseJSON: { success: boolean; errorMessage?: string }) => {
|
(responseJSON: { success: boolean; errorMessage?: string }) => {
|
||||||
if (responseJSON.success) {
|
if (responseJSON.success) {
|
||||||
window.location.href = los.urlPrefix + "/maps?t=" + Date.now();
|
window.location.href = los.getMapURL();
|
||||||
} else {
|
} else {
|
||||||
bulmaJS.alert({
|
bulmaJS.alert({
|
||||||
title: "Error Deleting " + exports.aliases.map,
|
title: "Error Deleting " + exports.aliases.map,
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
||||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),(()=>{var e;const t=exports.los,a=document.querySelector("#map--mapId").value,s=""===a,o=document.querySelector("#form--map");o.addEventListener("submit",function(e){e.preventDefault(),cityssm.postJSON(t.urlPrefix+"/maps/"+(s?"doCreateMap":"doUpdateMap"),o,e=>{e.success?(cityssm.disableNavBlocker(),s?window.location.href=t.urlPrefix+"/maps/"+e.mapId+"/edit":bulmaJS.alert({message:exports.aliases.map+" Updated Successfully",contextualColorName:"success"})):bulmaJS.alert({title:"Error Updating "+exports.aliases.map,message:e.errorMessage||"",contextualColorName:"danger"})})});const r=o.querySelectorAll("input, select");for(const e of r)e.addEventListener("change",cityssm.enableNavBlocker);null===(e=document.querySelector("#button--deleteMap"))||void 0===e||e.addEventListener("click",e=>{e.preventDefault(),bulmaJS.confirm({title:"Delete "+exports.aliases.map,message:`Are you sure you want to delete this ${exports.aliases.map.toLowerCase()} and all related ${exports.aliases.lots.toLowerCase()}?`,contextualColorName:"warning",okButton:{text:`Yes, Delete ${exports.aliases.map}`,callbackFunction:function(){cityssm.postJSON(t.urlPrefix+"/maps/doDeleteMap",{mapId:a},e=>{e.success?window.location.href=t.urlPrefix+"/maps?t="+Date.now():bulmaJS.alert({title:"Error Deleting "+exports.aliases.map,message:e.errorMessage||"",contextualColorName:"danger"})})}}})})})();
|
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),(()=>{var e;const t=exports.los,a=document.querySelector("#map--mapId").value,s=""===a,o=document.querySelector("#form--map");o.addEventListener("submit",function(e){e.preventDefault(),cityssm.postJSON(t.urlPrefix+"/maps/"+(s?"doCreateMap":"doUpdateMap"),o,e=>{e.success?(cityssm.disableNavBlocker(),s?window.location.href=t.urlPrefix+"/maps/"+e.mapId+"/edit":bulmaJS.alert({message:exports.aliases.map+" Updated Successfully",contextualColorName:"success"})):bulmaJS.alert({title:"Error Updating "+exports.aliases.map,message:e.errorMessage||"",contextualColorName:"danger"})})});const r=o.querySelectorAll("input, select");for(const e of r)e.addEventListener("change",cityssm.enableNavBlocker);null===(e=document.querySelector("#button--deleteMap"))||void 0===e||e.addEventListener("click",e=>{e.preventDefault(),bulmaJS.confirm({title:"Delete "+exports.aliases.map,message:`Are you sure you want to delete this ${exports.aliases.map.toLowerCase()} and all related ${exports.aliases.lots.toLowerCase()}?`,contextualColorName:"warning",okButton:{text:`Yes, Delete ${exports.aliases.map}`,callbackFunction:function(){cityssm.postJSON(t.urlPrefix+"/maps/doDeleteMap",{mapId:a},e=>{e.success?window.location.href=t.getMapURL():bulmaJS.alert({title:"Error Deleting "+exports.aliases.map,message:e.errorMessage||"",contextualColorName:"danger"})})}}})})})();
|
||||||
|
|
@ -38,8 +38,8 @@ export interface LOS {
|
||||||
getMoveUpDownButtonFieldHTML: (upButtonClassNames: string, downButtonClassNames: string, isSmall?: boolean) => string;
|
getMoveUpDownButtonFieldHTML: (upButtonClassNames: string, downButtonClassNames: string, isSmall?: boolean) => string;
|
||||||
getLoadingParagraphHTML: (captionText?: string) => string;
|
getLoadingParagraphHTML: (captionText?: string) => string;
|
||||||
getSearchResultsPagerHTML: (limit: number, offset: number, count: number) => string;
|
getSearchResultsPagerHTML: (limit: number, offset: number, count: number) => string;
|
||||||
getMapURL: (mapId: number | string, edit?: boolean, time?: boolean) => string;
|
getMapURL: (mapId?: number | string, edit?: boolean, time?: boolean) => string;
|
||||||
getLotURL: (lotId: number | string, edit?: boolean, time?: boolean) => string;
|
getLotURL: (lotId?: number | string, edit?: boolean, time?: boolean) => string;
|
||||||
getLotOccupancyURL: (lotOccupancyId: number | string, edit?: boolean, time?: boolean) => string;
|
getLotOccupancyURL: (lotOccupancyId?: number | string, edit?: boolean, time?: boolean) => string;
|
||||||
getWorkOrderURL: (workOrderId: number | string, edit?: boolean, time?: boolean) => string;
|
getWorkOrderURL: (workOrderId?: number | string, edit?: boolean, time?: boolean) => string;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -56,8 +56,8 @@ export interface LOS {
|
||||||
getLoadingParagraphHTML: (captionText?: string) => string;
|
getLoadingParagraphHTML: (captionText?: string) => string;
|
||||||
getSearchResultsPagerHTML: (limit: number, offset: number, count: number) => string;
|
getSearchResultsPagerHTML: (limit: number, offset: number, count: number) => string;
|
||||||
|
|
||||||
getMapURL: (mapId: number | string, edit?: boolean, time?: boolean) => string;
|
getMapURL: (mapId?: number | string, edit?: boolean, time?: boolean) => string;
|
||||||
getLotURL: (lotId: number | string, edit?: boolean, time?: boolean) => string;
|
getLotURL: (lotId?: number | string, edit?: boolean, time?: boolean) => string;
|
||||||
getLotOccupancyURL: (lotOccupancyId: number | string, edit?: boolean, time?: boolean) => string;
|
getLotOccupancyURL: (lotOccupancyId?: number | string, edit?: boolean, time?: boolean) => string;
|
||||||
getWorkOrderURL: (workOrderId: number | string, edit?: boolean, time?: boolean) => string;
|
getWorkOrderURL: (workOrderId?: number | string, edit?: boolean, time?: boolean) => string;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue