datastake-daf 0.6.755 → 0.6.757

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.
Files changed (49) hide show
  1. package/build/favicon.ico +0 -0
  2. package/build/logo192.png +0 -0
  3. package/build/logo512.png +0 -0
  4. package/build/manifest.json +25 -0
  5. package/build/robots.txt +3 -0
  6. package/dist/components/index.js +666 -626
  7. package/dist/constants/index.js +26 -0
  8. package/dist/hooks/index.js +11 -8
  9. package/dist/layouts/index.js +470 -448
  10. package/dist/pages/index.js +621 -551
  11. package/dist/utils/index.js +816 -448
  12. package/package.json +1 -1
  13. package/rollup.config.js +20 -0
  14. package/src/@daf/core/components/EditForm/form.jsx +1 -1
  15. package/src/@daf/core/components/EditForm/storyConfig2.js +866 -25029
  16. package/src/@daf/core/components/Graphs/components/BaseGraph.jsx +4 -2
  17. package/src/@daf/core/components/Icon/configs/ClockPlus.js +14 -0
  18. package/src/@daf/core/components/Icon/configs/WaziDarkIcon.js +15 -0
  19. package/src/@daf/core/components/Icon/configs/index.js +4 -0
  20. package/src/@daf/core/components/Screens/BaseScreen/index.jsx +3 -3
  21. package/src/@daf/hooks/useFilters.js +10 -8
  22. package/src/@daf/hooks/useWidgetFetch.js +3 -3
  23. package/src/@daf/pages/Dashboards/SupplyChain/index.jsx +2 -2
  24. package/src/@daf/pages/Dashboards/helper.js +3 -3
  25. package/src/@daf/pages/Documents/columns.js +2 -4
  26. package/src/@daf/pages/Documents/index.jsx +2 -3
  27. package/src/@daf/pages/Events/Activities/index.jsx +3 -4
  28. package/src/@daf/pages/Events/Incidents/index.jsx +2 -3
  29. package/src/@daf/pages/Events/columns.js +12 -14
  30. package/src/@daf/pages/Events/index.jsx +2 -3
  31. package/src/@daf/pages/Locations/MineSite/columns.js +23 -24
  32. package/src/@daf/pages/Locations/MineSite/index.jsx +5 -4
  33. package/src/@daf/pages/Locations/columns.js +2 -2
  34. package/src/@daf/pages/Locations/index.jsx +2 -3
  35. package/src/@daf/pages/Stakeholders/Operators/index.jsx +2 -2
  36. package/src/@daf/pages/Stakeholders/Workers/columns.js +14 -4
  37. package/src/@daf/pages/Stakeholders/Workers/index.jsx +2 -3
  38. package/src/@daf/pages/Stakeholders/index.jsx +2 -3
  39. package/src/@daf/pages/Summary/Minesite/components/MineDetailsSection/index.js +1 -1
  40. package/src/@daf/pages/Summary/Minesite/index.jsx +3 -0
  41. package/src/@daf/pages/Summary/Operator/components/KeyInformation/config.js +7 -1
  42. package/src/@daf/pages/Summary/Operator/index.jsx +4 -1
  43. package/src/@daf/pages/Summary/components/InformationAvailability/index.js +1 -1
  44. package/src/@daf/pages/Summary/hook.js +5 -2
  45. package/src/constants/breadCrumbs.js +20 -0
  46. package/src/constants.js +1 -0
  47. package/src/helpers/breadCrumbs.js +347 -0
  48. package/src/styles/components/_dataLink.scss +1 -0
  49. package/src/utils.js +3 -1
@@ -54,9 +54,10 @@ const BaseGraph = forwardRef(function BaseGraph(
54
54
 
55
55
  requestAnimationFrame(() => {
56
56
  fitView({
57
- padding: 0.1,
57
+ padding: 0.4,
58
58
  nodes: [...nodesToFit],
59
59
  duration: withDuration ? 300 : undefined,
60
+ maxZoom: 0.8,
60
61
  });
61
62
  });
62
63
  }, [JSON.stringify(nodesToFit), withDuration]);
