datastake-daf 0.6.743 → 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 +2630 -1243
  6. package/dist/services/index.js +3 -9
  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 +7 -6
  28. package/src/@daf/pages/{dashboards/AllInformation/Documents → Documents}/index.jsx +20 -27
  29. package/src/@daf/pages/Events/Activities/columns.js +222 -0
  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/Events/Incidents/create.jsx +104 -0
  34. package/src/@daf/pages/Events/Incidents/index.jsx +157 -0
  35. package/src/@daf/pages/Events/Incidents2/columns.js +176 -0
  36. package/src/@daf/pages/Events/Incidents2/config.js +170 -0
  37. package/src/@daf/pages/Events/Incidents2/create.jsx +104 -0
  38. package/src/@daf/pages/Events/Incidents2/index.jsx +156 -0
  39. package/src/@daf/pages/Events/columns.js +226 -0
  40. package/src/@daf/pages/Events/config.js +183 -0
  41. package/src/@daf/pages/{dashboards/AllInformation/Events → Events}/create.jsx +4 -4
  42. package/src/@daf/pages/{dashboards/AllInformation/Events → Events}/index.jsx +13 -9
  43. package/src/@daf/pages/{dashboards/AllInformation/Events → Locations/MineSite}/columns.js +52 -53
  44. package/src/@daf/pages/Locations/MineSite/config.js +165 -0
  45. package/src/@daf/pages/Locations/MineSite/create.jsx +104 -0
  46. package/src/@daf/pages/Locations/MineSite/index.jsx +155 -0
  47. package/src/@daf/pages/{dashboards/AllInformation/Locations → Locations}/columns.js +5 -5
  48. package/src/@daf/pages/{dashboards/AllInformation/Locations → Locations}/create.jsx +3 -3
  49. package/src/@daf/pages/{dashboards/AllInformation/Locations → Locations}/index.jsx +13 -5
  50. package/src/@daf/pages/{dashboards/Operations → Stakeholders}/Operators/columns.js +5 -5
  51. package/src/@daf/pages/{dashboards/Operations → Stakeholders}/Operators/create.jsx +2 -2
  52. package/src/@daf/pages/{dashboards/Operations → Stakeholders}/Operators/index.jsx +5 -5
  53. package/src/@daf/pages/{dashboards/Operations → Stakeholders}/Workers/columns.js +6 -6
  54. package/src/@daf/pages/Stakeholders/Workers/config.js +166 -0
  55. package/src/@daf/pages/{dashboards/Operations → Stakeholders}/Workers/create.jsx +2 -2
  56. package/src/@daf/pages/{dashboards/Operations → Stakeholders}/Workers/index.jsx +5 -5
  57. package/src/@daf/pages/{dashboards/AllInformation/Stakeholders → Stakeholders}/columns.js +5 -5
  58. package/src/@daf/pages/{dashboards/AllInformation/Stakeholders → Stakeholders}/create.jsx +3 -3
  59. package/src/@daf/pages/{dashboards/AllInformation/Stakeholders → Stakeholders}/index.jsx +14 -6
  60. package/src/@daf/pages/dashboards/SupplyChain/components/ChartsContainer/components/Identification/index.js +0 -2
  61. package/src/@daf/pages/dashboards/UserDashboard/components/KeyIndicators/config.js +2 -2
  62. package/src/@daf/pages/dashboards/UserDashboard/components/MineSites/index.jsx +1 -5
  63. package/src/@daf/pages/dashboards/UserDashboard/config.js +2 -2
  64. package/src/@daf/pages/pages/TablePageWithTabs/index.jsx +2 -2
  65. package/src/@daf/services/AuthenticationService.js +0 -1
  66. package/src/@daf/services/LinkedSubjects.js +3 -4
  67. package/src/pages.js +10 -7
  68. package/build/favicon.ico +0 -0
  69. package/build/logo192.png +0 -0
  70. package/build/logo512.png +0 -0
  71. package/build/manifest.json +0 -25
  72. package/build/robots.txt +0 -3
  73. package/src/@daf/pages/dashboards/AllInformation/Documents/columns.js +0 -107
  74. package/src/@daf/pages/dashboards/AllInformation/Stakeholders/config.js +0 -31
  75. /package/src/@daf/pages/{dashboards/AllInformation/Documents → Documents}/config.js +0 -0
  76. /package/src/@daf/pages/{dashboards/DueDilligence → Events}/Activities/config.js +0 -0
  77. /package/src/@daf/pages/{dashboards/Operations/Workers → Events/Incidents}/config.js +0 -0
  78. /package/src/@daf/pages/{dashboards/AllInformation/Events → Locations}/config.js +0 -0
  79. /package/src/@daf/pages/{dashboards/Operations → Stakeholders}/Operators/config.js +0 -0
  80. /package/src/@daf/pages/{dashboards/AllInformation/Locations → Stakeholders}/config.js +0 -0
