amp-workflow-ui 0.1.20 → 0.1.21

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 CHANGED
@@ -328,6 +328,7 @@ function WorkflowRequestCard({
328
328
  return statusList2 == null ? void 0 : statusList2.filter((item) => item.status !== 3);
329
329
  };
330
330
  const redirectionUrl = buildRedirectionUrl(requestDetails);
331
+ console.log("\u{1F680} ~ WorkflowRequestCard ~ redirectionUrl:", redirectionUrl);
331
332
  const currentStatus = ((_f = (_e = (_d = requestDetails == null ? void 0 : requestDetails.levels) == null ? void 0 : _d.find(
332
333
  (lvl) => lvl.id === (requestDetails == null ? void 0 : requestDetails.current_level)
333
334
  )) == null ? void 0 : _e.selected_status) == null ? void 0 : _f.status_id) === 1 ? "approved" : ((_i = (_h = (_g = requestDetails == null ? void 0 : requestDetails.levels) == null ? void 0 : _g.find(
@@ -1916,6 +1917,20 @@ function ApprovalWorkflow({
1916
1917
  setIsFilterOpen(false);
1917
1918
  fetchData(selectedOption, 1, tabs[selectedOption].search, filters);
1918
1919
  };
1920
+ const formatDataUrlConfig = (data) => {
1921
+ return data == null ? void 0 : data.reduce((acc, { module_name, ...details }) => {
1922
+ acc[module_name] = details;
1923
+ return acc;
1924
+ }, {});
1925
+ };
1926
+ React7.useEffect(() => {
1927
+ api.get({
1928
+ url: `/workflow/url-config`,
1929
+ serviceURL: "api"
1930
+ }).then((res) => {
1931
+ setUrlConfig(formatDataUrlConfig(res == null ? void 0 : res.data));
1932
+ });
1933
+ }, []);
1919
1934
  const fetchData = React7.useCallback(
1920
1935
  (tab, page, search, filtersOverride) => {
1921
1936
  var _a2, _b2;
@@ -2098,10 +2113,17 @@ function ApprovalWorkflow({
2098
2113
  }, [urlConfig, userInfo]);
2099
2114
  const buildRedirectionUrl = (info) => {
2100
2115
  const { module_name, module_id, reference_id, redirection_link } = info;
2116
+ console.log("\u{1F680} ~ buildRedirectionUrl ~ info:", {
2117
+ module_name,
2118
+ module_id,
2119
+ reference_id,
2120
+ redirection_link,
2121
+ urlConfig
2122
+ });
2101
2123
  if (redirection_link) return redirection_link;
2102
2124
  if (module_name === "route_approval") {
2103
2125
  return `${ENV_VARIABLES == null ? void 0 : ENV_VARIABLES.TRANSPORT_URL}route-listing/view/${reference_id}`;
2104
- } else if (module_name === "update_bus_details_approval") {
2126
+ } else if (module_name === "update_bus_details_approval" || module_name === "create_bus_details_approval") {
2105
2127
  return `${ENV_VARIABLES == null ? void 0 : ENV_VARIABLES.TRANSPORT_URL}bus-listing/view/${reference_id}`;
2106
2128
  } else if (module_name === "kit_handover_approve") {
2107
2129
  return `${ENV_VARIABLES == null ? void 0 : ENV_VARIABLES.FINANCE_URL}fee-collection/?reference_id=${reference_id}&module_name=${module_name}&module_id=${module_id}`;
@@ -2131,6 +2153,7 @@ function ApprovalWorkflow({
2131
2153
  }
2132
2154
  const callAllApi = () => {
2133
2155
  var _a2, _b2, _c2, _d2, _e2, _f2;
2156
+ setExpandedId(null);
2134
2157
  fetchData(
2135
2158
  "Assign To Me",
2136
2159
  1,