datastake-daf 0.6.759 → 0.6.761

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 (45) hide show
  1. package/dist/components/index.js +2464 -2707
  2. package/dist/constants/index.js +76 -0
  3. package/dist/pages/index.js +136 -314
  4. package/dist/services/index.js +91 -0
  5. package/dist/utils/index.js +388 -0
  6. package/package.json +1 -1
  7. package/rollup.config.js +20 -0
  8. package/src/@daf/core/components/EditForm/storyConfig2.js +866 -25029
  9. package/src/@daf/core/components/Screens/FindInformation/index.js +2 -1
  10. package/src/@daf/core/components/Screens/Users/columns.js +0 -6
  11. package/src/@daf/core/components/Table/NavigationAction/index.jsx +24 -0
  12. package/src/@daf/pages/Dashboards/SupplyChain/index.jsx +2 -2
  13. package/src/@daf/pages/Dashboards/UserDashboard/config.js +3 -3
  14. package/src/@daf/pages/Documents/columns.js +5 -22
  15. package/src/@daf/pages/Documents/index.jsx +2 -3
  16. package/src/@daf/pages/Events/Activities/columns.js +7 -59
  17. package/src/@daf/pages/Events/Activities/index.jsx +2 -3
  18. package/src/@daf/pages/Events/Incidents/columns.js +7 -61
  19. package/src/@daf/pages/Events/Incidents/index.jsx +2 -3
  20. package/src/@daf/pages/Events/columns.js +6 -47
  21. package/src/@daf/pages/Events/helper.js +14 -0
  22. package/src/@daf/pages/Events/index.jsx +2 -3
  23. package/src/@daf/pages/Locations/MineSite/columns.js +7 -12
  24. package/src/@daf/pages/Locations/MineSite/index.jsx +5 -4
  25. package/src/@daf/pages/Locations/columns.js +6 -32
  26. package/src/@daf/pages/Locations/index.jsx +2 -3
  27. package/src/@daf/pages/Partners/index.jsx +11 -0
  28. package/src/@daf/pages/Stakeholders/Operators/columns.js +2 -8
  29. package/src/@daf/pages/Stakeholders/Operators/index.jsx +2 -2
  30. package/src/@daf/pages/Stakeholders/Workers/columns.js +10 -49
  31. package/src/@daf/pages/Stakeholders/Workers/index.jsx +2 -3
  32. package/src/@daf/pages/Stakeholders/columns.js +4 -25
  33. package/src/@daf/pages/Stakeholders/index.jsx +2 -3
  34. package/src/@daf/pages/Summary/Minesite/components/LocationMap/index.js +0 -1
  35. package/src/@daf/pages/Summary/Minesite/index.jsx +2 -0
  36. package/src/@daf/pages/Summary/Operator/index.jsx +3 -1
  37. package/src/@daf/services/PartnerService.js +76 -0
  38. package/src/@daf/utils/tags.js +26 -0
  39. package/src/constants/breadCrumbs.js +22 -0
  40. package/src/constants.js +2 -0
  41. package/src/helpers/breadCrumbs.js +347 -0
  42. package/src/index.js +1 -1
  43. package/src/services.js +2 -1
  44. package/src/utils.js +5 -1
  45. package/dist/style/datastake/mapbox-gl.css +0 -330