@@ -0,0 +1,165 @@
1
+ export const checkboxConfig = {
2
+ name: 'Name',
3
+ datastakeId: 'ID'
4
+ }
5
+
6
+ export const getFiltersConfig = ({t}) => {
7
+ return {
8
+ country: {
9
+ type: 'select',
10
+ label: 'Country',
11
+ placeholder: (t) => `${t('Filter by')} ${t('Country').toLowerCase()}`,
12
+ style: { flex: 1 },
13
+ labelStyle: { flex: 1 },
14
+ getLabel: (option) => option.label,
15
+ getValue: (option) => option.value,
16
+ },
17
+ administrativeLevel1: {
18
+ type: 'ajaxSelect',
19
+ label: ({ t = (s) => s, options = {}, filters = {}, language = 'en' }) => {
20
+ const { administrativeLevel1 } = options;
21
+
22
+ if (administrativeLevel1) {
23
+ if (options.country) {
24
+ const _item = administrativeLevel1[filters.country];
25
+ if (_item) {
26
+ if (_item[language]) {
27
+ return _item[language]
28
+ }
29
+ }
30
+ }
31
+ }
32
+
33
+ return t('Province');
34
+ },
35
+ placeholder: (t) => `${t('Filter by')} ${t('Province').toLowerCase()}`,
36
+ filters: (data) => ({
37
+ country: data.country,
38
+ level: 'level_1',
39
+ }),
40
+ show: (data) => !data.country,
41
+ disabled: (data) => !data.country,
42
+ mapper: { label: "name", value: "id" },
43
+ method: 'getOptions',
44
+ entity: 'AdministrativeLevel',
45
+ style: { flex: 1 },
46
+ labelStyle: { flex: 1 },
47
+ },
48
+ administrativeLevel2: {
49
+ type: 'ajaxSelect',
50
+ label: ({ t = (s) => s, options = {}, filters = {}, language = 'en' }) => {
51
+ const { administrativeLevel2 } = options;
52
+
53
+ if (administrativeLevel2) {
54
+ if (options.country) {
55
+ const _item = administrativeLevel2[filters.country];
56
+ if (_item) {
57
+ if (_item[language]) {
58
+ return _item[language]
59
+ }
60
+ }
61
+ }
62
+ }
63
+
64
+ return t('Province');
65
+ },
66
+ show: (data) => !(data.country && data.administrativeLevel1),
67
+ placeholder: (t) => `${t('Filter by')} ${t('Territory').toLowerCase()}`,
68
+ filters: (data) => ({
69
+ country: data.country,
70
+ level: 'level_2',
71
+ administrativeLevel1: data.administrativeLevel1,
72
+ }),
73
+ disabled: (data) => !(data.country && data.administrativeLevel1),
74
+ mapper: { label: "name", value: "id" },
75
+ method: 'getOptions',
76
+ entity: 'AdministrativeLevel',
77
+ style: { flex: 1 },
78
+ labelStyle: { flex: 1 },
79
+ },
80
+ product: {
81
+ type: 'select',
82
+ label: 'Product',
83
+ placeholder: (t) => `${t('Filter by')} ${t('Product').toLowerCase()}`,
84
+ style: { flex: 1 },
85
+ labelStyle: { flex: 1 },
86
+ getLabel: (option) => option.label,
87
+ getValue: (option) => option.value,
88
+ filterOptions: (val) => {
89
+ if (val) {
90
+ const { option, filters } = val
91
+ if (filters && option) {
92
+ const { filters: optionFilters } = option;
93
+ if (Array.isArray(optionFilters) && optionFilters.length) {
94
+ const { value, condition } = optionFilters[0];
95
+ if (condition === 'includes') {
96
+ return value.includes('corporation');
97
+ }
98
+ }
99
+ }
100
+ }
101
+ return true;
102
+ },
103
+ },
104
+ positionInTheMineralSupplyChain: {
105
+ type: 'select',
106
+ label: 'Position',
107
+ placeholder: (t) => `${t('Filter by')} ${t('Position').toLowerCase()}`,
108
+ style: { flex: 1 },
109
+ labelStyle: { flex: 1 },
110
+ getLabel: (option) => option.label,
111
+ getValue: (option) => option.value,
112
+ },
113
+ status: {
114
+ type: "select",
115
+ label: "Status",
116
+ placeholder: (t) => `${t("Filter by")} ${t("Status").toLowerCase()}`,
117
+ style: { flex: 1 },
118
+ labelStyle: { fley: 1 },
119
+ getLabel: (option) => option.label,
120
+ getValue: (option) => option.value,
121
+ },
122
+ }
123
+ }
124
+
125
+ export const filtersConfig = {
126
+ name: '',
127
+ datastakeId: '',
128
+ };
129
+
130
+ export const getFilterOptions = (options, t) => {
131
+ const {
132
+ statusOptions = [],
133
+ categoryOptions = [],
134
+ countries = [],
135
+ product=[],
136
+ subCategory = [],
137
+ subCategoriesOptions,
138
+ stakeholderCategoryOptions,
139
+ stakeholderSubCategoriesOptions,
140
+ administrativeLevel1,
141
+ administrativeLevel2,
142
+ } = options || {};
143
+ console.log({options})
144
+
145
+ const _default = {
146
+ category: stakeholderCategoryOptions || categoryOptions,
147
+ country: countries,
148
+ product: product,
149
+ administrativeLevel1,
150
+ administrativeLevel2,
151
+ subCategory: subCategoriesOptions,
152
+ status: [
153
+ {
154
+ value: "submitted",
155
+ label: "Submitted",
156
+ },
157
+ {
158
+ value: "private",
159
+ label: "Private",
160
+ },
161
+ ],
162
+ }
163
+
164
+ return _default;
165
+ }
@@ -0,0 +1,104 @@
1
+ import React, { useEffect} from 'react'
2
+ import { message } from 'antd';
3
+ import { MessageTypes } from '../../../../helpers/messages.js';
4
+ import DynamicForm from '../../../core/components/DynamicForm/index.jsx';
5
+
6
+ const ProductionSitesCreate = ({
7
+ namespace = "PRODUCTION SITES",
8
+ view = ['scoping', 'new'],
9
+ edit = false,
10
+ formData = {},
11
+ loading = false,
12
+ onSubmitted = () => {},
13
+ onCancel = () => {},
14
+ getData = () => {},
15
+ saveData = () => {},
16
+ form: formConfig = {},
17
+ formValue = {},
18
+ defaultData = {},
19
+ user = {},
20
+ APP,
21
+ query,
22
+ goTo = () => {},
23
+ t = () => {},
24
+ ajaxForms = {},
25
+ changeAjaxForms = () => {},
26
+ ajaxOptions = {},
27
+ changeAjaxOptions = () => {},
28
+ getAppHeader = () => {},
29
+ getApiBaseUrl = () => {},
30
+ }) => {
31
+ let {
32
+ form = {},
33
+ data = defaultData || {},
34
+ } = !edit ? (formData[`${APP}-${view}`] || {}) : {
35
+ form: formConfig,
36
+ data: formValue
37
+ };
38
+
39
+ useEffect(() => {
40
+ if (Object.keys(form).length === 0 && !formData[`${APP}-${view}`]) {
41
+ if (!edit) {
42
+ getData({ namespace, module: APP, view, scope: 'global' });
43
+ } else {
44
+ form = formConfig;
45
+ data = formValue;
46
+ }
47
+ }
48
+ }, [edit, user?.language]);
49
+
50
+ return (
51
+ <div className="daf-create-form">
52
+ <DynamicForm
53
+ form={form}
54
+ data={{...defaultData, ...data}}
55
+ showSaveAndNext={false}
56
+ module={APP}
57
+ onCancel={onCancel}
58
+ isCreate
59
+ t={t}
60
+ excludedKeys={["title"]}
61
+ user={user}
62
+ ajaxForms={ajaxForms}
63
+ ajaxOptions={ajaxOptions}
64
+ getAppHeader={getAppHeader}
65
+ getApiBaseUrl={getApiBaseUrl}
66
+ changeAjaxOptions={changeAjaxOptions}
67
+ app={APP}
68
+ query={query}
69
+ goTo={goTo}
70
+ changeAjaxForms={changeAjaxForms}
71
+ submit={(payload, setSelectedFormNext) => {
72
+ const payloadData = { ...payload, module: APP, namespace };
73
+
74
+ const newPayload = {
75
+ ...defaultData,
76
+ ...payloadData,
77
+ form: 'production-sites'
78
+ };
79
+
80
+ const callback = (type, m, data) => {
81
+ if (setSelectedFormNext) {
82
+ setSelectedFormNext();
83
+ }
84
+ if (type === MessageTypes.SUCCESS) {
85
+ if (onSubmitted) onSubmitted(type, m, data);
86
+ } else {
87
+ message.error(m);
88
+ }
89
+ };
90
+
91
+ saveData(
92
+ !data && !data.id ? newPayload : Object.assign(newPayload, { id: data.id }),
93
+ callback,
94
+ );
95
+ }}
96
+ isFormDisabled={() => {
97
+ return !data || !data.typeOfEvent;
98
+ }}
99
+ />
100
+ </div>
101
+ )
102
+ }
103
+
104
+ export default ProductionSitesCreate
@@ -0,0 +1,155 @@
1
+ import React, { useMemo, useState, useEffect, useCallback } from 'react'
2
+ import TablePageWithTabs from '../../pages/TablePageWithTabs/index.jsx'
3
+ import { getColumns } from './columns.js';
4
+ import { checkboxConfig, getFiltersConfig, filtersConfig, getFilterOptions } from './config.js';
5
+ import { useGetQueryParams } from '../../../hooks/useGetQueryParams.js';
6
+ import ProductionSitesCreate from './create.jsx';
7
+ import { displayMessage } from '../../../../helpers/messages.js';
8
+
9
+ const ProductionSitesTable = ({
10
+ t = () => {},
11
+ goTo = () => {},
12
+ user = {},
13
+ options = {},
14
+ getRedirectLink = () => {},
15
+ theme = {},
16
+ loading = false,
17
+ data = {},
18
+ isMobile,
19
+ APP,
20
+ location,
21
+ getData = () => {},
22
+ getApiBaseUrl = () => {},
23
+ getAppHeader = () => {},
24
+ getFormData = () => {},
25
+ saveFormData = () => {},
26
+ formLoading = false,
27
+ query = {},
28
+ ajaxForms = {},
29
+ changeAjaxForms = () => {},
30
+ ajaxOptions = {},
31
+ changeAjaxOptions = () => {},
32
+ formData = {},
33
+ formValue = {},
34
+ form = {},
35
+ extendingFilters = {},
36
+ createDefaultValues = {},
37
+ }) => {
38
+ const [selectOptions, setSelectOptions] = useState();
39
+ const [activeTab, setActiveTab] = useState('own');
40
+
41
+ const columns = useMemo(() => getColumns({
42
+ t,
43
+ goTo,
44
+ user,
45
+ options,
46
+ activeTab,
47
+ getRedirectLink,
48
+ theme,
49
+ subject: 'production-sites',
50
+ data,
51
+ }), [t, goTo, user, options, activeTab, getRedirectLink, theme, data]);
52
+
53
+ const breadCrumbs = [];
54
+
55
+ const { paginationQuery, searchParams, otherParams, sortBy, sortDir } = useGetQueryParams({location});
56
+
57
+ const filters = useMemo(() => {
58
+ return {
59
+ ...otherParams,
60
+ ...extendingFilters
61
+ }
62
+ }, [otherParams, extendingFilters])
63
+
64
+ useEffect(() => {
65
+ getData({
66
+ pagination: paginationQuery,
67
+ ...(Object.keys(searchParams).length > 0 && { search: searchParams }),
68
+ ...otherParams,
69
+ tab: activeTab,
70
+ sortBy: {
71
+ [sortBy || "updatedAt"]: sortDir ? (sortDir === "ascend" ? 1 : -1) : -1,
72
+ },
73
+ ...extendingFilters
74
+ }, 'production-sites')
75
+ }, [location.search, activeTab, JSON.stringify(extendingFilters)]);
76
+
77
+ const selectFiltersConfig = useMemo(() => {
78
+ return getFiltersConfig({t});
79
+ }, [t]);
80
+
81
+ useEffect(() => {
82
+ setSelectOptions((prev) => ({
83
+ ...prev,
84
+ ...getFilterOptions(options, t),
85
+ }))
86
+ }, [options, t])
87
+
88
+ const handleActiveTabChange = useCallback((value) => {
89
+ setActiveTab(value);
90
+ }, []);
91
+
92
+ return (
93
+ <TablePageWithTabs
94
+ t={t}
95
+ title={t("production-sites")}
96
+ breadCrumbs={breadCrumbs}
97
+ location={location}
98
+ loading={loading}
99
+ goTo={goTo}
100
+ defaultActiveTab={"own"}
101
+ columns={columns}
102
+ data={data}
103
+ checkboxConfig={checkboxConfig}
104
+ APP={APP}
105
+ getApiBaseUrl={getApiBaseUrl}
106
+ selectOptions={selectOptions}
107
+ selectFiltersConfig={selectFiltersConfig}
108
+ getRedirectLink={getRedirectLink}
109
+ filtersConfig={filtersConfig}
110
+ isMobile={isMobile}
111
+ view="production-sites"
112
+ getActiveTab={handleActiveTabChange}
113
+ onDownload={() => {
114
+ console.log("download");
115
+ }}
116
+ drawerTitle={t("Create Production Site")}
117
+ >
118
+ {({onDrawerClose}) => (
119
+ <ProductionSitesCreate
120
+ defaultData={createDefaultValues}
121
+ t={t}
122
+ goTo={goTo}
123
+ user={user}
124
+ APP={APP}
125
+ getApiBaseUrl={getApiBaseUrl}
126
+ getAppHeader={getAppHeader}
127
+ getData={getFormData}
128
+ saveData={saveFormData}
129
+ loading={formLoading}
130
+ onSubmitted={(type, m, data) => {
131
+ if (data.datastakeId) {
132
+ displayMessage(
133
+ type,
134
+ t("affirmations::subject-created-successfully") || m,
135
+ );
136
+ // goTo(`/app/edit/stakeholders/${data.datastakeId}`);
137
+ goTo(`/app/edit/production-sites/${data.datastakeId}`)
138
+ }
139
+ }}
140
+ onCancel={onDrawerClose}
141
+ query={query}
142
+ ajaxForms={ajaxForms}
143
+ changeAjaxForms={changeAjaxForms}
144
+ ajaxOptions={ajaxOptions}
145
+ changeAjaxOptions={changeAjaxOptions}
146
+ formData={formData}
147
+ formValue={formValue}
148
+ form={form}
149
+ />
150
+ )}
151
+ </TablePageWithTabs>
152
+ )
153
+ }
154
+
155
+ export default ProductionSitesTable
@@ -1,10 +1,10 @@
1
1
  import React from 'react';
