datastake-daf 0.6.767 → 0.6.769

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 (79) hide show
  1. package/dist/components/index.js +1007 -730
  2. package/dist/layouts/index.js +495 -459
  3. package/dist/pages/index.js +7914 -6836
  4. package/dist/style/datastake/mapbox-gl.css +330 -0
  5. package/dist/utils/index.js +481 -457
  6. package/package.json +1 -1
  7. package/src/@daf/core/components/Charts/ColumnChart/index.jsx +10 -0
  8. package/src/@daf/core/components/Charts/LineChart/index.jsx +14 -0
  9. package/src/@daf/core/components/Dashboard/Map/ChainIcon/Markers/StakeholderMarker.js +5 -2
  10. package/src/@daf/core/components/Dashboard/Map/ChainIcon/index.js +67 -27
  11. package/src/@daf/core/components/Dashboard/Map/hook.js +26 -32
  12. package/src/@daf/core/components/Dashboard/Widget/ActivityIndicators/index.jsx +2 -0
  13. package/src/@daf/core/components/Dashboard/Widget/StatCard/StatCard.stories.js +226 -0
  14. package/src/@daf/core/components/Dashboard/Widget/StatCard/index.js +103 -0
  15. package/src/@daf/core/components/Dashboard/Widget/StatCard/style.js +83 -0
  16. package/src/@daf/core/components/Icon/configs/Down.js +8 -0
  17. package/src/@daf/core/components/Icon/configs/Up.js +8 -0
  18. package/src/@daf/core/components/Icon/configs/index.js +4 -0
  19. package/src/@daf/core/components/Icon/configs/partnerIcon.js +1 -1
  20. package/src/@daf/core/components/Screens/BaseScreen/index.jsx +1 -1
  21. package/src/@daf/core/components/Screens/TableScreen/TablePageWithTabs/index.jsx +1 -1
  22. package/src/@daf/core/components/Sidenav/Menu.jsx +4 -4
  23. package/src/@daf/core/components/UI/MissingTagButton/index.jsx +36 -0
  24. package/src/@daf/pages/Dashboards/SupplyChain/components/SupplyChainMap/index.js +0 -2
  25. package/src/@daf/pages/Documents/config.js +0 -10
  26. package/src/@daf/pages/Documents/index.jsx +51 -108
  27. package/src/@daf/pages/Events/Activities/config.js +1 -11
  28. package/src/@daf/pages/Events/Activities/index.jsx +47 -105
  29. package/src/@daf/pages/Events/Incidents/config.js +1 -11
  30. package/src/@daf/pages/Events/Incidents/index.jsx +47 -105
  31. package/src/@daf/pages/Events/config.js +18 -34
  32. package/src/@daf/pages/Events/index.jsx +49 -111
  33. package/src/@daf/pages/Locations/MineSite/config.js +0 -10
  34. package/src/@daf/pages/Locations/MineSite/index.jsx +47 -105
  35. package/src/@daf/pages/Locations/config.js +4 -16
  36. package/src/@daf/pages/Locations/index.jsx +53 -110
  37. package/src/@daf/pages/Stakeholders/Operators/config.js +0 -10
  38. package/src/@daf/pages/Stakeholders/Operators/index.jsx +47 -105
  39. package/src/@daf/pages/Stakeholders/Workers/config.js +0 -10
  40. package/src/@daf/pages/Stakeholders/Workers/index.jsx +47 -105
  41. package/src/@daf/pages/Stakeholders/config.js +3 -15
  42. package/src/@daf/pages/Stakeholders/index.jsx +53 -109
  43. package/src/@daf/pages/Summary/Activities/PlantingCycle/components/AssociatedInformation/index.jsx +43 -0
  44. package/src/@daf/pages/Summary/Activities/PlantingCycle/components/CommunityParticipation/CommunityStats/helper.js +60 -0
  45. package/src/@daf/pages/Summary/Activities/PlantingCycle/components/CommunityParticipation/CommunityStats/index.jsx +36 -0
  46. package/src/@daf/pages/Summary/Activities/PlantingCycle/components/CommunityParticipation/GenderDistribution/helper.js +117 -0
  47. package/src/@daf/pages/Summary/Activities/PlantingCycle/components/CommunityParticipation/GenderDistribution/index.jsx +49 -0
  48. package/src/@daf/pages/Summary/Activities/PlantingCycle/components/CommunityParticipation/JobsTimeline/index.jsx +212 -0
  49. package/src/@daf/pages/Summary/Activities/PlantingCycle/components/CommunityParticipation/index.jsx +72 -0
  50. package/src/@daf/pages/Summary/Activities/PlantingCycle/components/CycleIndicators/CyclePartners/helper.js +91 -0
  51. package/src/@daf/pages/Summary/Activities/PlantingCycle/components/CycleIndicators/CyclePartners/index.jsx +50 -0
  52. package/src/@daf/pages/Summary/Activities/PlantingCycle/components/CycleIndicators/HealthAndSafety/helper.js +134 -0
  53. package/src/@daf/pages/Summary/Activities/PlantingCycle/components/CycleIndicators/HealthAndSafety/index.jsx +49 -0
  54. package/src/@daf/pages/Summary/Activities/PlantingCycle/components/CycleIndicators/index.jsx +112 -0
  55. package/src/@daf/pages/Summary/Activities/PlantingCycle/components/CycleOutcomes/index.jsx +498 -0
  56. package/src/@daf/pages/Summary/Activities/PlantingCycle/components/KeyInformation/index.jsx +49 -0
  57. package/src/@daf/pages/Summary/Activities/PlantingCycle/components/PlantingLocations/index.jsx +120 -0
  58. package/src/@daf/pages/Summary/Activities/PlantingCycle/config.js +5 -10
  59. package/src/@daf/pages/Summary/Activities/PlantingCycle/helper.js +218 -0
  60. package/src/@daf/pages/Summary/Activities/PlantingCycle/index.jsx +22 -32
  61. package/src/@daf/pages/Summary/Activities/Restoration/components/ActivityImagery/index.jsx +29 -0
  62. package/src/@daf/pages/Summary/Activities/Restoration/components/ActivityLocation/index.jsx +94 -0
  63. package/src/@daf/pages/Summary/Activities/Restoration/components/WorkersDistribution/index.jsx +49 -0
  64. package/src/@daf/pages/Summary/Activities/Restoration/index.jsx +16 -138
  65. package/src/@daf/pages/TablePage/config.js +78 -0
  66. package/src/@daf/{core/components/Screens/TableScreen/TableWithTabsAndCreate → pages/TablePage}/create.jsx +6 -5
  67. package/src/@daf/pages/TablePage/hook.js +123 -0
  68. package/src/@daf/pages/TablePage/index.jsx +142 -0
  69. package/src/index.js +2 -0
  70. package/src/@daf/core/components/Screens/TableScreen/TableWithTabsAndCreate/index.jsx +0 -115
  71. package/src/@daf/pages/Documents/create.jsx +0 -105
  72. package/src/@daf/pages/Events/Activities/create.jsx +0 -104
  73. package/src/@daf/pages/Events/Incidents/create.jsx +0 -104
  74. package/src/@daf/pages/Events/create.jsx +0 -104
  75. package/src/@daf/pages/Locations/MineSite/create.jsx +0 -104
  76. package/src/@daf/pages/Locations/create.jsx +0 -104
  77. package/src/@daf/pages/Stakeholders/Operators/create.jsx +0 -104
  78. package/src/@daf/pages/Stakeholders/Workers/create.jsx +0 -104
  79. package/src/@daf/pages/Stakeholders/create.jsx +0 -105
