datastake-daf 0.6.733 → 0.6.735

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.
@@ -32,10 +32,10 @@ const LocationsTable = ({
32
32
  formData = {},
33
33
  formValue = {},
34
34
  form = {},
35
- dataOptions = {},
36
35
  }) => {
37
36
  const [selectOptions, setSelectOptions] = useState();
38
37
  const [activeTab, setActiveTab] = useState();
38
+
39
39
  const columns = useMemo(() => getColumns({
40
40
  t,
41
41
  goTo,
@@ -44,10 +44,9 @@ const LocationsTable = ({
44
44
  activeTab,
45
45
  getRedirectLink,
46
46
  theme,
47
- subject: 'location',
47
+ subject: 'locations',
48
48
  data,
49
- dataOptions
50
- }), [t, goTo, user, options, activeTab, getRedirectLink, theme, data, dataOptions]);
49
+ }), [t, goTo, user, options, activeTab, getRedirectLink, theme, data]);
51
50
 
52
51
  const breadCrumbs = [];
53
52
 
@@ -62,6 +61,8 @@ const LocationsTable = ({
62
61
  }, 'locations')
63
62
  }, [paginationQuery, otherParams, searchParams, activeTab]);
64
63
 
64
+ console.log({data})
65
+
65
66
  const selectFiltersConfig = useMemo(() => {
66
67
  return getFiltersConfig({t});
67
68
  }, [t]);
@@ -121,7 +122,7 @@ const LocationsTable = ({
121
122
  t("affirmations::subject-created-successfully") || m,
122
123
  );
123
124
  // goTo(`/app/edit/stakeholders/${data.datastakeId}`);
124
- window.location.reload();
125
+ goTo('/app/locations')
125
126
  }
126
127
  }}
127
128
  onCancel={onDrawerClose}
@@ -74,7 +74,9 @@ const StakeholdersCreate = ({
74
74
  const newPayload = {
75
75
  ...defaultData,
76
76
  ...payloadData,
77
+ form: 'stakeholder'
77
78
  };
79
+
78
80
 
79
81
  const callback = (type, m, data) => {
80
82
  if (setSelectedFormNext) {
@@ -43,7 +43,7 @@ const StakeholdersTable = ({
43
43
  activeTab,
44
44
  getRedirectLink,
45
45
  theme,
46
- subject: 'stakeholder'
46
+ subject: 'stakeholders'
47
47
  }), [t, goTo, user, options, activeTab, getRedirectLink, theme]);
48
48
 
49
49
  const breadCrumbs = [];
@@ -117,7 +117,7 @@ const StakeholdersTable = ({
117
117
  type,
118
118
  t("affirmations::subject-created-successfully") || m,
119
119
  );
120
- goTo(`/app/locations`);
120
+ goTo(`/app/stakeholders`);
121
121
  }
122
122
  }}
123
123
  onCancel={onDrawerClose}
@@ -25,6 +25,8 @@ function Identification({
25
25
  [t],
26
26
  );
27
27
 
28
+ console.log({identificationData: data})
29
+
28
30
  const chartConfig = useIdentification({ data, theme, options });
29
31
 
30
32
  return (
@@ -24,7 +24,7 @@ function TradeRelationships({goTo, t = () => {}, options = {}, hardcodedData = [
24
24
 
25
25
  const { data, loading } = useWidgetFetch({config: fetchConfig});
26
26
 
27
- const mappedData = mapDataForChainOfCustody(Object.keys(data)?.length > 0 ? data : hardcodedData, options?.category ?? [], goTo);
27
+ const mappedData = mapDataForChainOfCustody(Object.keys(data)?.length > 0 ? data : hardcodedData, options, goTo);
28
28
 
29
29
  return (
30
30
  <Widget
@@ -64,6 +64,9 @@ function MineSites({
64
64
  [activeTab, selectedPartners],
65
65
  );
66
66
 
67
+ console.log({activeTab})
68
+ console.log({dataFetchConfig})
69
+
67
70
  const { data, loading, setData } = useWidgetFetch({config: dataFetchConfig});
68
71
 
69
72
  const tabs = useMemo(() => getTabs(t), [t]);
@@ -45,14 +45,15 @@ const mapIcon = (category) => {
45
45
  const leftBackground = theme.colorPrimary3;
46
46
  const rightBackground = theme.colorPrimary6;
47
47
 
48
- export const mapDataForChainOfCustody = (data = {}, options = [], goTo = () => {}) => {
48
+ export const mapDataForChainOfCustody = (data = {}, options = {}, goTo = () => {}) => {
49
49
  const mapChildren = (items, type, parentId, isDirect = true) => {
50
- return (items ?? []).map((item) => ({
50
+ return (items ?? []).map((item) => {
51
+ return {
51
52
  id: item.id,
52
53
  number: 0,
53
54
  name: item.name,
54
55
  sources: parentId ? [parentId] : [],
55
- subTitle: findOptions(item.category, options),
56
+ subTitle: findOptions(item?.category, options?.categoriesOptions),
56
57
  leftIcon: type === "client" ? rightIcon : leftIcon,
57
58
  leftBackground: type === "client" ? rightBackground : leftBackground,
58
59
  topIcon: mapIcon(item.category),
@@ -62,14 +63,14 @@ export const mapDataForChainOfCustody = (data = {}, options = [], goTo = () => {
62
63
  goTo(`/app/partners?datastakeId=${item.id}`);
63
64
  }
64
65
  },
65
- }));
66
+ }});
66
67
  };
67
68
 
68
69
  return {
69
70
  id: data.id,
70
71
  number: 0,
71
72
  name: data.name,
72
- subTitle: findOptions(data.category, options),
73
+ subTitle: findOptions(data?.category, options?.categoriesOptions),
73
74
  leftIcon: middleIcon,
74
75
  leftBackground: theme.colorPrimary10,
75
76
  topIcon: mapIcon(data.category),