datastake-daf 0.6.744 → 0.6.745

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 (80) hide show
  1. package/dist/components/index.js +549 -893
  2. package/dist/context/index.js +0 -3
  3. package/dist/hooks/index.js +19 -4658
  4. package/dist/layouts/index.js +573 -916
  5. package/dist/pages/index.js +792 -988
  6. package/dist/services/index.js +1 -7
  7. package/dist/utils/index.js +466 -808
  8. package/package.json +3 -1
  9. package/rollup.config.js +7 -2
  10. package/src/@daf/core/components/DynamicForm/components/ajaxModal.js +1 -1
  11. package/src/@daf/core/components/EditForm/components/Comment/index.js +1 -1
  12. package/src/@daf/core/components/EditForm/components/DataLink/ajaxSelectDataLink.js +1 -1
  13. package/src/@daf/core/components/EditForm/components/DataLink/flat.js +1 -1
  14. package/src/@daf/core/components/EditForm/components/DataLink/index.js +1 -1
  15. package/src/@daf/core/components/EditForm/components/DataLinkGroup/index.js +1 -1
  16. package/src/@daf/core/components/EditForm/components/Repeatable/index.js +1 -1
  17. package/src/@daf/core/components/EditForm/components/ajaxSelect.js +1 -1
  18. package/src/@daf/core/components/EditForm/components/geolocation.js +1 -0
  19. package/src/@daf/core/components/EditForm/helper.js +0 -4
  20. package/src/@daf/core/components/Screens/Admin/AdminModals/CombineAccount/index.jsx +1 -1
  21. package/src/@daf/core/components/Screens/Admin/AdminModals/CombineLocation/index.jsx +1 -1
  22. package/src/@daf/core/components/Screens/Admin/AdminModals/CombineSubjects/index.jsx +1 -1
  23. package/src/@daf/layouts/AppLayout/index.jsx +5 -4
  24. package/src/@daf/layouts/AuthLayout/components/Select/style.js +1 -1
  25. package/src/@daf/layouts/AuthLayout/style.js +1 -1
  26. package/src/@daf/pages/Documents/columns.js +102 -0
  27. package/src/@daf/pages/{dashboards/AllInformation/Documents → Documents}/create.jsx +2 -2
  28. package/src/@daf/pages/{dashboards/AllInformation/Documents → Documents}/index.jsx +9 -6
  29. package/src/@daf/pages/{dashboards/DueDilligence/Incidents → Events/Activities}/columns.js +8 -7
  30. package/src/@daf/pages/{dashboards/DueDilligence → Events}/Activities/create.jsx +2 -2
  31. package/src/@daf/pages/{dashboards/DueDilligence → Events}/Activities/index.jsx +6 -6
  32. package/src/@daf/pages/{dashboards/DueDilligence/Activities → Events/Incidents}/columns.js +5 -5
  33. package/src/@daf/pages/{dashboards/DueDilligence → Events}/Incidents/create.jsx +2 -2
  34. package/src/@daf/pages/{dashboards/DueDilligence → Events}/Incidents/index.jsx +5 -5
  35. package/src/@daf/pages/{dashboards/DueDilligence → Events}/Incidents2/columns.js +4 -4
  36. package/src/@daf/pages/{dashboards/DueDilligence → Events}/Incidents2/config.js +0 -1
  37. package/src/@daf/pages/{dashboards/DueDilligence → Events}/Incidents2/create.jsx +2 -2
  38. package/src/@daf/pages/{dashboards/DueDilligence → Events}/Incidents2/index.jsx +5 -5
  39. package/src/@daf/pages/Events/columns.js +226 -0
  40. package/src/@daf/pages/{dashboards/AllInformation/Events → Events}/create.jsx +2 -2
  41. package/src/@daf/pages/{dashboards/AllInformation/Events → Events}/index.jsx +5 -9
  42. package/src/@daf/pages/{dashboards/Operations/ProductionSites → Locations/MineSite}/columns.js +4 -4
  43. package/src/@daf/pages/{dashboards/Operations/ProductionSites → Locations/MineSite}/create.jsx +2 -2
  44. package/src/@daf/pages/{dashboards/Operations/ProductionSites → Locations/MineSite}/index.jsx +5 -5
  45. package/src/@daf/pages/{dashboards/AllInformation/Locations → Locations}/columns.js +5 -5
  46. package/src/@daf/pages/{dashboards/AllInformation/Locations → Locations}/create.jsx +2 -2
  47. package/src/@daf/pages/{dashboards/AllInformation/Locations → Locations}/index.jsx +5 -5
  48. package/src/@daf/pages/{dashboards/Operations → Stakeholders}/Operators/columns.js +5 -5
  49. package/src/@daf/pages/{dashboards/Operations → Stakeholders}/Operators/create.jsx +2 -2
  50. package/src/@daf/pages/{dashboards/Operations → Stakeholders}/Operators/index.jsx +5 -5
  51. package/src/@daf/pages/{dashboards/Operations → Stakeholders}/Workers/columns.js +6 -6
  52. package/src/@daf/pages/{dashboards/Operations → Stakeholders}/Workers/create.jsx +2 -2
  53. package/src/@daf/pages/{dashboards/Operations → Stakeholders}/Workers/index.jsx +5 -5
  54. package/src/@daf/pages/{dashboards/AllInformation/Documents → Stakeholders}/columns.js +5 -5
  55. package/src/@daf/pages/{dashboards/AllInformation/Stakeholders → Stakeholders}/create.jsx +2 -2
  56. package/src/@daf/pages/{dashboards/AllInformation/Stakeholders → Stakeholders}/index.jsx +5 -5
  57. package/src/@daf/pages/dashboards/SupplyChain/components/ChartsContainer/components/Identification/index.js +0 -2
  58. package/src/@daf/pages/dashboards/UserDashboard/components/KeyIndicators/config.js +2 -2
  59. package/src/@daf/pages/dashboards/UserDashboard/components/MineSites/index.jsx +1 -5
  60. package/src/@daf/pages/dashboards/UserDashboard/config.js +2 -2
  61. package/src/@daf/pages/pages/TablePageWithTabs/index.jsx +2 -2
  62. package/src/@daf/services/AuthenticationService.js +0 -1
  63. package/src/@daf/services/LinkedSubjects.js +1 -2
  64. package/src/pages.js +9 -9
  65. package/build/favicon.ico +0 -0
  66. package/build/logo192.png +0 -0
  67. package/build/logo512.png +0 -0
  68. package/build/manifest.json +0 -25
  69. package/build/robots.txt +0 -3
  70. package/src/@daf/pages/dashboards/AllInformation/Events/columns.js +0 -151
  71. package/src/@daf/pages/dashboards/AllInformation/Stakeholders/columns.js +0 -132
  72. /package/src/@daf/pages/{dashboards/AllInformation/Documents → Documents}/config.js +0 -0
  73. /package/src/@daf/pages/{dashboards/DueDilligence → Events}/Activities/config.js +0 -0
  74. /package/src/@daf/pages/{dashboards/DueDilligence → Events}/Incidents/config.js +0 -0
  75. /package/src/@daf/pages/{dashboards/AllInformation/Events → Events}/config.js +0 -0
  76. /package/src/@daf/pages/{dashboards/Operations/ProductionSites → Locations/MineSite}/config.js +0 -0
  77. /package/src/@daf/pages/{dashboards/AllInformation/Locations → Locations}/config.js +0 -0
  78. /package/src/@daf/pages/{dashboards/Operations → Stakeholders}/Operators/config.js +0 -0
  79. /package/src/@daf/pages/{dashboards/Operations → Stakeholders}/Workers/config.js +0 -0
  80. /package/src/@daf/pages/{dashboards/AllInformation/Stakeholders → Stakeholders}/config.js +0 -0
