datastake-daf 0.6.748 → 0.6.750
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.
- package/dist/components/index.js +3904 -2706
- package/dist/layouts/index.js +7 -10
- package/dist/pages/index.js +1305 -692
- package/package.json +1 -1
- package/src/@daf/core/components/Screens/Settings/Edit/components/Form/index.js +115 -0
- package/src/@daf/core/components/Screens/Settings/Edit/components/Form/style.js +35 -0
- package/src/@daf/core/components/Screens/Settings/Edit/components/Inputs/ImageUpload.js +67 -0
- package/src/@daf/core/components/Screens/Settings/Edit/components/Inputs/Phone.js +24 -0
- package/src/@daf/core/components/Screens/Settings/Edit/components/Inputs/ResetPassword.js +122 -0
- package/src/@daf/core/components/Screens/Settings/Edit/components/Inputs/Select.js +26 -0
- package/src/@daf/core/components/Screens/Settings/Edit/components/Inputs/Switch.js +56 -0
- package/src/@daf/core/components/Screens/Settings/Edit/components/Inputs/Text.js +19 -0
- package/src/@daf/core/components/Screens/Settings/Edit/components/Inputs/TransferRights.js +30 -0
- package/src/@daf/core/components/Screens/Settings/Edit/components/helper.js +13 -0
- package/src/@daf/core/components/Screens/Settings/Edit/components/style.js +56 -0
- package/src/@daf/core/components/Screens/Settings/Edit/index.js +63 -0
- package/src/@daf/core/components/Screens/Settings/View/components/Content/helper.js +142 -0
- package/src/@daf/core/components/Screens/Settings/View/components/Content/index.js +61 -0
- package/src/@daf/core/components/Screens/Settings/View/components/Content/style.js +338 -0
- package/src/@daf/core/components/Screens/Settings/View/index.js +46 -0
- package/src/@daf/core/components/Screens/Settings/components/Header/index.js +64 -0
- package/src/@daf/core/components/Screens/Settings/components/Menu/index.js +36 -0
- package/src/@daf/core/components/Screens/Settings/config.js +30 -0
- package/src/@daf/core/components/Screens/Settings/index.js +164 -0
- package/src/@daf/core/components/Sidenav/Menu.jsx +9 -8
- package/src/@daf/pages/Documents/columns.js +25 -8
- package/src/@daf/pages/Documents/config.js +7 -10
- package/src/@daf/pages/Events/Activities/columns.js +19 -9
- package/src/@daf/pages/Events/Activities/config.js +23 -13
- package/src/@daf/pages/Events/Incidents/columns.js +19 -9
- package/src/@daf/pages/Events/Incidents/config.js +23 -13
- package/src/@daf/pages/Events/columns.js +33 -8
- package/src/@daf/pages/Events/config.js +14 -22
- package/src/@daf/pages/Locations/MineSite/columns.js +53 -18
- package/src/@daf/pages/Locations/columns.js +54 -32
- package/src/@daf/pages/Locations/config.js +12 -2
- package/src/@daf/pages/Stakeholders/Operators/columns.js +57 -22
- package/src/@daf/pages/Stakeholders/columns.js +45 -23
- package/src/@daf/pages/Stakeholders/config.js +12 -2
- package/src/@daf/pages/Stakeholders/index.jsx +1 -0
- package/src/@daf/services/BaseService.js +15 -0
- package/src/index.js +9 -0
|
@@ -4,7 +4,7 @@ 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
|
-
|
|
7
|
+
import MoreMenu from '../../../core/components/Table/MoreMenu/index.jsx';
|
|
8
8
|
const getLinkValue = (value, linkingObject) => {
|
|
9
9
|
if(linkingObject && linkingObject?.[value]) {
|
|
10
10
|
return linkingObject?.[value]?.name;
|
|
@@ -86,7 +86,7 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
|
|
|
86
86
|
return <AvatarGroup items={val}></AvatarGroup>;
|
|
87
87
|
},
|
|
88
88
|
},
|
|
89
|
-
|
|
89
|
+
{
|
|
90
90
|
dataIndex: 'operator',
|
|
91
91
|
title: t('Operator'),
|
|
92
92
|
ellipsis: true,
|
|
@@ -129,22 +129,57 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
|
|
|
129
129
|
return status ? <Tooltip title={status}>{status}</Tooltip> : '-';
|
|
130
130
|
},
|
|
131
131
|
},
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
132
|
+
|
|
133
|
+
{
|
|
134
|
+
title: t("Sources"),
|
|
135
|
+
dataIndex: 'source',
|
|
136
|
+
ellipsis: true,
|
|
137
|
+
show: activeTab !== "own",
|
|
138
|
+
render: (v, all) => {
|
|
139
|
+
if (all.empty) {
|
|
140
|
+
return <div className="daf-default-cell" />
|
|
141
|
+
}
|
|
142
|
+
const source = findOptions(v, data?.options?.sourceOptions);
|
|
143
|
+
return source ? <Tooltip title={source}>{source}</Tooltip> : '-';
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
id: 'actions',
|
|
148
|
+
title: "",
|
|
149
|
+
width: 60,
|
|
150
|
+
render: (_, all) => {
|
|
151
|
+
if (all.empty) {
|
|
152
|
+
return <div className="daf-default-cell" />;
|
|
153
|
+
}
|
|
154
|
+
const onClick = () => {
|
|
155
|
+
const link = `/app/view/${subject}/${all.datastakeId}`;
|
|
156
|
+
if (activeTab === "shared") {
|
|
157
|
+
link += `?sourceId=${all?.authorId?.id}`;
|
|
158
|
+
}
|
|
159
|
+
goTo(getRedirectLink(link));
|
|
160
|
+
};
|
|
161
|
+
const moreMenuItems = [
|
|
162
|
+
{
|
|
163
|
+
label: t("Details"),
|
|
164
|
+
value: "details",
|
|
165
|
+
onClick: onClick,
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
label: t("Summary"),
|
|
169
|
+
value: "Summary",
|
|
170
|
+
onClick: () => {
|
|
171
|
+
let link = `/app/mine-summary/${all.datastakeId}`
|
|
172
|
+
if (activeTab === "shared") {
|
|
173
|
+
link += `?sourceId=${all?.authorId?.id}`;
|
|
174
|
+
}
|
|
175
|
+
goTo(getRedirectLink(link));
|
|
176
|
+
},
|
|
177
|
+
// disabled: true,
|
|
178
|
+
},
|
|
179
|
+
];
|
|
180
|
+
return <div >
|
|
181
|
+
<MoreMenu items={moreMenuItems} />
|
|
182
|
+
</div>;
|
|
139
183
|
}
|
|
140
|
-
|
|
141
|
-
const link = `/app/view/${subject}/${all.datastakeId}`;
|
|
142
|
-
|
|
143
|
-
return <div style={{ display: "flex", justifyContent: "center" }}>
|
|
144
|
-
<a href={getRedirectLink(link)}>
|
|
145
|
-
<CustomIcon name="Link" size={15} color={theme.baseGray70} />
|
|
146
|
-
</a>
|
|
147
|
-
</div>;
|
|
148
184
|
}
|
|
149
|
-
}
|
|
150
185
|
].filter((column) => column.show !== false);
|
|
@@ -5,7 +5,7 @@ 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
7
|
import sourceAvatarConfig from '../../../helpers/sourceAvatarConfig.js';
|
|
8
|
-
|
|
8
|
+
import MoreMenu from '../../core/components/Table/MoreMenu/index.jsx';
|
|
9
9
|
const getLinkValue = (value, linkingObject) => {
|
|
10
10
|
if(linkingObject && linkingObject?.[value]) {
|
|
11
11
|
return linkingObject?.[value]?.name;
|
|
@@ -71,8 +71,8 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
|
|
|
71
71
|
},
|
|
72
72
|
},
|
|
73
73
|
{
|
|
74
|
-
dataIndex: '
|
|
75
|
-
title: t('
|
|
74
|
+
dataIndex: 'province',
|
|
75
|
+
title: t('Province'),
|
|
76
76
|
ellipsis: true,
|
|
77
77
|
show: true,
|
|
78
78
|
render: (v, all) => {
|
|
@@ -80,14 +80,14 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
|
|
|
80
80
|
return <div className="daf-default-cell" />
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
const
|
|
83
|
+
const province = getLinkValue(v, all?.linking?.SCL);
|
|
84
84
|
|
|
85
|
-
return
|
|
85
|
+
return province ? <Tooltip title={province}>{province}</Tooltip> : '-';
|
|
86
86
|
},
|
|
87
87
|
},
|
|
88
88
|
{
|
|
89
|
-
dataIndex: '
|
|
90
|
-
title: t('
|
|
89
|
+
dataIndex: 'territory',
|
|
90
|
+
title: t('Territory'),
|
|
91
91
|
ellipsis: true,
|
|
92
92
|
show: true,
|
|
93
93
|
render: (v, all) => {
|
|
@@ -95,11 +95,26 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
|
|
|
95
95
|
return <div className="daf-default-cell" />
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
const
|
|
98
|
+
const territory = getLinkValue(v, all?.linking?.SCL);
|
|
99
99
|
|
|
100
|
-
return
|
|
100
|
+
return territory ? <Tooltip title={territory}>{territory}</Tooltip> : '-';
|
|
101
101
|
},
|
|
102
102
|
},
|
|
103
|
+
{
|
|
104
|
+
title: t("Sources"),
|
|
105
|
+
dataIndex: "sources",
|
|
106
|
+
key: "sources",
|
|
107
|
+
show: activeTab !== "own",
|
|
108
|
+
render: (val, all) => {
|
|
109
|
+
if (all.empty) {
|
|
110
|
+
return <div className="daf-default-cell" />;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const sources = sourceAvatarConfig(val, user, applications);
|
|
114
|
+
|
|
115
|
+
return <AvatarGroup items={sources}></AvatarGroup>;
|
|
116
|
+
},
|
|
117
|
+
},
|
|
103
118
|
{
|
|
104
119
|
title: t("Last Update"),
|
|
105
120
|
dataIndex: "updatedAt",
|
|
@@ -115,21 +130,7 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
|
|
|
115
130
|
},
|
|
116
131
|
ellipsis: true,
|
|
117
132
|
},
|
|
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
|
+
|
|
133
134
|
{
|
|
134
135
|
id: 'actions',
|
|
135
136
|
title: "",
|
|
@@ -138,14 +139,35 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
|
|
|
138
139
|
if (all.empty) {
|
|
139
140
|
return <div className="daf-default-cell" />;
|
|
140
141
|
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
142
|
+
const onClick = () => {
|
|
143
|
+
const link = `/app/view/${subject}/${all.datastakeId}`;
|
|
144
|
+
if (activeTab === "shared") {
|
|
145
|
+
link += `?sourceId=${all?.authorId?.id}`;
|
|
146
|
+
}
|
|
147
|
+
goTo(getRedirectLink(link));
|
|
148
|
+
};
|
|
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>;
|
|
149
171
|
}
|
|
150
172
|
}
|
|
151
173
|
].filter((column) => column.show !== false);
|
|
@@ -13,7 +13,16 @@ export const getFiltersConfig = ({t}) => {
|
|
|
13
13
|
getLabel: (option) => option.label,
|
|
14
14
|
getValue: (option) => option.value,
|
|
15
15
|
},
|
|
16
|
-
|
|
16
|
+
category:{
|
|
17
|
+
type: 'select',
|
|
18
|
+
label: 'Category',
|
|
19
|
+
placeholder: (t) => `${t('Filter by')} ${t('Category').toLowerCase()}`,
|
|
20
|
+
style: { flex: 1 },
|
|
21
|
+
labelStyle: { flex: 1 },
|
|
22
|
+
getLabel: (option) => option.label,
|
|
23
|
+
getValue: (option) => option.value,
|
|
24
|
+
}
|
|
25
|
+
}
|
|
17
26
|
}
|
|
18
27
|
|
|
19
28
|
export const filtersConfig = {
|
|
@@ -22,9 +31,10 @@ export const filtersConfig = {
|
|
|
22
31
|
};
|
|
23
32
|
|
|
24
33
|
export const getFilterOptions = (options, t) => {
|
|
25
|
-
const { countries } = options || {};
|
|
34
|
+
const { countries = [], category = [] } = options || {};
|
|
26
35
|
const _default = {
|
|
27
36
|
country: countries,
|
|
37
|
+
category: category,
|
|
28
38
|
}
|
|
29
39
|
|
|
30
40
|
return _default;
|
|
@@ -5,7 +5,7 @@ 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
7
|
import sourceAvatarConfig from '../../../../helpers/sourceAvatarConfig.js';
|
|
8
|
-
|
|
8
|
+
import MoreMenu from '../../../core/components/Table/MoreMenu/index.jsx';
|
|
9
9
|
const getLinkValue = (value, linkingObject) => {
|
|
10
10
|
if(linkingObject && linkingObject?.[value]) {
|
|
11
11
|
return linkingObject?.[value]?.name;
|
|
@@ -99,7 +99,22 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
|
|
|
99
99
|
|
|
100
100
|
return district ? <Tooltip title={district}>{district}</Tooltip> : '-';
|
|
101
101
|
},
|
|
102
|
-
},
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
title: t("Last Update"),
|
|
105
|
+
dataIndex: "updatedAt",
|
|
106
|
+
key: "updatedAt",
|
|
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
|
+
},
|
|
103
118
|
{
|
|
104
119
|
title: t("Sources"),
|
|
105
120
|
dataIndex: "sources",
|
|
@@ -116,20 +131,19 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
|
|
|
116
131
|
},
|
|
117
132
|
},
|
|
118
133
|
{
|
|
119
|
-
title: t("
|
|
120
|
-
dataIndex:
|
|
121
|
-
key: "updatedAt",
|
|
122
|
-
width: 125,
|
|
123
|
-
render: (date, all) => {
|
|
124
|
-
if (all.empty) {
|
|
125
|
-
return <div className="daf-default-cell" />;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
const _date = date ? renderDateFormatted(date, "DD MMM YYYY", user?.language || 'en') : "-";
|
|
129
|
-
return <Tooltip title={_date}>{_date}</Tooltip>;
|
|
130
|
-
},
|
|
134
|
+
title: t("Status"),
|
|
135
|
+
dataIndex: 'status',
|
|
131
136
|
ellipsis: true,
|
|
137
|
+
show: activeTab == "own",
|
|
138
|
+
render: (v, all) => {
|
|
139
|
+
if (all.empty) {
|
|
140
|
+
return <div className="daf-default-cell" />
|
|
141
|
+
}
|
|
142
|
+
const status = findOptions(v, data?.options?.statusOptions);
|
|
143
|
+
return status ? <Tooltip title={status}>{status}</Tooltip> : '-';
|
|
144
|
+
},
|
|
132
145
|
},
|
|
146
|
+
|
|
133
147
|
{
|
|
134
148
|
id: 'actions',
|
|
135
149
|
title: "",
|
|
@@ -138,14 +152,35 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
|
|
|
138
152
|
if (all.empty) {
|
|
139
153
|
return <div className="daf-default-cell" />;
|
|
140
154
|
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
155
|
+
const onClick = () => {
|
|
156
|
+
const link = `/app/view/${subject}/${all.datastakeId}`;
|
|
157
|
+
if (activeTab === "shared") {
|
|
158
|
+
link += `?sourceId=${all?.authorId?.id}`;
|
|
159
|
+
}
|
|
160
|
+
goTo(getRedirectLink(link));
|
|
161
|
+
};
|
|
162
|
+
const moreMenuItems = [
|
|
163
|
+
{
|
|
164
|
+
label: t("Details"),
|
|
165
|
+
value: "details",
|
|
166
|
+
onClick: onClick,
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
label: t("Summary"),
|
|
170
|
+
value: "Summary",
|
|
171
|
+
onClick: () => {
|
|
172
|
+
let link = `/app/operator-summary/${all.datastakeId}`
|
|
173
|
+
if (activeTab === "shared") {
|
|
174
|
+
link += `?sourceId=${all?.authorId?.id}`;
|
|
175
|
+
}
|
|
176
|
+
goTo(getRedirectLink(link));
|
|
177
|
+
},
|
|
178
|
+
// disabled: true,
|
|
179
|
+
},
|
|
180
|
+
];
|
|
181
|
+
return <div >
|
|
182
|
+
<MoreMenu items={moreMenuItems} />
|
|
183
|
+
</div>;
|
|
149
184
|
}
|
|
150
185
|
}
|
|
151
186
|
].filter((column) => column.show !== false);
|
|
@@ -5,7 +5,7 @@ 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
7
|
import sourceAvatarConfig from '../../../helpers/sourceAvatarConfig.js';
|
|
8
|
-
|
|
8
|
+
import MoreMenu from '../../core/components/Table/MoreMenu/index.jsx';
|
|
9
9
|
export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink, theme, subject, applications}) => [
|
|
10
10
|
{
|
|
11
11
|
dataIndex: 'datastakeId',
|
|
@@ -78,21 +78,7 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
|
|
|
78
78
|
return country ? <Tooltip title={country}>{country}</Tooltip> : '-';
|
|
79
79
|
},
|
|
80
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
81
|
|
|
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
82
|
{
|
|
97
83
|
title: t("Sources"),
|
|
98
84
|
dataIndex: "sources",
|
|
@@ -111,6 +97,21 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
|
|
|
111
97
|
return <AvatarGroup items={sources}></AvatarGroup>;
|
|
112
98
|
},
|
|
113
99
|
},
|
|
100
|
+
{
|
|
101
|
+
title: t("Last Update"),
|
|
102
|
+
dataIndex: "updatedAt",
|
|
103
|
+
key: "updatedAt",
|
|
104
|
+
width: 125,
|
|
105
|
+
render: (date, all) => {
|
|
106
|
+
if (all.empty) {
|
|
107
|
+
return <div className="daf-default-cell" />;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const _date = date ? renderDateFormatted(date, "DD MMM YYYY", user?.language || 'en') : "-";
|
|
111
|
+
return <Tooltip title={_date}>{_date}</Tooltip>;
|
|
112
|
+
},
|
|
113
|
+
ellipsis: true,
|
|
114
|
+
},
|
|
114
115
|
{
|
|
115
116
|
id: 'actions',
|
|
116
117
|
title: "",
|
|
@@ -119,14 +120,35 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
|
|
|
119
120
|
if (all.empty) {
|
|
120
121
|
return <div className="daf-default-cell" />;
|
|
121
122
|
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
123
|
+
const onClick = () => {
|
|
124
|
+
const link = `/app/view/${subject}/${all.datastakeId}`;
|
|
125
|
+
if (activeTab === "shared") {
|
|
126
|
+
link += `?sourceId=${all?.authorId?.id}`;
|
|
127
|
+
}
|
|
128
|
+
goTo(getRedirectLink(link));
|
|
129
|
+
};
|
|
130
|
+
const moreMenuItems = [
|
|
131
|
+
{
|
|
132
|
+
label: t("Details"),
|
|
133
|
+
value: "details",
|
|
134
|
+
onClick: onClick,
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
label: t("Summary"),
|
|
138
|
+
value: "Summary",
|
|
139
|
+
onClick: () => {
|
|
140
|
+
let link = `/app/summary/${subject}/${all.datastakeId}`
|
|
141
|
+
if (activeTab === "shared") {
|
|
142
|
+
link += `?sourceId=${all?.authorId?.id}`;
|
|
143
|
+
}
|
|
144
|
+
goTo(getRedirectLink(link));
|
|
145
|
+
},
|
|
146
|
+
// disabled: true,
|
|
147
|
+
},
|
|
148
|
+
];
|
|
149
|
+
return <div >
|
|
150
|
+
<MoreMenu items={moreMenuItems} />
|
|
151
|
+
</div>;
|
|
130
152
|
}
|
|
131
153
|
}
|
|
132
154
|
].filter((column) => column.show !== false);
|
|
@@ -13,7 +13,16 @@ export const getFiltersConfig = ({t}) => {
|
|
|
13
13
|
getLabel: (option) => option.label,
|
|
14
14
|
getValue: (option) => option.value,
|
|
15
15
|
},
|
|
16
|
-
|
|
16
|
+
category:{
|
|
17
|
+
type: 'select',
|
|
18
|
+
label: 'Category',
|
|
19
|
+
placeholder: (t) => `${t('Filter by')} ${t('Category').toLowerCase()}`,
|
|
20
|
+
style: { flex: 1 },
|
|
21
|
+
labelStyle: { flex: 1 },
|
|
22
|
+
getLabel: (option) => option.label,
|
|
23
|
+
getValue: (option) => option.value,
|
|
24
|
+
}
|
|
25
|
+
}
|
|
17
26
|
}
|
|
18
27
|
|
|
19
28
|
export const filtersConfig = {
|
|
@@ -22,9 +31,10 @@ export const filtersConfig = {
|
|
|
22
31
|
};
|
|
23
32
|
|
|
24
33
|
export const getFilterOptions = (options, t) => {
|
|
25
|
-
const { countries } = options || {};
|
|
34
|
+
const { countries = [], category = [] } = options || {};
|
|
26
35
|
const _default = {
|
|
27
36
|
country: countries,
|
|
37
|
+
category: category,
|
|
28
38
|
}
|
|
29
39
|
|
|
30
40
|
return _default;
|
|
@@ -5,6 +5,7 @@ import { checkboxConfig, getFiltersConfig, filtersConfig, getFilterOptions } fro
|
|
|
5
5
|
import { useGetQueryParams } from '../../hooks/useGetQueryParams.js';
|
|
6
6
|
import StakeholdersCreate from './create.jsx';
|
|
7
7
|
import { displayMessage } from '../../../helpers/messages.js';
|
|
8
|
+
import DAFHeader from '../../core/components/Header/index.jsx';
|
|
8
9
|
|
|
9
10
|
const StakeholdersTable = ({
|
|
10
11
|
t = () => {},
|
|
@@ -6,6 +6,21 @@ import { StorageManager } from '../../helpers/StorageManager.js';
|
|
|
6
6
|
import { getServicesConfig } from './helpers/config.js';
|
|
7
7
|
import { ErrorService } from './ErrorService.js';
|
|
8
8
|
|
|
9
|
+
// Helper functions for external use
|
|
10
|
+
export const getMainApiUrl = () => {
|
|
11
|
+
const config = getServicesConfig();
|
|
12
|
+
return config.mainApiUrl;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const getAppHeader = () => {
|
|
16
|
+
const config = getServicesConfig();
|
|
17
|
+
return {
|
|
18
|
+
Language: StorageManager.get('datastakeLng') || 'en',
|
|
19
|
+
'ngrok-skip-browser-warning': true,
|
|
20
|
+
Application: config.application,
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
|
|
9
24
|
export class BaseService extends BaseHTTPService {
|
|
10
25
|
constructor() {
|
|
11
26
|
const config = getServicesConfig();
|
package/src/index.js
CHANGED
|
@@ -190,3 +190,12 @@ export { InformationChannelProvider } from "./@daf/core/components/Screens/Infor
|
|
|
190
190
|
// UI
|
|
191
191
|
export { default as SDGIcons } from "./@daf/core/components/UI/SDGIcon/index.jsx";
|
|
192
192
|
export { default as CountryFlag } from "./@daf/core/components/UI/CountryFlag/index.jsx"
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
//Settings
|
|
196
|
+
export { default as Settings } from "./@daf/core/components/Screens/Settings/index.js";
|
|
197
|
+
export { default as SettingsView } from "./@daf/core/components/Screens/Settings/View/index.js";
|
|
198
|
+
export { default as SettingsEdit } from "./@daf/core/components/Screens/Settings/Edit/index.js";
|
|
199
|
+
export { default as SettingsHeader } from "./@daf/core/components/Screens/Settings/components/Header/index.js";
|
|
200
|
+
export { default as SettingsMenu } from "./@daf/core/components/Screens/Settings/components/Menu/index.js";
|
|
201
|
+
export { INPUT_TYPES, ACTIVE_FORM_KEY, PLACEHOLDER, getDefaultActiveForm } from "./@daf/core/components/Screens/Settings/config.js";
|