datastake-daf 0.6.804 → 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.
Files changed (44) hide show
  1. package/dist/components/index.js +1481 -1167
  2. package/dist/layouts/index.js +2 -2
  3. package/dist/pages/index.js +316 -66
  4. package/dist/utils/index.js +6 -0
  5. package/package.json +1 -1
  6. package/src/@daf/core/components/EditForm/RenderForm.js +13 -1
  7. package/src/@daf/core/components/EditForm/_index.scss +4 -3
  8. package/src/@daf/core/components/EditForm/components/DataLink/flat.js +9 -2
  9. package/src/@daf/core/components/EditForm/components/DataLink/index.js +8 -1
  10. package/src/@daf/core/components/EditForm/components/DataLinkGroup/index.js +8 -1
  11. package/src/@daf/core/components/EditForm/components/Repeatable/index.js +11 -1
  12. package/src/@daf/core/components/EditForm/context/index.js +9 -0
  13. package/src/@daf/core/components/EditForm/form.jsx +5 -1
  14. package/src/@daf/core/components/EditForm/helper.js +25 -3
  15. package/src/@daf/core/components/Header/hook.js +4 -4
  16. package/src/@daf/core/components/Screens/Admin/AdminModals/CombineLocation/columns.js +3 -3
  17. package/src/@daf/core/components/Screens/Admin/AdminModals/CombineLocation/helper.js +3 -3
  18. package/src/@daf/core/components/Screens/Admin/AdminModals/CombineLocation/index.jsx +3 -3
  19. package/src/@daf/core/components/Screens/Admin/AdminModals/CombineSubjects/columns.js +3 -3
  20. package/src/@daf/core/components/Screens/Admin/AdminModals/CombineSubjects/index.jsx +3 -3
  21. package/src/@daf/core/components/Screens/Admin/AdminTables/LocationTable/column.js +3 -3
  22. package/src/@daf/core/components/Screens/Admin/AdminTables/LocationTable/helper.js +1 -8
  23. package/src/@daf/core/components/Screens/Admin/AdminTables/SubjectsTable/columns.js +3 -3
  24. package/src/@daf/core/components/Screens/Admin/AdminTables/SubjectsTable/helper.js +1 -8
  25. package/src/@daf/core/components/Screens/Admin/AdminViews/ViewLocation/helpers.js +3 -6
  26. package/src/@daf/core/components/Screens/Admin/AdminViews/ViewLocation/index.jsx +2 -2
  27. package/src/@daf/core/components/Screens/Admin/AdminViews/ViewStakeholder/index.jsx +2 -1
  28. package/src/@daf/core/components/ViewForm/components/DataLink/flat.js +11 -1
  29. package/src/@daf/core/components/ViewForm/components/DataLink/index.js +11 -1
  30. package/src/@daf/core/components/ViewForm/components/DataLinkGroup/index.js +11 -1
  31. package/src/@daf/core/components/ViewForm/content.jsx +51 -28
  32. package/src/@daf/core/components/ViewForm/context/index.js +80 -0
  33. package/src/@daf/pages/Dashboards/SelfAssesment/components/AssociatedInformation/columns.js +9 -5
  34. package/src/@daf/pages/Dashboards/SelfAssesment/components/AssociatedInformation/index.jsx +15 -3
  35. package/src/@daf/pages/Dashboards/SelfAssesment/components/OrganisationInformation/columns.js +2 -2
  36. package/src/@daf/pages/Dashboards/SelfAssesment/components/OrganisationInformation/index.jsx +9 -5
  37. package/src/@daf/pages/Dashboards/SelfAssesment/index.jsx +1 -1
  38. package/src/@daf/pages/Edit/index.jsx +1 -0
  39. package/src/@daf/pages/Locations/MineSite/columns.js +5 -5
  40. package/src/@daf/pages/Stakeholders/Operators/columns.js +6 -8
  41. package/src/@daf/pages/View/index.jsx +1 -0
  42. package/src/helpers/adminLevels.js +4 -0
  43. package/src/utils.js +3 -1
  44. package/dist/style/datastake/mapbox-gl.css +0 -330