@@ -33,7 +33,7 @@ const TablePageWithTabs = ({
33
33
  }) => {
34
34
  const params = new URLSearchParams(location?.search);
35
35
  const [activeTab, setActiveTab] = useState(params.get("tab") || defaultActiveTab);
36
- const [openCreateModal, setOpenCreateModal] = useState(false);
36
+ const [openCreateModal, setOpenCreateModal] = useState(params.has("create"));
37
37
 
38
38
  const getActiveTabRef = useRef(getActiveTab);
39
39
  useEffect(() => {
@@ -103,7 +103,7 @@ const TablePageWithTabs = ({
103
103
  />
104
104
  {openCreateModal && (
105
105
  <Drawer
106
- destroyOnClose
106
+ destroyOnHidden
107
107
  title={
108
108
  <DrawerHeader
109
109
  title={t(drawerTitle)}
@@ -219,7 +219,6 @@ class AuthenticationService extends BaseService {
219
219
  language,
220
220
  ...params
221
221
  }) {
222
- console.log({language})
223
222
  return this.apiPost({
224
223
  url: '/query/form-options',
225
224
  isDaf: true,
@@ -4,7 +4,6 @@ import { filterCreateData } from "../../helpers/Forms.js";
4
4
  import { removeKeysFromObject } from "../utils/object.js";
5
5
 
6
6
  export const getNamespace = (namespace) => {
7
- console.log({namespace})
8
7
  let _namespace = namespace;
9
8
  switch (namespace) {
10
9
  case "locations":
@@ -117,7 +116,7 @@ class LinkedSubjectsService extends BaseService {
117
116
  url: `/forms/options`,
118
117
  isApp: true,
119
118
  params: {
120
- id: "categoryOptions,locationCategories,countries,category,subCategory,optionPositionSupplyChain",
119
+ id: "categoryOptions,eventsType,locationCategories,countries,category,subCategory,optionPositionSupplyChain",
121
120
  },
122
121
  });
123
122
  }
package/src/pages.js CHANGED
@@ -1,16 +1,16 @@
1
1
  // Dashboards
2
2
  export { default as SupplyChainDashboard } from './@daf/pages/dashboards/SupplyChain/index.jsx';
3
3
  export { default as UserDashboard } from './@daf/pages/dashboards/UserDashboard/index.jsx';
4
- export { default as OperatorsTable } from './@daf/pages/dashboards/Operations/Operators/index.jsx';
5
- export { default as LocationsTable } from './@daf/pages/dashboards/AllInformation/Locations/index.jsx';
6
- export { default as StakeholdersTable } from './@daf/pages/dashboards/AllInformation/Stakeholders/index.jsx';
7
- export { default as EventsTable } from './@daf/pages/dashboards/AllInformation/Events/index.jsx';
8
- export { default as DocumentsTable } from './@daf/pages/dashboards/AllInformation/Documents/index.jsx';
9
- export { default as WorkersTable } from './@daf/pages/dashboards/Operations/Workers/index.jsx';
10
- export { default as ActivitiesTable } from './@daf/pages/dashboards/DueDilligence/Activities/index.jsx';
4
+ export { default as OperatorsTable } from './@daf/pages/Stakeholders/Operators/index.jsx';
5
+ export { default as LocationsTable } from './@daf/pages/Locations/index.jsx';
6
+ export { default as StakeholdersTable } from './@daf/pages/Stakeholders/index.jsx';
7
+ export { default as EventsTable } from './@daf/pages/Events/index.jsx';
8
+ export { default as DocumentsTable } from './@daf/pages/Documents/index.jsx';
9
+ export { default as WorkersTable } from './@daf/pages/Stakeholders/Workers/index.jsx';
10
+ export { default as ActivitiesTable } from './@daf/pages/Events/Activities/index.jsx';
11
11
 
12
- export { default as IncidentsTable } from './@daf/pages/dashboards/DueDilligence/Incidents/index.jsx';
13
- export { default as ProductionSitesTable } from './@daf/pages/dashboards/Operations/ProductionSites/index.jsx';
12
+ export { default as IncidentsTable } from './@daf/pages/Events/Incidents/index.jsx';
13
+ export { default as ProductionSitesTable } from './@daf/pages/Locations/MineSite/index.jsx';
14
14
 
15
15
  // Pages
16
16
  export { default as TablePageWithTabs } from './@daf/pages/pages/TablePageWithTabs/index.jsx';
package/build/favicon.ico DELETED
Binary file
package/build/logo192.png DELETED
Binary file
package/build/logo512.png DELETED
Binary file
@@ -1,25 +0,0 @@
1
- {
2
- "short_name": "React App",
3
- "name": "Create React App Sample",
4
- "icons": [
5
- {
6
- "src": "favicon.ico",
7
- "sizes": "64x64 32x32 24x24 16x16",
8
- "type": "image/x-icon"
9
- },
10
- {
11
- "src": "logo192.png",
12
- "type": "image/png",
13
- "sizes": "192x192"
14
- },
15
- {
16
- "src": "logo512.png",
17
- "type": "image/png",
18
- "sizes": "512x512"
19
- }
20
- ],
21
- "start_url": ".",
22
- "display": "standalone",
23
- "theme_color": "#000000",
24
- "background_color": "#ffffff"
25
- }
package/build/robots.txt DELETED
@@ -1,3 +0,0 @@
1
- # https://www.robotstxt.org/robotstxt.html
2
- User-agent: *
3
- Disallow:
@@ -1,151 +0,0 @@
1
- import React from 'react';
2
- import { Tooltip } from 'antd';
3
- import { findOptions } from '../../../../../helpers/StringHelper.js';
4
- import { renderDateFormatted } from '../../../../../helpers/Forms.js';
5
- import CustomIcon from '../../../../core/components/Icon/CustomIcon.jsx';
6
- import AvatarGroup from '../../../../core/components/AvatarGroup/index.jsx';
7
- import sourceAvatarConfig from '../../../../../helpers/sourceAvatarConfig.js';
8
-
9
- const getLinkValue = (value, linkingObject) => {
10
- if(linkingObject && linkingObject?.[value]) {
11
- return linkingObject?.[value]?.name;
12
- }
13
- return null;
14
- }
15
-
16
- export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink, theme, subject, data, applications}) => [
17
- {
18
- dataIndex: 'datastakeId',
19
- title: t('ID'),
20
- ellipsis: true,
21
- show: true,
22
- render: (v, all) => {
23
- if (all.empty) {
24
- return <div className="daf-default-cell" />
25
- }
26
-
27
- return <Tooltip title={v}>{v}</Tooltip>;
28
- },
29
- },
30
- {
31
- dataIndex: 'name',
32
- title: t('Name'),
33
- ellipsis: true,
34
- show: true,
35
- render: (v, all) => {
36
- if (all.empty) {
37
- return <div className="daf-default-cell" />
38
- }
39
-
40
- return <Tooltip title={v}>{v}</Tooltip>;
41
- },
42
- },
43
- {
44
- dataIndex: 'type',
45
- title: t('Type'),
46
- ellipsis: true,
47
- show: true,
48
- render: (v, all) => {
49
- if (all.empty) {
50
- return <div className="daf-default-cell" />
51
- }
52
-
53
- const type = findOptions(v, data?.options?.locationCategories);
54
-
55
- return type ? <Tooltip title={type}>{type}</Tooltip> : '-';
56
- },
57
- },
58
- {
59
- dataIndex: 'keyStakeholder',
60
- title: t('Key Stakeholder'),
61
- ellipsis: true,
62
- show: true,
63
- render: (v, all) => {
64
- if (all.empty) {
65
- return <div className="daf-default-cell" />
66
- }
67
-
68
- const country = findOptions(v, options?.countries);
69
-
70
- return country ? <Tooltip title={country}>{country}</Tooltip> : '-';
71
- },
72
- },
73
- {
74
- dataIndex: 'scope',
75
- title: t('Scope'),
76
- ellipsis: true,
77
- show: true,
78
- render: (v, all) => {
79
- if (all.empty) {
80
- return <div className="daf-default-cell" />
81
- }
82
-
83
- const scope = getLinkValue(v, all?.linking?.SCL);
84
-
85
- return scope ? <Tooltip title={scope}>{scope}</Tooltip> : '-';
86
- },
87
- },
88
- {
89
- title: t("Start Date"),
90
- dataIndex: "startDate",
91
- key: "startDate",
92
- width: 125,
93
- render: (date, all) => {
94
- if (all.empty) {
95
- return <div className="daf-default-cell" />;
96
- }
97
-
98
- const _date = date ? renderDateFormatted(date, "DD MMM YYYY", user?.language || 'en') : "-";
99
- return <Tooltip title={_date}>{_date}</Tooltip>;
100
- },
101
- ellipsis: true,
102
- },
103
- {
104
- title: t("End Date"),
105
- dataIndex: "endDate",
106
- key: "endDate",
107
- width: 125,
108
- render: (date, all) => {
109
- if (all.empty) {
110
- return <div className="daf-default-cell" />;
111
- }
112
-
113
- const _date = date ? renderDateFormatted(date, "DD MMM YYYY", user?.language || 'en') : "-";
114
- return <Tooltip title={_date}>{_date}</Tooltip>;
115
- },
116
- ellipsis: true,
117
- },
118
- {
119
- title: t("Sources"),
120
- dataIndex: "sources",
121
- key: "sources",
122
- show: activeTab !== "own",
123
- render: (val, all) => {
124
- if (all.empty) {
125
- return <div className="daf-default-cell" />;
126
- }
127
-
128
- const sources = sourceAvatarConfig(val, user, applications);
129
-
130
- return <AvatarGroup items={sources}></AvatarGroup>;
131
- },
132
- },
133
- {
134
- id: 'actions',
135
- title: "",
136
- width: 60,
137
- render: (_, all) => {
138
- if (all.empty) {
139
- return <div className="daf-default-cell" />;
140
- }
141
-
142
- const link = `/app/view/${subject}/${all.datastakeId}`;
143
-
144
- return <div style={{ display: "flex", justifyContent: "center" }}>
145
- <a href={getRedirectLink(link)}>
146
- <CustomIcon name="Link" size={15} color={theme.baseGray70} />
147
- </a>
148
- </div>;
149
- }
150
- }
151
- ].filter((column) => column.show !== false);
@@ -1,132 +0,0 @@
1
- import React from 'react';
2
- import { Tooltip } from 'antd';
3
- import { findOptions } from '../../../../../helpers/StringHelper.js';
4
- import { renderDateFormatted } from '../../../../../helpers/Forms.js';
5
- import CustomIcon from '../../../../core/components/Icon/CustomIcon.jsx';
6
- import AvatarGroup from '../../../../core/components/AvatarGroup/index.jsx';
7
- import sourceAvatarConfig from '../../../../../helpers/sourceAvatarConfig.js';
8
-
9
- export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink, theme, subject, applications}) => [
10
- {
11
- dataIndex: 'datastakeId',
12
- title: t('ID'),
13
- ellipsis: true,
14
- show: true,
15
- render: (v, all) => {
16
- if (all.empty) {
17
- return <div className="daf-default-cell" />
18
- }
19
-
20
- return <Tooltip title={v}>{v}</Tooltip>;
21
- },
22
- },
23
- {
24
- dataIndex: 'name',
25
- title: t('Name'),
26
- ellipsis: true,
27
- show: true,
28
- render: (v, all) => {
29
- if (all.empty) {
30
- return <div className="daf-default-cell" />
31
- }
32
-
33
- return <Tooltip title={v}>{v}</Tooltip>;
34
- },
35
- },
36
- {
37
- dataIndex: 'category',
38
- title: t('Category'),
39
- ellipsis: true,
40
- show: true,
41
- render: (v, all) => {
42
- if (all.empty) {
43
- return <div className="daf-default-cell" />
44
- }
45
-
46
- const category = findOptions(v, options?.categoriesOptions);
47
-
48
- return category ? <Tooltip title={category}>{category}</Tooltip> : '-';
49
- },
50
- },
51
- {
52
- dataIndex: 'subCategory',
53
- title: t('Sub Category'),
54
- ellipsis: true,
55
- show: true,
56
- render: (v, all) => {
57
- if (all.empty) {
58
- return <div className="daf-default-cell" />
59
- }
60
-
61
- const subCategory = findOptions(v, options?.subCategoriesOptions);
62
-
63
- return subCategory ? <Tooltip title={subCategory}>{subCategory}</Tooltip> : '-';
64
- },
65
- },
66
- {
67
- dataIndex: 'country',
68
- title: t('Country'),
69
- ellipsis: true,
70
- show: true,
71
- render: (v, all) => {
72
- if (all.empty) {
73
- return <div className="daf-default-cell" />
74
- }
75
-
76
- const country = findOptions(v, options?.countries);
77
-
78
- return country ? <Tooltip title={country}>{country}</Tooltip> : '-';
79
- },
80
- },
81
- {
82
- title: t("Last Update"),
83
- dataIndex: "updatedAt",
84
- key: "updatedAt",
85
- width: 125,
86
- render: (date, all) => {
87
- if (all.empty) {
88
- return <div className="daf-default-cell" />;
89
- }
90
-
91
- const _date = date ? renderDateFormatted(date, "DD MMM YYYY", user?.language || 'en') : "-";
92
- return <Tooltip title={_date}>{_date}</Tooltip>;
93
- },
94
- ellipsis: true,
95
- },
96
- {
97
- title: t("Sources"),
98
- dataIndex: "sources",
99
- key: "sources",
100
- show: activeTab !== "own",
101
- render: (val, all) => {
102
- if (all.empty) {
103
- return <div className="daf-default-cell" />;
104
- }
105
- if (!val || val?.length === 0) {
106
- return "--";
107
- }
108
-
109
- const sources = sourceAvatarConfig(val, user, applications);
110
-
111
- return <AvatarGroup items={sources}></AvatarGroup>;
112
- },
113
- },
114
- {
115
- id: 'actions',
116
- title: "",
117
- width: 60,
118
- render: (_, all) => {
119
- if (all.empty) {
120
- return <div className="daf-default-cell" />;
121
- }
122
-
123
- const link = `/app/view/${subject}/${all.datastakeId}`;
124
-
125
- return <div style={{ display: "flex", justifyContent: "center" }}>
126
- <a href={getRedirectLink(link)}>
127
- <CustomIcon name="Link" size={15} color={theme.baseGray70} />
128
- </a>
129
- </div>;
130
- }
131
- }
132
- ].filter((column) => column.show !== false);