2
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';
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
8
 
9
9
  const getLinkValue = (value, linkingObject) => {
10
10
  if(linkingObject && linkingObject?.[value]) {
@@ -1,7 +1,7 @@
1
1
  import React, { useEffect} from 'react'
2
2
  import { message } from 'antd';
3
- import { MessageTypes } from '../../../../../helpers/messages.js';
4
- import DynamicForm from '../../../../core/components/DynamicForm/index.jsx';
3
+ import { MessageTypes } from '../../../helpers/messages.js';
4
+ import DynamicForm from '../../core/components/DynamicForm/index.jsx';
5
5
 
6
6
  const StakeholdersCreate = ({
7
7
  namespace = 'locations',
@@ -39,7 +39,7 @@ const StakeholdersCreate = ({
39
39
  useEffect(() => {
40
40
  if (Object.keys(form).length === 0 && !formData[`${APP}-${view}`]) {
41
41
  if (!edit) {
42
- getData({ namespace, module: APP, view, scope: 'global' });
42
+ getData({ namespace, module: APP, view, scope: 'create' });
43
43
  } else {
44
44
  form = formConfig;
45
45
  data = formValue;
@@ -1,10 +1,10 @@
1
1
  import React, { useMemo, useState, useEffect, useCallback } from 'react'
2
- import TablePageWithTabs from '../../../pages/TablePageWithTabs/index.jsx'
2
+ import TablePageWithTabs from '../pages/TablePageWithTabs/index.jsx'
3
3
  import { getColumns } from './columns.js';
4
4
  import { checkboxConfig, getFiltersConfig, filtersConfig, getFilterOptions } from './config.js';
5
- import { useGetQueryParams } from '../../../../hooks/useGetQueryParams.js';
5
+ import { useGetQueryParams } from '../../hooks/useGetQueryParams.js';
6
6
  import StakeholdersCreate from './create.jsx';
7
- import { displayMessage } from '../../../../../helpers/messages.js';
7
+ import { displayMessage } from '../../../helpers/messages.js';
8
8
 
9
9
  const LocationsTable = ({
10
10
  t = () => {},
@@ -33,9 +33,10 @@ const LocationsTable = ({
33
33
  formValue = {},
34
34
  form = {},
35
35
  applications = [],
36
+ subjectClear = () => {},
36
37
  }) => {
37
38
  const [selectOptions, setSelectOptions] = useState();
38
- const [activeTab, setActiveTab] = useState();
39
+ const [activeTab, setActiveTab] = useState("own");
39
40
 
40
41
  const columns = useMemo(() => getColumns({
41
42
  t,
@@ -80,6 +81,13 @@ const LocationsTable = ({
80
81
  setActiveTab(value);
81
82
  }, []);
82
83
 
84
+ useEffect(
85
+ () => () => {
86
+ subjectClear();
87
+ },
88
+ [],
89
+ );
90
+
83
91
  return (
84
92
  <TablePageWithTabs
85
93
  t={t}
@@ -88,7 +96,7 @@ const LocationsTable = ({
88
96
  location={location}
89
97
  loading={loading}
90
98
  goTo={goTo}
91
- defaultActiveTab={"all"}
99
+ defaultActiveTab={"own"}
92
100
  columns={columns}
93
101
  data={data}
94
102
  checkboxConfig={checkboxConfig}
@@ -1,10 +1,10 @@
1
1
  import React from 'react';
2
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';
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
8
 
9
9
  const getLinkValue = (value, linkingObject) => {
10
10
  if(linkingObject && linkingObject?.[value]) {
@@ -1,7 +1,7 @@
1
1
  import React, { useEffect} from 'react'
2
2
  import { message } from 'antd';
3
- import { MessageTypes } from '../../../../../helpers/messages.js';
4
- import DynamicForm from '../../../../core/components/DynamicForm/index.jsx';
3
+ import { MessageTypes } from '../../../../helpers/messages.js';
4
+ import DynamicForm from '../../../core/components/DynamicForm/index.jsx';
5
5
 
6
6
  const StakeholdersCreate = ({
7
7
  namespace = "OPERATOR",
@@ -1,10 +1,10 @@
1
1
  import React, { useMemo, useState, useEffect, useCallback } from 'react'
2
- import TablePageWithTabs from '../../../pages/TablePageWithTabs/index.jsx'
2
+ import TablePageWithTabs from '../../pages/TablePageWithTabs/index.jsx'
3
3
  import { getColumns } from './columns.js';
4
4
  import { checkboxConfig, getFiltersConfig, filtersConfig, getFilterOptions } from './config.js';
5
- import { useGetQueryParams } from '../../../../hooks/useGetQueryParams.js';
5
+ import { useGetQueryParams } from '../../../hooks/useGetQueryParams.js';
6
6
  import StakeholdersCreate from './create.jsx';
7
- import { displayMessage } from '../../../../../helpers/messages.js';
7
+ import { displayMessage } from '../../../../helpers/messages.js';
8
8
 
9
9
  const OperatorsTable = ({
10
10
  t = () => {},
@@ -37,7 +37,7 @@ const OperatorsTable = ({
37
37
  applications = [],
38
38
  }) => {
39
39
  const [selectOptions, setSelectOptions] = useState();
40
- const [activeTab, setActiveTab] = useState();
40
+ const [activeTab, setActiveTab] = useState('own');
41
41
 
42
42
  const columns = useMemo(() => getColumns({
43
43
  t,
@@ -99,7 +99,7 @@ const OperatorsTable = ({
99
99
  location={location}
100
100
  loading={loading}
101
101
  goTo={goTo}
102
- defaultActiveTab={"all"}
102
+ defaultActiveTab={"own"}
103
103
  columns={columns}
104
104
  data={data}
105
105
  checkboxConfig={checkboxConfig}
@@ -1,10 +1,10 @@
1
1
  import React from 'react';
2
2
  import { Tooltip, Tag } 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';
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
8
 
9
9
  const getLinkValue = (value, linkingObject) => {
10
10
  if(linkingObject && linkingObject?.[value]) {
@@ -137,7 +137,7 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
137
137
 
138
138
  const sources = sourceAvatarConfig(val, user, applications);
139
139
 
140
- return <AvatarGroup items={val}></AvatarGroup>;
140
+ return <AvatarGroup items={sources}></AvatarGroup>;
141
141
  },
142
142
  },
143
143
  {