@@ -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={form?.meta?.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={form?.meta?.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={dataLinkInput?.meta?.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: fullWidth ? "100%" : 700 }}>
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
- <div className="content" style={style}>
381
- {!hasSubSections ? (
382
- renderContent(form)
383
- ) : (
384
- <React.Fragment>
385
- <h1 className="title">{form ? getInputLabel(form, data) : ""}</h1>
386
- <Tabs
387
- className="section-tabs"
388
- items={repeatObjects(groupSections, (key) => {
389
- const section = groupSections[key];
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
- return {
392
- style: { maxHeight: "calc(100vh - 100px)", overflowY: "auto" },
393
- label: (
394
- <span>
395
- {section.icon ? <GetIcon icon={section.icon} /> : null}{" "}
396
- {getInputLabel(section, data)}
397
- </span>
398
- ),
399
- key: key,
400
- tabKey: key,
401
- children: renderContent(groupSections[key], false),
402
- };
403
- })}
404
- />
405
- </React.Fragment>
406
- )}
407
- </div>
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
 
@@ -0,0 +1,80 @@
1
+ import { createContext, useContext } from "react";
2
+
3
+ const ViewContext = createContext({
4
+ user: null,
5
+ isReview: false,
6
+ t: (s) => s,
7
+ errors: {},
8
+ changeErrors: () => { },
9
+ ajaxOptions: {},
10
+ getAppHeader: () => { },
11
+ getApiBaseUrl: () => { },
12
+ changeAjaxOptions: () => { },
13
+ changeAjaxForms: () => { },
14
+ getMainApiUrl: () => { },
15
+ app: null,
16
+ ajaxForms: {},
17
+ query: null,
18
+ goTo: () => { },
19
+ maxWidth: "75%",
20
+ staticWidth: "614px",
21
+ fullWidth: false,
22
+ });
23
+
24
+ export const ViewProvider = ({
25
+ t,
26
+ user,
27
+ ajaxForms,
28
+ isReview,
29
+ children,
30
+ ajaxOptions,
31
+ highlightMandatory,
32
+ getAppHeader,
33
+ getApiBaseUrl,
34
+ changeAjaxOptions,
35
+ getMainApiUrl,
36
+ app,
37
+ query,
38
+ goTo,
39
+ errors,
40
+ changeErrors,
41
+ changeAjaxForms,
42
+ evaluationConfig,
43
+ maxWidth,
44
+ staticWidth,
45
+ fullWidth,
46
+ }) => {
47
+ const values = {
48
+ t,
49
+ errors,
50
+ changeErrors,
51
+ user,
52
+ ajaxForms,
53
+ isReview,
54
+ changeAjaxOptions,
55
+ getMainApiUrl,
56
+ ajaxOptions,
57
+ highlightMandatory,
58
+ app,
59
+ changeAjaxForms,
60
+ getAppHeader,
61
+ getApiBaseUrl,
62
+ query,
63
+ evaluationConfig,
64
+ goTo,
65
+ maxWidth,
66
+ staticWidth,
67
+ fullWidth,
68
+ };
69
+
70
+ return (
71
+ <ViewContext.Provider value={values}>
72
+ {children}
73
+ </ViewContext.Provider>
74
+ );
75
+ }
76
+
77
+ export const useViewContext = () => {
78
+ const values = useContext(ViewContext);
79
+ return values;
80
+ }
@@ -4,6 +4,7 @@ import { renderDateFormatted } from '../../../../../../helpers/Forms.js';
4
4
  import { findOptions, getLinkValue } from '../../../../../../helpers/StringHelper.js';
5
5
  import CustomIcon from '../../../../../core/components/Icon/CustomIcon.jsx';
6
6
  import NavigationAction from '../../../../../core/components/Table/NavigationAction/index.jsx';
7
+ import { getAdminLevelName } from '../../../../../../helpers/adminLevels.js';
7
8
 
8
9
 
9
10
  export const getColumns = ({ t, activeTab, options, user, goTo, getRedirectLink, theme }) =>
@@ -62,7 +63,10 @@ export const getColumns = ({ t, activeTab, options, user, goTo, getRedirectLink,
62
63
  if (all.empty) {
63
64
  return <div className="daf-default-cell" />;
64
65
  }
65
- const label = findOptions(v, options?.categoriesOptions) || "-";
66
+
67
+ const categoriesOptions = [...(options?.categoriesOptions || []), ...(options?.locationCategories || [])]
68
+
69
+ const label = findOptions(v, categoriesOptions) || "-";
66
70
 
67
71
  return (
68
72
  <Tooltip title={label}>{label || "-"}</Tooltip>
@@ -79,7 +83,7 @@ export const getColumns = ({ t, activeTab, options, user, goTo, getRedirectLink,
79
83
  return <div className="daf-default-cell" />;
80
84
  }
81
85
 
82
- const label = findOptions(v, options?.subCategoriesOptionsSbgi) || "-";
86
+ const label = findOptions(v, options?.subCategoriesOptions) || "-";
83
87
 
84
88
  return (
85
89
  <Tooltip title={label}>{label || "-"}</Tooltip>
@@ -113,7 +117,7 @@ export const getColumns = ({ t, activeTab, options, user, goTo, getRedirectLink,
113
117
  return <div className="daf-default-cell" />
114
118
  }
115
119
 
116
- const region = getLinkValue(all?.administrativeLevel1, all?.linking?.SCL);
120
+ const region = getAdminLevelName(all?.linking?.SCL, "level_1");
117
121
 
118
122
  return region ? <Tooltip title={region}>{region}</Tooltip> : '-';
119
123
  },
@@ -128,7 +132,7 @@ export const getColumns = ({ t, activeTab, options, user, goTo, getRedirectLink,
128
132
  return <div className="daf-default-cell" />
129
133
  }
130
134
 
131
- const district = getLinkValue(all?.administrativeLevel2, all?.linking?.SCL);
135
+ const district = getAdminLevelName(all?.linking?.SCL, "level_2");
132
136
 
133
137
  return district ? <Tooltip title={district}>{district}</Tooltip> : '-';
134
138
  },
@@ -167,7 +171,7 @@ export const getColumns = ({ t, activeTab, options, user, goTo, getRedirectLink,
167
171
  },
168
172
  },
169
173
  {
170
- dataIndex: "lastUpdated",
174
+ dataIndex: "lastUpdate",
171
175
  title: t("Last Update"),
172
176
  ellipsis: true,
173
177
  show: true,
@@ -5,6 +5,7 @@ import SearchFilters from '../../../../../core/components/Filters/searchFilters/
5
5
  import DafTable from '../../../../../core/components/Table/index.jsx';
6
6
  import TabsHeader from '../../../../../core/components/Header/TabsHeader/index.jsx';
7
7
  import { getColumns } from './columns.js';
8
+ import { useWidgetFetch } from '../../../../../hooks/useWidgetFetch.js';
8
9
 
9
10
  function AssociatedInformation({
10
11
  t = () => {},
@@ -12,6 +13,7 @@ function AssociatedInformation({
12
13
  goTo = () => {},
13
14
  getRedirectLink = () => {},
14
15
  options = {},
16
+ theme = {},
15
17
  }) {
16
18
  const tabs = [
17
19
  { value: "stakeholders", label: t("Stakeholders") },
@@ -21,11 +23,20 @@ function AssociatedInformation({
21
23
  ];
22
24
  const [activeTab, setActiveTab] = useState("stakeholders");
23
25
 
24
- const data = [];
26
+ const defaultConfig = useMemo(
27
+ () => ({
28
+ basepath: "stakeholder",
29
+ url: "/kyc/associatedInformation",
30
+ }),
31
+ [],
32
+ );
33
+
34
+ const { data, loading } = useWidgetFetch({config: defaultConfig});
35
+ console.log({data})
25
36
 
26
37
  const columns = useMemo(
27
- () => getColumns({ t, isMonitoring: false, activeTab, options, getRedirectLink, user }),
28
- [t, activeTab, options, getRedirectLink, user],
38
+ () => getColumns({ t, isMonitoring: false, activeTab, options, getRedirectLink, user, theme, goTo }),
39
+ [t, activeTab, options, getRedirectLink, user, theme, goTo],
29
40
  );
30
41
 
31
42
  return (
@@ -33,6 +44,7 @@ function AssociatedInformation({
33
44
  title={t("Associated Information")}
34
45
  expandable
35
46
  className="with-border-header no-px-body overflow-hidden"
47
+ loading={loading}
36
48
  >
37
49
  <div style={{ display: "flex", flexDirection: "column", gap: "24px", marginLeft: "12px" }}>
38
50
  <TabsHeader
@@ -33,9 +33,9 @@ export const getColumns = ({
33
33
  if (all.empty) {
34
34
  return <div className="daf-default-cell" />
35
35
  }
36
- const published = false;
36
+ const published = all?.published || false;
37
37
 
38
- return <ProgressBarWithIcon published={published} data={v} t={t} />
38
+ return <ProgressBarWithIcon published={published} data={all} t={t} />
39
39
  }
40
40
  },
41
41
  {
@@ -9,22 +9,25 @@ function OrganisationInformation({
9
9
  goTo = () => {},
10
10
  getRedirectLink = () => {},
11
11
  theme = {},
12
+ data,
13
+ loading,
12
14
  }) {
13
- const organistionInfo = [
15
+ const organisationInfo = [
14
16
  {key: 'kyc', label: t("My KYC")},
15
17
  {key: 'management-systems', label: t("Management Systems")},
16
18
  ]
17
19
 
18
20
  const tableData = useMemo(() => {
19
- return organistionInfo.map((item) => {
21
+ return organisationInfo.map((item) => {
20
22
  return {
21
23
  key: item.key,
22
24
  name: item.label,
23
- completion: 0,
24
- lastUpdate: "",
25
+ completion: data?.data?.[`${item.key}Data`]?.meta?.completion?.percentage || 0,
26
+ lastUpdate: data?.data?.[`${item.key}Data`]?.updatedAt || "",
27
+ ...data?.data?.[`${item.key}Data`],
25
28
  }
26
29
  })
27
- }, [organistionInfo])
30
+ }, [organisationInfo, data])
28
31
 
29
32
  const columns = useMemo(() => {
30
33
  return getColumns({ t, data: tableData, user, goTo, getRedirectLink, theme })
@@ -34,6 +37,7 @@ function OrganisationInformation({
34
37
  <Widget
35
38
  title={t("Organisation Information")}
36
39
  className="with-border-header daf-table-wrapper no-pagination no-px-body"
40
+ loading={loading}
37
41
  >
38
42
  <DAFTable columns={columns} data={tableData} />
39
43
  </Widget>
@@ -32,7 +32,7 @@ function SelfAssesment({
32
32
  <ProductionSites t={t} options={options} user={user} goTo={goTo} getRedirectLink={getRedirectLink} data={data} loading={loading} />
33
33
  </section>
34
34
  <section>
35
- <AssociatedInformation t={t} user={user} goTo={goTo} getRedirectLink={getRedirectLink} data={data} loading={loading} />
35
+ <AssociatedInformation t={t} user={user} goTo={goTo} getRedirectLink={getRedirectLink} data={data} loading={loading} theme={theme} options={options} />
36
36
  </section>
37
37
  </DashboardLayout>
38
38
  )
@@ -331,6 +331,7 @@ const Edit = ({
331
331
  linkingForms={linkingForms}
332
332
  form={selectedForm}
333
333
  data={data}
334
+ fullWidth
334
335
  {...{
335
336
  t,
336
337
  user,
@@ -158,11 +158,6 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
158
158
  goTo(getRedirectLink(link));
159
159
  };
160
160
  const moreMenuItems = [
161
- {
162
- label: t("Details"),
163
- value: "details",
164
- onClick: onClick,
165
- },
166
161
  {
167
162
  label: t("Summary"),
168
163
  value: "Summary",
@@ -175,6 +170,11 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
175
170
  },
176
171
  // disabled: true,
177
172
  },
173
+ {
174
+ label: t("Details"),
175
+ value: "details",
176
+ onClick: onClick,
177
+ },
178
178
  ];
179
179
  return <div >
180
180
  <MoreMenu items={moreMenuItems} />
@@ -162,11 +162,6 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
162
162
  goTo(getRedirectLink(link));
163
163
  };
164
164
  const moreMenuItems = [
165
- {
166
- label: t("Details"),
167
- value: "details",
168
- onClick: onClick,
169
- },
170
165
  {
171
166
  label: t("Summary"),
172
167
  value: "Summary",
@@ -179,10 +174,13 @@ export const getColumns = ({t, goTo, user, options, activeTab, getRedirectLink,
179
174
  },
180
175
  // disabled: true,
181
176
  },
177
+ {
178
+ label: t("Details"),
179
+ value: "details",
180
+ onClick: onClick,
181
+ },
182
182
  ];
183
- return <div >
184
- <MoreMenu items={moreMenuItems} />
185
- </div>;
183
+ return <MoreMenu items={moreMenuItems} />
186
184
  }
187
185
  }
188
186
  ].filter((column) => column.show !== false);
@@ -304,6 +304,7 @@ const View = ({
304
304
  getApiBaseUrl={getApiBaseUrl}
305
305
  getAppHeader={getAppHeader}
306
306
  user={user}
307
+ fullWidth
307
308
  />
308
309
  )}
309
310
  </div>
@@ -0,0 +1,4 @@
1
+ export const getAdminLevelName = (data, level) => {
2
+ const entry = Object.values(data || {}).find(item => item.level === level);
3
+ return entry?.name || "-";
4
+ };
package/src/utils.js CHANGED
@@ -64,4 +64,6 @@ export { renderBreadCrumbs, buildBreadCrumbs as buildBreadCrumbsHelper } from '.
64
64
 
65
65
  export { copyToClipboard } from './helpers/copyToClipboard.js'
66
66
 
67
- export { isArrayOfObjects } from './@daf/utils/arrays.js'
67
+ export { isArrayOfObjects } from './@daf/utils/arrays.js'
68
+
69
+ export { getAdminLevelName } from './helpers/adminLevels.js'