@mseva/digit-ui-module-ptr 1.0.18 → 1.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1450 -114
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +1335 -35
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -30440,6 +30440,17 @@ function _catch$1(body, recover) {
|
|
|
30440
30440
|
}
|
|
30441
30441
|
return result;
|
|
30442
30442
|
}
|
|
30443
|
+
function _finallyRethrows(body, finalizer) {
|
|
30444
|
+
try {
|
|
30445
|
+
var result = body();
|
|
30446
|
+
} catch (e) {
|
|
30447
|
+
return finalizer(true, e);
|
|
30448
|
+
}
|
|
30449
|
+
if (result && result.then) {
|
|
30450
|
+
return result.then(finalizer.bind(null, false), finalizer.bind(null, true));
|
|
30451
|
+
}
|
|
30452
|
+
return finalizer(false, result);
|
|
30453
|
+
}
|
|
30443
30454
|
|
|
30444
30455
|
const configPTApproverApplication = _ref => {
|
|
30445
30456
|
var _action$assigneeRoles;
|
|
@@ -30957,6 +30968,101 @@ const configPTRApproverApplication = _ref => {
|
|
|
30957
30968
|
};
|
|
30958
30969
|
};
|
|
30959
30970
|
|
|
30971
|
+
const configSVApproverApplication = _ref => {
|
|
30972
|
+
let {
|
|
30973
|
+
t,
|
|
30974
|
+
action,
|
|
30975
|
+
selectFile,
|
|
30976
|
+
uploadedFile,
|
|
30977
|
+
setUploadedFile,
|
|
30978
|
+
approvers,
|
|
30979
|
+
selectedApprover,
|
|
30980
|
+
setSelectedApprover,
|
|
30981
|
+
isUploading
|
|
30982
|
+
} = _ref;
|
|
30983
|
+
const LoadingSpinner = () => /*#__PURE__*/React__default.createElement("div", {
|
|
30984
|
+
className: "loading-spinner"
|
|
30985
|
+
});
|
|
30986
|
+
console.log("isuploading ", isUploading);
|
|
30987
|
+
return {
|
|
30988
|
+
label: {
|
|
30989
|
+
heading: `WF_${action === null || action === void 0 ? void 0 : action.action}_APPLICATION`,
|
|
30990
|
+
submit: `SV_${action === null || action === void 0 ? void 0 : action.action}`,
|
|
30991
|
+
cancel: "SV_COMMON_CANCEL"
|
|
30992
|
+
},
|
|
30993
|
+
form: [{
|
|
30994
|
+
body: [(action === null || action === void 0 ? void 0 : action.action) === "APPROVE" || (action === null || action === void 0 ? void 0 : action.action) === "REJECT" || (action === null || action === void 0 ? void 0 : action.action) === "SENDBACKTOCITIZEN" ? "" : {
|
|
30995
|
+
label: t("SV_ASSIGNEE"),
|
|
30996
|
+
type: "dropdown",
|
|
30997
|
+
populators: /*#__PURE__*/React__default.createElement(digitUiReactComponents.Dropdown, {
|
|
30998
|
+
option: approvers,
|
|
30999
|
+
t: t,
|
|
31000
|
+
optionKey: "name",
|
|
31001
|
+
select: setSelectedApprover,
|
|
31002
|
+
selected: selectedApprover
|
|
31003
|
+
})
|
|
31004
|
+
}, {
|
|
31005
|
+
label: t("SV_ACTION_COMMENTS"),
|
|
31006
|
+
isMandatory: true,
|
|
31007
|
+
type: "textarea",
|
|
31008
|
+
populators: {
|
|
31009
|
+
name: "comments",
|
|
31010
|
+
validation: {
|
|
31011
|
+
required: true
|
|
31012
|
+
}
|
|
31013
|
+
}
|
|
31014
|
+
}, {
|
|
31015
|
+
label: `${t("SV_ATTATCH_FILE")}${action.docUploadRequired ? " *" : ""}`,
|
|
31016
|
+
populators: /*#__PURE__*/React__default.createElement(digitUiReactComponents.UploadFile, {
|
|
31017
|
+
id: "workflow-doc-sv",
|
|
31018
|
+
onUpload: selectFile,
|
|
31019
|
+
onDelete: () => {
|
|
31020
|
+
setUploadedFile(null);
|
|
31021
|
+
},
|
|
31022
|
+
message: isUploading ? /*#__PURE__*/React__default.createElement("div", {
|
|
31023
|
+
style: {
|
|
31024
|
+
display: "flex",
|
|
31025
|
+
alignItems: "center",
|
|
31026
|
+
gap: "8px"
|
|
31027
|
+
}
|
|
31028
|
+
}, /*#__PURE__*/React__default.createElement(LoadingSpinner, null), /*#__PURE__*/React__default.createElement("span", null, "Uploading...")) : uploadedFile ? `1 ${t(`SV_FILE_UPLOADED`)}` : t(`SV_NO_FILE`)
|
|
31029
|
+
})
|
|
31030
|
+
}]
|
|
31031
|
+
}]
|
|
31032
|
+
};
|
|
31033
|
+
};
|
|
31034
|
+
|
|
31035
|
+
const configTLDirectRenewApplication = _ref => {
|
|
31036
|
+
let {
|
|
31037
|
+
t,
|
|
31038
|
+
action,
|
|
31039
|
+
years,
|
|
31040
|
+
selectedApprover,
|
|
31041
|
+
setSelectedApprover,
|
|
31042
|
+
assigneeLabel,
|
|
31043
|
+
businessService
|
|
31044
|
+
} = _ref;
|
|
31045
|
+
return {
|
|
31046
|
+
label: {
|
|
31047
|
+
heading: `WF_${action === null || action === void 0 ? void 0 : action.action}_APPLICATION`,
|
|
31048
|
+
submit: `WF_${businessService === null || businessService === void 0 ? void 0 : businessService.toUpperCase()}_${action === null || action === void 0 ? void 0 : action.action}`,
|
|
31049
|
+
cancel: "WF_EMPLOYEE_NEWTL_CANCEL"
|
|
31050
|
+
},
|
|
31051
|
+
form: [{
|
|
31052
|
+
body: [{
|
|
31053
|
+
label: t("TL_VALID_FOR_NO_OF_YEARS"),
|
|
31054
|
+
type: "dropdown",
|
|
31055
|
+
populators: /*#__PURE__*/React__default.createElement(digitUiReactComponents.Dropdown, {
|
|
31056
|
+
option: years,
|
|
31057
|
+
autoComplete: "off",
|
|
31058
|
+
select: setSelectedApprover,
|
|
31059
|
+
selected: selectedApprover
|
|
31060
|
+
})
|
|
31061
|
+
}]
|
|
31062
|
+
}]
|
|
31063
|
+
};
|
|
31064
|
+
};
|
|
31065
|
+
|
|
30960
31066
|
const Heading = props => {
|
|
30961
31067
|
return /*#__PURE__*/React__default.createElement("h1", {
|
|
30962
31068
|
className: "heading-m"
|
|
@@ -32961,8 +33067,8 @@ var _DataView = DataView;
|
|
|
32961
33067
|
var Promise$1 = _getNative$1(_root$1, 'Promise');
|
|
32962
33068
|
var _Promise = Promise$1;
|
|
32963
33069
|
|
|
32964
|
-
var Set = _getNative$1(_root$1, 'Set');
|
|
32965
|
-
var _Set = Set;
|
|
33070
|
+
var Set$1 = _getNative$1(_root$1, 'Set');
|
|
33071
|
+
var _Set = Set$1;
|
|
32966
33072
|
|
|
32967
33073
|
var WeakMap = _getNative$1(_root$1, 'WeakMap');
|
|
32968
33074
|
var _WeakMap = WeakMap;
|
|
@@ -33676,103 +33782,1204 @@ const ActionModal$6 = _ref => {
|
|
|
33676
33782
|
} catch (e) {
|
|
33677
33783
|
Promise.reject(e);
|
|
33678
33784
|
}
|
|
33679
|
-
})();
|
|
33680
|
-
}, [file]);
|
|
33681
|
-
function submit(data) {
|
|
33682
|
-
if ((action === null || action === void 0 ? void 0 : action.action) == "COMMON_APPROVED") {
|
|
33683
|
-
let workflow = {
|
|
33684
|
-
action: "OPEN",
|
|
33685
|
-
comments: data === null || data === void 0 ? void 0 : data.comments,
|
|
33686
|
-
businessService: "ptr",
|
|
33687
|
-
moduleName: "pet-services"
|
|
33785
|
+
})();
|
|
33786
|
+
}, [file]);
|
|
33787
|
+
function submit(data) {
|
|
33788
|
+
if ((action === null || action === void 0 ? void 0 : action.action) == "COMMON_APPROVED") {
|
|
33789
|
+
let workflow = {
|
|
33790
|
+
action: "OPEN",
|
|
33791
|
+
comments: data === null || data === void 0 ? void 0 : data.comments,
|
|
33792
|
+
businessService: "ptr",
|
|
33793
|
+
moduleName: "pet-services"
|
|
33794
|
+
};
|
|
33795
|
+
applicationData.creationReason = "CREATE";
|
|
33796
|
+
submitAction({
|
|
33797
|
+
PetRegistrationApplications: [{
|
|
33798
|
+
...applicationData,
|
|
33799
|
+
workflow
|
|
33800
|
+
}]
|
|
33801
|
+
});
|
|
33802
|
+
}
|
|
33803
|
+
let workflow = {
|
|
33804
|
+
action: action === null || action === void 0 ? void 0 : action.action,
|
|
33805
|
+
comments: data === null || data === void 0 ? void 0 : data.comments,
|
|
33806
|
+
businessService,
|
|
33807
|
+
moduleName: moduleCode
|
|
33808
|
+
};
|
|
33809
|
+
workflow["assignes"] = action !== null && action !== void 0 && action.isTerminateState || !selectedApprover ? [] : [selectedApprover];
|
|
33810
|
+
if (uploadedFile) workflow["documents"] = [{
|
|
33811
|
+
documentType: (action === null || action === void 0 ? void 0 : action.action) + " DOC",
|
|
33812
|
+
fileName: file === null || file === void 0 ? void 0 : file.name,
|
|
33813
|
+
fileStoreId: uploadedFile
|
|
33814
|
+
}];
|
|
33815
|
+
submitAction({
|
|
33816
|
+
PetRegistrationApplications: [{
|
|
33817
|
+
...applicationData,
|
|
33818
|
+
workflow
|
|
33819
|
+
}]
|
|
33820
|
+
});
|
|
33821
|
+
}
|
|
33822
|
+
React.useEffect(() => {
|
|
33823
|
+
if (action) {
|
|
33824
|
+
setConfig(configPTRApproverApplication({
|
|
33825
|
+
t,
|
|
33826
|
+
action,
|
|
33827
|
+
approvers,
|
|
33828
|
+
selectedApprover,
|
|
33829
|
+
setSelectedApprover,
|
|
33830
|
+
selectFile,
|
|
33831
|
+
uploadedFile,
|
|
33832
|
+
setUploadedFile,
|
|
33833
|
+
businessService
|
|
33834
|
+
}));
|
|
33835
|
+
}
|
|
33836
|
+
}, [action, approvers, uploadedFile]);
|
|
33837
|
+
return action && config.form ? /*#__PURE__*/React__default.createElement(digitUiReactComponents.Modal, {
|
|
33838
|
+
headerBarMain: /*#__PURE__*/React__default.createElement(Heading$6, {
|
|
33839
|
+
label: t(config.label.heading)
|
|
33840
|
+
}),
|
|
33841
|
+
headerBarEnd: /*#__PURE__*/React__default.createElement(CloseBtn$6, {
|
|
33842
|
+
onClick: closeModal
|
|
33843
|
+
}),
|
|
33844
|
+
actionCancelLabel: t(config.label.cancel),
|
|
33845
|
+
actionCancelOnSubmit: closeModal,
|
|
33846
|
+
actionSaveLabel: t(config.label.submit),
|
|
33847
|
+
actionSaveOnSubmit: () => {},
|
|
33848
|
+
formId: "modal-action"
|
|
33849
|
+
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.FormComposer, {
|
|
33850
|
+
config: config.form,
|
|
33851
|
+
noBoxShadow: true,
|
|
33852
|
+
inline: true,
|
|
33853
|
+
childrenAtTheBottom: true,
|
|
33854
|
+
onSubmit: submit,
|
|
33855
|
+
defaultValues: defaultValues,
|
|
33856
|
+
formId: "modal-action"
|
|
33857
|
+
})) : /*#__PURE__*/React__default.createElement(digitUiReactComponents.Loader, null);
|
|
33858
|
+
};
|
|
33859
|
+
|
|
33860
|
+
const Heading$7 = props => {
|
|
33861
|
+
return /*#__PURE__*/React__default.createElement("h1", {
|
|
33862
|
+
className: "heading-m"
|
|
33863
|
+
}, props.label);
|
|
33864
|
+
};
|
|
33865
|
+
const Close$7 = () => /*#__PURE__*/React__default.createElement("svg", {
|
|
33866
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
33867
|
+
viewBox: "0 0 24 24",
|
|
33868
|
+
fill: "#FFFFFF"
|
|
33869
|
+
}, /*#__PURE__*/React__default.createElement("path", {
|
|
33870
|
+
d: "M0 0h24v24H0V0z",
|
|
33871
|
+
fill: "none"
|
|
33872
|
+
}), /*#__PURE__*/React__default.createElement("path", {
|
|
33873
|
+
d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"
|
|
33874
|
+
}));
|
|
33875
|
+
const CloseBtn$7 = props => {
|
|
33876
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
33877
|
+
className: "icon-bg-secondary",
|
|
33878
|
+
onClick: props.onClick
|
|
33879
|
+
}, /*#__PURE__*/React__default.createElement(Close$7, null));
|
|
33880
|
+
};
|
|
33881
|
+
const ActionModal$7 = _ref => {
|
|
33882
|
+
var _tradeMdmsData$TradeL, _applicationData, _applicationData$trad;
|
|
33883
|
+
let {
|
|
33884
|
+
t,
|
|
33885
|
+
action,
|
|
33886
|
+
tenantId,
|
|
33887
|
+
state,
|
|
33888
|
+
id,
|
|
33889
|
+
closeModal,
|
|
33890
|
+
submitAction,
|
|
33891
|
+
actionData,
|
|
33892
|
+
applicationData,
|
|
33893
|
+
businessService,
|
|
33894
|
+
moduleCode
|
|
33895
|
+
} = _ref;
|
|
33896
|
+
const stateId = Digit.ULBService.getStateId();
|
|
33897
|
+
const {
|
|
33898
|
+
data: tradeMdmsData,
|
|
33899
|
+
isLoading: tradeMdmsLoading
|
|
33900
|
+
} = Digit.Hooks.tl.useTradeLicenseMDMS(stateId, "TradeLicense", "TradeUnits", "[?(@.type=='TL')]");
|
|
33901
|
+
console.log("tradeMdmsData", tradeMdmsData === null || tradeMdmsData === void 0 ? void 0 : (_tradeMdmsData$TradeL = tradeMdmsData.TradeLicense) === null || _tradeMdmsData$TradeL === void 0 ? void 0 : _tradeMdmsData$TradeL.TradeType);
|
|
33902
|
+
console.log("applicationData", applicationData);
|
|
33903
|
+
const [config, setConfig] = React.useState({});
|
|
33904
|
+
const [defaultValues, setDefaultValues] = React.useState({});
|
|
33905
|
+
const [approvers, setApprovers] = React.useState([]);
|
|
33906
|
+
const [selectedApprover, setSelectedApprover] = React.useState("");
|
|
33907
|
+
const [financialYears, setFinancialYears] = React.useState([]);
|
|
33908
|
+
const [selectedFinancialYear, setSelectedFinancialYear] = React.useState(null);
|
|
33909
|
+
const tradeUnits = (_applicationData = applicationData) === null || _applicationData === void 0 ? void 0 : (_applicationData$trad = _applicationData.tradeLicenseDetail) === null || _applicationData$trad === void 0 ? void 0 : _applicationData$trad.tradeUnits;
|
|
33910
|
+
console.log("tradeUnits", tradeUnits);
|
|
33911
|
+
const years = React.useMemo(() => {
|
|
33912
|
+
var _tradeMdmsData$TradeL2;
|
|
33913
|
+
if (tradeMdmsLoading || !tradeMdmsData || !tradeUnits.length) return [];
|
|
33914
|
+
const tradeTypeCodes = new Set(tradeUnits.map(unit => unit.tradeType));
|
|
33915
|
+
const matchedTradeTypes = (_tradeMdmsData$TradeL2 = tradeMdmsData.TradeLicense) === null || _tradeMdmsData$TradeL2 === void 0 ? void 0 : _tradeMdmsData$TradeL2.TradeType.filter(type => tradeTypeCodes.has(type.code));
|
|
33916
|
+
const hasHazardous = matchedTradeTypes.some(unit => unit === null || unit === void 0 ? void 0 : unit.ishazardous);
|
|
33917
|
+
console.log("hasHazardous", hasHazardous);
|
|
33918
|
+
if (hasHazardous) return ['1'];else return ['1', '2', '3'];
|
|
33919
|
+
}, [tradeMdmsLoading, tradeMdmsData, tradeUnits]);
|
|
33920
|
+
console.log("years", years);
|
|
33921
|
+
function submit(data) {
|
|
33922
|
+
var _applicationData2;
|
|
33923
|
+
let financialYear = (_applicationData2 = applicationData) === null || _applicationData2 === void 0 ? void 0 : _applicationData2.financialYear;
|
|
33924
|
+
const financialYearDate = financialYear === null || financialYear === void 0 ? void 0 : financialYear.split('-')[1];
|
|
33925
|
+
const finalFinancialYear = `20${Number(financialYearDate)}-${Number(financialYearDate) + 1}`;
|
|
33926
|
+
applicationData = {
|
|
33927
|
+
...applicationData,
|
|
33928
|
+
financialYear: finalFinancialYear,
|
|
33929
|
+
action: "INITIATE",
|
|
33930
|
+
additionalDetail: {
|
|
33931
|
+
...applicationData.additionalDetail,
|
|
33932
|
+
validityYears: selectedApprover.length > 0 ? parseInt(selectedApprover) : ""
|
|
33933
|
+
}
|
|
33934
|
+
};
|
|
33935
|
+
submitAction({
|
|
33936
|
+
Licenses: [applicationData]
|
|
33937
|
+
});
|
|
33938
|
+
}
|
|
33939
|
+
React.useEffect(() => {
|
|
33940
|
+
if (action) {
|
|
33941
|
+
setConfig(configTLDirectRenewApplication({
|
|
33942
|
+
t,
|
|
33943
|
+
action,
|
|
33944
|
+
years,
|
|
33945
|
+
selectedApprover,
|
|
33946
|
+
setSelectedApprover,
|
|
33947
|
+
businessService
|
|
33948
|
+
}));
|
|
33949
|
+
}
|
|
33950
|
+
}, [action, years, financialYears, selectedFinancialYear]);
|
|
33951
|
+
return action && config.form ? /*#__PURE__*/React__default.createElement(digitUiReactComponents.Modal, {
|
|
33952
|
+
headerBarMain: /*#__PURE__*/React__default.createElement(Heading$7, {
|
|
33953
|
+
label: t(config.label.heading)
|
|
33954
|
+
}),
|
|
33955
|
+
headerBarEnd: /*#__PURE__*/React__default.createElement(CloseBtn$7, {
|
|
33956
|
+
onClick: closeModal
|
|
33957
|
+
}),
|
|
33958
|
+
actionCancelLabel: t(config.label.cancel),
|
|
33959
|
+
actionCancelOnSubmit: closeModal,
|
|
33960
|
+
actionSaveLabel: t(config.label.submit),
|
|
33961
|
+
actionSaveOnSubmit: () => {},
|
|
33962
|
+
formId: "modal-action"
|
|
33963
|
+
}, tradeMdmsLoading ? /*#__PURE__*/React__default.createElement(digitUiReactComponents.Loader, null) : /*#__PURE__*/React__default.createElement(digitUiReactComponents.FormComposer, {
|
|
33964
|
+
config: config.form,
|
|
33965
|
+
noBoxShadow: true,
|
|
33966
|
+
inline: true,
|
|
33967
|
+
childrenAtTheBottom: true,
|
|
33968
|
+
onSubmit: submit,
|
|
33969
|
+
defaultValues: defaultValues,
|
|
33970
|
+
formId: "modal-action"
|
|
33971
|
+
})) : /*#__PURE__*/React__default.createElement(digitUiReactComponents.Loader, null);
|
|
33972
|
+
};
|
|
33973
|
+
|
|
33974
|
+
const Heading$8 = props => {
|
|
33975
|
+
return /*#__PURE__*/React__default.createElement("h1", {
|
|
33976
|
+
className: "heading-m"
|
|
33977
|
+
}, props.label);
|
|
33978
|
+
};
|
|
33979
|
+
const Close$8 = () => /*#__PURE__*/React__default.createElement("svg", {
|
|
33980
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
33981
|
+
viewBox: "0 0 24 24",
|
|
33982
|
+
fill: "#FFFFFF"
|
|
33983
|
+
}, /*#__PURE__*/React__default.createElement("path", {
|
|
33984
|
+
d: "M0 0h24v24H0V0z",
|
|
33985
|
+
fill: "none"
|
|
33986
|
+
}), /*#__PURE__*/React__default.createElement("path", {
|
|
33987
|
+
d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"
|
|
33988
|
+
}));
|
|
33989
|
+
const CloseBtn$8 = props => {
|
|
33990
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
33991
|
+
className: "icon-bg-secondary",
|
|
33992
|
+
onClick: props.onClick
|
|
33993
|
+
}, /*#__PURE__*/React__default.createElement(Close$8, null));
|
|
33994
|
+
};
|
|
33995
|
+
const ActionModal$8 = _ref => {
|
|
33996
|
+
var _action$assigneeRoles, _action$assigneeRoles2;
|
|
33997
|
+
let {
|
|
33998
|
+
t,
|
|
33999
|
+
action,
|
|
34000
|
+
tenantId,
|
|
34001
|
+
state,
|
|
34002
|
+
id,
|
|
34003
|
+
closeModal,
|
|
34004
|
+
submitAction,
|
|
34005
|
+
actionData,
|
|
34006
|
+
applicationData,
|
|
34007
|
+
businessService,
|
|
34008
|
+
moduleCode
|
|
34009
|
+
} = _ref;
|
|
34010
|
+
const {
|
|
34011
|
+
data: approverData,
|
|
34012
|
+
isLoading: PTALoading
|
|
34013
|
+
} = Digit.Hooks.useEmployeeSearch(tenantId, {
|
|
34014
|
+
roles: action === null || action === void 0 ? void 0 : (_action$assigneeRoles = action.assigneeRoles) === null || _action$assigneeRoles === void 0 ? void 0 : (_action$assigneeRoles2 = _action$assigneeRoles.map) === null || _action$assigneeRoles2 === void 0 ? void 0 : _action$assigneeRoles2.call(_action$assigneeRoles, e => ({
|
|
34015
|
+
code: e
|
|
34016
|
+
})),
|
|
34017
|
+
isActive: true
|
|
34018
|
+
}, {
|
|
34019
|
+
enabled: action === null || action === void 0 ? void 0 : action.isTerminateState
|
|
34020
|
+
});
|
|
34021
|
+
const [config, setConfig] = React.useState({});
|
|
34022
|
+
const [defaultValues, setDefaultValues] = React.useState({});
|
|
34023
|
+
const [approvers, setApprovers] = React.useState([]);
|
|
34024
|
+
const [selectedApprover, setSelectedApprover] = React.useState(null);
|
|
34025
|
+
const [file, setFile] = React.useState(null);
|
|
34026
|
+
const [uploadedFile, setUploadedFile] = React.useState(null);
|
|
34027
|
+
const [error, setError] = React.useState(null);
|
|
34028
|
+
const [isUploading, setIsUploading] = React.useState(false);
|
|
34029
|
+
React.useEffect(() => {
|
|
34030
|
+
var _approverData$Employe;
|
|
34031
|
+
setApprovers(approverData === null || approverData === void 0 ? void 0 : (_approverData$Employe = approverData.Employees) === null || _approverData$Employe === void 0 ? void 0 : _approverData$Employe.map(employee => {
|
|
34032
|
+
var _employee$user;
|
|
34033
|
+
return {
|
|
34034
|
+
uuid: employee === null || employee === void 0 ? void 0 : employee.uuid,
|
|
34035
|
+
name: employee === null || employee === void 0 ? void 0 : (_employee$user = employee.user) === null || _employee$user === void 0 ? void 0 : _employee$user.name
|
|
34036
|
+
};
|
|
34037
|
+
}));
|
|
34038
|
+
}, [approverData]);
|
|
34039
|
+
function selectFile(e) {
|
|
34040
|
+
setIsUploading(true);
|
|
34041
|
+
setFile(e.target.files[0]);
|
|
34042
|
+
}
|
|
34043
|
+
React.useEffect(() => {
|
|
34044
|
+
(function () {
|
|
34045
|
+
try {
|
|
34046
|
+
setError(null);
|
|
34047
|
+
const _temp3 = function () {
|
|
34048
|
+
if (file) {
|
|
34049
|
+
const _temp2 = function () {
|
|
34050
|
+
if (file.size >= 5242880) {
|
|
34051
|
+
setError(t("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));
|
|
34052
|
+
} else {
|
|
34053
|
+
const _temp = _finallyRethrows(function () {
|
|
34054
|
+
return _catch$1(function () {
|
|
34055
|
+
return Promise.resolve(Digit.UploadServices.Filestorage("StreetVending", file, tenantId)).then(function (response) {
|
|
34056
|
+
var _response$data, _response$data$files;
|
|
34057
|
+
if ((response === null || response === void 0 ? void 0 : (_response$data = response.data) === null || _response$data === void 0 ? void 0 : (_response$data$files = _response$data.files) === null || _response$data$files === void 0 ? void 0 : _response$data$files.length) > 0) {
|
|
34058
|
+
var _response$data2, _response$data2$files;
|
|
34059
|
+
setUploadedFile(response === null || response === void 0 ? void 0 : (_response$data2 = response.data) === null || _response$data2 === void 0 ? void 0 : (_response$data2$files = _response$data2.files[0]) === null || _response$data2$files === void 0 ? void 0 : _response$data2$files.fileStoreId);
|
|
34060
|
+
} else {
|
|
34061
|
+
setError(t("CS_FILE_UPLOAD_ERROR"));
|
|
34062
|
+
}
|
|
34063
|
+
});
|
|
34064
|
+
}, function () {
|
|
34065
|
+
setError(t("CS_FILE_UPLOAD_ERROR"));
|
|
34066
|
+
});
|
|
34067
|
+
}, function (_wasThrown, _result) {
|
|
34068
|
+
setIsUploading(false);
|
|
34069
|
+
if (_wasThrown) throw _result;
|
|
34070
|
+
return _result;
|
|
34071
|
+
});
|
|
34072
|
+
if (_temp && _temp.then) return _temp.then(function () {});
|
|
34073
|
+
}
|
|
34074
|
+
}();
|
|
34075
|
+
if (_temp2 && _temp2.then) return _temp2.then(function () {});
|
|
34076
|
+
}
|
|
34077
|
+
}();
|
|
34078
|
+
return _temp3 && _temp3.then ? _temp3.then(function () {}) : void 0;
|
|
34079
|
+
} catch (e) {
|
|
34080
|
+
Promise.reject(e);
|
|
34081
|
+
}
|
|
34082
|
+
})();
|
|
34083
|
+
}, [file]);
|
|
34084
|
+
console.log("actyhdesh,jhfsefsef", action, applicationData);
|
|
34085
|
+
function submit(data) {
|
|
34086
|
+
var _applicationData$audi;
|
|
34087
|
+
let workflow = {
|
|
34088
|
+
action: action === null || action === void 0 ? void 0 : action.action,
|
|
34089
|
+
comments: data === null || data === void 0 ? void 0 : data.comments,
|
|
34090
|
+
businessService,
|
|
34091
|
+
moduleName: moduleCode,
|
|
34092
|
+
assignes: (action === null || action === void 0 ? void 0 : action.action) === "SENDBACKTOCITIZEN" ? [applicationData === null || applicationData === void 0 ? void 0 : (_applicationData$audi = applicationData.auditDetails) === null || _applicationData$audi === void 0 ? void 0 : _applicationData$audi.createdBy] : selectedApprover !== null && selectedApprover !== void 0 && selectedApprover.uuid ? [selectedApprover === null || selectedApprover === void 0 ? void 0 : selectedApprover.uuid] : null
|
|
34093
|
+
};
|
|
34094
|
+
if (uploadedFile) workflow["documents"] = [{
|
|
34095
|
+
documentType: (action === null || action === void 0 ? void 0 : action.action) + " DOC",
|
|
34096
|
+
fileName: file === null || file === void 0 ? void 0 : file.name,
|
|
34097
|
+
fileStoreId: uploadedFile
|
|
34098
|
+
}];
|
|
34099
|
+
submitAction({
|
|
34100
|
+
streetVendingDetail: {
|
|
34101
|
+
...applicationData,
|
|
34102
|
+
workflow
|
|
34103
|
+
}
|
|
34104
|
+
});
|
|
34105
|
+
}
|
|
34106
|
+
React.useEffect(() => {
|
|
34107
|
+
setConfig(configSVApproverApplication({
|
|
34108
|
+
t,
|
|
34109
|
+
action,
|
|
34110
|
+
approvers,
|
|
34111
|
+
selectedApprover,
|
|
34112
|
+
setSelectedApprover,
|
|
34113
|
+
selectFile,
|
|
34114
|
+
uploadedFile,
|
|
34115
|
+
setUploadedFile,
|
|
34116
|
+
businessService,
|
|
34117
|
+
isUploading
|
|
34118
|
+
}));
|
|
34119
|
+
}, [action, approvers, uploadedFile]);
|
|
34120
|
+
return action && config.form ? /*#__PURE__*/React__default.createElement(digitUiReactComponents.Modal, {
|
|
34121
|
+
headerBarMain: /*#__PURE__*/React__default.createElement(Heading$8, {
|
|
34122
|
+
label: t(config.label.heading)
|
|
34123
|
+
}),
|
|
34124
|
+
headerBarEnd: /*#__PURE__*/React__default.createElement(CloseBtn$8, {
|
|
34125
|
+
onClick: closeModal
|
|
34126
|
+
}),
|
|
34127
|
+
actionCancelLabel: t(config.label.cancel),
|
|
34128
|
+
actionCancelOnSubmit: closeModal,
|
|
34129
|
+
actionSaveLabel: t(config.label.submit),
|
|
34130
|
+
actionSaveOnSubmit: () => {},
|
|
34131
|
+
formId: "modal-action"
|
|
34132
|
+
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.FormComposer, {
|
|
34133
|
+
config: config.form,
|
|
34134
|
+
noBoxShadow: true,
|
|
34135
|
+
inline: true,
|
|
34136
|
+
childrenAtTheBottom: true,
|
|
34137
|
+
onSubmit: submit,
|
|
34138
|
+
defaultValues: defaultValues,
|
|
34139
|
+
formId: "modal-action"
|
|
34140
|
+
})) : /*#__PURE__*/React__default.createElement(digitUiReactComponents.Loader, null);
|
|
34141
|
+
};
|
|
34142
|
+
|
|
34143
|
+
const ActionModal$9 = props => {
|
|
34144
|
+
if (props !== null && props !== void 0 && props.businessService.includes("PT")) {
|
|
34145
|
+
return /*#__PURE__*/React__default.createElement(ActionModal, props);
|
|
34146
|
+
}
|
|
34147
|
+
if (props !== null && props !== void 0 && props.businessService.includes("ptr")) {
|
|
34148
|
+
return /*#__PURE__*/React__default.createElement(ActionModal$6, props);
|
|
34149
|
+
}
|
|
34150
|
+
if (props !== null && props !== void 0 && props.businessService.includes("NewTL") || props !== null && props !== void 0 && props.businessService.includes("TL") || props !== null && props !== void 0 && props.businessService.includes("EDITRENEWAL")) {
|
|
34151
|
+
return /*#__PURE__*/React__default.createElement(ActionModal$1, props);
|
|
34152
|
+
}
|
|
34153
|
+
if (props !== null && props !== void 0 && props.businessService.includes("DIRECTRENEWAL")) {
|
|
34154
|
+
return /*#__PURE__*/React__default.createElement(ActionModal$7, props);
|
|
34155
|
+
}
|
|
34156
|
+
if (props !== null && props !== void 0 && props.moduleCode.includes("BPAREG")) {
|
|
34157
|
+
return /*#__PURE__*/React__default.createElement(ActionModal$2, props);
|
|
34158
|
+
}
|
|
34159
|
+
if (props !== null && props !== void 0 && props.moduleCode.includes("BPA")) {
|
|
34160
|
+
return /*#__PURE__*/React__default.createElement(ActionModal$3, props);
|
|
34161
|
+
}
|
|
34162
|
+
if (props !== null && props !== void 0 && props.moduleCode.includes("NOC")) {
|
|
34163
|
+
return /*#__PURE__*/React__default.createElement(ActionModal$4, props);
|
|
34164
|
+
}
|
|
34165
|
+
if (props !== null && props !== void 0 && props.moduleCode.includes("WS")) {
|
|
34166
|
+
return /*#__PURE__*/React__default.createElement(ActionModal$5, props);
|
|
34167
|
+
}
|
|
34168
|
+
if (props !== null && props !== void 0 && props.businessService.includes("street-vending")) {
|
|
34169
|
+
return /*#__PURE__*/React__default.createElement(ActionModal$8, props);
|
|
34170
|
+
}
|
|
34171
|
+
};
|
|
34172
|
+
|
|
34173
|
+
var bind = function bind(fn, thisArg) {
|
|
34174
|
+
return function wrap() {
|
|
34175
|
+
var args = new Array(arguments.length);
|
|
34176
|
+
for (var i = 0; i < args.length; i++) {
|
|
34177
|
+
args[i] = arguments[i];
|
|
34178
|
+
}
|
|
34179
|
+
return fn.apply(thisArg, args);
|
|
34180
|
+
};
|
|
34181
|
+
};
|
|
34182
|
+
|
|
34183
|
+
var toString$1 = Object.prototype.toString;
|
|
34184
|
+
function isArray$2(val) {
|
|
34185
|
+
return toString$1.call(val) === '[object Array]';
|
|
34186
|
+
}
|
|
34187
|
+
function isUndefined(val) {
|
|
34188
|
+
return typeof val === 'undefined';
|
|
34189
|
+
}
|
|
34190
|
+
function isBuffer(val) {
|
|
34191
|
+
return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);
|
|
34192
|
+
}
|
|
34193
|
+
function isArrayBuffer(val) {
|
|
34194
|
+
return toString$1.call(val) === '[object ArrayBuffer]';
|
|
34195
|
+
}
|
|
34196
|
+
function isFormData(val) {
|
|
34197
|
+
return typeof FormData !== 'undefined' && val instanceof FormData;
|
|
34198
|
+
}
|
|
34199
|
+
function isArrayBufferView(val) {
|
|
34200
|
+
var result;
|
|
34201
|
+
if (typeof ArrayBuffer !== 'undefined' && ArrayBuffer.isView) {
|
|
34202
|
+
result = ArrayBuffer.isView(val);
|
|
34203
|
+
} else {
|
|
34204
|
+
result = val && val.buffer && val.buffer instanceof ArrayBuffer;
|
|
34205
|
+
}
|
|
34206
|
+
return result;
|
|
34207
|
+
}
|
|
34208
|
+
function isString(val) {
|
|
34209
|
+
return typeof val === 'string';
|
|
34210
|
+
}
|
|
34211
|
+
function isNumber(val) {
|
|
34212
|
+
return typeof val === 'number';
|
|
34213
|
+
}
|
|
34214
|
+
function isObject$2(val) {
|
|
34215
|
+
return val !== null && typeof val === 'object';
|
|
34216
|
+
}
|
|
34217
|
+
function isPlainObject(val) {
|
|
34218
|
+
if (toString$1.call(val) !== '[object Object]') {
|
|
34219
|
+
return false;
|
|
34220
|
+
}
|
|
34221
|
+
var prototype = Object.getPrototypeOf(val);
|
|
34222
|
+
return prototype === null || prototype === Object.prototype;
|
|
34223
|
+
}
|
|
34224
|
+
function isDate(val) {
|
|
34225
|
+
return toString$1.call(val) === '[object Date]';
|
|
34226
|
+
}
|
|
34227
|
+
function isFile(val) {
|
|
34228
|
+
return toString$1.call(val) === '[object File]';
|
|
34229
|
+
}
|
|
34230
|
+
function isBlob(val) {
|
|
34231
|
+
return toString$1.call(val) === '[object Blob]';
|
|
34232
|
+
}
|
|
34233
|
+
function isFunction$2(val) {
|
|
34234
|
+
return toString$1.call(val) === '[object Function]';
|
|
34235
|
+
}
|
|
34236
|
+
function isStream(val) {
|
|
34237
|
+
return isObject$2(val) && isFunction$2(val.pipe);
|
|
34238
|
+
}
|
|
34239
|
+
function isURLSearchParams(val) {
|
|
34240
|
+
return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;
|
|
34241
|
+
}
|
|
34242
|
+
function trim(str) {
|
|
34243
|
+
return str.replace(/^\s*/, '').replace(/\s*$/, '');
|
|
34244
|
+
}
|
|
34245
|
+
function isStandardBrowserEnv() {
|
|
34246
|
+
if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || navigator.product === 'NativeScript' || navigator.product === 'NS')) {
|
|
34247
|
+
return false;
|
|
34248
|
+
}
|
|
34249
|
+
return typeof window !== 'undefined' && typeof document !== 'undefined';
|
|
34250
|
+
}
|
|
34251
|
+
function forEach(obj, fn) {
|
|
34252
|
+
if (obj === null || typeof obj === 'undefined') {
|
|
34253
|
+
return;
|
|
34254
|
+
}
|
|
34255
|
+
if (typeof obj !== 'object') {
|
|
34256
|
+
obj = [obj];
|
|
34257
|
+
}
|
|
34258
|
+
if (isArray$2(obj)) {
|
|
34259
|
+
for (var i = 0, l = obj.length; i < l; i++) {
|
|
34260
|
+
fn.call(null, obj[i], i, obj);
|
|
34261
|
+
}
|
|
34262
|
+
} else {
|
|
34263
|
+
for (var key in obj) {
|
|
34264
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
34265
|
+
fn.call(null, obj[key], key, obj);
|
|
34266
|
+
}
|
|
34267
|
+
}
|
|
34268
|
+
}
|
|
34269
|
+
}
|
|
34270
|
+
function merge() {
|
|
34271
|
+
var result = {};
|
|
34272
|
+
function assignValue(val, key) {
|
|
34273
|
+
if (isPlainObject(result[key]) && isPlainObject(val)) {
|
|
34274
|
+
result[key] = merge(result[key], val);
|
|
34275
|
+
} else if (isPlainObject(val)) {
|
|
34276
|
+
result[key] = merge({}, val);
|
|
34277
|
+
} else if (isArray$2(val)) {
|
|
34278
|
+
result[key] = val.slice();
|
|
34279
|
+
} else {
|
|
34280
|
+
result[key] = val;
|
|
34281
|
+
}
|
|
34282
|
+
}
|
|
34283
|
+
for (var i = 0, l = arguments.length; i < l; i++) {
|
|
34284
|
+
forEach(arguments[i], assignValue);
|
|
34285
|
+
}
|
|
34286
|
+
return result;
|
|
34287
|
+
}
|
|
34288
|
+
function extend(a, b, thisArg) {
|
|
34289
|
+
forEach(b, function assignValue(val, key) {
|
|
34290
|
+
if (thisArg && typeof val === 'function') {
|
|
34291
|
+
a[key] = bind(val, thisArg);
|
|
34292
|
+
} else {
|
|
34293
|
+
a[key] = val;
|
|
34294
|
+
}
|
|
34295
|
+
});
|
|
34296
|
+
return a;
|
|
34297
|
+
}
|
|
34298
|
+
function stripBOM(content) {
|
|
34299
|
+
if (content.charCodeAt(0) === 0xFEFF) {
|
|
34300
|
+
content = content.slice(1);
|
|
34301
|
+
}
|
|
34302
|
+
return content;
|
|
34303
|
+
}
|
|
34304
|
+
var utils = {
|
|
34305
|
+
isArray: isArray$2,
|
|
34306
|
+
isArrayBuffer: isArrayBuffer,
|
|
34307
|
+
isBuffer: isBuffer,
|
|
34308
|
+
isFormData: isFormData,
|
|
34309
|
+
isArrayBufferView: isArrayBufferView,
|
|
34310
|
+
isString: isString,
|
|
34311
|
+
isNumber: isNumber,
|
|
34312
|
+
isObject: isObject$2,
|
|
34313
|
+
isPlainObject: isPlainObject,
|
|
34314
|
+
isUndefined: isUndefined,
|
|
34315
|
+
isDate: isDate,
|
|
34316
|
+
isFile: isFile,
|
|
34317
|
+
isBlob: isBlob,
|
|
34318
|
+
isFunction: isFunction$2,
|
|
34319
|
+
isStream: isStream,
|
|
34320
|
+
isURLSearchParams: isURLSearchParams,
|
|
34321
|
+
isStandardBrowserEnv: isStandardBrowserEnv,
|
|
34322
|
+
forEach: forEach,
|
|
34323
|
+
merge: merge,
|
|
34324
|
+
extend: extend,
|
|
34325
|
+
trim: trim,
|
|
34326
|
+
stripBOM: stripBOM
|
|
34327
|
+
};
|
|
34328
|
+
|
|
34329
|
+
function encode(val) {
|
|
34330
|
+
return encodeURIComponent(val).replace(/%3A/gi, ':').replace(/%24/g, '$').replace(/%2C/gi, ',').replace(/%20/g, '+').replace(/%5B/gi, '[').replace(/%5D/gi, ']');
|
|
34331
|
+
}
|
|
34332
|
+
var buildURL = function buildURL(url, params, paramsSerializer) {
|
|
34333
|
+
if (!params) {
|
|
34334
|
+
return url;
|
|
34335
|
+
}
|
|
34336
|
+
var serializedParams;
|
|
34337
|
+
if (paramsSerializer) {
|
|
34338
|
+
serializedParams = paramsSerializer(params);
|
|
34339
|
+
} else if (utils.isURLSearchParams(params)) {
|
|
34340
|
+
serializedParams = params.toString();
|
|
34341
|
+
} else {
|
|
34342
|
+
var parts = [];
|
|
34343
|
+
utils.forEach(params, function serialize(val, key) {
|
|
34344
|
+
if (val === null || typeof val === 'undefined') {
|
|
34345
|
+
return;
|
|
34346
|
+
}
|
|
34347
|
+
if (utils.isArray(val)) {
|
|
34348
|
+
key = key + '[]';
|
|
34349
|
+
} else {
|
|
34350
|
+
val = [val];
|
|
34351
|
+
}
|
|
34352
|
+
utils.forEach(val, function parseValue(v) {
|
|
34353
|
+
if (utils.isDate(v)) {
|
|
34354
|
+
v = v.toISOString();
|
|
34355
|
+
} else if (utils.isObject(v)) {
|
|
34356
|
+
v = JSON.stringify(v);
|
|
34357
|
+
}
|
|
34358
|
+
parts.push(encode(key) + '=' + encode(v));
|
|
34359
|
+
});
|
|
34360
|
+
});
|
|
34361
|
+
serializedParams = parts.join('&');
|
|
34362
|
+
}
|
|
34363
|
+
if (serializedParams) {
|
|
34364
|
+
var hashmarkIndex = url.indexOf('#');
|
|
34365
|
+
if (hashmarkIndex !== -1) {
|
|
34366
|
+
url = url.slice(0, hashmarkIndex);
|
|
34367
|
+
}
|
|
34368
|
+
url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
|
|
34369
|
+
}
|
|
34370
|
+
return url;
|
|
34371
|
+
};
|
|
34372
|
+
|
|
34373
|
+
function InterceptorManager() {
|
|
34374
|
+
this.handlers = [];
|
|
34375
|
+
}
|
|
34376
|
+
InterceptorManager.prototype.use = function use(fulfilled, rejected) {
|
|
34377
|
+
this.handlers.push({
|
|
34378
|
+
fulfilled: fulfilled,
|
|
34379
|
+
rejected: rejected
|
|
34380
|
+
});
|
|
34381
|
+
return this.handlers.length - 1;
|
|
34382
|
+
};
|
|
34383
|
+
InterceptorManager.prototype.eject = function eject(id) {
|
|
34384
|
+
if (this.handlers[id]) {
|
|
34385
|
+
this.handlers[id] = null;
|
|
34386
|
+
}
|
|
34387
|
+
};
|
|
34388
|
+
InterceptorManager.prototype.forEach = function forEach(fn) {
|
|
34389
|
+
utils.forEach(this.handlers, function forEachHandler(h) {
|
|
34390
|
+
if (h !== null) {
|
|
34391
|
+
fn(h);
|
|
34392
|
+
}
|
|
34393
|
+
});
|
|
34394
|
+
};
|
|
34395
|
+
var InterceptorManager_1 = InterceptorManager;
|
|
34396
|
+
|
|
34397
|
+
var transformData = function transformData(data, headers, fns) {
|
|
34398
|
+
utils.forEach(fns, function transform(fn) {
|
|
34399
|
+
data = fn(data, headers);
|
|
34400
|
+
});
|
|
34401
|
+
return data;
|
|
34402
|
+
};
|
|
34403
|
+
|
|
34404
|
+
var isCancel = function isCancel(value) {
|
|
34405
|
+
return !!(value && value.__CANCEL__);
|
|
34406
|
+
};
|
|
34407
|
+
|
|
34408
|
+
var normalizeHeaderName = function normalizeHeaderName(headers, normalizedName) {
|
|
34409
|
+
utils.forEach(headers, function processHeader(value, name) {
|
|
34410
|
+
if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {
|
|
34411
|
+
headers[normalizedName] = value;
|
|
34412
|
+
delete headers[name];
|
|
34413
|
+
}
|
|
34414
|
+
});
|
|
34415
|
+
};
|
|
34416
|
+
|
|
34417
|
+
var enhanceError = function enhanceError(error, config, code, request, response) {
|
|
34418
|
+
error.config = config;
|
|
34419
|
+
if (code) {
|
|
34420
|
+
error.code = code;
|
|
34421
|
+
}
|
|
34422
|
+
error.request = request;
|
|
34423
|
+
error.response = response;
|
|
34424
|
+
error.isAxiosError = true;
|
|
34425
|
+
error.toJSON = function toJSON() {
|
|
34426
|
+
return {
|
|
34427
|
+
message: this.message,
|
|
34428
|
+
name: this.name,
|
|
34429
|
+
description: this.description,
|
|
34430
|
+
number: this.number,
|
|
34431
|
+
fileName: this.fileName,
|
|
34432
|
+
lineNumber: this.lineNumber,
|
|
34433
|
+
columnNumber: this.columnNumber,
|
|
34434
|
+
stack: this.stack,
|
|
34435
|
+
config: this.config,
|
|
34436
|
+
code: this.code
|
|
34437
|
+
};
|
|
34438
|
+
};
|
|
34439
|
+
return error;
|
|
34440
|
+
};
|
|
34441
|
+
|
|
34442
|
+
var createError = function createError(message, config, code, request, response) {
|
|
34443
|
+
var error = new Error(message);
|
|
34444
|
+
return enhanceError(error, config, code, request, response);
|
|
34445
|
+
};
|
|
34446
|
+
|
|
34447
|
+
var settle = function settle(resolve, reject, response) {
|
|
34448
|
+
var validateStatus = response.config.validateStatus;
|
|
34449
|
+
if (!response.status || !validateStatus || validateStatus(response.status)) {
|
|
34450
|
+
resolve(response);
|
|
34451
|
+
} else {
|
|
34452
|
+
reject(createError('Request failed with status code ' + response.status, response.config, null, response.request, response));
|
|
34453
|
+
}
|
|
34454
|
+
};
|
|
34455
|
+
|
|
34456
|
+
var cookies = utils.isStandardBrowserEnv() ? function standardBrowserEnv() {
|
|
34457
|
+
return {
|
|
34458
|
+
write: function write(name, value, expires, path, domain, secure) {
|
|
34459
|
+
var cookie = [];
|
|
34460
|
+
cookie.push(name + '=' + encodeURIComponent(value));
|
|
34461
|
+
if (utils.isNumber(expires)) {
|
|
34462
|
+
cookie.push('expires=' + new Date(expires).toGMTString());
|
|
34463
|
+
}
|
|
34464
|
+
if (utils.isString(path)) {
|
|
34465
|
+
cookie.push('path=' + path);
|
|
34466
|
+
}
|
|
34467
|
+
if (utils.isString(domain)) {
|
|
34468
|
+
cookie.push('domain=' + domain);
|
|
34469
|
+
}
|
|
34470
|
+
if (secure === true) {
|
|
34471
|
+
cookie.push('secure');
|
|
34472
|
+
}
|
|
34473
|
+
document.cookie = cookie.join('; ');
|
|
34474
|
+
},
|
|
34475
|
+
read: function read(name) {
|
|
34476
|
+
var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
|
|
34477
|
+
return match ? decodeURIComponent(match[3]) : null;
|
|
34478
|
+
},
|
|
34479
|
+
remove: function remove(name) {
|
|
34480
|
+
this.write(name, '', Date.now() - 86400000);
|
|
34481
|
+
}
|
|
34482
|
+
};
|
|
34483
|
+
}() : function nonStandardBrowserEnv() {
|
|
34484
|
+
return {
|
|
34485
|
+
write: function write() {},
|
|
34486
|
+
read: function read() {
|
|
34487
|
+
return null;
|
|
34488
|
+
},
|
|
34489
|
+
remove: function remove() {}
|
|
34490
|
+
};
|
|
34491
|
+
}();
|
|
34492
|
+
|
|
34493
|
+
var isAbsoluteURL = function isAbsoluteURL(url) {
|
|
34494
|
+
return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url);
|
|
34495
|
+
};
|
|
34496
|
+
|
|
34497
|
+
var combineURLs = function combineURLs(baseURL, relativeURL) {
|
|
34498
|
+
return relativeURL ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') : baseURL;
|
|
34499
|
+
};
|
|
34500
|
+
|
|
34501
|
+
var buildFullPath = function buildFullPath(baseURL, requestedURL) {
|
|
34502
|
+
if (baseURL && !isAbsoluteURL(requestedURL)) {
|
|
34503
|
+
return combineURLs(baseURL, requestedURL);
|
|
34504
|
+
}
|
|
34505
|
+
return requestedURL;
|
|
34506
|
+
};
|
|
34507
|
+
|
|
34508
|
+
var ignoreDuplicateOf = ['age', 'authorization', 'content-length', 'content-type', 'etag', 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', 'last-modified', 'location', 'max-forwards', 'proxy-authorization', 'referer', 'retry-after', 'user-agent'];
|
|
34509
|
+
var parseHeaders = function parseHeaders(headers) {
|
|
34510
|
+
var parsed = {};
|
|
34511
|
+
var key;
|
|
34512
|
+
var val;
|
|
34513
|
+
var i;
|
|
34514
|
+
if (!headers) {
|
|
34515
|
+
return parsed;
|
|
34516
|
+
}
|
|
34517
|
+
utils.forEach(headers.split('\n'), function parser(line) {
|
|
34518
|
+
i = line.indexOf(':');
|
|
34519
|
+
key = utils.trim(line.substr(0, i)).toLowerCase();
|
|
34520
|
+
val = utils.trim(line.substr(i + 1));
|
|
34521
|
+
if (key) {
|
|
34522
|
+
if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {
|
|
34523
|
+
return;
|
|
34524
|
+
}
|
|
34525
|
+
if (key === 'set-cookie') {
|
|
34526
|
+
parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);
|
|
34527
|
+
} else {
|
|
34528
|
+
parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
|
|
34529
|
+
}
|
|
34530
|
+
}
|
|
34531
|
+
});
|
|
34532
|
+
return parsed;
|
|
34533
|
+
};
|
|
34534
|
+
|
|
34535
|
+
var isURLSameOrigin = utils.isStandardBrowserEnv() ? function standardBrowserEnv() {
|
|
34536
|
+
var msie = /(msie|trident)/i.test(navigator.userAgent);
|
|
34537
|
+
var urlParsingNode = document.createElement('a');
|
|
34538
|
+
var originURL;
|
|
34539
|
+
function resolveURL(url) {
|
|
34540
|
+
var href = url;
|
|
34541
|
+
if (msie) {
|
|
34542
|
+
urlParsingNode.setAttribute('href', href);
|
|
34543
|
+
href = urlParsingNode.href;
|
|
34544
|
+
}
|
|
34545
|
+
urlParsingNode.setAttribute('href', href);
|
|
34546
|
+
return {
|
|
34547
|
+
href: urlParsingNode.href,
|
|
34548
|
+
protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
|
|
34549
|
+
host: urlParsingNode.host,
|
|
34550
|
+
search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
|
|
34551
|
+
hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
|
|
34552
|
+
hostname: urlParsingNode.hostname,
|
|
34553
|
+
port: urlParsingNode.port,
|
|
34554
|
+
pathname: urlParsingNode.pathname.charAt(0) === '/' ? urlParsingNode.pathname : '/' + urlParsingNode.pathname
|
|
34555
|
+
};
|
|
34556
|
+
}
|
|
34557
|
+
originURL = resolveURL(window.location.href);
|
|
34558
|
+
return function isURLSameOrigin(requestURL) {
|
|
34559
|
+
var parsed = utils.isString(requestURL) ? resolveURL(requestURL) : requestURL;
|
|
34560
|
+
return parsed.protocol === originURL.protocol && parsed.host === originURL.host;
|
|
34561
|
+
};
|
|
34562
|
+
}() : function nonStandardBrowserEnv() {
|
|
34563
|
+
return function isURLSameOrigin() {
|
|
34564
|
+
return true;
|
|
34565
|
+
};
|
|
34566
|
+
}();
|
|
34567
|
+
|
|
34568
|
+
var xhr = function xhrAdapter(config) {
|
|
34569
|
+
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
|
34570
|
+
var requestData = config.data;
|
|
34571
|
+
var requestHeaders = config.headers;
|
|
34572
|
+
if (utils.isFormData(requestData)) {
|
|
34573
|
+
delete requestHeaders['Content-Type'];
|
|
34574
|
+
}
|
|
34575
|
+
var request = new XMLHttpRequest();
|
|
34576
|
+
if (config.auth) {
|
|
34577
|
+
var username = config.auth.username || '';
|
|
34578
|
+
var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';
|
|
34579
|
+
requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);
|
|
34580
|
+
}
|
|
34581
|
+
var fullPath = buildFullPath(config.baseURL, config.url);
|
|
34582
|
+
request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
|
|
34583
|
+
request.timeout = config.timeout;
|
|
34584
|
+
request.onreadystatechange = function handleLoad() {
|
|
34585
|
+
if (!request || request.readyState !== 4) {
|
|
34586
|
+
return;
|
|
34587
|
+
}
|
|
34588
|
+
if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
|
|
34589
|
+
return;
|
|
34590
|
+
}
|
|
34591
|
+
var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;
|
|
34592
|
+
var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;
|
|
34593
|
+
var response = {
|
|
34594
|
+
data: responseData,
|
|
34595
|
+
status: request.status,
|
|
34596
|
+
statusText: request.statusText,
|
|
34597
|
+
headers: responseHeaders,
|
|
34598
|
+
config: config,
|
|
34599
|
+
request: request
|
|
33688
34600
|
};
|
|
33689
|
-
|
|
33690
|
-
|
|
33691
|
-
|
|
33692
|
-
|
|
33693
|
-
|
|
33694
|
-
|
|
34601
|
+
settle(resolve, reject, response);
|
|
34602
|
+
request = null;
|
|
34603
|
+
};
|
|
34604
|
+
request.onabort = function handleAbort() {
|
|
34605
|
+
if (!request) {
|
|
34606
|
+
return;
|
|
34607
|
+
}
|
|
34608
|
+
reject(createError('Request aborted', config, 'ECONNABORTED', request));
|
|
34609
|
+
request = null;
|
|
34610
|
+
};
|
|
34611
|
+
request.onerror = function handleError() {
|
|
34612
|
+
reject(createError('Network Error', config, null, request));
|
|
34613
|
+
request = null;
|
|
34614
|
+
};
|
|
34615
|
+
request.ontimeout = function handleTimeout() {
|
|
34616
|
+
var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';
|
|
34617
|
+
if (config.timeoutErrorMessage) {
|
|
34618
|
+
timeoutErrorMessage = config.timeoutErrorMessage;
|
|
34619
|
+
}
|
|
34620
|
+
reject(createError(timeoutErrorMessage, config, 'ECONNABORTED', request));
|
|
34621
|
+
request = null;
|
|
34622
|
+
};
|
|
34623
|
+
if (utils.isStandardBrowserEnv()) {
|
|
34624
|
+
var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ? cookies.read(config.xsrfCookieName) : undefined;
|
|
34625
|
+
if (xsrfValue) {
|
|
34626
|
+
requestHeaders[config.xsrfHeaderName] = xsrfValue;
|
|
34627
|
+
}
|
|
34628
|
+
}
|
|
34629
|
+
if ('setRequestHeader' in request) {
|
|
34630
|
+
utils.forEach(requestHeaders, function setRequestHeader(val, key) {
|
|
34631
|
+
if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {
|
|
34632
|
+
delete requestHeaders[key];
|
|
34633
|
+
} else {
|
|
34634
|
+
request.setRequestHeader(key, val);
|
|
34635
|
+
}
|
|
33695
34636
|
});
|
|
33696
34637
|
}
|
|
33697
|
-
|
|
33698
|
-
|
|
33699
|
-
|
|
33700
|
-
|
|
33701
|
-
|
|
33702
|
-
|
|
33703
|
-
|
|
33704
|
-
|
|
33705
|
-
|
|
33706
|
-
|
|
33707
|
-
|
|
33708
|
-
}
|
|
33709
|
-
|
|
33710
|
-
|
|
33711
|
-
|
|
33712
|
-
|
|
33713
|
-
|
|
33714
|
-
}
|
|
34638
|
+
if (!utils.isUndefined(config.withCredentials)) {
|
|
34639
|
+
request.withCredentials = !!config.withCredentials;
|
|
34640
|
+
}
|
|
34641
|
+
if (config.responseType) {
|
|
34642
|
+
try {
|
|
34643
|
+
request.responseType = config.responseType;
|
|
34644
|
+
} catch (e) {
|
|
34645
|
+
if (config.responseType !== 'json') {
|
|
34646
|
+
throw e;
|
|
34647
|
+
}
|
|
34648
|
+
}
|
|
34649
|
+
}
|
|
34650
|
+
if (typeof config.onDownloadProgress === 'function') {
|
|
34651
|
+
request.addEventListener('progress', config.onDownloadProgress);
|
|
34652
|
+
}
|
|
34653
|
+
if (typeof config.onUploadProgress === 'function' && request.upload) {
|
|
34654
|
+
request.upload.addEventListener('progress', config.onUploadProgress);
|
|
34655
|
+
}
|
|
34656
|
+
if (config.cancelToken) {
|
|
34657
|
+
config.cancelToken.promise.then(function onCanceled(cancel) {
|
|
34658
|
+
if (!request) {
|
|
34659
|
+
return;
|
|
34660
|
+
}
|
|
34661
|
+
request.abort();
|
|
34662
|
+
reject(cancel);
|
|
34663
|
+
request = null;
|
|
34664
|
+
});
|
|
34665
|
+
}
|
|
34666
|
+
if (!requestData) {
|
|
34667
|
+
requestData = null;
|
|
34668
|
+
}
|
|
34669
|
+
request.send(requestData);
|
|
34670
|
+
});
|
|
34671
|
+
};
|
|
34672
|
+
|
|
34673
|
+
var DEFAULT_CONTENT_TYPE = {
|
|
34674
|
+
'Content-Type': 'application/x-www-form-urlencoded'
|
|
34675
|
+
};
|
|
34676
|
+
function setContentTypeIfUnset(headers, value) {
|
|
34677
|
+
if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {
|
|
34678
|
+
headers['Content-Type'] = value;
|
|
33715
34679
|
}
|
|
33716
|
-
|
|
33717
|
-
|
|
33718
|
-
|
|
33719
|
-
|
|
33720
|
-
|
|
33721
|
-
|
|
33722
|
-
|
|
33723
|
-
|
|
33724
|
-
|
|
33725
|
-
|
|
33726
|
-
|
|
33727
|
-
|
|
33728
|
-
|
|
34680
|
+
}
|
|
34681
|
+
function getDefaultAdapter() {
|
|
34682
|
+
var adapter;
|
|
34683
|
+
if (typeof XMLHttpRequest !== 'undefined') {
|
|
34684
|
+
adapter = xhr;
|
|
34685
|
+
} else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {
|
|
34686
|
+
adapter = xhr;
|
|
34687
|
+
}
|
|
34688
|
+
return adapter;
|
|
34689
|
+
}
|
|
34690
|
+
var defaults = {
|
|
34691
|
+
adapter: getDefaultAdapter(),
|
|
34692
|
+
transformRequest: [function transformRequest(data, headers) {
|
|
34693
|
+
normalizeHeaderName(headers, 'Accept');
|
|
34694
|
+
normalizeHeaderName(headers, 'Content-Type');
|
|
34695
|
+
if (utils.isFormData(data) || utils.isArrayBuffer(data) || utils.isBuffer(data) || utils.isStream(data) || utils.isFile(data) || utils.isBlob(data)) {
|
|
34696
|
+
return data;
|
|
33729
34697
|
}
|
|
33730
|
-
|
|
33731
|
-
|
|
33732
|
-
|
|
33733
|
-
|
|
33734
|
-
|
|
33735
|
-
|
|
33736
|
-
|
|
33737
|
-
|
|
33738
|
-
|
|
33739
|
-
|
|
33740
|
-
|
|
33741
|
-
|
|
33742
|
-
|
|
33743
|
-
|
|
33744
|
-
|
|
33745
|
-
|
|
33746
|
-
|
|
33747
|
-
|
|
33748
|
-
|
|
33749
|
-
|
|
33750
|
-
|
|
33751
|
-
|
|
34698
|
+
if (utils.isArrayBufferView(data)) {
|
|
34699
|
+
return data.buffer;
|
|
34700
|
+
}
|
|
34701
|
+
if (utils.isURLSearchParams(data)) {
|
|
34702
|
+
setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');
|
|
34703
|
+
return data.toString();
|
|
34704
|
+
}
|
|
34705
|
+
if (utils.isObject(data)) {
|
|
34706
|
+
setContentTypeIfUnset(headers, 'application/json;charset=utf-8');
|
|
34707
|
+
return JSON.stringify(data);
|
|
34708
|
+
}
|
|
34709
|
+
return data;
|
|
34710
|
+
}],
|
|
34711
|
+
transformResponse: [function transformResponse(data) {
|
|
34712
|
+
if (typeof data === 'string') {
|
|
34713
|
+
try {
|
|
34714
|
+
data = JSON.parse(data);
|
|
34715
|
+
} catch (e) {}
|
|
34716
|
+
}
|
|
34717
|
+
return data;
|
|
34718
|
+
}],
|
|
34719
|
+
timeout: 0,
|
|
34720
|
+
xsrfCookieName: 'XSRF-TOKEN',
|
|
34721
|
+
xsrfHeaderName: 'X-XSRF-TOKEN',
|
|
34722
|
+
maxContentLength: -1,
|
|
34723
|
+
maxBodyLength: -1,
|
|
34724
|
+
validateStatus: function validateStatus(status) {
|
|
34725
|
+
return status >= 200 && status < 300;
|
|
34726
|
+
}
|
|
34727
|
+
};
|
|
34728
|
+
defaults.headers = {
|
|
34729
|
+
common: {
|
|
34730
|
+
'Accept': 'application/json, text/plain, */*'
|
|
34731
|
+
}
|
|
33752
34732
|
};
|
|
34733
|
+
utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {
|
|
34734
|
+
defaults.headers[method] = {};
|
|
34735
|
+
});
|
|
34736
|
+
utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
|
|
34737
|
+
defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);
|
|
34738
|
+
});
|
|
34739
|
+
var defaults_1 = defaults;
|
|
33753
34740
|
|
|
33754
|
-
|
|
33755
|
-
if (
|
|
33756
|
-
|
|
34741
|
+
function throwIfCancellationRequested(config) {
|
|
34742
|
+
if (config.cancelToken) {
|
|
34743
|
+
config.cancelToken.throwIfRequested();
|
|
33757
34744
|
}
|
|
33758
|
-
|
|
33759
|
-
|
|
34745
|
+
}
|
|
34746
|
+
var dispatchRequest = function dispatchRequest(config) {
|
|
34747
|
+
throwIfCancellationRequested(config);
|
|
34748
|
+
config.headers = config.headers || {};
|
|
34749
|
+
config.data = transformData(config.data, config.headers, config.transformRequest);
|
|
34750
|
+
config.headers = utils.merge(config.headers.common || {}, config.headers[config.method] || {}, config.headers);
|
|
34751
|
+
utils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], function cleanHeaderConfig(method) {
|
|
34752
|
+
delete config.headers[method];
|
|
34753
|
+
});
|
|
34754
|
+
var adapter = config.adapter || defaults_1.adapter;
|
|
34755
|
+
return adapter(config).then(function onAdapterResolution(response) {
|
|
34756
|
+
throwIfCancellationRequested(config);
|
|
34757
|
+
response.data = transformData(response.data, response.headers, config.transformResponse);
|
|
34758
|
+
return response;
|
|
34759
|
+
}, function onAdapterRejection(reason) {
|
|
34760
|
+
if (!isCancel(reason)) {
|
|
34761
|
+
throwIfCancellationRequested(config);
|
|
34762
|
+
if (reason && reason.response) {
|
|
34763
|
+
reason.response.data = transformData(reason.response.data, reason.response.headers, config.transformResponse);
|
|
34764
|
+
}
|
|
34765
|
+
}
|
|
34766
|
+
return Promise.reject(reason);
|
|
34767
|
+
});
|
|
34768
|
+
};
|
|
34769
|
+
|
|
34770
|
+
var mergeConfig = function mergeConfig(config1, config2) {
|
|
34771
|
+
config2 = config2 || {};
|
|
34772
|
+
var config = {};
|
|
34773
|
+
var valueFromConfig2Keys = ['url', 'method', 'data'];
|
|
34774
|
+
var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params'];
|
|
34775
|
+
var defaultToConfig2Keys = ['baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer', 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName', 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress', 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent', 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding'];
|
|
34776
|
+
var directMergeKeys = ['validateStatus'];
|
|
34777
|
+
function getMergedValue(target, source) {
|
|
34778
|
+
if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
|
|
34779
|
+
return utils.merge(target, source);
|
|
34780
|
+
} else if (utils.isPlainObject(source)) {
|
|
34781
|
+
return utils.merge({}, source);
|
|
34782
|
+
} else if (utils.isArray(source)) {
|
|
34783
|
+
return source.slice();
|
|
34784
|
+
}
|
|
34785
|
+
return source;
|
|
33760
34786
|
}
|
|
33761
|
-
|
|
33762
|
-
|
|
34787
|
+
function mergeDeepProperties(prop) {
|
|
34788
|
+
if (!utils.isUndefined(config2[prop])) {
|
|
34789
|
+
config[prop] = getMergedValue(config1[prop], config2[prop]);
|
|
34790
|
+
} else if (!utils.isUndefined(config1[prop])) {
|
|
34791
|
+
config[prop] = getMergedValue(undefined, config1[prop]);
|
|
34792
|
+
}
|
|
33763
34793
|
}
|
|
33764
|
-
|
|
33765
|
-
|
|
34794
|
+
utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {
|
|
34795
|
+
if (!utils.isUndefined(config2[prop])) {
|
|
34796
|
+
config[prop] = getMergedValue(undefined, config2[prop]);
|
|
34797
|
+
}
|
|
34798
|
+
});
|
|
34799
|
+
utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);
|
|
34800
|
+
utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {
|
|
34801
|
+
if (!utils.isUndefined(config2[prop])) {
|
|
34802
|
+
config[prop] = getMergedValue(undefined, config2[prop]);
|
|
34803
|
+
} else if (!utils.isUndefined(config1[prop])) {
|
|
34804
|
+
config[prop] = getMergedValue(undefined, config1[prop]);
|
|
34805
|
+
}
|
|
34806
|
+
});
|
|
34807
|
+
utils.forEach(directMergeKeys, function merge(prop) {
|
|
34808
|
+
if (prop in config2) {
|
|
34809
|
+
config[prop] = getMergedValue(config1[prop], config2[prop]);
|
|
34810
|
+
} else if (prop in config1) {
|
|
34811
|
+
config[prop] = getMergedValue(undefined, config1[prop]);
|
|
34812
|
+
}
|
|
34813
|
+
});
|
|
34814
|
+
var axiosKeys = valueFromConfig2Keys.concat(mergeDeepPropertiesKeys).concat(defaultToConfig2Keys).concat(directMergeKeys);
|
|
34815
|
+
var otherKeys = Object.keys(config1).concat(Object.keys(config2)).filter(function filterAxiosKeys(key) {
|
|
34816
|
+
return axiosKeys.indexOf(key) === -1;
|
|
34817
|
+
});
|
|
34818
|
+
utils.forEach(otherKeys, mergeDeepProperties);
|
|
34819
|
+
return config;
|
|
34820
|
+
};
|
|
34821
|
+
|
|
34822
|
+
function Axios(instanceConfig) {
|
|
34823
|
+
this.defaults = instanceConfig;
|
|
34824
|
+
this.interceptors = {
|
|
34825
|
+
request: new InterceptorManager_1(),
|
|
34826
|
+
response: new InterceptorManager_1()
|
|
34827
|
+
};
|
|
34828
|
+
}
|
|
34829
|
+
Axios.prototype.request = function request(config) {
|
|
34830
|
+
if (typeof config === 'string') {
|
|
34831
|
+
config = arguments[1] || {};
|
|
34832
|
+
config.url = arguments[0];
|
|
34833
|
+
} else {
|
|
34834
|
+
config = config || {};
|
|
33766
34835
|
}
|
|
33767
|
-
|
|
33768
|
-
|
|
34836
|
+
config = mergeConfig(this.defaults, config);
|
|
34837
|
+
if (config.method) {
|
|
34838
|
+
config.method = config.method.toLowerCase();
|
|
34839
|
+
} else if (this.defaults.method) {
|
|
34840
|
+
config.method = this.defaults.method.toLowerCase();
|
|
34841
|
+
} else {
|
|
34842
|
+
config.method = 'get';
|
|
33769
34843
|
}
|
|
33770
|
-
|
|
33771
|
-
|
|
34844
|
+
var chain = [dispatchRequest, undefined];
|
|
34845
|
+
var promise = Promise.resolve(config);
|
|
34846
|
+
this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
|
|
34847
|
+
chain.unshift(interceptor.fulfilled, interceptor.rejected);
|
|
34848
|
+
});
|
|
34849
|
+
this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
|
|
34850
|
+
chain.push(interceptor.fulfilled, interceptor.rejected);
|
|
34851
|
+
});
|
|
34852
|
+
while (chain.length) {
|
|
34853
|
+
promise = promise.then(chain.shift(), chain.shift());
|
|
33772
34854
|
}
|
|
33773
|
-
|
|
33774
|
-
|
|
34855
|
+
return promise;
|
|
34856
|
+
};
|
|
34857
|
+
Axios.prototype.getUri = function getUri(config) {
|
|
34858
|
+
config = mergeConfig(this.defaults, config);
|
|
34859
|
+
return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, '');
|
|
34860
|
+
};
|
|
34861
|
+
utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
|
|
34862
|
+
Axios.prototype[method] = function (url, config) {
|
|
34863
|
+
return this.request(mergeConfig(config || {}, {
|
|
34864
|
+
method: method,
|
|
34865
|
+
url: url,
|
|
34866
|
+
data: (config || {}).data
|
|
34867
|
+
}));
|
|
34868
|
+
};
|
|
34869
|
+
});
|
|
34870
|
+
utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
|
|
34871
|
+
Axios.prototype[method] = function (url, data, config) {
|
|
34872
|
+
return this.request(mergeConfig(config || {}, {
|
|
34873
|
+
method: method,
|
|
34874
|
+
url: url,
|
|
34875
|
+
data: data
|
|
34876
|
+
}));
|
|
34877
|
+
};
|
|
34878
|
+
});
|
|
34879
|
+
var Axios_1 = Axios;
|
|
34880
|
+
|
|
34881
|
+
function Cancel(message) {
|
|
34882
|
+
this.message = message;
|
|
34883
|
+
}
|
|
34884
|
+
Cancel.prototype.toString = function toString() {
|
|
34885
|
+
return 'Cancel' + (this.message ? ': ' + this.message : '');
|
|
34886
|
+
};
|
|
34887
|
+
Cancel.prototype.__CANCEL__ = true;
|
|
34888
|
+
var Cancel_1 = Cancel;
|
|
34889
|
+
|
|
34890
|
+
function CancelToken(executor) {
|
|
34891
|
+
if (typeof executor !== 'function') {
|
|
34892
|
+
throw new TypeError('executor must be a function.');
|
|
34893
|
+
}
|
|
34894
|
+
var resolvePromise;
|
|
34895
|
+
this.promise = new Promise(function promiseExecutor(resolve) {
|
|
34896
|
+
resolvePromise = resolve;
|
|
34897
|
+
});
|
|
34898
|
+
var token = this;
|
|
34899
|
+
executor(function cancel(message) {
|
|
34900
|
+
if (token.reason) {
|
|
34901
|
+
return;
|
|
34902
|
+
}
|
|
34903
|
+
token.reason = new Cancel_1(message);
|
|
34904
|
+
resolvePromise(token.reason);
|
|
34905
|
+
});
|
|
34906
|
+
}
|
|
34907
|
+
CancelToken.prototype.throwIfRequested = function throwIfRequested() {
|
|
34908
|
+
if (this.reason) {
|
|
34909
|
+
throw this.reason;
|
|
34910
|
+
}
|
|
34911
|
+
};
|
|
34912
|
+
CancelToken.source = function source() {
|
|
34913
|
+
var cancel;
|
|
34914
|
+
var token = new CancelToken(function executor(c) {
|
|
34915
|
+
cancel = c;
|
|
34916
|
+
});
|
|
34917
|
+
return {
|
|
34918
|
+
token: token,
|
|
34919
|
+
cancel: cancel
|
|
34920
|
+
};
|
|
34921
|
+
};
|
|
34922
|
+
var CancelToken_1 = CancelToken;
|
|
34923
|
+
|
|
34924
|
+
var spread = function spread(callback) {
|
|
34925
|
+
return function wrap(arr) {
|
|
34926
|
+
return callback.apply(null, arr);
|
|
34927
|
+
};
|
|
34928
|
+
};
|
|
34929
|
+
|
|
34930
|
+
var isAxiosError = function isAxiosError(payload) {
|
|
34931
|
+
return typeof payload === 'object' && payload.isAxiosError === true;
|
|
34932
|
+
};
|
|
34933
|
+
|
|
34934
|
+
function createInstance(defaultConfig) {
|
|
34935
|
+
var context = new Axios_1(defaultConfig);
|
|
34936
|
+
var instance = bind(Axios_1.prototype.request, context);
|
|
34937
|
+
utils.extend(instance, Axios_1.prototype, context);
|
|
34938
|
+
utils.extend(instance, context);
|
|
34939
|
+
return instance;
|
|
34940
|
+
}
|
|
34941
|
+
var axios = createInstance(defaults_1);
|
|
34942
|
+
axios.Axios = Axios_1;
|
|
34943
|
+
axios.create = function create(instanceConfig) {
|
|
34944
|
+
return createInstance(mergeConfig(axios.defaults, instanceConfig));
|
|
34945
|
+
};
|
|
34946
|
+
axios.Cancel = Cancel_1;
|
|
34947
|
+
axios.CancelToken = CancelToken_1;
|
|
34948
|
+
axios.isCancel = isCancel;
|
|
34949
|
+
axios.all = function all(promises) {
|
|
34950
|
+
return Promise.all(promises);
|
|
34951
|
+
};
|
|
34952
|
+
axios.spread = spread;
|
|
34953
|
+
axios.isAxiosError = isAxiosError;
|
|
34954
|
+
var axios_1 = axios;
|
|
34955
|
+
var _default = axios;
|
|
34956
|
+
axios_1.default = _default;
|
|
34957
|
+
|
|
34958
|
+
var axios$1 = axios_1;
|
|
34959
|
+
|
|
34960
|
+
axios$1.interceptors.response.use(res => res, err => {
|
|
34961
|
+
var _err$response, _err$response$data;
|
|
34962
|
+
const isEmployee = window.location.pathname.split("/").includes("employee");
|
|
34963
|
+
if (err !== null && err !== void 0 && (_err$response = err.response) !== null && _err$response !== void 0 && (_err$response$data = _err$response.data) !== null && _err$response$data !== void 0 && _err$response$data.Errors) {
|
|
34964
|
+
for (const error of err.response.data.Errors) {
|
|
34965
|
+
var _error$message, _error$message$toLowe, _error$message2, _error$message2$toLow;
|
|
34966
|
+
if (error.message.includes("InvalidAccessTokenException")) {
|
|
34967
|
+
localStorage.clear();
|
|
34968
|
+
sessionStorage.clear();
|
|
34969
|
+
window.location.href = (isEmployee ? "/digit-ui/employee/user/login" : "/digit-ui/citizen/login") + `?from=${encodeURIComponent(window.location.pathname + window.location.search)}`;
|
|
34970
|
+
} else if (error !== null && error !== void 0 && (_error$message = error.message) !== null && _error$message !== void 0 && (_error$message$toLowe = _error$message.toLowerCase()) !== null && _error$message$toLowe !== void 0 && _error$message$toLowe.includes("internal server error") || error !== null && error !== void 0 && (_error$message2 = error.message) !== null && _error$message2 !== void 0 && (_error$message2$toLow = _error$message2.toLowerCase()) !== null && _error$message2$toLow !== void 0 && _error$message2$toLow.includes("some error occured")) {
|
|
34971
|
+
window.location.href = (isEmployee ? "/digit-ui/employee/user/error" : "/digit-ui/citizen/error") + `?type=maintenance&from=${encodeURIComponent(window.location.pathname + window.location.search)}`;
|
|
34972
|
+
} else if (error.message.includes("ZuulRuntimeException")) {
|
|
34973
|
+
window.location.href = (isEmployee ? "/digit-ui/employee/user/error" : "/digit-ui/citizen/error") + `?type=notfound&from=${encodeURIComponent(window.location.pathname + window.location.search)}`;
|
|
34974
|
+
}
|
|
34975
|
+
}
|
|
33775
34976
|
}
|
|
34977
|
+
throw err;
|
|
34978
|
+
});
|
|
34979
|
+
window.Digit = window.Digit || {};
|
|
34980
|
+
window.Digit = {
|
|
34981
|
+
...window.Digit,
|
|
34982
|
+
RequestCache: window.Digit.RequestCache || {}
|
|
33776
34983
|
};
|
|
33777
34984
|
|
|
33778
34985
|
var lodash$1 = createCommonjsModule(function (module, exports) {
|
|
@@ -42653,7 +43860,7 @@ const ArrearSummary = _ref => {
|
|
|
42653
43860
|
};
|
|
42654
43861
|
|
|
42655
43862
|
function ApplicationDetailsContent(_ref) {
|
|
42656
|
-
var _applicationDetails$a2, _workflowDetails$data3, _workflowDetails$data4, _workflowDetails$data5, _workflowDetails$data6, _workflowDetails$data7, _workflowDetails$data8, _workflowDetails$data9, _workflowDetails$data10, _workflowDetails$data11, _workflowDetails$data12, _workflowDetails$data13, _workflowDetails$data21, _workflowDetails$data22;
|
|
43863
|
+
var _applicationDetails$a2, _applicationDetails$a3, _applicationDetails$a6, _workflowDetails$data3, _workflowDetails$data4, _workflowDetails$data5, _workflowDetails$data6, _workflowDetails$data7, _workflowDetails$data8, _workflowDetails$data9, _workflowDetails$data10, _workflowDetails$data11, _workflowDetails$data12, _workflowDetails$data13, _workflowDetails$data21, _workflowDetails$data22;
|
|
42657
43864
|
let {
|
|
42658
43865
|
applicationDetails,
|
|
42659
43866
|
demandData,
|
|
@@ -42673,8 +43880,11 @@ function ApplicationDetailsContent(_ref) {
|
|
|
42673
43880
|
const {
|
|
42674
43881
|
t
|
|
42675
43882
|
} = reactI18next.useTranslation();
|
|
43883
|
+
const history = reactRouterDom.useHistory();
|
|
43884
|
+
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
43885
|
+
const [showToast, setShowToast] = React.useState(null);
|
|
42676
43886
|
let isEditApplication = window.location.href.includes("editApplication") && window.location.href.includes("bpa");
|
|
42677
|
-
console.log("
|
|
43887
|
+
console.log("applicationDetails: ", applicationDetails);
|
|
42678
43888
|
function OpenImage(imageSource, index, thumbnailsToShow) {
|
|
42679
43889
|
var _thumbnailsToShow$ful;
|
|
42680
43890
|
window.open(thumbnailsToShow === null || thumbnailsToShow === void 0 ? void 0 : (_thumbnailsToShow$ful = thumbnailsToShow.fullImage) === null || _thumbnailsToShow$ful === void 0 ? void 0 : _thumbnailsToShow$ful[0], "_blank");
|
|
@@ -42856,19 +44066,19 @@ function ApplicationDetailsContent(_ref) {
|
|
|
42856
44066
|
};
|
|
42857
44067
|
const tableStyles = {
|
|
42858
44068
|
table: {
|
|
42859
|
-
border:
|
|
42860
|
-
width:
|
|
42861
|
-
fontFamily:
|
|
44069
|
+
border: "2px solid black",
|
|
44070
|
+
width: "100%",
|
|
44071
|
+
fontFamily: "sans-serif"
|
|
42862
44072
|
},
|
|
42863
44073
|
td: {
|
|
42864
44074
|
padding: "10px",
|
|
42865
|
-
border:
|
|
42866
|
-
textAlign:
|
|
44075
|
+
border: "1px solid black",
|
|
44076
|
+
textAlign: "center"
|
|
42867
44077
|
},
|
|
42868
44078
|
th: {
|
|
42869
44079
|
padding: "10px",
|
|
42870
|
-
border:
|
|
42871
|
-
textAlign:
|
|
44080
|
+
border: "1px solid black",
|
|
44081
|
+
textAlign: "center"
|
|
42872
44082
|
}
|
|
42873
44083
|
};
|
|
42874
44084
|
const getMainDivStyles = () => {
|
|
@@ -42918,6 +44128,79 @@ function ApplicationDetailsContent(_ref) {
|
|
|
42918
44128
|
const totalBalanceTax = demandData === null || demandData === void 0 ? void 0 : demandData.reduce((sum, item) => sum + item.balanceTax, 0);
|
|
42919
44129
|
const totalBalanceInterest = demandData === null || demandData === void 0 ? void 0 : demandData.reduce((sum, item) => sum + item.balanceInterest, 0);
|
|
42920
44130
|
const totalBalancePenality = demandData === null || demandData === void 0 ? void 0 : demandData.reduce((sum, item) => sum + item.balancePenality, 0);
|
|
44131
|
+
const closeToast = () => {
|
|
44132
|
+
setShowToast(null);
|
|
44133
|
+
};
|
|
44134
|
+
const updatePropertyStatus = function (propertyData, status, propertyIds) {
|
|
44135
|
+
try {
|
|
44136
|
+
const confirm = window.confirm(`Are you sure you want to make this property ${status}?`);
|
|
44137
|
+
if (!confirm) return Promise.resolve();
|
|
44138
|
+
const payload = {
|
|
44139
|
+
...propertyData,
|
|
44140
|
+
status: status,
|
|
44141
|
+
isactive: status === "ACTIVE",
|
|
44142
|
+
isinactive: status === "INACTIVE",
|
|
44143
|
+
creationReason: "STATUS",
|
|
44144
|
+
additionalDetails: {
|
|
44145
|
+
...propertyData.additionalDetails,
|
|
44146
|
+
propertytobestatus: status
|
|
44147
|
+
},
|
|
44148
|
+
workflow: {
|
|
44149
|
+
...propertyData.workflow,
|
|
44150
|
+
businessService: "PT.CREATE",
|
|
44151
|
+
action: "OPEN",
|
|
44152
|
+
moduleName: "PT"
|
|
44153
|
+
}
|
|
44154
|
+
};
|
|
44155
|
+
return Promise.resolve(Digit.PTService.updatePT({
|
|
44156
|
+
Property: {
|
|
44157
|
+
...payload
|
|
44158
|
+
}
|
|
44159
|
+
}, tenantId, propertyIds)).then(function (response) {
|
|
44160
|
+
console.log("response from inactive/active", response);
|
|
44161
|
+
});
|
|
44162
|
+
} catch (e) {
|
|
44163
|
+
return Promise.reject(e);
|
|
44164
|
+
}
|
|
44165
|
+
};
|
|
44166
|
+
const applicationData_pt = applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.applicationData;
|
|
44167
|
+
const propertyIds = (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a2 = applicationDetails.applicationData) === null || _applicationDetails$a2 === void 0 ? void 0 : _applicationDetails$a2.propertyId) || "";
|
|
44168
|
+
const checkPropertyStatus = applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a3 = applicationDetails.additionalDetails) === null || _applicationDetails$a3 === void 0 ? void 0 : _applicationDetails$a3.propertytobestatus;
|
|
44169
|
+
const PropertyInActive = () => {
|
|
44170
|
+
if (checkPropertyStatus == "ACTIVE") {
|
|
44171
|
+
updatePropertyStatus(applicationData_pt, "INACTIVE", propertyIds);
|
|
44172
|
+
} else {
|
|
44173
|
+
alert("Property is already inactive.");
|
|
44174
|
+
}
|
|
44175
|
+
};
|
|
44176
|
+
const PropertyActive = () => {
|
|
44177
|
+
if (checkPropertyStatus == "INACTIVE") {
|
|
44178
|
+
updatePropertyStatus(applicationData_pt, "ACTIVE", propertyIds);
|
|
44179
|
+
} else {
|
|
44180
|
+
alert("Property is already active.");
|
|
44181
|
+
}
|
|
44182
|
+
};
|
|
44183
|
+
const EditProperty = () => {
|
|
44184
|
+
var _applicationDetails$a4;
|
|
44185
|
+
const canEditProperty = (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a4 = applicationDetails.applicationData) === null || _applicationDetails$a4 === void 0 ? void 0 : _applicationDetails$a4.status) === "ACTIVE";
|
|
44186
|
+
if (canEditProperty) {
|
|
44187
|
+
var _applicationDetails$a5;
|
|
44188
|
+
const pID = applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a5 = applicationDetails.applicationData) === null || _applicationDetails$a5 === void 0 ? void 0 : _applicationDetails$a5.propertyId;
|
|
44189
|
+
if (pID) {
|
|
44190
|
+
history.push({
|
|
44191
|
+
pathname: `/digit-ui/employee/pt/edit-application/${pID}`
|
|
44192
|
+
});
|
|
44193
|
+
}
|
|
44194
|
+
} else {
|
|
44195
|
+
setShowToast({
|
|
44196
|
+
isError: true,
|
|
44197
|
+
label: " This action cannot be done on Inactive property or the property in workflow"
|
|
44198
|
+
});
|
|
44199
|
+
}
|
|
44200
|
+
};
|
|
44201
|
+
const AccessProperty = () => {
|
|
44202
|
+
alert("access property");
|
|
44203
|
+
};
|
|
42921
44204
|
return /*#__PURE__*/React__default.createElement(digitUiReactComponents.Card, {
|
|
42922
44205
|
style: {
|
|
42923
44206
|
position: "relative"
|
|
@@ -42930,8 +44213,8 @@ function ApplicationDetailsContent(_ref) {
|
|
|
42930
44213
|
infoClickLable: "WS_CLICK_ON_LABEL",
|
|
42931
44214
|
infoClickInfoLabel: getClickInfoDetails(),
|
|
42932
44215
|
infoClickInfoLabel1: getClickInfoDetails1()
|
|
42933
|
-
}) : null, applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$
|
|
42934
|
-
var _detail$values, _detail$additionalDet, _applicationDetails$
|
|
44216
|
+
}) : null, applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a6 = applicationDetails.applicationDetails) === null || _applicationDetails$a6 === void 0 ? void 0 : _applicationDetails$a6.map((detail, index) => {
|
|
44217
|
+
var _detail$values, _detail$additionalDet, _applicationDetails$a7, _applicationDetails$a8, _applicationDetails$a9, _applicationDetails$a10, _detail$additionalDet2, _applicationDetails$a11, _applicationDetails$a12, _detail$additionalDet3, _detail$additionalDet4, _detail$additionalDet5, _detail$additionalDet6, _detail$additionalDet7, _detail$additionalDet8, _detail$additionalDet9, _detail$additionalDet10, _detail$additionalDet11, _workflowDetails$data, _workflowDetails$data2, _detail$additionalDet12, _detail$additionalDet13, _detail$additionalDet14, _detail$additionalDet15, _detail$additionalDet16, _detail$additionalDet17, _detail$additionalDet18, _detail$additionalDet19, _detail$additionalDet20, _detail$additionalDet21, _detail$additionalDet22, _detail$additionalDet23, _detail$additionalDet24, _detail$additionalDet25, _detail$additionalDet26, _detail$additionalDet27, _detail$additionalDet28, _detail$additionalDet29, _detail$additionalDet30, _detail$additionalDet31;
|
|
42935
44218
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, {
|
|
42936
44219
|
key: index
|
|
42937
44220
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -43075,10 +44358,10 @@ function ApplicationDetailsContent(_ref) {
|
|
|
43075
44358
|
})))), (detail === null || detail === void 0 ? void 0 : detail.belowComponent) && /*#__PURE__*/React__default.createElement(detail.belowComponent, null), (detail === null || detail === void 0 ? void 0 : (_detail$additionalDet = detail.additionalDetails) === null || _detail$additionalDet === void 0 ? void 0 : _detail$additionalDet.inspectionReport) && /*#__PURE__*/React__default.createElement(ScruntinyDetails, {
|
|
43076
44359
|
scrutinyDetails: detail === null || detail === void 0 ? void 0 : detail.additionalDetails,
|
|
43077
44360
|
paymentsList: paymentsList,
|
|
43078
|
-
additionalDetails: applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$
|
|
44361
|
+
additionalDetails: applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a7 = applicationDetails.applicationData) === null || _applicationDetails$a7 === void 0 ? void 0 : _applicationDetails$a7.additionalDetails,
|
|
43079
44362
|
applicationData: applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.applicationData
|
|
43080
|
-
}), (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$
|
|
43081
|
-
fiReport: applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$
|
|
44363
|
+
}), (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a8 = applicationDetails.applicationData) === null || _applicationDetails$a8 === void 0 ? void 0 : (_applicationDetails$a9 = _applicationDetails$a8.additionalDetails) === null || _applicationDetails$a9 === void 0 ? void 0 : (_applicationDetails$a10 = _applicationDetails$a9.fieldinspection_pending) === null || _applicationDetails$a10 === void 0 ? void 0 : _applicationDetails$a10.length) > 0 && (detail === null || detail === void 0 ? void 0 : (_detail$additionalDet2 = detail.additionalDetails) === null || _detail$additionalDet2 === void 0 ? void 0 : _detail$additionalDet2.fiReport) && /*#__PURE__*/React__default.createElement(InspectionReport, {
|
|
44364
|
+
fiReport: applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a11 = applicationDetails.applicationData) === null || _applicationDetails$a11 === void 0 ? void 0 : (_applicationDetails$a12 = _applicationDetails$a11.additionalDetails) === null || _applicationDetails$a12 === void 0 ? void 0 : _applicationDetails$a12.fieldinspection_pending
|
|
43082
44365
|
}), (detail === null || detail === void 0 ? void 0 : (_detail$additionalDet3 = detail.additionalDetails) === null || _detail$additionalDet3 === void 0 ? void 0 : _detail$additionalDet3.floors) && /*#__PURE__*/React__default.createElement(PropertyFloors, {
|
|
43083
44366
|
floors: detail === null || detail === void 0 ? void 0 : (_detail$additionalDet4 = detail.additionalDetails) === null || _detail$additionalDet4 === void 0 ? void 0 : _detail$additionalDet4.floors
|
|
43084
44367
|
}), (detail === null || detail === void 0 ? void 0 : (_detail$additionalDet5 = detail.additionalDetails) === null || _detail$additionalDet5 === void 0 ? void 0 : _detail$additionalDet5.owners) && /*#__PURE__*/React__default.createElement(PropertyOwners, {
|
|
@@ -43177,9 +44460,9 @@ function ApplicationDetailsContent(_ref) {
|
|
|
43177
44460
|
onClick: toggleTimeline
|
|
43178
44461
|
})))), /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardSectionHeader, {
|
|
43179
44462
|
style: {
|
|
43180
|
-
marginBottom:
|
|
44463
|
+
marginBottom: "16px",
|
|
43181
44464
|
marginTop: "16px",
|
|
43182
|
-
fontSize:
|
|
44465
|
+
fontSize: "24px"
|
|
43183
44466
|
}
|
|
43184
44467
|
}, "DCB Details"), /*#__PURE__*/React__default.createElement("table", {
|
|
43185
44468
|
border: "1px",
|
|
@@ -43303,7 +44586,41 @@ function ApplicationDetailsContent(_ref) {
|
|
|
43303
44586
|
style: tableStyles.th
|
|
43304
44587
|
}, "Total Balance"), /*#__PURE__*/React__default.createElement("td", {
|
|
43305
44588
|
style: tableStyles.td
|
|
43306
|
-
}, totalBalanceTax))))
|
|
44589
|
+
}, totalBalanceTax)))), /*#__PURE__*/React__default.createElement(digitUiReactComponents.ActionBar, {
|
|
44590
|
+
className: "clear-search-container",
|
|
44591
|
+
style: {
|
|
44592
|
+
display: "block"
|
|
44593
|
+
}
|
|
44594
|
+
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.SubmitBar, {
|
|
44595
|
+
label: "Make Property Active",
|
|
44596
|
+
style: {
|
|
44597
|
+
flex: 1
|
|
44598
|
+
},
|
|
44599
|
+
onSubmit: PropertyActive
|
|
44600
|
+
}), /*#__PURE__*/React__default.createElement(digitUiReactComponents.SubmitBar, {
|
|
44601
|
+
label: "Make Property Inactive",
|
|
44602
|
+
style: {
|
|
44603
|
+
marginLeft: "20px"
|
|
44604
|
+
},
|
|
44605
|
+
onSubmit: PropertyInActive
|
|
44606
|
+
}), /*#__PURE__*/React__default.createElement(digitUiReactComponents.SubmitBar, {
|
|
44607
|
+
label: "Edit Property",
|
|
44608
|
+
style: {
|
|
44609
|
+
marginLeft: "20px"
|
|
44610
|
+
},
|
|
44611
|
+
onSubmit: EditProperty
|
|
44612
|
+
}), /*#__PURE__*/React__default.createElement(digitUiReactComponents.SubmitBar, {
|
|
44613
|
+
label: "Access Property",
|
|
44614
|
+
style: {
|
|
44615
|
+
marginLeft: "20px"
|
|
44616
|
+
},
|
|
44617
|
+
onSubmit: AccessProperty
|
|
44618
|
+
})), showToast && /*#__PURE__*/React__default.createElement(digitUiReactComponents.Toast, {
|
|
44619
|
+
error: showToast.isError,
|
|
44620
|
+
label: t(showToast.label),
|
|
44621
|
+
onClose: closeToast,
|
|
44622
|
+
isDleteBtn: "false"
|
|
44623
|
+
}));
|
|
43307
44624
|
}
|
|
43308
44625
|
|
|
43309
44626
|
function ApplicationDetailsToast(_ref) {
|
|
@@ -43448,6 +44765,7 @@ function ApplicationDetailsActionBar(_ref) {
|
|
|
43448
44765
|
isMenuBotton = true;
|
|
43449
44766
|
isSingleButton = false;
|
|
43450
44767
|
}
|
|
44768
|
+
console.log("workflow details: ", workflowDetails);
|
|
43451
44769
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, !(workflowDetails !== null && workflowDetails !== void 0 && workflowDetails.isLoading) && isMenuBotton && !isSingleButton && /*#__PURE__*/React__default.createElement(digitUiReactComponents.ActionBar, {
|
|
43452
44770
|
style: {
|
|
43453
44771
|
...ActionBarStyle
|
|
@@ -43481,7 +44799,7 @@ function ApplicationDetailsActionBar(_ref) {
|
|
|
43481
44799
|
}, t(`${forcedActionPrefix || `WF_EMPLOYEE_${businessService === null || businessService === void 0 ? void 0 : businessService.toUpperCase()}`}_${actions === null || actions === void 0 ? void 0 : (_actions$4 = actions[0]) === null || _actions$4 === void 0 ? void 0 : _actions$4.action}`))));
|
|
43482
44800
|
}
|
|
43483
44801
|
|
|
43484
|
-
const Close$
|
|
44802
|
+
const Close$9 = () => /*#__PURE__*/React__default.createElement("svg", {
|
|
43485
44803
|
xmlns: "http://www.w3.org/2000/svg",
|
|
43486
44804
|
viewBox: "0 0 24 24",
|
|
43487
44805
|
fill: "#FFFFFF"
|
|
@@ -43491,11 +44809,11 @@ const Close$7 = () => /*#__PURE__*/React__default.createElement("svg", {
|
|
|
43491
44809
|
}), /*#__PURE__*/React__default.createElement("path", {
|
|
43492
44810
|
d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"
|
|
43493
44811
|
}));
|
|
43494
|
-
const CloseBtn$
|
|
44812
|
+
const CloseBtn$9 = props => {
|
|
43495
44813
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
43496
44814
|
className: "icon-bg-secondary",
|
|
43497
44815
|
onClick: props.onClick
|
|
43498
|
-
}, /*#__PURE__*/React__default.createElement(Close$
|
|
44816
|
+
}, /*#__PURE__*/React__default.createElement(Close$9, null));
|
|
43499
44817
|
};
|
|
43500
44818
|
function ApplicationDetailsWarningPopup(_ref) {
|
|
43501
44819
|
let {
|
|
@@ -43513,7 +44831,7 @@ function ApplicationDetailsWarningPopup(_ref) {
|
|
|
43513
44831
|
headerBarMain: /*#__PURE__*/React__default.createElement("h1", {
|
|
43514
44832
|
className: "heading-m"
|
|
43515
44833
|
}, t("PT_DUES_ARE_PENDING")),
|
|
43516
|
-
headerBarEnd: /*#__PURE__*/React__default.createElement(CloseBtn$
|
|
44834
|
+
headerBarEnd: /*#__PURE__*/React__default.createElement(CloseBtn$9, {
|
|
43517
44835
|
onClick: () => {
|
|
43518
44836
|
closeWarningPopup();
|
|
43519
44837
|
}
|
|
@@ -43630,6 +44948,7 @@ const ApplicationDetails = props => {
|
|
|
43630
44948
|
}, [showToast]);
|
|
43631
44949
|
function onActionSelect(action) {
|
|
43632
44950
|
if (action) {
|
|
44951
|
+
var _action$redirectionUr8, _action$redirectionUr9, _action$redirectionUr10;
|
|
43633
44952
|
if ((action === null || action === void 0 ? void 0 : action.action) == "EDIT PAY 2" && window.location.href.includes("bpa")) {
|
|
43634
44953
|
window.location.assign(window.location.href.split("bpa")[0] + "editApplication/bpa" + window.location.href.split("bpa")[1]);
|
|
43635
44954
|
}
|
|
@@ -43662,12 +44981,15 @@ const ApplicationDetails = props => {
|
|
|
43662
44981
|
}
|
|
43663
44982
|
} else if (!(action !== null && action !== void 0 && action.redirectionUrl) && (action === null || action === void 0 ? void 0 : action.action) != "EDIT PAY 2") {
|
|
43664
44983
|
setShowModal(true);
|
|
44984
|
+
} else if ((action === null || action === void 0 ? void 0 : (_action$redirectionUr8 = action.redirectionUrl) === null || _action$redirectionUr8 === void 0 ? void 0 : (_action$redirectionUr9 = _action$redirectionUr8.state) === null || _action$redirectionUr9 === void 0 ? void 0 : (_action$redirectionUr10 = _action$redirectionUr9.applicationData) === null || _action$redirectionUr10 === void 0 ? void 0 : _action$redirectionUr10.workflowCode) === "DIRECTRENEWAL") {
|
|
44985
|
+
console.log("Got Inside Direct");
|
|
44986
|
+
setShowModal(true);
|
|
43665
44987
|
} else {
|
|
43666
|
-
var _action$
|
|
44988
|
+
var _action$redirectionUr11, _action$redirectionUr12;
|
|
43667
44989
|
history.push({
|
|
43668
|
-
pathname: (_action$
|
|
44990
|
+
pathname: (_action$redirectionUr11 = action.redirectionUrl) === null || _action$redirectionUr11 === void 0 ? void 0 : _action$redirectionUr11.pathname,
|
|
43669
44991
|
state: {
|
|
43670
|
-
...((_action$
|
|
44992
|
+
...((_action$redirectionUr12 = action.redirectionUrl) === null || _action$redirectionUr12 === void 0 ? void 0 : _action$redirectionUr12.state)
|
|
43671
44993
|
}
|
|
43672
44994
|
});
|
|
43673
44995
|
}
|
|
@@ -43692,9 +45014,14 @@ const ApplicationDetails = props => {
|
|
|
43692
45014
|
}
|
|
43693
45015
|
try {
|
|
43694
45016
|
let _exit = false;
|
|
43695
|
-
const _temp5 = function (_data$Property, _data$Property$workfl, _data$Property$workfl2, _data$Licenses, _data$Licenses$, _data$
|
|
43696
|
-
if ((data === null || data === void 0 ? void 0 : (_data$Property = data.Property) === null || _data$Property === void 0 ? void 0 : (_data$Property$workfl = _data$Property.workflow) === null || _data$Property$workfl === void 0 ? void 0 : (_data$Property$workfl2 = _data$Property$workfl.comment) === null || _data$Property$workfl2 === void 0 ? void 0 : _data$Property$workfl2.length) == 0 || (data === null || data === void 0 ? void 0 : (_data$Licenses = data.Licenses) === null || _data$Licenses === void 0 ? void 0 : (_data$Licenses$ = _data$Licenses[0]) === null || _data$Licenses$ === void 0 ? void 0 : (_data$Licenses$$
|
|
43697
|
-
|
|
45017
|
+
const _temp5 = function (_data$Property, _data$Property$workfl, _data$Property$workfl2, _data$Licenses, _data$Licenses$, _data$Licenses2, _data$Licenses2$, _data$Licenses2$$addi, _data$Licenses2$$addi2, _data$Licenses3, _data$Licenses3$, _data$Licenses3$$comm, _data$WaterConnection, _data$WaterConnection2, _data$SewerageConnect, _data$SewerageConnect2, _data$BPA, _data$BPA$comment) {
|
|
45018
|
+
if ((data === null || data === void 0 ? void 0 : (_data$Property = data.Property) === null || _data$Property === void 0 ? void 0 : (_data$Property$workfl = _data$Property.workflow) === null || _data$Property$workfl === void 0 ? void 0 : (_data$Property$workfl2 = _data$Property$workfl.comment) === null || _data$Property$workfl2 === void 0 ? void 0 : _data$Property$workfl2.length) == 0 || ((data === null || data === void 0 ? void 0 : (_data$Licenses = data.Licenses) === null || _data$Licenses === void 0 ? void 0 : (_data$Licenses$ = _data$Licenses[0]) === null || _data$Licenses$ === void 0 ? void 0 : _data$Licenses$.action) === "INITIATE" ? (data === null || data === void 0 ? void 0 : (_data$Licenses2 = data.Licenses) === null || _data$Licenses2 === void 0 ? void 0 : (_data$Licenses2$ = _data$Licenses2[0]) === null || _data$Licenses2$ === void 0 ? void 0 : (_data$Licenses2$$addi = _data$Licenses2$.additionalDetail) === null || _data$Licenses2$$addi === void 0 ? void 0 : (_data$Licenses2$$addi2 = _data$Licenses2$$addi.validityYears) === null || _data$Licenses2$$addi2 === void 0 ? void 0 : _data$Licenses2$$addi2.length) == 0 : (data === null || data === void 0 ? void 0 : (_data$Licenses3 = data.Licenses) === null || _data$Licenses3 === void 0 ? void 0 : (_data$Licenses3$ = _data$Licenses3[0]) === null || _data$Licenses3$ === void 0 ? void 0 : (_data$Licenses3$$comm = _data$Licenses3$.comment) === null || _data$Licenses3$$comm === void 0 ? void 0 : _data$Licenses3$$comm.length) == 0) || (data === null || data === void 0 ? void 0 : (_data$WaterConnection = data.WaterConnection) === null || _data$WaterConnection === void 0 ? void 0 : (_data$WaterConnection2 = _data$WaterConnection.comment) === null || _data$WaterConnection2 === void 0 ? void 0 : _data$WaterConnection2.length) == 0 || (data === null || data === void 0 ? void 0 : (_data$SewerageConnect = data.SewerageConnection) === null || _data$SewerageConnect === void 0 ? void 0 : (_data$SewerageConnect2 = _data$SewerageConnect.comment) === null || _data$SewerageConnect2 === void 0 ? void 0 : _data$SewerageConnect2.length) == 0 || (data === null || data === void 0 ? void 0 : (_data$BPA = data.BPA) === null || _data$BPA === void 0 ? void 0 : (_data$BPA$comment = _data$BPA.comment) === null || _data$BPA$comment === void 0 ? void 0 : _data$BPA$comment.length) == 0) {
|
|
45019
|
+
var _data$Licenses4, _data$Licenses4$;
|
|
45020
|
+
if ((data === null || data === void 0 ? void 0 : (_data$Licenses4 = data.Licenses) === null || _data$Licenses4 === void 0 ? void 0 : (_data$Licenses4$ = _data$Licenses4[0]) === null || _data$Licenses4$ === void 0 ? void 0 : _data$Licenses4$.action) === "INITIATE") {
|
|
45021
|
+
alert(t("Please fill in the validity before submitting"));
|
|
45022
|
+
} else {
|
|
45023
|
+
alert(t("Please fill in the comments before submitting"));
|
|
45024
|
+
}
|
|
43698
45025
|
} else {
|
|
43699
45026
|
const _temp4 = function (_data$BPA2, _data$BPA3, _data$BPA3$additional, _data$BPA4, _data$BPA4$workflow) {
|
|
43700
45027
|
if ((data === null || data === void 0 ? void 0 : (_data$BPA2 = data.BPA) === null || _data$BPA2 === void 0 ? void 0 : _data$BPA2.businessService) == "BPA" && !(data !== null && data !== void 0 && (_data$BPA3 = data.BPA) !== null && _data$BPA3 !== void 0 && (_data$BPA3$additional = _data$BPA3.additionalDetails) !== null && _data$BPA3$additional !== void 0 && _data$BPA3$additional.blockingReason) && (data === null || data === void 0 ? void 0 : (_data$BPA4 = data.BPA) === null || _data$BPA4 === void 0 ? void 0 : (_data$BPA4$workflow = _data$BPA4.workflow) === null || _data$BPA4$workflow === void 0 ? void 0 : _data$BPA4$workflow.action) == "BLOCK") {
|
|
@@ -43714,7 +45041,7 @@ const ApplicationDetails = props => {
|
|
|
43714
45041
|
setTimeout(closeToast, 5000);
|
|
43715
45042
|
},
|
|
43716
45043
|
onSuccess: (data, variables) => {
|
|
43717
|
-
var _isOBPS, _isOBPS2, _isOBPS3, _data$Amendments;
|
|
45044
|
+
var _isOBPS, _isOBPS2, _isOBPS3, _data$Amendments, _data$Licenses5, _data$Licenses$2;
|
|
43718
45045
|
sessionStorage.removeItem("WS_SESSION_APPLICATION_DETAILS");
|
|
43719
45046
|
setIsEnableLoader(false);
|
|
43720
45047
|
if ((_isOBPS = isOBPS) !== null && _isOBPS !== void 0 && _isOBPS.bpa) {
|
|
@@ -43759,6 +45086,15 @@ const ApplicationDetails = props => {
|
|
|
43759
45086
|
}
|
|
43760
45087
|
return;
|
|
43761
45088
|
}
|
|
45089
|
+
if ((data === null || data === void 0 ? void 0 : (_data$Licenses5 = data.Licenses) === null || _data$Licenses5 === void 0 ? void 0 : _data$Licenses5.length) > 0 && data !== null && data !== void 0 && (_data$Licenses$2 = data.Licenses[0]) !== null && _data$Licenses$2 !== void 0 && _data$Licenses$2.applicationNumber) {
|
|
45090
|
+
var _data$Licenses$3;
|
|
45091
|
+
setShowToast({
|
|
45092
|
+
key: "success",
|
|
45093
|
+
action: selectedAction
|
|
45094
|
+
});
|
|
45095
|
+
history.replace(`/digit-ui/employee/tl/application-details/${data === null || data === void 0 ? void 0 : (_data$Licenses$3 = data.Licenses[0]) === null || _data$Licenses$3 === void 0 ? void 0 : _data$Licenses$3.applicationNumber}`);
|
|
45096
|
+
return;
|
|
45097
|
+
}
|
|
43762
45098
|
setShowToast({
|
|
43763
45099
|
key: "success",
|
|
43764
45100
|
action: selectedAction
|
|
@@ -43876,7 +45212,7 @@ const ApplicationDetails = props => {
|
|
|
43876
45212
|
showTimeLine: showTimeLine,
|
|
43877
45213
|
oldValue: oldValue,
|
|
43878
45214
|
isInfoLabel: isInfoLabel
|
|
43879
|
-
}), showModal ? /*#__PURE__*/React__default.createElement(ActionModal$
|
|
45215
|
+
}), showModal ? /*#__PURE__*/React__default.createElement(ActionModal$9, {
|
|
43880
45216
|
t: t,
|
|
43881
45217
|
action: selectedAction,
|
|
43882
45218
|
tenantId: tenantId,
|