datastake-daf 0.6.793 → 0.6.794
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 +4321 -3157
- package/dist/services/index.js +69 -3
- package/dist/utils/index.js +14 -17
- package/package.json +1 -1
- package/src/@daf/core/components/Screens/Admin/AdminDashboard/components/UserStatistics/TopContributors/hook.js +0 -1
- package/src/@daf/core/components/Screens/Admin/AdminDashboard/components/UserStatistics/TopContributors/index.jsx +1 -1
- package/src/@daf/core/components/Screens/Admin/AdminDashboard/components/UserStatistics/UserGrowth/hook.js +1 -1
- package/src/@daf/core/components/Screens/Admin/AdminDashboard/components/UserStatistics/UserGrowth/index.jsx +1 -1
- package/src/@daf/core/components/Screens/Admin/AdminModals/AddUser/index.jsx +0 -1
- package/src/@daf/core/components/Screens/Admin/AdminModals/CombineLocation/columns.js +79 -0
- package/src/@daf/core/components/Screens/Admin/AdminModals/CombineLocation/helper.js +2 -2
- package/src/@daf/core/components/Screens/Admin/AdminModals/CombineLocation/index.jsx +18 -8
- package/src/@daf/core/components/Screens/Admin/AdminModals/CombineSubjects/index.jsx +6 -6
- package/src/@daf/core/components/Screens/Admin/AdminModals/NewAccount/index.jsx +1 -1
- package/src/@daf/core/components/Screens/Admin/AdminScreens/Dashboard.jsx +2 -2
- package/src/@daf/core/components/Screens/Admin/AdminScreens/Location.jsx +6 -7
- package/src/@daf/core/components/Screens/Admin/AdminScreens/Subjects.jsx +2 -2
- package/src/@daf/core/components/Screens/Admin/AdminScreens/SubjectsView.jsx +272 -0
- package/src/@daf/core/components/Screens/Admin/AdminScreens/index.js +1 -0
- package/src/@daf/core/components/Screens/Admin/AdminTables/AccountTable/index.jsx +1 -0
- package/src/@daf/core/components/Screens/Admin/AdminTables/LocationTable/column.js +223 -0
- package/src/@daf/core/components/Screens/Admin/AdminTables/LocationTable/helper.js +65 -0
- package/src/@daf/core/components/Screens/Admin/AdminTables/LocationTable/index.jsx +73 -45
- package/src/@daf/core/components/Screens/Admin/AdminTables/SubjectsTable/columns.js +37 -37
- package/src/@daf/core/components/Screens/Admin/AdminTables/SubjectsTable/index.jsx +48 -22
- package/src/@daf/core/components/Screens/Admin/AdminTables/UserTable/index.jsx +1 -0
- package/src/@daf/core/components/Screens/Admin/AdminViews/EditLocation/index.jsx +81 -0
- package/src/@daf/core/components/Screens/Admin/AdminViews/EditStakeholder/index.jsx +76 -0
- package/src/@daf/core/components/Screens/Admin/AdminViews/ViewLocation/config.js +38 -0
- package/src/@daf/core/components/Screens/Admin/AdminViews/ViewLocation/helpers.js +13 -0
- package/src/@daf/core/components/Screens/Admin/AdminViews/ViewLocation/index.jsx +77 -0
- package/src/@daf/core/components/Screens/Admin/AdminViews/ViewStakeholder/config.js +38 -0
- package/src/@daf/core/components/Screens/Admin/AdminViews/ViewStakeholder/helpers.js +0 -0
- package/src/@daf/core/components/Screens/Admin/AdminViews/ViewStakeholder/index.jsx +75 -0
- package/src/@daf/core/components/Screens/Admin/AdminViews/components/Edit/index.jsx +3 -1
- package/src/@daf/core/components/Screens/Admin/AdminViews/components/SidebarMenu/index.jsx +5 -3
- package/src/@daf/core/components/Screens/Admin/AdminViews/components/Users/helper.js +13 -8
- package/src/@daf/core/components/Screens/Admin/AdminViews/components/Users/index.jsx +2 -2
- package/src/@daf/core/components/Screens/Admin/AdminViews/index.jsx +3 -4
- package/src/@daf/core/components/Screens/Admin/adminRoutes.js +81 -2
- package/src/@daf/pages/SelfAssesment/components/AssociatedInformationTable/columns.js +180 -0
- package/src/@daf/pages/SelfAssesment/components/AssociatedInformationTable/config.js +0 -0
- package/src/@daf/pages/SelfAssesment/components/AssociatedInformationTable/index.jsx +27 -0
- package/src/@daf/pages/SelfAssesment/components/OrgInformationTable/columns.js +157 -0
- package/src/@daf/pages/SelfAssesment/components/OrgInformationTable/config.js +31 -0
- package/src/@daf/pages/SelfAssesment/components/OrgInformationTable/index.js +77 -0
- package/src/@daf/pages/SelfAssesment/components/ProductionSiteTable/columns.js +117 -0
- package/src/@daf/pages/SelfAssesment/components/ProductionSiteTable/index.jsx +54 -0
- package/src/@daf/pages/SelfAssesment/index.jsx +0 -0
- package/src/@daf/services/AdminService.js +79 -7
- package/src/@daf/services/DashboardService.js +2 -1
- package/src/@daf/utils/filters.js +15 -13
- package/src/constants/locales/en/translation.js +7 -0
- package/src/constants/locales/fr/translation.js +1 -1
- package/src/constants/locales/sp/translation.js +1 -1
- package/build/favicon.ico +0 -0
- package/build/logo192.png +0 -0
- package/build/logo512.png +0 -0
- package/build/manifest.json +0 -25
- package/build/robots.txt +0 -3
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { Tooltip } from "antd";
|
|
2
|
+
import CustomIcon from "../../../../core/components/Icon/CustomIcon.jsx";
|
|
3
|
+
// import {findOptions} from "../../../../helpers/StringHelper.js";
|
|
4
|
+
import ProgressBar from "../../../../core/components/ProgressBar/index.jsx";
|
|
5
|
+
import ProgressBarSideIcon from "../../../../core/components/ProgressBar/components/SideIcon/index.jsx";
|
|
6
|
+
import { Link } from "react-router-dom";
|
|
7
|
+
import { renderDateFormatted } from "../../../../../helpers/Forms.js";
|
|
8
|
+
|
|
9
|
+
export const getColumns = ({
|
|
10
|
+
t,
|
|
11
|
+
goTo = () => {},
|
|
12
|
+
show = "show",
|
|
13
|
+
getRedirectLink = () => {},
|
|
14
|
+
token,
|
|
15
|
+
selectedSubjects,
|
|
16
|
+
setSelectedSubjects,
|
|
17
|
+
selectOptions,
|
|
18
|
+
entity,
|
|
19
|
+
}) => {
|
|
20
|
+
const cols = [
|
|
21
|
+
{
|
|
22
|
+
dataIndex: "formName",
|
|
23
|
+
title: t("form"),
|
|
24
|
+
ellipsis: true,
|
|
25
|
+
show: true,
|
|
26
|
+
render: (v, all) => {
|
|
27
|
+
if (all.empty) {
|
|
28
|
+
return <div className="daf-default-cell" />;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const title = all?.published
|
|
32
|
+
? t("general-information")
|
|
33
|
+
: t("registration");
|
|
34
|
+
|
|
35
|
+
return <Tooltip title={title}>{title}</Tooltip>;
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
dataIndex: "completion",
|
|
40
|
+
title: t("completion"),
|
|
41
|
+
ellipsis: true,
|
|
42
|
+
show: !isMonitoring,
|
|
43
|
+
render: (v, all) => {
|
|
44
|
+
if (all.empty) {
|
|
45
|
+
return <div className="daf-default-cell" />;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const submittedStages = ["evaluation", "planning", "improvement"];
|
|
49
|
+
|
|
50
|
+
const step1Stage = data?.stepStages?.["step-1"];
|
|
51
|
+
const step2Stage = data?.stepStages?.["step-2"];
|
|
52
|
+
const isSubmitted =
|
|
53
|
+
data?.published &&
|
|
54
|
+
submittedStages.includes(step1Stage) &&
|
|
55
|
+
submittedStages.includes(step2Stage);
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<div style={{ display: "flex", alignItems: "center", gap: "5px" }}>
|
|
59
|
+
<ProgressBar
|
|
60
|
+
tooltipTitle={isSubmitted && t("Submitted")}
|
|
61
|
+
style={{ width: "100%" }}
|
|
62
|
+
percentage={v || 0}
|
|
63
|
+
isSubmitted={isSubmitted}
|
|
64
|
+
></ProgressBar>
|
|
65
|
+
{isSubmitted ? (
|
|
66
|
+
<ProgressBarSideIcon size={16} iconSize={10} />
|
|
67
|
+
) : (
|
|
68
|
+
<span>{v || 0}%</span>
|
|
69
|
+
)}
|
|
70
|
+
</div>
|
|
71
|
+
);
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
dataIndex: "monitoring",
|
|
76
|
+
title: t("Monitoring"),
|
|
77
|
+
ellipsis: true,
|
|
78
|
+
show: isMonitoring,
|
|
79
|
+
render: (v, all) => {
|
|
80
|
+
if (all.empty) {
|
|
81
|
+
return <div className="daf-default-cell" />;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return <Tooltip title={v || 0}>{v || 0}</Tooltip>;
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
dataIndex: "lastUpdate",
|
|
89
|
+
title: t("Last Update"),
|
|
90
|
+
ellipsis: true,
|
|
91
|
+
show: true,
|
|
92
|
+
render: (_v, all) => {
|
|
93
|
+
if (all.empty) {
|
|
94
|
+
return <div className="daf-default-cell" />;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
const v = _v
|
|
98
|
+
? renderDateFormatted(_v, "DD MMM YYYY", user?.language || "en")
|
|
99
|
+
: "-";
|
|
100
|
+
|
|
101
|
+
return <Tooltip title={v}>{v}</Tooltip>;
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
dataIndex: "action",
|
|
106
|
+
title: "",
|
|
107
|
+
width: 60,
|
|
108
|
+
show: true,
|
|
109
|
+
render: (_, all) => {
|
|
110
|
+
if (all.empty) {
|
|
111
|
+
return <div className="daf-default-cell" />;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
let link = `/app/mines/${all.datastakeId}/${all?.key?.toLowerCase()}`;
|
|
115
|
+
|
|
116
|
+
if (all?.key.includes("monitoring")) {
|
|
117
|
+
return (
|
|
118
|
+
<Link to={getRedirectLink(link)}>
|
|
119
|
+
<CustomIcon name="Link" width={18} height={18} />
|
|
120
|
+
</Link>
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
if (all?.key.includes("identification")) {
|
|
125
|
+
link = `/app/view/location/${all.datastakeId}`;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
const stage = data?.stage;
|
|
129
|
+
const key = all?.key;
|
|
130
|
+
let isDisabled = false;
|
|
131
|
+
|
|
132
|
+
if (
|
|
133
|
+
(stage === "evaluation" && (key === "improvement" || key === "planning")) ||
|
|
134
|
+
(stage === "planning" && key === "improvement") ||
|
|
135
|
+
(!["evaluation", "planning", "improvement"].includes(stage) &&
|
|
136
|
+
key !== "identification")
|
|
137
|
+
) {
|
|
138
|
+
isDisabled = true;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
return <div style={{ display: "flex", justifyContent: "center" }}>
|
|
142
|
+
{isDisabled ? (
|
|
143
|
+
<span style={{ cursor: "not-allowed", opacity: 0.5 }}>
|
|
144
|
+
<CustomIcon name="Link" width={18} height={18} />
|
|
145
|
+
</span>
|
|
146
|
+
) : (
|
|
147
|
+
<Link to={getRedirectLink(link)}>
|
|
148
|
+
<CustomIcon name="Link" width={18} height={18} />
|
|
149
|
+
</Link>
|
|
150
|
+
)}
|
|
151
|
+
</div>;
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
]
|
|
155
|
+
|
|
156
|
+
return cols.filter((c) => c[show]);
|
|
157
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export const getFiltersConfig = ({t}) => {
|
|
2
|
+
return {
|
|
3
|
+
timeframe: {
|
|
4
|
+
type: "timeframe",
|
|
5
|
+
label: "Timeframe",
|
|
6
|
+
style: { flex: 1 },
|
|
7
|
+
},
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const getFilterOptions = (options, t) => {
|
|
12
|
+
const { timeframe = [] } = options || {};
|
|
13
|
+
const _default = {
|
|
14
|
+
timeframe: timeframe,
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return _default;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const formConfig = {
|
|
21
|
+
namespace: 'organisation',
|
|
22
|
+
view: 'information',
|
|
23
|
+
scope: 'create',
|
|
24
|
+
formType: 'organisation',
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export const viewConfig = {
|
|
28
|
+
title: "Organisations",
|
|
29
|
+
createTitle: "Create Organisation",
|
|
30
|
+
}
|
|
31
|
+
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import TablePage from "../../../TablePage/index.jsx";
|
|
3
|
+
|
|
4
|
+
const OrganisationInformationTable = ({
|
|
5
|
+
t = () => {},
|
|
6
|
+
goTo = () => {},
|
|
7
|
+
user = {},
|
|
8
|
+
options = {},
|
|
9
|
+
getRedirectLink = () => {},
|
|
10
|
+
theme = {},
|
|
11
|
+
loading = false,
|
|
12
|
+
data = {},
|
|
13
|
+
isMobile,
|
|
14
|
+
APP,
|
|
15
|
+
location,
|
|
16
|
+
getData = () => {},
|
|
17
|
+
getApiBaseUrl = () => {},
|
|
18
|
+
getAppHeader = () => {},
|
|
19
|
+
getFormData = () => {},
|
|
20
|
+
saveFormData = () => {},
|
|
21
|
+
formLoading = false,
|
|
22
|
+
query = {},
|
|
23
|
+
ajaxForms = {},
|
|
24
|
+
changeAjaxForms = () => {},
|
|
25
|
+
ajaxOptions = {},
|
|
26
|
+
changeAjaxOptions = () => {},
|
|
27
|
+
formData = {},
|
|
28
|
+
formValue = {},
|
|
29
|
+
form = {},
|
|
30
|
+
applications = [],
|
|
31
|
+
subjectClear = () => {},
|
|
32
|
+
breadcrumbs = [],
|
|
33
|
+
extendingFilters = {},
|
|
34
|
+
createDefaultValues = {},
|
|
35
|
+
}) => {
|
|
36
|
+
return (
|
|
37
|
+
<TablePage
|
|
38
|
+
t={t}
|
|
39
|
+
goTo={goTo}
|
|
40
|
+
user={user}
|
|
41
|
+
options={options}
|
|
42
|
+
getRedirectLink={getRedirectLink}
|
|
43
|
+
theme={theme}
|
|
44
|
+
loading={loading}
|
|
45
|
+
data={data}
|
|
46
|
+
isMobile={isMobile}
|
|
47
|
+
APP={APP}
|
|
48
|
+
location={location}
|
|
49
|
+
applications={applications}
|
|
50
|
+
|
|
51
|
+
subject="organisations"
|
|
52
|
+
getData={getData}
|
|
53
|
+
getApiBaseUrl={getApiBaseUrl}
|
|
54
|
+
getAppHeader={getAppHeader}
|
|
55
|
+
subjectClear={subjectClear}
|
|
56
|
+
extendingFilters={extendingFilters}
|
|
57
|
+
breadcrumbs={breadcrumbs}
|
|
58
|
+
|
|
59
|
+
formConfig={{
|
|
60
|
+
getFormData,
|
|
61
|
+
saveFormData,
|
|
62
|
+
formLoading,
|
|
63
|
+
query,
|
|
64
|
+
ajaxForms,
|
|
65
|
+
changeAjaxForms,
|
|
66
|
+
ajaxOptions,
|
|
67
|
+
changeAjaxOptions,
|
|
68
|
+
formData,
|
|
69
|
+
formValue,
|
|
70
|
+
form,
|
|
71
|
+
}}
|
|
72
|
+
defaultValues={createDefaultValues}
|
|
73
|
+
/>
|
|
74
|
+
);
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export default OrganisationInformationTable;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Tooltip, Tag } from 'antd';
|
|
3
|
+
import { findOptions } from '../../../../helpers/StringHelper.js';
|
|
4
|
+
import { renderDateFormatted } from '../../../../helpers/Forms.js';
|
|
5
|
+
import NavigationAction from '../../../core/components/Table/NavigationAction/index.jsx';
|
|
6
|
+
import AvatarGroup from '../../../core/components/AvatarGroup/index.jsx';
|
|
7
|
+
import sourceAvatarConfig from '../../../../helpers/sourceAvatarConfig.js';
|
|
8
|
+
import { renderStatusTag } from '../../../utils/tags.js';
|
|
9
|
+
|
|
10
|
+
export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink, theme, subject, data, applications}) => [
|
|
11
|
+
{
|
|
12
|
+
dataIndex: 'datastakeId',
|
|
13
|
+
title: t('ID'),
|
|
14
|
+
ellipsis: true,
|
|
15
|
+
show: true,
|
|
16
|
+
render: (v, all) => {
|
|
17
|
+
if (all.empty) {
|
|
18
|
+
return <div className="daf-default-cell" />
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return <Tooltip title={v}>{v}</Tooltip>;
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
dataIndex: 'name',
|
|
26
|
+
title: t('Name'),
|
|
27
|
+
ellipsis: true,
|
|
28
|
+
show: true,
|
|
29
|
+
render: (v, all) => {
|
|
30
|
+
if (all.empty) {
|
|
31
|
+
return <div className="daf-default-cell" />
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return <Tooltip title={v}>{v}</Tooltip>;
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
dataIndex: 'category',
|
|
39
|
+
title: t('Type'),
|
|
40
|
+
ellipsis: true,
|
|
41
|
+
show: true,
|
|
42
|
+
render: (v, all) => {
|
|
43
|
+
if (all.empty) {
|
|
44
|
+
return <div className="daf-default-cell" />
|
|
45
|
+
}
|
|
46
|
+
const category = findOptions(v, options?.locationCategories);
|
|
47
|
+
|
|
48
|
+
return <Tooltip title={category}>{category}</Tooltip>;
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
dataIndex: 'region',
|
|
53
|
+
title: t('Region'),
|
|
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 region = getLinkValue(all?.administrativeLevel1, all?.linking?.SCL);
|
|
62
|
+
|
|
63
|
+
return region ? <Tooltip title={region}>{region}</Tooltip> : '-';
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
dataIndex: 'district',
|
|
68
|
+
title: t('District'),
|
|
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 district = getLinkValue(all?.administrativeLevel2, all?.linking?.SCL);
|
|
77
|
+
|
|
78
|
+
return district ? <Tooltip title={district}>{district}</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
|
+
{
|
|
98
|
+
id: 'actions',
|
|
99
|
+
title: "",
|
|
100
|
+
width: 60,
|
|
101
|
+
render: (_, all) => {
|
|
102
|
+
if (all.empty) {
|
|
103
|
+
return <div className="daf-default-cell" />;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
const onClick = () => {
|
|
107
|
+
let link = `/app/view/${subject}/${all.datastakeId}`;
|
|
108
|
+
if (activeTab === "shared") {
|
|
109
|
+
link += `?sourceId=${all?.authorId?.id}`;
|
|
110
|
+
}
|
|
111
|
+
goTo(getRedirectLink(link));
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
return <NavigationAction onClick={onClick} theme={theme} />;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
].filter((column) => column.show !== false);
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import TablePage from '../../../TablePage/index.jsx';
|
|
3
|
+
import { getColumns } from './columns.js';
|
|
4
|
+
|
|
5
|
+
const ProductionSiteTable = ({
|
|
6
|
+
t = () => {},
|
|
7
|
+
goTo = () => {},
|
|
8
|
+
user = {},
|
|
9
|
+
options = {},
|
|
10
|
+
getRedirectLink = () => {},
|
|
11
|
+
theme = {},
|
|
12
|
+
loading = false,
|
|
13
|
+
data = {},
|
|
14
|
+
isMobile,
|
|
15
|
+
APP,
|
|
16
|
+
location,
|
|
17
|
+
getData = () => {},
|
|
18
|
+
getApiBaseUrl = () => {},
|
|
19
|
+
getAppHeader = () => {},
|
|
20
|
+
applications = [],
|
|
21
|
+
subjectClear = () => {},
|
|
22
|
+
breadcrumbs = [],
|
|
23
|
+
extendingFilters = {},
|
|
24
|
+
createDefaultValues = {},
|
|
25
|
+
}) => {
|
|
26
|
+
return (
|
|
27
|
+
<TablePage
|
|
28
|
+
t={t}
|
|
29
|
+
goTo={goTo}
|
|
30
|
+
user={user}
|
|
31
|
+
options={options}
|
|
32
|
+
getRedirectLink={getRedirectLink}
|
|
33
|
+
theme={theme}
|
|
34
|
+
loading={loading}
|
|
35
|
+
data={data}
|
|
36
|
+
isMobile={isMobile}
|
|
37
|
+
APP={APP}
|
|
38
|
+
location={location}
|
|
39
|
+
applications={applications}
|
|
40
|
+
subject="production-sites"
|
|
41
|
+
getData={getData}
|
|
42
|
+
getApiBaseUrl={getApiBaseUrl}
|
|
43
|
+
getAppHeader={getAppHeader}
|
|
44
|
+
subjectClear={subjectClear}
|
|
45
|
+
extendingFilters={extendingFilters}
|
|
46
|
+
breadcrumbs={breadcrumbs}
|
|
47
|
+
formConfig={formConfig}
|
|
48
|
+
defaultValues={createDefaultValues}
|
|
49
|
+
onDownload={() => console.log("download")}
|
|
50
|
+
/>
|
|
51
|
+
)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export default ProductionSiteTable
|
|
File without changes
|
|
@@ -69,18 +69,90 @@ class AdminService extends BaseService {
|
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
getSubjects({ subject, params }) {
|
|
72
|
-
|
|
73
|
-
url:
|
|
72
|
+
return this.apiGet({
|
|
73
|
+
url: `/management/subjects/${subject}`,
|
|
74
74
|
params,
|
|
75
|
-
|
|
75
|
+
});
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
mergeLocations({ ids, data }) {
|
|
79
|
+
const [id1, id2, ...remainingIds] = ids || [];
|
|
80
|
+
|
|
81
|
+
if (!id1 || !id2) {
|
|
82
|
+
throw new Error('At least two IDs are required for merging');
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const url = `/management/merge/location/${id1}/${id2}`;
|
|
86
|
+
|
|
87
|
+
const payload = {
|
|
88
|
+
...data,
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
if (remainingIds.length > 0) {
|
|
92
|
+
payload.additionalIds = remainingIds;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
return this.apiPost({
|
|
96
|
+
url,
|
|
97
|
+
data: payload,
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
mergeSubjects({ subject, ids, data }) {
|
|
104
|
+
const [id1, id2, ...remainingIds] = ids || [];
|
|
105
|
+
|
|
106
|
+
if (!id1 || !id2) {
|
|
107
|
+
throw new Error('At least two IDs are required for merging');
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const url = `/management/merge/${subject}/${id1}/${id2}`;
|
|
111
|
+
|
|
112
|
+
const payload = {
|
|
113
|
+
...data,
|
|
114
|
+
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
if (remainingIds.length > 0) {
|
|
118
|
+
payload.additionalIds = remainingIds;
|
|
119
|
+
}
|
|
120
|
+
|
|
79
121
|
return this.apiPost({
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
})
|
|
122
|
+
url,
|
|
123
|
+
data: payload,
|
|
124
|
+
});
|
|
83
125
|
}
|
|
126
|
+
|
|
127
|
+
viewLocation({ id }) {
|
|
128
|
+
return this.apiGet({
|
|
129
|
+
url: `/management/subject/location/${id}`,
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
viewStakeholder({ id }) {
|
|
134
|
+
return this.apiGet({
|
|
135
|
+
url: `/management/subject/stakeholder/${id}`,
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
updateSubject({ subject, id, data }) {
|
|
140
|
+
const type = subject === 'location' ? 'location' : 'stakeholder';
|
|
141
|
+
return this.apiPut({
|
|
142
|
+
url: `/management/subject/${type}/${id}`,
|
|
143
|
+
data,
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
getUserGrowth(activeFilter) {
|
|
148
|
+
return this.apiGet({
|
|
149
|
+
url: `/accounts/dashboard/user-growth`,
|
|
150
|
+
isUserManager: true,
|
|
151
|
+
params: { activeFilter },
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
|
|
84
156
|
}
|
|
85
157
|
|
|
86
158
|
export default createLazyService(AdminService);
|
|
@@ -63,19 +63,29 @@ export const getDefaultActiveFilters = (
|
|
|
63
63
|
};
|
|
64
64
|
|
|
65
65
|
const NEW_PAGINATION_APPS = ["nashiriki"];
|
|
66
|
+
|
|
66
67
|
export const filterParams = (value, module) => {
|
|
67
68
|
const { activeFilters, ...rest } = value;
|
|
68
69
|
|
|
69
|
-
const {
|
|
70
|
-
|
|
70
|
+
const {
|
|
71
|
+
page = 1,
|
|
72
|
+
pageSize = 20,
|
|
73
|
+
sortDir,
|
|
74
|
+
sortBy,
|
|
75
|
+
search,
|
|
76
|
+
searchParams,
|
|
77
|
+
...filters
|
|
78
|
+
} = activeFilters || {};
|
|
71
79
|
|
|
72
80
|
const params = {};
|
|
73
|
-
|
|
81
|
+
|
|
74
82
|
params.pagination = JSON.stringify({
|
|
75
|
-
|
|
76
|
-
|
|
83
|
+
page,
|
|
84
|
+
pageSize,
|
|
77
85
|
});
|
|
78
86
|
|
|
87
|
+
params.filters = JSON.stringify(filters);
|
|
88
|
+
|
|
79
89
|
if (search && searchParams) {
|
|
80
90
|
params.search = JSON.stringify({
|
|
81
91
|
qs: search,
|
|
@@ -90,13 +100,5 @@ export const filterParams = (value, module) => {
|
|
|
90
100
|
});
|
|
91
101
|
}
|
|
92
102
|
|
|
93
|
-
if (Object.keys(filters).length) {
|
|
94
|
-
if (value.sourceId && value.sourceId === "overview") {
|
|
95
|
-
params.filters = JSON.stringify(filters);
|
|
96
|
-
} else {
|
|
97
|
-
params.filters = JSON.stringify({ ...filters, authorId: undefined });
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
103
|
return { ...rest, ...params };
|
|
102
104
|
};
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
const en = {
|
|
2
|
+
"sbg-admin::remove-user-title":"Remove User Title",
|
|
3
|
+
"sbg-admin::remove-user-body":"Remove User Body",
|
|
4
|
+
"Administrative-level-1": "Administrative Level 1",
|
|
5
|
+
"Administrative-level-2": "Administrative Level 2",
|
|
6
|
+
"merge-output": "Merge Output",
|
|
7
|
+
"admin::current_subjects": "Current Subjects",
|
|
8
|
+
"add-account":"Add Account",
|
|
2
9
|
"Site": "Site",
|
|
3
10
|
"Production Sites": "Production Sites",
|
|
4
11
|
"Type of account": "Type of account",
|
package/build/favicon.ico
DELETED
|
Binary file
|
package/build/logo192.png
DELETED
|
Binary file
|
package/build/logo512.png
DELETED
|
Binary file
|
package/build/manifest.json
DELETED
|
@@ -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