@@ -82,8 +83,9 @@ const BaseGraph = forwardRef(function BaseGraph(
82
83
  minZoom={minZoom}
83
84
  maxZoom={maxZoom}
84
85
  attributionPosition="top-left"
86
+ fitView={true} // zoom out on default
85
87
  fitViewOptions={{
86
- padding: 0.1,
88
+ padding: 0.2, //zoom out on default
87
89
  duration: withDuration ? 300 : undefined,
88
90
  }}
89
91
  {...props}
@@ -0,0 +1,14 @@
1
+ const config = {
2
+ viewBox: "0 0 19 19",
3
+ children: (
4
+ <path
5
+ d="M17.3506 10.1375C17.3942 9.79224 17.4167 9.44041 17.4167 9.08333C17.4167 4.48096 13.6857 0.75 9.08333 0.75C4.48096 0.75 0.75 4.48096 0.75 9.08333C0.75 13.6857 4.48096 17.4167 9.08333 17.4167C9.44617 17.4167 9.80359 17.3935 10.1542 17.3485M9.08333 4.08333V9.08333L12.1986 10.641M14.9167 17.4167V12.4167M12.4167 14.9167H17.4167"
6
+ stroke="currentColor"
7
+ strokeWidth="1.5"
8
+ strokeLinecap="round"
9
+ strokeLinejoin="round"
10
+ />
11
+ ),
12
+ };
13
+
14
+ export default config;
@@ -0,0 +1,15 @@
1
+ const config = {
2
+ viewBox: '0 0 25 26',
3
+ children: (
4
+ <path
5
+ d="M12.5001 0C19.4037 2.39999e-07 25.0001 5.59644 25.0001 12.5C25.0001 19.0635 19.941 24.4456 13.5099 24.96C13.1457 24.9946 12.7787 25.0126 12.4103 25.0146H12.1056C5.42401 25.0146 0.00713129 19.5985 0.00695801 12.917C0.00242724 12.7787 0.000122101 12.6394 0.00012207 12.5C0.00012207 5.59644 5.59656 0 12.5001 0ZM12.1642 5.32715C8.53558 5.32715 5.65747 8.46702 5.65735 12.2588V13.4951C5.65735 17.287 8.5355 20.4268 12.1642 20.4268C15.7926 20.4264 18.671 17.2868 18.671 13.4951V12.2588C18.6709 8.46722 15.7925 5.32748 12.1642 5.32715ZM12.1642 6.42676C15.1149 6.42709 17.5703 9.00217 17.5704 12.2588V13.4951C17.5704 16.7518 15.115 19.3268 12.1642 19.3271C9.21313 19.3271 6.75696 16.7521 6.75696 13.4951V12.2588C6.75708 9.00197 9.21321 6.42676 12.1642 6.42676ZM11.7618 9.40918L8.86145 12.5166L8.51086 12.8926L8.86145 13.2676L11.7618 16.375L12.1642 16.8057L12.5665 16.375L15.4669 13.2676L15.8175 12.8926L15.4669 12.5166L12.5665 9.40918L12.1642 8.97852L11.7618 9.40918ZM13.798 13.4424L12.1632 15.1924L10.5294 13.4424H13.798ZM13.798 12.3418H10.5294L12.1632 10.5908L13.798 12.3418Z"
6
+ fill="currentColor"
7
+ />
8
+ ),
9
+ tag: ['logo']
10
+ }
11
+
12
+ export default config;
13
+
14
+
15
+
@@ -222,6 +222,8 @@ import Aid from "./Aid";
222
222
  import Bear from "./Bear";
223
223
  import Security from "./Security";
224
224
  import Minus from "./Minus";
225
+ import ClockPlus from "./ClockPlus";
226
+ import WaziDarkIcon from "./WaziDarkIcon";
225
227
 
226
228
  const config = {
227
229
  AppAdmin,
@@ -448,6 +450,8 @@ const config = {
448
450
  Bear,
449
451
  Security,
450
452
  Minus,
453
+ ClockPlus,
454
+ WaziDarkIcon,
451
455
  };
452
456
 
453
457
  export default config;
@@ -104,8 +104,8 @@ const BaseScreen = ({
104
104
  });
105
105
 
106
106
  useEffect(() => {
107
- if (typeof data?.meta?.total === "number") {
108
- setPagination((prev) => ({ ...prev, total: data?.meta?.total }));
107
+ if (typeof (data?.meta?.total || data?.totalItems) === "number") {
108
+ setPagination((prev) => ({ ...prev, total: (data?.meta?.total || data?.totalItems) }));
109
109
  }
110
110
  }, [data]);
111
111
 
@@ -161,7 +161,7 @@ const BaseScreen = ({
161
161
  goNext={goNext}
162
162
  canGoNext={canGoNext}
163
163
  canGoPrev={canGoPrev}
164
- totalItems={pagination.total}
164
+ totalItems={pagination.total || pagination.pageSize}
165
165
  doTotalItems
166
166
  onChangePagination={(val) => {
167
167
  onTableChange({ ...pagination, current: 1, pageSize: val });
@@ -15,7 +15,7 @@ export const useFilters = ({
15
15
  doPagination = true,
16
16
  getRedirectLink,
17
17
  }) => {
18
- const params = useMemo(() => new URLSearchParams(location.search), [location.search]);
18
+ const params = useMemo(() => new URLSearchParams(location?.search), [location?.search]);
19
19
  const [activeFilters, setActiveFilters] = useState(
20
20
  defaultActiveFilters || getDefaultActiveFilters(params, selectFiltersConfig, defaultPageSize, defaultUrlParams, doPagination)
21
21
  );
@@ -69,9 +69,9 @@ export const useFilters = ({
69
69
  if (typeof getRedirectLink === 'function') {
70
70
  goTo(getRedirectLink(
71
71
  view === 'mine-monitoring'
72
- ? (qs !== '' ? `${location.pathname}?${qs}`
73
- : doPagination ? `${location.pathname}?page=${page}`
74
- : location.pathname)
72
+ ? (qs !== '' ? `${location?.pathname}?${qs}`
73
+ : doPagination ? `${location?.pathname}?page=${page}`
74
+ : location?.pathname)
75
75
  : (qs !== '' ? `${`/app/${view}`}?${qs}`
76
76
  : doPagination ? `${`/app/${view}`}?page=${page}`
77
77
  : `${`/app/${view}`}`)
@@ -81,9 +81,9 @@ export const useFilters = ({
81
81
 
82
82
  if (view === 'mine-monitoring') {
83
83
  goTo(
84
- qs !== '' ? `${location.pathname}?${qs}`
85
- : doPagination ? `${location.pathname}?page=${page}`
86
- : location.pathname);
84
+ qs !== '' ? `${location?.pathname}?${qs}`
85
+ : doPagination ? `${location?.pathname}?page=${page}`
86
+ : location?.pathname);
87
87
  } else {
88
88
  goTo(
89
89
  qs !== '' ? `${`/app/${module}/${view}`}?${qs}`
@@ -91,7 +91,7 @@ export const useFilters = ({
91
91
  : `${`/app/${module}/${view}`}`);
92
92
  }
93
93
  }
94
- }, [module, view, location.pathname, goTo, getRedirectLink, doPagination]);
94
+ }, [module, view, location?.pathname, goTo, getRedirectLink, doPagination]);
95
95
 
96
96
  const defaultFilters = useMemo(() => {
97
97
  const def = {};
@@ -234,6 +234,8 @@ export const useFilters = ({
234
234
  const canGoPrev = useMemo(() => pagination.current !== 1, [pagination]);
235
235
  const canGoNext = useMemo(() => pagination.current !== totalPages && totalPages, [pagination, totalPages]);
236
236
 
237
+ console.log({totalPages, pagination})
238
+
237
239
  const goPrev = () => {
238
240
  if (!canGoPrev) {
239
241
  return;
@@ -16,9 +16,9 @@ export const useWidgetFetch = ({config, getData = DashboardService.getWidget, on
16
16
 
17
17
 
18
18
  const fetchData = async () => {
19
- // if (stop) {
20
- // return;
21
- // }
19
+ if (stop) {
20
+ return;
21
+ }
22
22
 
23
23
  setLoading(true);
24
24
 
@@ -20,7 +20,7 @@ function SupplyChain({
20
20
  setSelectedPartners,
21
21
  informationSources,
22
22
  hardcodedData,
23
- breadCrumbs = [],
23
+ breadcrumbs = [],
24
24
  }) {
25
25
 
26
26
  const sourceOptions = useMemo(() => {
@@ -69,7 +69,7 @@ function SupplyChain({
69
69
  />
70
70
  </div>
71
71
  }
72
- breadcrumbs={breadCrumbs}
72
+ breadcrumbs={breadcrumbs}
73
73
  />
74
74
  }
75
75
  >
@@ -11,7 +11,7 @@ const individualIcon = <CustomIcon name="UserCircle" color="#6C737F" width={18}
11
11
  const csIcon = <CustomIcon name="CivilSociety" color="#6C737F" width={18} height={18} />;
12
12
  const leftIcon = (
13
13
  <CustomIcon
14
- name="NashirikiSmallLogo"
14
+ name="WaziDarkIcon"
15
15
  color={theme.colorPrimary8}
16
16
  width={16}
17
17
  height={16}
@@ -19,14 +19,14 @@ const leftIcon = (
19
19
  );
20
20
  const middleIcon = (
21
21
  <CustomIcon
22
- name="NashirikiSmallLogo"
22
+ name="WaziDarkIcon"
23
23
  color={theme.colorPrimary2}
24
24
  width={16}
25
25
  height={16}
26
26
  />
27
27
  );
28
28
 
29
- const rightIcon = <CustomIcon name="NashirikiSmallLogo" color="white" width={16} height={16} />;
29
+ const rightIcon = <CustomIcon name="WaziDarkIcon" color="white" width={16} height={16} />;
30
30
 
31
31
  const mapIcon = (category) => {
32
32
  switch (category) {
@@ -37,7 +37,6 @@ export const getColumns = ({ t, goTo, user, options, activeTab, getRedirectLink,
37
37
  title: t("Date"),
38
38
  dataIndex: "date",
39
39
  key: "date",
40
- width: 125,
41
40
  render: (date, all) => {
42
41
  if (all.empty) {
43
42
  return <div className="daf-default-cell" />;
@@ -58,19 +57,18 @@ export const getColumns = ({ t, goTo, user, options, activeTab, getRedirectLink,
58
57
  return <div className="daf-default-cell" />;
59
58
  }
60
59
  if (!val || val?.length === 0) {
61
- return "--";
60
+ return "-";
62
61
  }
63
62
 
64
63
  const sources = sourceAvatarConfig(val, user, applications);
65
64
 
66
- return <AvatarGroup items={sources}></AvatarGroup>;
65
+ return <AvatarGroup items={sources} />;
67
66
  },
68
67
  },
69
68
  {
70
69
  title: t("Last Update"),
71
70
  dataIndex: "updatedAt",
72
71
  key: "updatedAt",
73
- width: 125,
74
72
  render: (date, all) => {
75
73
  if (all.empty) {
76
74
  return <div className="daf-default-cell" />;
@@ -34,6 +34,7 @@ const DocumentsTable = ({
34
34
  form = {},
35
35
  applications = [],
36
36
  subjectClear = () => {},
37
+ breadcrumbs = [],
37
38
  }) => {
38
39
  const [selectOptions, setSelectOptions] = useState();
39
40
  const [activeTab, setActiveTab] = useState("own");
@@ -49,8 +50,6 @@ const DocumentsTable = ({
49
50
  applications,
50
51
  }), [t, goTo, user, options, activeTab, getRedirectLink, theme, applications]);
51
52
 
52
- const breadCrumbs = [];
53
-
54
53
  const { paginationQuery, searchParams, otherParams, sortBy, sortDir } = useGetQueryParams({location});
55
54
 
56
55
  useEffect(() => {
@@ -91,7 +90,7 @@ const DocumentsTable = ({
91
90
  <TablePageWithTabs
92
91
  t={t}
93
92
  title={t("Documents")}
94
- breadCrumbs={breadCrumbs}
93
+ breadCrumbs={breadcrumbs}
95
94
  location={location}
96
95
  loading={loading}
97
96
  goTo={goTo}
@@ -35,6 +35,7 @@ const ActivitiesTable = ({
35
35
  extendingFilters = {},
36
36
  createDefaultValues = {},
37
37
  applications = [],
38
+ breadcrumbs = [],
38
39
  }) => {
39
40
  const [selectOptions, setSelectOptions] = useState();
40
41
  const [activeTab, setActiveTab] = useState("own");
@@ -47,13 +48,11 @@ const ActivitiesTable = ({
47
48
  activeTab,
48
49
  getRedirectLink,
49
50
  theme,
50
- subject: 'correctiveActions',
51
+ subject: 'activities',
51
52
  data,
52
53
  applications,
53
54
  }), [t, goTo, user, options, activeTab, getRedirectLink, theme, data, applications]);
54
55
 
55
- const breadCrumbs = [];
56
-
57
56
  const { paginationQuery, searchParams, otherParams, sortBy, sortDir } = useGetQueryParams({location});
58
57
 
59
58
  const filters = useMemo(() => {
@@ -95,7 +94,7 @@ const ActivitiesTable = ({
95
94
  <TablePageWithTabs
96
95
  t={t}
97
96
  title={t("Activities")}
98
- breadCrumbs={breadCrumbs}
97
+ breadCrumbs={breadcrumbs}
99
98
  location={location}
100
99
  loading={loading}
101
100
  goTo={goTo}
@@ -35,6 +35,7 @@ const IncidentsTable = ({
35
35
  extendingFilters = {},
36
36
  createDefaultValues = {},
37
37
  applications = [],
38
+ breadcrumbs = [],
38
39
  }) => {
39
40
  const [selectOptions, setSelectOptions] = useState();
40
41
  const [activeTab, setActiveTab] = useState("own");
@@ -52,8 +53,6 @@ const IncidentsTable = ({
52
53
  applications,
53
54
  }), [t, goTo, user, options, activeTab, getRedirectLink, theme, data, applications]);
54
55
 
55
- const breadCrumbs = [];
56
-
57
56
  const { paginationQuery, searchParams, otherParams, sortBy, sortDir } = useGetQueryParams({location});
58
57
 
59
58
  const filters = useMemo(() => {
@@ -95,7 +94,7 @@ const IncidentsTable = ({
95
94
  <TablePageWithTabs
96
95
  t={t}
97
96
  title={t("Incidents")}
98
- breadCrumbs={breadCrumbs}
97
+ breadCrumbs={breadcrumbs}
99
98
  location={location}
100
99
  loading={loading}
101
100
  goTo={goTo}
@@ -96,7 +96,7 @@ export const getColumns = ({ t, goTo, user, options, activeTab, getRedirectLink,
96
96
  })
97
97
 
98
98
  if (val?.length === 0) {
99
- return "--";
99
+ return "-";
100
100
  }
101
101
 
102
102
  return <MoreTags values={val} />;
@@ -106,19 +106,19 @@ export const getColumns = ({ t, goTo, user, options, activeTab, getRedirectLink,
106
106
  title: t("Date"),
107
107
  dataIndex: "date",
108
108
  key: "date",
109
- testimonials: true,
110
- incident: true,
111
- correctiveActions: true,
109
+ // testimonials: true,
110
+ // incident: true,
111
+ // correctiveActions: true,
112
112
  show: true,
113
- sorter: () => 0 + 0,
114
- searchType: "date",
115
- width: 125,
113
+ // sorter: () => 0 + 0,
114
+ // searchType: "date",
115
+ // width: 125,
116
116
  render: (date, all) => {
117
117
  if (all.empty) {
118
118
  return null;
119
119
  }
120
120
 
121
- const title = date ? renderDateFormatted(date, "DD MMM YYYY") : "--";
121
+ const title = date ? renderDateFormatted(date, "DD MMM YYYY") : "-";
122
122
  return <Tooltip title={title}>{title}</Tooltip>;
123
123
  },
124
124
  ellipsis: true,
@@ -134,13 +134,13 @@ export const getColumns = ({ t, goTo, user, options, activeTab, getRedirectLink,
134
134
  }
135
135
 
136
136
  if (!value) {
137
- return "--";
137
+ return "-";
138
138
  }
139
139
 
140
140
  // Form the moment the intend of the if block is to be executed only in event table
141
141
  if (typeof value === "string") {
142
142
  if (all.navigationEventType === "other") {
143
- return "--";
143
+ return "-";
144
144
  }
145
145
 
146
146
  const categoryOptions = (data?.options?.categoryOptions || []).map((c) => {
@@ -158,13 +158,13 @@ export const getColumns = ({ t, goTo, user, options, activeTab, getRedirectLink,
158
158
  ...(data?.options?.testimonialsType || []),
159
159
  ];
160
160
 
161
- const title = relaxantOptions.find((v) => v.value === value)?.label || "--";
161
+ const title = relaxantOptions.find((v) => v.value === value)?.label || "-";
162
162
 
163
163
  return <Tooltip title={title}>{title}</Tooltip>;
164
164
  }
165
165
 
166
166
  const val = value.map((v, i) => ({ label: v.name, value: `${v.name}-${i}` }));
167
- return val.length ? <MoreTags values={val} /> : "--";
167
+ return val.length ? <MoreTags values={val} /> : "-";
168
168
  },
169
169
  },
170
170
  {
@@ -190,7 +190,6 @@ export const getColumns = ({ t, goTo, user, options, activeTab, getRedirectLink,
190
190
  correctiveActions: activeTab === "own",
191
191
  testimonials: activeTab === "own",
192
192
  incident: activeTab === "own",
193
- width: 120,
194
193
  render: (value, all) => {
195
194
  if (all.empty) {
196
195
  return <div className="daf-default-cell" />;
@@ -209,7 +208,6 @@ export const getColumns = ({ t, goTo, user, options, activeTab, getRedirectLink,
209
208
  title: t("Last Update"),
210
209
  dataIndex: "updatedAt",
211
210
  key: "updatedAt",
212
- width: 125,
213
211
  render: (date, all) => {
214
212
  if (all.empty) {
215
213
  return <div className="daf-default-cell" />;
@@ -35,6 +35,7 @@ const EventsTable = ({
35
35
  extendingFilters = {},
36
36
  applications = [],
37
37
  subjectClear = () => {},
38
+ breadcrumbs = [],
38
39
  }) => {
39
40
  const [selectOptions, setSelectOptions] = useState();
40
41
  const [activeTab, setActiveTab] = useState("own");
@@ -52,8 +53,6 @@ const EventsTable = ({
52
53
  applications,
53
54
  }), [t, goTo, user, options, activeTab, getRedirectLink, theme, data, applications]);
54
55
 
55
- const breadCrumbs = [];
56
-
57
56
  const { paginationQuery, searchParams, otherParams, sortBy, sortDir } = useGetQueryParams({location});
58
57
 
59
58
  const filters = useMemo(() => {
@@ -101,7 +100,7 @@ const EventsTable = ({
101
100
  <TablePageWithTabs
102
101
  t={t}
103
102
  title={t("events")}
104
- breadCrumbs={breadCrumbs}
103
+ breadCrumbs={breadcrumbs}
105
104
  location={location}
106
105
  loading={loading}
107
106
  goTo={goTo}
@@ -4,7 +4,9 @@ import { findOptions } from '../../../../helpers/StringHelper.js';
4
4
  import { renderDateFormatted } from '../../../../helpers/Forms.js';
5
5
  import CustomIcon from '../../../core/components/Icon/CustomIcon.jsx';
6
6
  import AvatarGroup from '../../../core/components/AvatarGroup/index.jsx';
7
+ import sourceAvatarConfig from '../../../../helpers/sourceAvatarConfig.js';
7
8
  import MoreMenu from '../../../core/components/Table/MoreMenu/index.jsx';
9
+
8
10
  const getLinkValue = (value, linkingObject) => {
9
11
  if(linkingObject && linkingObject?.[value]) {
10
12
  return linkingObject?.[value]?.name;
@@ -12,7 +14,7 @@ const getLinkValue = (value, linkingObject) => {
12
14
  return null;
13
15
  }
14
16
 
15
- export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink, theme, subject, data}) => [
17
+ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink, theme, subject, data, applications}) => [
16
18
  {
17
19
  dataIndex: 'datastakeId',
18
20
  title: t('ID'),
@@ -40,8 +42,8 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
40
42
  },
41
43
  },
42
44
  {
43
- dataIndex: 'province',
44
- title: t('Province'),
45
+ dataIndex: 'region',
46
+ title: t('Region'),
45
47
  ellipsis: true,
46
48
  show: true,
47
49
  render: (v, all) => {
@@ -49,13 +51,11 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
49
51
  return <div className="daf-default-cell" />
50
52
  }
51
53
 
52
- const region = getLinkValue(all?.location?.administrativeLevel1, all?.location?.linking?.SCL);
54
+ const region = getLinkValue(all?.administrativeLevel1, all?.linking?.SCL);
53
55
 
54
56
  return region ? <Tooltip title={region}>{region}</Tooltip> : '-';
55
57
  },
56
58
  },
57
-
58
-
59
59
  {
60
60
  dataIndex: 'territory',
61
61
  title: t('Territory'),
@@ -66,26 +66,25 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
66
66
  return <div className="daf-default-cell" />
67
67
  }
68
68
 
69
- const district = getLinkValue(all?.location?.administrativeLevel2, all?.location?.linking?.SCL);
69
+ const district = getLinkValue(all?.administrativeLevel2, all?.linking?.SCL);
70
70
 
71
71
  return district ? <Tooltip title={district}>{district}</Tooltip> : '-';
72
72
  },
73
73
  },
74
74
  {
75
- title: t("Products"),
76
- dataIndex: "products",
77
- key: "products",
78
- show: activeTab !== "own",
79
- render: (val, all) => {
80
- if (all.empty) {
81
- return <div className="daf-default-cell" />;
82
- }
83
-
84
- console.log({val, all})
85
-
86
- return <AvatarGroup items={val}></AvatarGroup>;
75
+ dataIndex: 'category',
76
+ title: t('Type'),
77
+ ellipsis: true,
78
+ show: true,
79
+ render: (v, all) => {
80
+ if (all.empty) {
81
+ return <div className="daf-default-cell" />
82
+ }
83
+ const category = findOptions(v, options?.locationCategories);
84
+
85
+ return <Tooltip title={category}>{category}</Tooltip>;
87
86
  },
88
- },
87
+ },
89
88
  {
90
89
  dataIndex: 'operator',
91
90
  title: t('Operator'),
@@ -132,15 +131,15 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
132
131
 
133
132
  {
134
133
  title: t("Sources"),
135
- dataIndex: 'source',
134
+ dataIndex: 'sources',
136
135
  ellipsis: true,
137
136
  show: activeTab !== "own",
138
137
  render: (v, all) => {
139
138
  if (all.empty) {
140
139
  return <div className="daf-default-cell" />
141
140
  }
142
- const source = findOptions(v, data?.options?.sourceOptions);
143
- return source ? <Tooltip title={source}>{source}</Tooltip> : '-';
141
+ const sources = sourceAvatarConfig(v, user, applications);
142
+ return <AvatarGroup items={sources}></AvatarGroup>;
144
143
  },
145
144
  },
146
145
  {
@@ -152,7 +151,7 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
152
151
  return <div className="daf-default-cell" />;
153
152
  }
154
153
  const onClick = () => {
155
- const link = `/app/view/${subject}/${all.datastakeId}`;
154
+ let link = `/app/view/${subject}/${all.datastakeId}`;
156
155
  if (activeTab === "shared") {
157
156
  link += `?sourceId=${all?.authorId?.id}`;
158
157
  }
@@ -34,6 +34,8 @@ const ProductionSitesTable = ({
34
34
  form = {},
35
35
  extendingFilters = {},
36
36
  createDefaultValues = {},
37
+ applications = [],
38
+ breadcrumbs = [],
37
39
  }) => {
38
40
  const [selectOptions, setSelectOptions] = useState();
39
41
  const [activeTab, setActiveTab] = useState('own');
@@ -48,9 +50,8 @@ const ProductionSitesTable = ({
48
50
  theme,
49
51
  subject: 'production-sites',
50
52
  data,
51
- }), [t, goTo, user, options, activeTab, getRedirectLink, theme, data]);
52
-
53
- const breadCrumbs = [];
53
+ applications,
54
+ }), [t, goTo, user, options, activeTab, getRedirectLink, theme, data, applications]);
54
55
 
55
56
  const { paginationQuery, searchParams, otherParams, sortBy, sortDir } = useGetQueryParams({location});
56
57
 
@@ -93,7 +94,7 @@ const ProductionSitesTable = ({
93
94
  <TablePageWithTabs
94
95
  t={t}
95
96
  title={t("production-sites")}
96
- breadCrumbs={breadCrumbs}
97
+ breadCrumbs={breadcrumbs}
97
98
  location={location}
98
99
  loading={loading}
99
100
  goTo={goTo}
@@ -80,7 +80,7 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
80
80
  return <div className="daf-default-cell" />
81
81
  }
82
82
 
83
- const province = getLinkValue(v, all?.linking?.SCL);
83
+ const province = getLinkValue(all?.administrativeLevel1, all?.linking?.SCL);
84
84
 
85
85
  return province ? <Tooltip title={province}>{province}</Tooltip> : '-';
86
86
  },
@@ -95,7 +95,7 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
95
95
  return <div className="daf-default-cell" />
96
96
  }
97
97
 
98
- const territory = getLinkValue(v, all?.linking?.SCL);
98
+ const territory = getLinkValue(all?.administrativeLevel2, all?.linking?.SCL);
99
99
 
100
100
  return territory ? <Tooltip title={territory}>{territory}</Tooltip> : '-';
101
101
  },
@@ -34,6 +34,7 @@ const LocationsTable = ({
34
34
  form = {},
35
35
  applications = [],
36
36
  subjectClear = () => {},
37
+ breadcrumbs = [],
37
38
  }) => {
38
39
  const [selectOptions, setSelectOptions] = useState();
39
40
  const [activeTab, setActiveTab] = useState("own");
@@ -51,8 +52,6 @@ const LocationsTable = ({
51
52
  applications,
52
53
  }), [t, goTo, user, options, activeTab, getRedirectLink, theme, data, applications]);
53
54
 
54
- const breadCrumbs = [];
55
-
56
55
  const { paginationQuery, searchParams, otherParams } = useGetQueryParams({location});
57
56
 
58
57
  useEffect(() => {
@@ -92,7 +91,7 @@ const LocationsTable = ({
92
91
  <TablePageWithTabs
93
92
  t={t}
94
93
  title={t("Locations")}
95
- breadCrumbs={breadCrumbs}
94
+ breadCrumbs={breadcrumbs}
96
95
  location={location}
97
96
  loading={loading}
98
97
  goTo={goTo}
@@ -35,6 +35,7 @@ const OperatorsTable = ({
35
35
  extendingFilters = {},
36
36
  createDefaultValues = {},
37
37
  applications = [],
38
+ breadcrumbs = [],
38
39
  }) => {
39
40
  const [selectOptions, setSelectOptions] = useState();
40
41
  const [activeTab, setActiveTab] = useState('own');
@@ -52,7 +53,6 @@ const OperatorsTable = ({
52
53
  applications,
53
54
  }), [t, goTo, user, options, activeTab, getRedirectLink, theme, data, applications]);
54
55
 
55
- const breadCrumbs = [];
56
56
 
57
57
  const { paginationQuery, searchParams, otherParams, sortBy, sortDir } = useGetQueryParams({location});
58
58
 
@@ -95,7 +95,7 @@ const OperatorsTable = ({
95
95
  <TablePageWithTabs
96
96
  t={t}
97
97
  title={t("Operators")}
98
- breadCrumbs={breadCrumbs}
98
+ breadCrumbs={breadcrumbs}
99
99
  location={location}
100
100
  loading={loading}
101
101
  goTo={goTo}
@@ -167,10 +167,20 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
167
167
  const link = `/app/view/${subject}/${all.datastakeId}`;
168
168
 
169
169
  return <div style={{ display: "flex", justifyContent: "center" }}>
170
- <a href={getRedirectLink(link)}>
171
- <CustomIcon name="Link" size={15} color={theme.baseGray70} />
172
- </a>
173
- </div>;
170
+ <button
171
+ onClick={() => goTo(getRedirectLink(link))}
172
+ style={{
173
+ cursor: 'pointer',
174
+ border: 'none',
175
+ background: 'transparent',
176
+ padding: 0,
177
+ display: 'flex',
178
+ alignItems: 'center'
179
+ }}
180
+ >
181
+ <CustomIcon name="Link" size={15} color={theme.baseGray70} />
182
+ </button>
183
+ </div>;
174
184
  }
175
185
  }
176
186
  ].filter((column) => column.show !== false);