@@ -18,6 +18,7 @@ export default function FindInformation({
18
18
  goTo = () => {},
19
19
  getRedirectLink = () => {},
20
20
  renderBreadCrumbs = () => {},
21
+ breadcrumbs = [],
21
22
  }) {
22
23
  const { defaultTab, setDefaultTab } = useFindInformation();
23
24
  const params = useMemo(() => new URLSearchParams(location.search), [location.search]);
@@ -41,7 +42,7 @@ export default function FindInformation({
41
42
  return (
42
43
  <div className="daf-create-view semibold form-input-output">
43
44
  <Header
44
- breadcrumbs={breadCrumbs}
45
+ breadcrumbs={breadcrumbs || breadCrumbs}
45
46
  title={t("Find Information")}
46
47
  supportText={t(
47
48
  "Identify available information sources among users of compatible applications and connected databases.",
@@ -3,12 +3,6 @@ import { Modal, Tag, Typography, message ,Tooltip} from "antd";
3
3
 
4
4
  import { renderDateFormatted } from '../../../../../helpers/Forms.js';
5
5
  import MoreMenu from '../../../../core/components/Table/MoreMenu/index.jsx';
6
- const getLinkValue = (value, linkingObject) => {
7
- if(linkingObject && linkingObject?.[value]) {
8
- return linkingObject?.[value]?.name;
9
- }
10
- return null;
11
- }
12
6
 
13
7
  export const getColumns = ({t, goTo, user, removeUser = () => {},
14
8
  resendInvite = () => {},
@@ -0,0 +1,24 @@
1
+ import React from 'react'
2
+ import CustomIcon from '../../Icon/CustomIcon.jsx';
3
+
4
+ const NavigationAction = ({onClick, theme}) => {
5
+ return (
6
+ <div style={{ display: "flex", justifyContent: "center" }}>
7
+ <button
8
+ onClick={onClick}
9
+ style={{
10
+ cursor: 'pointer',
11
+ border: 'none',
12
+ background: 'transparent',
13
+ padding: 0,
14
+ display: 'flex',
15
+ alignItems: 'center'
16
+ }}
17
+ >
18
+ <CustomIcon name="Link" size={15} color={theme.baseGray70} />
19
+ </button>
20
+ </div>
21
+ )
22
+ }
23
+
24
+ export default NavigationAction
@@ -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
  >
@@ -1,9 +1,9 @@
1
1
  export const getActionWidgetsConfig = ({ goTo, getRedirectLink, APP, t }) => [
2
- ...(APP === 'nashiriki' ? [{
2
+ {
3
3
  icon: "MineSite",
4
4
  title: t("nashiriki::create-mine-site"),
5
- onClick: () => goTo(getRedirectLink("/app/scl?create=true")),
6
- }] : []),
5
+ onClick: () => goTo(getRedirectLink("/app/production-sites?create=true")),
6
+ },
7
7
  {
8
8
  icon: "FileEdit",
9
9
  title: "Report Activity",
@@ -1,11 +1,10 @@
1
1
  import React from 'react';
2
2
  import { Tooltip } from 'antd';
3
- import { findOptions } from '../../../helpers/StringHelper.js';
4
3
  import { renderDateFormatted } from '../../../helpers/Forms.js';
5
- import CustomIcon from '../../core/components/Icon/CustomIcon.jsx';
6
4
  import AvatarGroup from '../../core/components/AvatarGroup/index.jsx';
7
5
  import sourceAvatarConfig from '../../../helpers/sourceAvatarConfig.js';
8
- import MoreMenu from '../../core/components/Table/MoreMenu/index.jsx';
6
+ import NavigationAction from '../../core/components/Table/NavigationAction/index.jsx';
7
+
9
8
  export const getColumns = ({ t, goTo, user, options, activeTab, getRedirectLink, theme, subject, applications }) => [
10
9
  {
11
10
  dataIndex: 'datastakeId',
@@ -88,30 +87,14 @@ export const getColumns = ({ t, goTo, user, options, activeTab, getRedirectLink,
88
87
  return <div className="daf-default-cell" />;
89
88
  }
90
89
  const onClick = () => {
91
- const link = `/app/view/${subject}/${all.datastakeId}`;
90
+ let link = `/app/view/${subject}/${all.datastakeId}`;
92
91
  if (activeTab === "shared") {
93
92
  link += `?sourceId=${all?.authorId?.id}`;
94
93
  }
95
94
  goTo(getRedirectLink(link));
96
95
  };
97
- const moreMenuItems = [
98
- {
99
- label: t("Details"),
100
- value: "details",
101
- onClick: onClick,
102
- },
103
- {
104
- label: t("Remove"),
105
- value: "remove",
106
- onClick: () => {
107
- console.log("remove");
108
- },
109
- disabled: true,
110
- },
111
- ];
112
- return <div >
113
- <MoreMenu items={moreMenuItems} />
114
- </div>;
96
+
97
+ return <NavigationAction onClick={onClick} theme={theme} />;
115
98
  }
116
99
  }
117
100
  ].filter((column) => column.show !== false);
@@ -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}
@@ -1,55 +1,12 @@
1
1
  import React from 'react';
2
2
  import { Tooltip, Tag } from 'antd';
3
- import { findOptions } from '../../../../helpers/StringHelper.js';
3
+ import { findOptions, getLinkValue } from '../../../../helpers/StringHelper.js';
4
4
  import { renderDateFormatted } from '../../../../helpers/Forms.js';
5
- import CustomIcon from '../../../core/components/Icon/CustomIcon.jsx';
6
5
  import AvatarGroup from '../../../core/components/AvatarGroup/index.jsx';
7
6
  import sourceAvatarConfig from '../../../../helpers/sourceAvatarConfig.js';
8
- import MoreMenu from '../../../core/components/Table/MoreMenu/index.jsx';
9
- const getLinkValue = (value, linkingObject) => {
10
- if(linkingObject && linkingObject?.[value]) {
11
- return linkingObject?.[value]?.name;
12
- }
13
- return null;
14
- }
15
-
16
- const getEventCategoryBySubject = (eventCategoryObject, subject) => {
17
- if (!eventCategoryObject || typeof eventCategoryObject !== 'object') {
18
- return null;
19
- }
20
-
21
- const subjectSingular = subject.endsWith('ies')
22
- ? subject.slice(0, -3) + 'y'
23
- : subject;
24
-
25
- const key = `typeOfEvent is ${subjectSingular}`;
26
- return eventCategoryObject[key] || null;
27
- };
28
-
29
- export const renderStatusTag = ({ value, t = (s) => s }) => {
30
- const width = 87;
31
-
32
- switch (value) {
33
- case "edited":
34
- return (
35
- <Tag color="yellow" style={{ width }} className="text-center">
36
- {t("Edited")}
37
- </Tag>
38
- );
39
- case "submitted":
40
- return (
41
- <Tag color="green" style={{ width }} className="text-center">
42
- {t("Submitted")}
43
- </Tag>
44
- );
45
- default:
46
- return (
47
- <Tag color="blue" style={{ width }} className="text-center">
48
- {t("Private")}
49
- </Tag>
50
- );
51
- }
52
- };
7
+ import { getEventCategoryBySubject } from '../helper.js';
8
+ import { renderStatusTag } from '../../../utils/tags.js';
9
+ import NavigationAction from '../../../core/components/Table/NavigationAction/index.jsx';
53
10
 
54
11
  export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink, theme, subject, data, applications}) => [
55
12
  {
@@ -210,23 +167,14 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
210
167
  return <div className="daf-default-cell" />;
211
168
  }
212
169
  const onClick = () => {
213
- const link = `/app/view/${subject}/${all.datastakeId}`;
170
+ let link = `/app/view/${subject}/${all.datastakeId}`;
214
171
  if (activeTab === "shared") {
215
172
  link += `?sourceId=${all?.authorId?.id}`;
216
173
  }
217
174
  goTo(getRedirectLink(link));
218
175
  };
219
- const moreMenuItems = [
220
- {
221
- label: t("Details"),
222
- value: "details",
223
- onClick: onClick,
224
- },
225
-
226
- ];
227
- return <div >
228
- <MoreMenu items={moreMenuItems} />
229
- </div>;
176
+
177
+ return <NavigationAction onClick={onClick} theme={theme} />;
230
178
  }
231
179
  }
232
180
  ].filter((column) => column.show !== false);
@@ -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");
@@ -52,8 +53,6 @@ const ActivitiesTable = ({
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}
@@ -1,57 +1,12 @@
1
1
  import React from 'react';
2
2
  import { Tooltip, Tag } from 'antd';
3
- import { findOptions } from '../../../../helpers/StringHelper.js';
3
+ import { findOptions, getLinkValue } from '../../../../helpers/StringHelper.js';
4
4
  import { renderDateFormatted } from '../../../../helpers/Forms.js';
5
- import CustomIcon from '../../../core/components/Icon/CustomIcon.jsx';
6
5
  import AvatarGroup from '../../../core/components/AvatarGroup/index.jsx';
7
6
  import sourceAvatarConfig from '../../../../helpers/sourceAvatarConfig.js';
8
- import MoreMenu from '../../../core/components/Table/MoreMenu/index.jsx';
9
- const getLinkValue = (value, linkingObject) => {
10
- if(linkingObject && linkingObject?.[value]) {
11
- return linkingObject?.[value]?.name;
12
- }
13
- return null;
14
- }
15
-
16
- const getEventCategoryBySubject = (eventCategoryObject, subject) => {
17
- if (!eventCategoryObject || typeof eventCategoryObject !== 'object') {
18
- return null;
19
- }
20
-
21
- const subjectSingular = subject.endsWith('ies')
22
- ? subject.slice(0, -3) + 'y'
23
- : subject.endsWith('s')
24
- ? subject.slice(0, -1)
25
- : subject;
26
-
27
- const key = `typeOfEvent is ${subjectSingular}`;
28
- return eventCategoryObject[key] || null;
29
- };
30
-
31
- export const renderStatusTag = ({ value, t = (s) => s }) => {
32
- const width = 87;
33
-
34
- switch (value) {
35
- case "edited":
36
- return (
37
- <Tag color="yellow" style={{ width }} className="text-center">
38
- {t("Edited")}
39
- </Tag>
40
- );
41
- case "submitted":
42
- return (
43
- <Tag color="green" style={{ width }} className="text-center">
44
- {t("Submitted")}
45
- </Tag>
46
- );
47
- default:
48
- return (
49
- <Tag color="blue" style={{ width }} className="text-center">
50
- {t("Private")}
51
- </Tag>
52
- );
53
- }
54
- };
7
+ import { getEventCategoryBySubject } from '../helper.js';
8
+ import { renderStatusTag } from '../../../utils/tags.js';
9
+ import NavigationAction from '../../../core/components/Table/NavigationAction/index.jsx';
55
10
 
56
11
  export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink, theme, subject, data, applications}) => [
57
12
  {
@@ -209,23 +164,14 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
209
164
  return <div className="daf-default-cell" />;
210
165
  }
211
166
  const onClick = () => {
212
- const link = `/app/view/${subject}/${all.datastakeId}`;
167
+ let link = `/app/view/${subject}/${all.datastakeId}`;
213
168
  if (activeTab === "shared") {
214
169
  link += `?sourceId=${all?.authorId?.id}`;
215
170
  }
216
171
  goTo(getRedirectLink(link));
217
172
  };
218
- const moreMenuItems = [
219
- {
220
- label: t("Details"),
221
- value: "details",
222
- onClick: onClick,
223
- },
224
-
225
- ];
226
- return <div >
227
- <MoreMenu items={moreMenuItems} />
228
- </div>;
173
+
174
+ return <NavigationAction onClick={onClick} theme={theme} />;
229
175
  }
230
176
  }
231
177
  ].filter((column) => column.show !== false);
@@ -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}
@@ -2,43 +2,11 @@ import React from 'react';
2
2
  import { Tooltip, Tag } from 'antd';
3
3
  import { findOptions } from '../../../helpers/StringHelper.js';
4
4
  import { renderDateFormatted } from '../../../helpers/Forms.js';
5
- import CustomIcon from '../../core/components/Icon/CustomIcon.jsx';
6
- // import CustomIcon from '../../core/components/';
7
5
  import AvatarGroup from '../../core/components/AvatarGroup/index.jsx';
8
6
  import sourceAvatarConfig from '../../../helpers/sourceAvatarConfig.js';
9
7
  import MoreTags from '../../core/components/Table/MoreTags/index.jsx';
10
- import MoreMenu from '../../core/components/Table/MoreMenu/index.jsx';
11
- const getLinkValue = (value, linkingObject) => {
12
- if (linkingObject && linkingObject?.[value]) {
13
- return linkingObject?.[value]?.name;
14
- }
15
- return null;
16
- }
17
-
18
- export const renderEventStatusTag = ({ value, t = (s) => s }) => {
19
- const width = 87;
20
-
21
- switch (value) {
22
- case "edited":
23
- return (
24
- <Tag color="orange" style={{ width }} className="text-center">
25
- {t("Edited")}
26
- </Tag>
27
- );
28
- case "submitted":
29
- return (
30
- <Tag color="green" style={{ width }} className="text-center">
31
- {t("Submitted")}
32
- </Tag>
33
- );
34
- default:
35
- return (
36
- <Tag color="blue" style={{ width }} className="text-center">
37
- {t("Private")}
38
- </Tag>
39
- );
40
- }
41
- };
8
+ import NavigationAction from '../../core/components/Table/NavigationAction/index.jsx';
9
+ import { renderStatusTag } from '../../utils/tags.js';
42
10
 
43
11
  export const getColumns = ({ t, goTo, user, options, activeTab, getRedirectLink, theme, subject, data, applications }) => [
44
12
  {
@@ -200,7 +168,7 @@ export const getColumns = ({ t, goTo, user, options, activeTab, getRedirectLink,
200
168
  }
201
169
 
202
170
  const _val = all?.published || all?.status === "submitted" ? "submitted" : value;
203
- return renderEventStatusTag({ value: _val, t });
171
+ return renderStatusTag({ value: _val, t });
204
172
  },
205
173
  ellipsis: true,
206
174
  },
@@ -227,23 +195,14 @@ export const getColumns = ({ t, goTo, user, options, activeTab, getRedirectLink,
227
195
  return <div className="daf-default-cell" />;
228
196
  }
229
197
  const onClick = () => {
230
- const link = `/app/view/${subject}/${all.datastakeId}`;
198
+ let link = `/app/view/${subject}/${all.datastakeId}`;
231
199
  if (activeTab === "shared") {
232
200
  link += `?sourceId=${all?.authorId?.id}`;
233
201
  }
234
202
  goTo(getRedirectLink(link));
235
203
  };
236
- const moreMenuItems = [
237
- {
238
- label: t("Details"),
239
- value: "details",
240
- onClick: onClick,
241
- },
242
-
243
- ];
244
- return <div >
245
- <MoreMenu items={moreMenuItems} />
246
- </div>;
204
+
205
+ return <NavigationAction onClick={onClick} theme={theme} />;
247
206
  }
248
207
  }
249
208
  ].filter((column) => column.show !== false);
