datastake-daf 0.6.803 → 0.6.805
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 +1716 -1364
- package/dist/layouts/index.js +2 -2
- package/dist/pages/index.js +564 -133
- package/dist/utils/index.js +6 -0
- package/package.json +1 -1
- package/public/Biodiversity/others-default.svg +38 -0
- package/public/Biodiversity/others.svg +38 -0
- package/public/Biodiversity/unidentified-pests-default.svg +33 -0
- package/public/Biodiversity/unidentified-pests.svg +33 -0
- package/src/@daf/core/components/Dashboard/Widget/FaunaWidget/config.js +15 -0
- package/src/@daf/core/components/Dashboard/Widget/FaunaWidget/index.jsx +83 -0
- package/src/@daf/core/components/Dashboard/Widget/InvasiveSpeciesWidget/config.js +11 -0
- package/src/@daf/core/components/Dashboard/Widget/InvasiveSpeciesWidget/index.jsx +87 -0
- package/src/@daf/core/components/EditForm/RenderForm.js +13 -1
- package/src/@daf/core/components/EditForm/_index.scss +4 -3
- package/src/@daf/core/components/EditForm/components/DataLink/flat.js +9 -2
- package/src/@daf/core/components/EditForm/components/DataLink/index.js +8 -1
- package/src/@daf/core/components/EditForm/components/DataLinkGroup/index.js +8 -1
- package/src/@daf/core/components/EditForm/components/Repeatable/index.js +11 -1
- package/src/@daf/core/components/EditForm/context/index.js +9 -0
- package/src/@daf/core/components/EditForm/form.jsx +5 -1
- package/src/@daf/core/components/EditForm/helper.js +25 -3
- package/src/@daf/core/components/Header/hook.js +4 -4
- package/src/@daf/core/components/Screens/Admin/AdminModals/CombineLocation/columns.js +3 -3
- package/src/@daf/core/components/Screens/Admin/AdminModals/CombineLocation/helper.js +3 -3
- package/src/@daf/core/components/Screens/Admin/AdminModals/CombineLocation/index.jsx +3 -3
- package/src/@daf/core/components/Screens/Admin/AdminModals/CombineSubjects/columns.js +3 -3
- package/src/@daf/core/components/Screens/Admin/AdminModals/CombineSubjects/index.jsx +3 -3
- package/src/@daf/core/components/Screens/Admin/AdminTables/LocationTable/column.js +3 -3
- package/src/@daf/core/components/Screens/Admin/AdminTables/LocationTable/helper.js +1 -8
- package/src/@daf/core/components/Screens/Admin/AdminTables/SubjectsTable/columns.js +3 -3
- package/src/@daf/core/components/Screens/Admin/AdminTables/SubjectsTable/helper.js +1 -8
- package/src/@daf/core/components/Screens/Admin/AdminViews/ViewLocation/helpers.js +3 -6
- package/src/@daf/core/components/Screens/Admin/AdminViews/ViewLocation/index.jsx +2 -2
- package/src/@daf/core/components/Screens/Admin/AdminViews/ViewStakeholder/index.jsx +2 -1
- package/src/@daf/core/components/ViewForm/components/DataLink/flat.js +11 -1
- package/src/@daf/core/components/ViewForm/components/DataLink/index.js +11 -1
- package/src/@daf/core/components/ViewForm/components/DataLinkGroup/index.js +11 -1
- package/src/@daf/core/components/ViewForm/content.jsx +51 -28
- package/src/@daf/core/components/ViewForm/context/index.js +80 -0
- package/src/@daf/pages/Dashboards/SelfAssesment/components/AssociatedInformation/columns.js +9 -5
- package/src/@daf/pages/Dashboards/SelfAssesment/components/AssociatedInformation/index.jsx +15 -3
- package/src/@daf/pages/Dashboards/SelfAssesment/components/OrganisationInformation/columns.js +2 -2
- package/src/@daf/pages/Dashboards/SelfAssesment/components/OrganisationInformation/index.jsx +9 -5
- package/src/@daf/pages/Dashboards/SelfAssesment/index.jsx +1 -1
- package/src/@daf/pages/Edit/index.jsx +1 -0
- package/src/@daf/pages/Locations/MineSite/columns.js +5 -5
- package/src/@daf/pages/Stakeholders/Operators/columns.js +6 -8
- package/src/@daf/pages/Summary/Activities/Monitoring/components/BiodiversityAndHabitat/index.jsx +34 -31
- package/src/@daf/pages/View/index.jsx +1 -0
- package/src/helpers/adminLevels.js +4 -0
- package/src/index.js +2 -0
- package/src/utils.js +3 -1
|
@@ -57,6 +57,7 @@ export const EditForm = ({
|
|
|
57
57
|
staticWidth = "614px",
|
|
58
58
|
fullWidth = false,
|
|
59
59
|
noConvert = false,
|
|
60
|
+
maxWidth = "75%",
|
|
60
61
|
}) => {
|
|
61
62
|
const [isSubmitting] = useState(false);
|
|
62
63
|
const formData = JSON.parse(JSON.stringify(convertUndefinedToNull(data) || {}));
|
|
@@ -345,7 +346,7 @@ export const EditForm = ({
|
|
|
345
346
|
key={id}
|
|
346
347
|
name={id}
|
|
347
348
|
layout="vertical"
|
|
348
|
-
style={{ maxWidth: fullWidth ? "unset" : 700 }}
|
|
349
|
+
style={{ maxWidth: maxWidth || (fullWidth ? "unset" : 700) || 700 }}
|
|
349
350
|
className={`main-form${formClass ? ` ${formClass}` : ""} `}
|
|
350
351
|
onValuesChange={(_changedValue, _allValues) => {
|
|
351
352
|
const changedValue = { ..._changedValue };
|
|
@@ -565,6 +566,9 @@ export const EditForm = ({
|
|
|
565
566
|
|
|
566
567
|
return (
|
|
567
568
|
<EditProvider
|
|
569
|
+
maxWidth={maxWidth}
|
|
570
|
+
staticWidth={staticWidth}
|
|
571
|
+
fullWidth={fullWidth}
|
|
568
572
|
t={t}
|
|
569
573
|
isReview={isReview}
|
|
570
574
|
user={user}
|
|
@@ -904,6 +904,9 @@ export const inputTypeComponent = {
|
|
|
904
904
|
inputName,
|
|
905
905
|
name,
|
|
906
906
|
tags,
|
|
907
|
+
maxWidth,
|
|
908
|
+
staticWidth,
|
|
909
|
+
fullWidth,
|
|
907
910
|
},
|
|
908
911
|
{ forms, form, inputMeta = {}, t, isHighlighted },
|
|
909
912
|
) => {
|
|
@@ -982,6 +985,8 @@ export const inputTypeComponent = {
|
|
|
982
985
|
opts = groupOptions;
|
|
983
986
|
}
|
|
984
987
|
|
|
988
|
+
console.log({maxWidth, staticWidth, fullWidth});
|
|
989
|
+
|
|
985
990
|
return (
|
|
986
991
|
<Select
|
|
987
992
|
size="medium"
|
|
@@ -999,6 +1004,11 @@ export const inputTypeComponent = {
|
|
|
999
1004
|
getInputProp(props.placeholder, formsValue) ||
|
|
1000
1005
|
t("Select all relevant options")
|
|
1001
1006
|
}
|
|
1007
|
+
styles={{
|
|
1008
|
+
selector: {
|
|
1009
|
+
width: "100%" ,
|
|
1010
|
+
}
|
|
1011
|
+
}}
|
|
1002
1012
|
>
|
|
1003
1013
|
{(opts || []).map((option, i) => {
|
|
1004
1014
|
const otherProps = {};
|
|
@@ -2669,6 +2679,9 @@ export const GetFormItem = ({
|
|
|
2669
2679
|
changeAjaxForms,
|
|
2670
2680
|
app,
|
|
2671
2681
|
isReview,
|
|
2682
|
+
maxWidth,
|
|
2683
|
+
staticWidth,
|
|
2684
|
+
fullWidth,
|
|
2672
2685
|
} = useEditContext();
|
|
2673
2686
|
const lastReview = (inputMeta?.reviews || [])[(inputMeta?.reviews?.length || 0) - 1];
|
|
2674
2687
|
const [isShown, setIsShown] = useState(!!inputData.commentValue);
|
|
@@ -3165,7 +3178,7 @@ export const GetFormItem = ({
|
|
|
3165
3178
|
valueOnlyString
|
|
3166
3179
|
/>
|
|
3167
3180
|
) : inputTypeComponent[input.type] ? (
|
|
3168
|
-
inputTypeComponent[input.type](inputData, {
|
|
3181
|
+
inputTypeComponent[input.type]({ ...inputData, maxWidth, staticWidth, fullWidth }, {
|
|
3169
3182
|
form: MainForm,
|
|
3170
3183
|
forms: options,
|
|
3171
3184
|
allForms: plainForms,
|
|
@@ -3182,6 +3195,9 @@ export const GetFormItem = ({
|
|
|
3182
3195
|
getApiBaseUrl,
|
|
3183
3196
|
getAppHeader,
|
|
3184
3197
|
isHighlighted,
|
|
3198
|
+
maxWidth,
|
|
3199
|
+
staticWidth,
|
|
3200
|
+
fullWidth,
|
|
3185
3201
|
})
|
|
3186
3202
|
) : (
|
|
3187
3203
|
console.log(input)
|
|
@@ -3250,7 +3266,7 @@ export const GetFormItem = ({
|
|
|
3250
3266
|
</div>
|
|
3251
3267
|
}
|
|
3252
3268
|
>
|
|
3253
|
-
{inputTypeComponent.comment(inputData, {
|
|
3269
|
+
{inputTypeComponent.comment({ ...inputData, maxWidth, staticWidth, fullWidth }, {
|
|
3254
3270
|
form: MainForm,
|
|
3255
3271
|
forms: options,
|
|
3256
3272
|
setFormValues: setValues,
|
|
@@ -3265,6 +3281,9 @@ export const GetFormItem = ({
|
|
|
3265
3281
|
t,
|
|
3266
3282
|
getApiBaseUrl,
|
|
3267
3283
|
getAppHeader,
|
|
3284
|
+
maxWidth,
|
|
3285
|
+
staticWidth,
|
|
3286
|
+
fullWidth,
|
|
3268
3287
|
})}
|
|
3269
3288
|
</Form.Item>
|
|
3270
3289
|
<span className="max-char-span">
|
|
@@ -3290,7 +3309,7 @@ export const GetFormItem = ({
|
|
|
3290
3309
|
</div>
|
|
3291
3310
|
}
|
|
3292
3311
|
>
|
|
3293
|
-
{inputTypeComponent.comment(inputData, {
|
|
3312
|
+
{inputTypeComponent.comment({ ...inputData, maxWidth, staticWidth, fullWidth }, {
|
|
3294
3313
|
form: MainForm,
|
|
3295
3314
|
forms: options,
|
|
3296
3315
|
value: lastReview?.comment || "",
|
|
@@ -3321,6 +3340,9 @@ export const GetFormItem = ({
|
|
|
3321
3340
|
t,
|
|
3322
3341
|
getApiBaseUrl,
|
|
3323
3342
|
getAppHeader,
|
|
3343
|
+
maxWidth,
|
|
3344
|
+
staticWidth,
|
|
3345
|
+
fullWidth,
|
|
3324
3346
|
})}
|
|
3325
3347
|
</Form.Item>
|
|
3326
3348
|
<span className="max-char-span">
|
|
@@ -91,12 +91,12 @@ export const useHeader = ({
|
|
|
91
91
|
];
|
|
92
92
|
|
|
93
93
|
const actionButtons =
|
|
94
|
-
onDownload && _actionButtons
|
|
95
|
-
? [..._actionButtons, ...(hasFilters ? filterButton : []), downloadButton]
|
|
96
|
-
: [..._actionButtons, ...(hasFilters ? filterButton : [])];
|
|
94
|
+
onDownload && _actionButtons?.length < 3
|
|
95
|
+
? [...(_actionButtons?.length ? _actionButtons : []), ...(hasFilters ? filterButton : []), downloadButton]
|
|
96
|
+
: [...(_actionButtons?.length ? _actionButtons : []), ...(hasFilters ? filterButton : [])];
|
|
97
97
|
|
|
98
98
|
const extraButtons =
|
|
99
|
-
onDownload && _actionButtons
|
|
99
|
+
onDownload && _actionButtons?.length >= 3
|
|
100
100
|
? [..._extraButtons, downloadButtonAction]
|
|
101
101
|
: [..._extraButtons];
|
|
102
102
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { findOptions } from "../../../../../../../helpers/StringHelper.js";
|
|
2
2
|
import { Tooltip } from "antd";
|
|
3
|
-
import {
|
|
3
|
+
import { getAdminLevelName } from "../../../../../../../helpers/adminLevels.js";
|
|
4
4
|
|
|
5
5
|
export const getColumns = ({ t, selectOptions, module, entity }) => {
|
|
6
6
|
return [
|
|
@@ -53,7 +53,7 @@ export const getColumns = ({ t, selectOptions, module, entity }) => {
|
|
|
53
53
|
if(all?.administrativeLevel1 && value === all?.administrativeLevel1) {
|
|
54
54
|
label = all?.linking?.SCL?.[value]?.name
|
|
55
55
|
} else {
|
|
56
|
-
label =
|
|
56
|
+
label = getAdminLevelName(all?.linking?.SCL, "level_1")
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
return <Tooltip title={label || '-'}>{label || '-'}</Tooltip>;
|
|
@@ -69,7 +69,7 @@ export const getColumns = ({ t, selectOptions, module, entity }) => {
|
|
|
69
69
|
if(all?.administrativeLevel2 && value === all?.administrativeLevel2) {
|
|
70
70
|
label = all?.linking?.SCL?.[value]?.name
|
|
71
71
|
} else {
|
|
72
|
-
label =
|
|
72
|
+
label = getAdminLevelName(all?.linking?.SCL, "level_2")
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
return <Tooltip title={label || '-'}>{label || '-'}</Tooltip>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { findOptions } from "../../../../../../../helpers/StringHelper.js";
|
|
2
2
|
import { Tooltip } from "antd";
|
|
3
|
-
import {
|
|
3
|
+
import { getAdminLevelName } from "../../../../../../../helpers/adminLevels.js";
|
|
4
4
|
|
|
5
5
|
export const getColumns = ({ t, selectOptions, module, entity }) => {
|
|
6
6
|
return [
|
|
@@ -53,7 +53,7 @@ export const getColumns = ({ t, selectOptions, module, entity }) => {
|
|
|
53
53
|
if(all?.administrativeLevel1 && value === all?.administrativeLevel1) {
|
|
54
54
|
label = all?.linking?.SCL?.[value]?.name
|
|
55
55
|
} else {
|
|
56
|
-
label =
|
|
56
|
+
label = getAdminLevelName(all?.linking?.SCL, "level_1")
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
return <Tooltip title={label || '-'}>{label || '-'}</Tooltip>;
|
|
@@ -69,7 +69,7 @@ export const getColumns = ({ t, selectOptions, module, entity }) => {
|
|
|
69
69
|
if(all?.administrativeLevel2 && value === all?.administrativeLevel2) {
|
|
70
70
|
label = all?.linking?.SCL?.[value]?.name
|
|
71
71
|
} else {
|
|
72
|
-
label =
|
|
72
|
+
label = getAdminLevelName(all?.linking?.SCL, "level_2")
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
return <Tooltip title={label || '-'}>{label || '-'}</Tooltip>;
|
|
@@ -3,7 +3,7 @@ import { Form, Input, Select, theme } from "antd";
|
|
|
3
3
|
import { Container } from "../CombineModalStyle.js";
|
|
4
4
|
import DAFTable from "../../../../Table/index.jsx";
|
|
5
5
|
import { useMemo, useState } from "react";
|
|
6
|
-
import {
|
|
6
|
+
import { getAdminLevelName } from "../../../../../../../helpers/adminLevels.js";
|
|
7
7
|
import { getColumns } from "./helper.js";
|
|
8
8
|
|
|
9
9
|
const { useToken } = theme;
|
|
@@ -186,7 +186,7 @@ export default function CombineLocationModal({
|
|
|
186
186
|
placeholder={t("Province")}
|
|
187
187
|
options={selectedLocations
|
|
188
188
|
.map((location) => {
|
|
189
|
-
const _data =
|
|
189
|
+
const _data = getAdminLevelName(location?.linking?.SCL, "level_1");
|
|
190
190
|
return {
|
|
191
191
|
label: _data?.name || "-",
|
|
192
192
|
value: _data?.id || "-",
|
|
@@ -204,7 +204,7 @@ export default function CombineLocationModal({
|
|
|
204
204
|
placeholder={t("Territory")}
|
|
205
205
|
options={selectedLocations
|
|
206
206
|
.map((location) => {
|
|
207
|
-
const _data =
|
|
207
|
+
const _data = getAdminLevelName(location?.linking?.SCL, "level_2");
|
|
208
208
|
return {
|
|
209
209
|
label: _data?.name || "-",
|
|
210
210
|
value: _data?.id || "-",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { findOptions } from "../../../../../../../helpers/StringHelper.js";
|
|
2
2
|
import { Tooltip } from "antd";
|
|
3
|
-
import {
|
|
3
|
+
import { getAdminLevelName } from "../../../../../../../helpers/adminLevels.js";
|
|
4
4
|
|
|
5
5
|
export const getColumns = ({ t, selectOptions, module, entity }) => {
|
|
6
6
|
return [
|
|
@@ -53,7 +53,7 @@ export const getColumns = ({ t, selectOptions, module, entity }) => {
|
|
|
53
53
|
if(all?.administrativeLevel1 && value === all?.administrativeLevel1) {
|
|
54
54
|
label = all?.linking?.SCL?.[value]?.name
|
|
55
55
|
} else {
|
|
56
|
-
label =
|
|
56
|
+
label = getAdminLevelName(all?.linking?.SCL, "level_1")
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
return <Tooltip title={label || '-'}>{label || '-'}</Tooltip>;
|
|
@@ -69,7 +69,7 @@ export const getColumns = ({ t, selectOptions, module, entity }) => {
|
|
|
69
69
|
if(all?.administrativeLevel2 && value === all?.administrativeLevel2) {
|
|
70
70
|
label = all?.linking?.SCL?.[value]?.name
|
|
71
71
|
} else {
|
|
72
|
-
label =
|
|
72
|
+
label = getAdminLevelName(all?.linking?.SCL, "level_2")
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
return <Tooltip title={label || '-'}>{label || '-'}</Tooltip>;
|
|
@@ -6,7 +6,7 @@ import DAFTable from "../../../../Table/index.jsx";
|
|
|
6
6
|
import { useMemo, useState } from "react";
|
|
7
7
|
import { mapToSelectOptions } from "./helper.js";
|
|
8
8
|
import { getColumns } from "./columns.js";
|
|
9
|
-
import {
|
|
9
|
+
import { getAdminLevelName } from "../../../../../../../helpers/adminLevels.js";
|
|
10
10
|
|
|
11
11
|
const { useToken } = theme;
|
|
12
12
|
|
|
@@ -141,7 +141,7 @@ export default function CombineSubjectsModal({
|
|
|
141
141
|
<Select
|
|
142
142
|
placeholder={t("Province")}
|
|
143
143
|
options={mapToSelectOptions(selectedSubjects, null, selectOptions, null, (subject) => {
|
|
144
|
-
const _data =
|
|
144
|
+
const _data = getAdminLevelName(subject?.linking?.SCL, "level_1");
|
|
145
145
|
return {
|
|
146
146
|
label: _data?.name || "-",
|
|
147
147
|
value: _data?.id || "-",
|
|
@@ -154,7 +154,7 @@ export default function CombineSubjectsModal({
|
|
|
154
154
|
<Select
|
|
155
155
|
placeholder={t("Territory")}
|
|
156
156
|
options={mapToSelectOptions(selectedSubjects, null, selectOptions, null, (subject) => {
|
|
157
|
-
const _data =
|
|
157
|
+
const _data = getAdminLevelName(subject?.linking?.SCL, "level_2");
|
|
158
158
|
return {
|
|
159
159
|
label: _data?.name || "-",
|
|
160
160
|
value: _data?.id || "-",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Checkbox, Tooltip, Avatar } from "antd";
|
|
2
2
|
import CustomIcon from "../../../../Icon/CustomIcon.jsx";
|
|
3
3
|
import { findOptions } from "../../../../../../../helpers/StringHelper.js";
|
|
4
|
-
import {
|
|
4
|
+
import { getAdminLevelName } from "../../../../../../../helpers/adminLevels.js";
|
|
5
5
|
|
|
6
6
|
export const getColumns = ({
|
|
7
7
|
t,
|
|
@@ -121,7 +121,7 @@ export const getColumns = ({
|
|
|
121
121
|
if(all?.administrativeLevel1 && value === all?.administrativeLevel1) {
|
|
122
122
|
label = all?.linking?.SCL?.[value]?.name
|
|
123
123
|
} else {
|
|
124
|
-
label =
|
|
124
|
+
label = getAdminLevelName(all?.linking?.SCL, "level_1")
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
return <Tooltip title={label || '-'}>{label || '-'}</Tooltip>;
|
|
@@ -142,7 +142,7 @@ export const getColumns = ({
|
|
|
142
142
|
if(all?.administrativeLevel2 && value === all?.administrativeLevel2) {
|
|
143
143
|
label = all?.linking?.SCL?.[value]?.name
|
|
144
144
|
} else {
|
|
145
|
-
label =
|
|
145
|
+
label = getAdminLevelName(all?.linking?.SCL, "level_2")
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
return <Tooltip title={label || '-'}>{label || '-'}</Tooltip>;
|
|
@@ -55,11 +55,4 @@ export const defaultUrlParams = { activeTab: "active" };
|
|
|
55
55
|
export const checkboxConfig = {
|
|
56
56
|
name: "Name",
|
|
57
57
|
datastakeId: "ID",
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
export const getNameByLevel = (data, level) => {
|
|
61
|
-
const entry = Object.values(data || {}).find(item => item.level === level);
|
|
62
|
-
return entry;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
|
|
58
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Checkbox, Tooltip, Avatar } from "antd";
|
|
2
2
|
import CustomIcon from "../../../../Icon/CustomIcon.jsx";
|
|
3
3
|
import { findOptions } from "../../../../../../../helpers/StringHelper.js";
|
|
4
|
-
import {
|
|
4
|
+
import { getAdminLevelName } from "../../../../../../../helpers/adminLevels.js";
|
|
5
5
|
|
|
6
6
|
export const getColumns = ({
|
|
7
7
|
t,
|
|
@@ -121,7 +121,7 @@ export const getColumns = ({
|
|
|
121
121
|
if(all?.administrativeLevel1 && value === all?.administrativeLevel1) {
|
|
122
122
|
label = all?.linking?.SCL?.[value]?.name
|
|
123
123
|
} else {
|
|
124
|
-
label =
|
|
124
|
+
label = getAdminLevelName(all?.linking?.SCL, "level_1")
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
return <Tooltip title={label || '-'}>{label || '-'}</Tooltip>;
|
|
@@ -142,7 +142,7 @@ export const getColumns = ({
|
|
|
142
142
|
if(all?.administrativeLevel2 && value === all?.administrativeLevel2) {
|
|
143
143
|
label = all?.linking?.SCL?.[value]?.name
|
|
144
144
|
} else {
|
|
145
|
-
label =
|
|
145
|
+
label = getAdminLevelName(all?.linking?.SCL, "level_2")
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
return <Tooltip title={label || '-'}>{label || '-'}</Tooltip>;
|
|
@@ -55,11 +55,4 @@ export const defaultUrlParams = { activeTab: "active" };
|
|
|
55
55
|
export const checkboxConfig = {
|
|
56
56
|
name: "Name",
|
|
57
57
|
datastakeId: "ID",
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
export const getNameByLevel = (data, level) => {
|
|
61
|
-
const entry = Object.values(data || {}).find(item => item.level === level);
|
|
62
|
-
return entry;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
|
|
58
|
+
};
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
const entry = Object.values(data || {}).find(item => item.level === level);
|
|
3
|
-
return entry?.name || "-";
|
|
4
|
-
};
|
|
1
|
+
import { getAdminLevelName } from "../../../../../../../helpers/adminLevels.js";
|
|
5
2
|
|
|
6
3
|
export const getAdministrativeLevel1 = (location) => {
|
|
7
|
-
return
|
|
4
|
+
return getAdminLevelName(location?.linking?.SCL, "level_1");
|
|
8
5
|
};
|
|
9
6
|
|
|
10
7
|
export const getAdministrativeLevel2 = (location) => {
|
|
11
|
-
return
|
|
8
|
+
return getAdminLevelName(location?.linking?.SCL, "level_2");
|
|
12
9
|
};
|
|
13
10
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { findOptions } from "../../../../../../../helpers/StringHelper.js";
|
|
2
|
-
import {
|
|
2
|
+
import { getAdminLevelName } from "../../../../../../../helpers/adminLevels.js";
|
|
3
3
|
import LocationTable from "../../AdminTables/LocationTable/index.jsx";
|
|
4
4
|
|
|
5
5
|
const isView = true;
|
|
@@ -43,7 +43,7 @@ export default function View({
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
if (item.type === "administrative") {
|
|
46
|
-
return
|
|
46
|
+
return getAdminLevelName(data?.linking?.SCL, item.level) || "-";
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
return val ?? "-";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { findOptions } from "../../../../../../../helpers/StringHelper.js";
|
|
2
2
|
import StakeholderTable from "../../AdminTables/SubjectsTable/index.jsx";
|
|
3
|
+
import { getAdminLevelName } from "../../../../../../../helpers/adminLevels.js";
|
|
3
4
|
const isView = true;
|
|
4
5
|
|
|
5
6
|
export default function View({
|
|
@@ -41,7 +42,7 @@ export default function View({
|
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
if (item.type === "administrative") {
|
|
44
|
-
return
|
|
45
|
+
return getAdminLevelName(data?.linking?.SCL, item.level) || "-";
|
|
45
46
|
}
|
|
46
47
|
|
|
47
48
|
return val ?? "-";
|
|
@@ -9,6 +9,7 @@ import { getLabelFromScopeForDataLink, tooltipInputs } from "../../../../../../h
|
|
|
9
9
|
import ModalHeader from "../../../Header/ModalHeader/index.jsx";
|
|
10
10
|
import { formatClassname } from "../../../../../../helpers/ClassesHelper";
|
|
11
11
|
import { getInputLabel } from "../../config.js";
|
|
12
|
+
import { useViewContext } from "../../context";
|
|
12
13
|
|
|
13
14
|
export default function DataLinkFlat({
|
|
14
15
|
form = {},
|
|
@@ -25,6 +26,11 @@ export default function DataLinkFlat({
|
|
|
25
26
|
getToken,
|
|
26
27
|
app,
|
|
27
28
|
}) {
|
|
29
|
+
const {
|
|
30
|
+
maxWidth,
|
|
31
|
+
staticWidth,
|
|
32
|
+
fullWidth,
|
|
33
|
+
} = useViewContext();
|
|
28
34
|
const isSingle = useMemo(() => form?.meta?.maxRepeat === 1, [form]);
|
|
29
35
|
const [modalRow, setModalRow] = useState(null)
|
|
30
36
|
const [linkingData, setLinkingData] = useState({});
|
|
@@ -418,7 +424,11 @@ export default function DataLinkFlat({
|
|
|
418
424
|
], [mapKey, inputs, tableKeys, ajaxModalValues]);
|
|
419
425
|
|
|
420
426
|
return (
|
|
421
|
-
<div className={formatClassname(['data-link-cont mt-2', noBody && 'no-body'])} style={
|
|
427
|
+
<div className={formatClassname(['data-link-cont mt-2', noBody && 'no-body'])} style={{
|
|
428
|
+
...form?.meta?.style,
|
|
429
|
+
maxWidth: fullWidth ? "unset" : maxWidth,
|
|
430
|
+
width: fullWidth ? "100%" : maxWidth,
|
|
431
|
+
}}>
|
|
422
432
|
<div className="daf-table-wrapper no-padding repeatable-form-table no-pagination">
|
|
423
433
|
<ConfigProvider renderEmpty={() => notApplicable ? t('Not applicable') : t('No information available')}>
|
|
424
434
|
<Table
|
|
@@ -9,6 +9,7 @@ import { getLabelFromScopeForDataLink, tooltipInputs } from "../../../../../../h
|
|
|
9
9
|
import ModalHeader from "../../../Header/ModalHeader/index.jsx";
|
|
10
10
|
import { formatClassname } from "../../../../../../helpers/ClassesHelper";
|
|
11
11
|
import { getInputLabel } from "../../config.js";
|
|
12
|
+
import { useViewContext } from "../../context";
|
|
12
13
|
|
|
13
14
|
export default function DataLink({
|
|
14
15
|
form = {},
|
|
@@ -25,6 +26,11 @@ export default function DataLink({
|
|
|
25
26
|
getToken,
|
|
26
27
|
app,
|
|
27
28
|
}) {
|
|
29
|
+
const {
|
|
30
|
+
maxWidth,
|
|
31
|
+
staticWidth,
|
|
32
|
+
fullWidth,
|
|
33
|
+
} = useViewContext();
|
|
28
34
|
const isSingle = useMemo(() => form?.meta?.maxRepeat === 1, [form]);
|
|
29
35
|
const [modalRow, setModalRow] = useState(null)
|
|
30
36
|
const [linkingData, setLinkingData] = useState({});
|
|
@@ -372,7 +378,11 @@ export default function DataLink({
|
|
|
372
378
|
], [mapKey, inputs, tableKeys, ajaxModalValues]);
|
|
373
379
|
|
|
374
380
|
return (
|
|
375
|
-
<div className={formatClassname(['data-link-cont mt-2', noBody && 'no-body'])} style={
|
|
381
|
+
<div className={formatClassname(['data-link-cont mt-2', noBody && 'no-body'])} style={{
|
|
382
|
+
...form?.meta?.style,
|
|
383
|
+
maxWidth: fullWidth ? "unset" : maxWidth,
|
|
384
|
+
width: fullWidth ? "100%" : maxWidth,
|
|
385
|
+
}}>
|
|
376
386
|
<div className="daf-table-wrapper no-padding repeatable-form-table no-pagination">
|
|
377
387
|
<ConfigProvider renderEmpty={() => notApplicable ? t('Not applicable') : t('No information available')}>
|
|
378
388
|
<Table
|
|
@@ -9,6 +9,7 @@ import { tooltipInputs, getLabelFromScopeForDataLink } from "../../../../../../h
|
|
|
9
9
|
import ModalHeader from "../../../Header/ModalHeader/index.jsx";
|
|
10
10
|
import { formatClassname } from "../../../../../../helpers/ClassesHelper.js";
|
|
11
11
|
import { getInputLabel } from "../../config.js";
|
|
12
|
+
import { useViewContext } from "../../context";
|
|
12
13
|
|
|
13
14
|
export default function DataLinkGroup({
|
|
14
15
|
form = {},
|
|
@@ -25,6 +26,11 @@ export default function DataLinkGroup({
|
|
|
25
26
|
getToken,
|
|
26
27
|
app,
|
|
27
28
|
}) {
|
|
29
|
+
const {
|
|
30
|
+
maxWidth,
|
|
31
|
+
staticWidth,
|
|
32
|
+
fullWidth,
|
|
33
|
+
} = useViewContext();
|
|
28
34
|
const dataLinkKey = useMemo(() =>
|
|
29
35
|
Object.keys(form?.inputs || {}).find((k) => form?.inputs[k]?.type === "dataLink"), [form]);
|
|
30
36
|
|
|
@@ -371,7 +377,11 @@ export default function DataLinkGroup({
|
|
|
371
377
|
], [mapKey, inputs, tableKeys, ajaxModalValues]);
|
|
372
378
|
|
|
373
379
|
return (
|
|
374
|
-
<div className={formatClassname(['data-link-cont mt-2', noBody && 'no-body'])} style={
|
|
380
|
+
<div className={formatClassname(['data-link-cont mt-2', noBody && 'no-body'])} style={{
|
|
381
|
+
...dataLinkInput?.meta?.style,
|
|
382
|
+
maxWidth: fullWidth ? "unset" : maxWidth,
|
|
383
|
+
width: fullWidth ? "100%" : maxWidth,
|
|
384
|
+
}}>
|
|
375
385
|
<div className="daf-table-wrapper no-padding repeatable-form-table no-pagination">
|
|
376
386
|
<ConfigProvider renderEmpty={() => notApplicable ? t('Not applicable') : t('No information available')}>
|
|
377
387
|
<Table
|
|
@@ -9,6 +9,7 @@ import RepeatableGroup from "./components/repeatableGroup";
|
|
|
9
9
|
import RepeatableModals from "./components/repeatableModals";
|
|
10
10
|
import { repeatObjects, isGroupInput, groupSubsections, getLastRow, showHideInput } from "./helper";
|
|
11
11
|
import GetIcon from "../Icon/index.jsx";
|
|
12
|
+
import { ViewProvider } from "./context";
|
|
12
13
|
|
|
13
14
|
const Content = ({
|
|
14
15
|
style = {},
|
|
@@ -30,6 +31,8 @@ const Content = ({
|
|
|
30
31
|
user,
|
|
31
32
|
evaluationConfig = [],
|
|
32
33
|
fullWidth = false,
|
|
34
|
+
maxWidth = "75%",
|
|
35
|
+
staticWidth = "614px",
|
|
33
36
|
}) => {
|
|
34
37
|
const groupSingle = (grps) => {
|
|
35
38
|
const form = Object.keys(grps).reduce((f, gKey) => {
|
|
@@ -222,6 +225,9 @@ const Content = ({
|
|
|
222
225
|
data={data}
|
|
223
226
|
allData={data}
|
|
224
227
|
linkingData={linkingData}
|
|
228
|
+
maxWidth={maxWidth}
|
|
229
|
+
staticWidth={staticWidth}
|
|
230
|
+
fullWidth={fullWidth}
|
|
225
231
|
className={
|
|
226
232
|
isEven
|
|
227
233
|
? ind === _length - 1 || ind === _length - 2
|
|
@@ -283,6 +289,9 @@ const Content = ({
|
|
|
283
289
|
ajaxOptions={ajaxOptions}
|
|
284
290
|
evaluationConfig={evaluationConfig}
|
|
285
291
|
cols={2}
|
|
292
|
+
maxWidth={maxWidth}
|
|
293
|
+
staticWidth={staticWidth}
|
|
294
|
+
fullWidth={fullWidth}
|
|
286
295
|
></Input>
|
|
287
296
|
</div>
|
|
288
297
|
) : null;
|
|
@@ -352,7 +361,7 @@ const Content = ({
|
|
|
352
361
|
|
|
353
362
|
return (
|
|
354
363
|
<>
|
|
355
|
-
<div className="wrapper" key={Date.now()} style={{ width:
|
|
364
|
+
<div className="wrapper" key={Date.now()} style={{ width: "75%", display: "flex", justifyContent: "center" }}>
|
|
356
365
|
{f.alertConf ? (
|
|
357
366
|
<Alert
|
|
358
367
|
className="w-100"
|
|
@@ -377,34 +386,48 @@ const Content = ({
|
|
|
377
386
|
}
|
|
378
387
|
|
|
379
388
|
return (
|
|
380
|
-
<
|
|
381
|
-
{
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
389
|
+
<ViewProvider
|
|
390
|
+
t={t}
|
|
391
|
+
app={app}
|
|
392
|
+
ajaxForms={ajaxForms}
|
|
393
|
+
changeAjaxForms={changeAjaxForms}
|
|
394
|
+
getApiBaseUrl={getApiBaseUrl}
|
|
395
|
+
getAppHeader={getAppHeader}
|
|
396
|
+
user={user}
|
|
397
|
+
evaluationConfig={evaluationConfig}
|
|
398
|
+
fullWidth={fullWidth}
|
|
399
|
+
maxWidth={maxWidth}
|
|
400
|
+
staticWidth={staticWidth}
|
|
401
|
+
>
|
|
402
|
+
<div className="content" style={style}>
|
|
403
|
+
{!hasSubSections ? (
|
|
404
|
+
renderContent(form)
|
|
405
|
+
) : (
|
|
406
|
+
<React.Fragment>
|
|
407
|
+
<h1 className="title">{form ? getInputLabel(form, data) : ""}</h1>
|
|
408
|
+
<Tabs
|
|
409
|
+
className="section-tabs"
|
|
410
|
+
items={repeatObjects(groupSections, (key) => {
|
|
411
|
+
const section = groupSections[key];
|
|
390
412
|
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
413
|
+
return {
|
|
414
|
+
style: { maxHeight: "calc(100vh - 100px)", overflowY: "auto" },
|
|
415
|
+
label: (
|
|
416
|
+
<span>
|
|
417
|
+
{section.icon ? <GetIcon icon={section.icon} /> : null}{" "}
|
|
418
|
+
{getInputLabel(section, data)}
|
|
419
|
+
</span>
|
|
420
|
+
),
|
|
421
|
+
key: key,
|
|
422
|
+
tabKey: key,
|
|
423
|
+
children: renderContent(groupSections[key], false),
|
|
424
|
+
};
|
|
425
|
+
})}
|
|
426
|
+
/>
|
|
427
|
+
</React.Fragment>
|
|
428
|
+
)}
|
|
429
|
+
</div>
|
|
430
|
+
</ViewProvider>
|
|
408
431
|
);
|
|
409
432
|
};
|
|
410
433
|
|