@@ -1,104 +0,0 @@
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 StakeholdersCreate = ({
7
- namespace = 'locations',
8
- view = 'scoping',
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: 'create' });
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={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: 'location'
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 StakeholdersCreate
@@ -1,104 +0,0 @@
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 StakeholdersCreate = ({
7
- namespace = "OPERATOR",
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: 'operator'
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 StakeholdersCreate
@@ -1,104 +0,0 @@
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 StakeholdersCreate = ({
7
- namespace = "WORKERS",
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: 'worker'
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 StakeholdersCreate
@@ -1,105 +0,0 @@
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 StakeholdersCreate = ({
7
- namespace = 'stakeholders',
8
- view = 'scoping',
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: 'create' });
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={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: 'stakeholder'
78
- };
79
-
80
-
81
- const callback = (type, m, data) => {
82
- if (setSelectedFormNext) {
83
- setSelectedFormNext();
84
- }
85
- if (type === MessageTypes.SUCCESS) {
86
- if (onSubmitted) onSubmitted(type, m, data);
87
- } else {
88
- message.error(m);
89
- }
90
- };
91
-
92
- saveData(
93
- !data && !data.id ? newPayload : Object.assign(newPayload, { id: data.id }),
94
- callback,
95
- );
96
- }}
97
- isFormDisabled={() => {
98
- return !data || !data.typeOfEvent;
99
- }}
100
- />
101
- </div>
102
- )
103
- }
104
-
105
- export default StakeholdersCreate