@@ -0,0 +1,14 @@
1
+ export const getEventCategoryBySubject = (eventCategoryObject, subject) => {
2
+ if (!eventCategoryObject || typeof eventCategoryObject !== 'object') {
3
+ return null;
4
+ }
5
+
6
+ const subjectSingular = subject.endsWith('ies')
7
+ ? subject.slice(0, -3) + 'y'
8
+ : subject.endsWith('s')
9
+ ? subject.slice(0, -1)
10
+ : subject;
11
+
12
+ const key = `typeOfEvent is ${subjectSingular}`;
13
+ return eventCategoryObject[key] || null;
14
+ };
@@ -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}
@@ -1,18 +1,13 @@
1
1
  import React from 'react';
2
2
  import { Tooltip } from 'antd';
3
- import { findOptions } from '../../../../helpers/StringHelper.js';
3
+ import { findOptions, getLinkValue } 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';
8
- const getLinkValue = (value, linkingObject) => {
9
- if(linkingObject && linkingObject?.[value]) {
10
- return linkingObject?.[value]?.name;
11
- }
12
- return null;
13
- }
14
9
 
15
- export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink, theme, subject, data}) => [
10
+ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink, theme, subject, data, applications}) => [
16
11
  {
17
12
  dataIndex: 'datastakeId',
18
13
  title: t('ID'),
@@ -129,15 +124,15 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
129
124
 
130
125
  {
131
126
  title: t("Sources"),
132
- dataIndex: 'source',
127
+ dataIndex: 'sources',
133
128
  ellipsis: true,
134
129
  show: activeTab !== "own",
135
130
  render: (v, all) => {
136
131
  if (all.empty) {
137
132
  return <div className="daf-default-cell" />
138
133
  }
139
- const source = findOptions(v, data?.options?.sourceOptions);
140
- return source ? <Tooltip title={source}>{source}</Tooltip> : '-';
134
+ const sources = sourceAvatarConfig(v, user, applications);
135
+ return <AvatarGroup items={sources}></AvatarGroup>;
141
136
  },
142
137
  },
143
138
  {
@@ -149,7 +144,7 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
149
144
  return <div className="daf-default-cell" />;
150
145
  }
151
146
  const onClick = () => {
152
- const link = `/app/view/${subject}/${all.datastakeId}`;
147
+ let link = `/app/view/${subject}/${all.datastakeId}`;
153
148
  if (activeTab === "shared") {
154
149
  link += `?sourceId=${all?.authorId?.id}`;
155
150
  }
@@ -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}
@@ -1,17 +1,10 @@
1
1
  import React from 'react';
2
2
  import { Tooltip } from 'antd';
3
- import { findOptions } from '../../../helpers/StringHelper.js';
3
+ import { findOptions, getLinkValue } from '../../../helpers/StringHelper.js';
4
4
  import { renderDateFormatted } from '../../../helpers/Forms.js';
5
- import CustomIcon from '../../core/components/Icon/CustomIcon.jsx';
6
5
  import AvatarGroup from '../../core/components/AvatarGroup/index.jsx';
7
6
  import sourceAvatarConfig from '../../../helpers/sourceAvatarConfig.js';
8
- import MoreMenu from '../../core/components/Table/MoreMenu/index.jsx';
9
- const getLinkValue = (value, linkingObject) => {
10
- if(linkingObject && linkingObject?.[value]) {
11
- return linkingObject?.[value]?.name;
12
- }
13
- return null;
14
- }
7
+ import NavigationAction from '../../core/components/Table/NavigationAction/index.jsx';
15
8
 
16
9
  export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink, theme, subject, data, applications}) => [
17
10
  {
@@ -139,35 +132,16 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
139
132
  if (all.empty) {
140
133
  return <div className="daf-default-cell" />;
141
134
  }
135
+
142
136
  const onClick = () => {
143
- const link = `/app/view/${subject}/${all.datastakeId}`;
137
+ let link = `/app/view/${subject}/${all.datastakeId}`;
144
138
  if (activeTab === "shared") {
145
139
  link += `?sourceId=${all?.authorId?.id}`;
146
140
  }
147
141
  goTo(getRedirectLink(link));
148
142
  };
149
- const moreMenuItems = [
150
- {
151
- label: t("Details"),
152
- value: "details",
153
- onClick: onClick,
154
- },
155
- {
156
- label: t("Summary"),
157
- value: "Summary",
158
- onClick: () => {
159
- let link = `/app/summary/${subject}/${all.datastakeId}`
160
- if (activeTab === "shared") {
161
- link += `?sourceId=${all?.authorId?.id}`;
162
- }
163
- goTo(getRedirectLink(link));
164
- },
165
- // disabled: true,
166
- },
167
- ];
168
- return <div >
169
- <MoreMenu items={moreMenuItems} />
170
- </div>;
143
+
144
+ return <NavigationAction onClick={onClick} theme={theme} />;
171
145
  }
172
146
  }
173
147
  ].filter((column) => column.show !== false);