datastake-daf 0.6.802 → 0.6.804

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.
@@ -12579,7 +12579,7 @@ const mapDataForChainOfCustody = (data = {}, options = {}, goTo = () => {}) => {
12579
12579
  hardcodedData: PropTypes__default["default"].array
12580
12580
  });
12581
12581
 
12582
- const Container$2 = styled__default["default"].div`
12582
+ const Container$1 = styled__default["default"].div`
12583
12583
  height: ${props => props.height || '300px'};
12584
12584
  width: ${props => props.isPdf ? props.width ? props.width : '1000px' : 'calc(100% - 48px)'};
12585
12585
  `;
@@ -12853,7 +12853,7 @@ function LineChart({
12853
12853
  className: "flex flex-1 flex-column justify-content-center",
12854
12854
  children: [/*#__PURE__*/jsxRuntime.jsx("div", {
12855
12855
  className: "flex justify-content-center",
12856
- children: /*#__PURE__*/jsxRuntime.jsx(Container$2, {
12856
+ children: /*#__PURE__*/jsxRuntime.jsx(Container$1, {
12857
12857
  ref: containerRef,
12858
12858
  height: height,
12859
12859
  isPdf: isPdf,
@@ -14767,7 +14767,7 @@ function BarChart({
14767
14767
  className: "flex flex-1 flex-column justify-content-center",
14768
14768
  children: [/*#__PURE__*/jsxRuntime.jsx("div", {
14769
14769
  className: "flex justify-content-center",
14770
- children: /*#__PURE__*/jsxRuntime.jsx(Container$2, {
14770
+ children: /*#__PURE__*/jsxRuntime.jsx(Container$1, {
14771
14771
  ref: containerRef,
14772
14772
  height: height,
14773
14773
  isPdf: isPdf,
@@ -14855,10 +14855,6 @@ const useContributionsGraph = ({
14855
14855
  });
14856
14856
  }, [data, t]);
14857
14857
  const isEmpty = React.useMemo(() => _data?.length === 0, [_data]);
14858
- console.log({
14859
- _data,
14860
- isEmpty
14861
- });
14862
14858
  const chartConfig = React.useMemo(() => {
14863
14859
  return {
14864
14860
  data: _data,
@@ -19333,12 +19329,6 @@ const showHideInput$3 = (input, formsValue, repeatValues) => {
19333
19329
  }
19334
19330
  return true;
19335
19331
  };
19336
- const getNkey = namespace => {
19337
- if (['location', 'scl', 'village', 'event', 'incidents', 'corrective-actions', 'testimonials', 'initiatives', 'victims', 'pictures', 'documents', 'lir', 'sp', 'im', 'sci', 'bpe', 'gm'].includes(namespace)) {
19338
- return 'scoping';
19339
- }
19340
- return namespace;
19341
- };
19342
19332
  const groupSubsections = (form, onlyConf = false) => {
19343
19333
  return Object.keys(form).reduce((f, fKey) => {
19344
19334
  if (form[fKey].subSection) {
@@ -44758,7 +44748,7 @@ function RadialBarChart({
44758
44748
  className: "flex flex-1 flex-column justify-content-center",
44759
44749
  children: [/*#__PURE__*/jsxRuntime.jsx("div", {
44760
44750
  className: "flex justify-content-center",
44761
- children: /*#__PURE__*/jsxRuntime.jsx(Container$2, {
44751
+ children: /*#__PURE__*/jsxRuntime.jsx(Container$1, {
44762
44752
  ref: containerRef,
44763
44753
  isPdf: isPdf
44764
44754
  })
@@ -48536,6 +48526,218 @@ const VegetationContainer = styled__default["default"].div`
48536
48526
  }
48537
48527
  `;
48538
48528
 
48529
+ const getFaunaConfig = () => {
48530
+ return [{
48531
+ img: "/Biodiversity/birds.svg",
48532
+ key: "birds",
48533
+ disabled: "/Biodiversity/birds-default.svg"
48534
+ }, {
48535
+ img: "/Biodiversity/crabs.svg",
48536
+ key: "crabs",
48537
+ disabled: "/Biodiversity/crabs-default.svg"
48538
+ }, {
48539
+ img: "/Biodiversity/cymbium.svg",
48540
+ key: "cymbium",
48541
+ disabled: "/Biodiversity/cymbium-default.svg"
48542
+ }, {
48543
+ img: "/Biodiversity/fish.svg",
48544
+ key: "fish",
48545
+ disabled: "/Biodiversity/fish-default.svg"
48546
+ }, {
48547
+ img: "/Biodiversity/juveniles.svg",
48548
+ key: "juveniles",
48549
+ disabled: "/Biodiversity/juveniles-default.svg"
48550
+ }, {
48551
+ img: "/Biodiversity/mollusks.svg",
48552
+ key: "mollusks",
48553
+ disabled: "/Biodiversity/mollusks-default.svg"
48554
+ }, {
48555
+ img: "/Biodiversity/mongooses.svg",
48556
+ key: "mongooses",
48557
+ disabled: "/Biodiversity/mongooses-default.svg"
48558
+ }, {
48559
+ img: "/Biodiversity/monkeys.svg",
48560
+ key: "monkeys",
48561
+ disabled: "/Biodiversity/monkeys-default.svg"
48562
+ }, {
48563
+ img: "/Biodiversity/oysters.svg",
48564
+ key: "oysters",
48565
+ disabled: "/Biodiversity/oysters-default.svg"
48566
+ }, {
48567
+ img: "/Biodiversity/snails.svg",
48568
+ key: "snails",
48569
+ disabled: "/Biodiversity/snails-default.svg"
48570
+ }];
48571
+ };
48572
+
48573
+ function FaunaWidget({
48574
+ title = "Observed Fauna",
48575
+ faunaPresent = [],
48576
+ filterKeys = null,
48577
+ columnsPerRow = 5,
48578
+ itemWidth = 100,
48579
+ itemHeight = 100,
48580
+ t = key => key,
48581
+ ...props
48582
+ }) {
48583
+ let faunaConfig = getFaunaConfig();
48584
+
48585
+ // Filter to show only specific keys if filterKeys is provided
48586
+ if (filterKeys && Array.isArray(filterKeys)) {
48587
+ faunaConfig = faunaConfig.filter(item => filterKeys.includes(item.key));
48588
+ }
48589
+ return /*#__PURE__*/jsxRuntime.jsx(Widget, {
48590
+ title: title,
48591
+ className: `with-border-header no-p-body`,
48592
+ ...props,
48593
+ children: /*#__PURE__*/jsxRuntime.jsx(FaunaWrapper, {
48594
+ $columnsPerRow: columnsPerRow,
48595
+ children: /*#__PURE__*/jsxRuntime.jsx(FaunaContainer, {
48596
+ $columnsPerRow: columnsPerRow,
48597
+ $itemWidth: itemWidth,
48598
+ $itemHeight: itemHeight,
48599
+ children: faunaConfig.map(item => {
48600
+ // Use colored SVG if the item's key exists in faunaPresent array
48601
+ // Otherwise use default SVG
48602
+ const isPresent = Array.isArray(faunaPresent) && faunaPresent.includes(item.key);
48603
+ const shouldUseColored = isPresent;
48604
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
48605
+ title: t(`straatos::${item.key}`),
48606
+ children: /*#__PURE__*/jsxRuntime.jsx("img", {
48607
+ src: shouldUseColored ? item.img : item.disabled,
48608
+ className: `fauna-item`,
48609
+ alt: item.key
48610
+ }, item.key)
48611
+ }, item.key);
48612
+ })
48613
+ })
48614
+ })
48615
+ });
48616
+ }
48617
+ const FaunaWrapper = styled__default["default"].div`
48618
+ padding: 24px;
48619
+ width: 100%;
48620
+ ${props => props.$columnsPerRow ? `
48621
+ overflow-x: auto;
48622
+ ` : ''}
48623
+ `;
48624
+ const FaunaContainer = styled__default["default"].div`
48625
+ display: grid;
48626
+ grid-template-columns: ${props => props.$columnsPerRow ? `repeat(${props.$columnsPerRow}, 1fr)` : `repeat(auto-fit, minmax(${props.$itemWidth}px, 1fr))`};
48627
+ gap: 24px;
48628
+ width: 100%;
48629
+
48630
+ .fauna-item {
48631
+ width: 100%;
48632
+ aspect-ratio: ${props => props.$itemWidth / props.$itemHeight};
48633
+ border-radius: 7px;
48634
+ flex-shrink: 0;
48635
+ display: block;
48636
+ margin: 0;
48637
+ padding: 0;
48638
+ object-fit: contain;
48639
+ }
48640
+ `;
48641
+
48642
+ const getInvasiveSpeciesConfig = () => {
48643
+ return [{
48644
+ img: "/Biodiversity/spiders.svg",
48645
+ key: "spiders",
48646
+ disabled: "/Biodiversity/spiders-default.svg"
48647
+ }, {
48648
+ img: "/Biodiversity/scale-insects.svg",
48649
+ key: "scaleInsects",
48650
+ disabled: "/Biodiversity/scale-insects-default.svg"
48651
+ }, {
48652
+ img: "/Biodiversity/caterpillars.svg",
48653
+ key: "caterpillars",
48654
+ disabled: "/Biodiversity/caterpillars-default.svg"
48655
+ }, {
48656
+ img: "/Biodiversity/ants.svg",
48657
+ key: "ants",
48658
+ disabled: "/Biodiversity/ants-default.svg"
48659
+ }, {
48660
+ img: "/Biodiversity/unidentified-pests.svg",
48661
+ key: "unidentifiedPests",
48662
+ disabled: "/Biodiversity/unidentified-pests-default.svg"
48663
+ }, {
48664
+ img: "/Biodiversity/others.svg",
48665
+ key: "other",
48666
+ disabled: "/Biodiversity/others-default.svg"
48667
+ }];
48668
+ };
48669
+
48670
+ function InvasiveSpeciesWidget({
48671
+ title = "Invasive Species",
48672
+ invasiveSpecies = [],
48673
+ hasInvasiveSpecies,
48674
+ filterKeys = null,
48675
+ columnsPerRow = 3,
48676
+ itemWidth = 100,
48677
+ itemHeight = 100,
48678
+ t = key => key,
48679
+ ...props
48680
+ }) {
48681
+ let invasiveSpeciesConfig = getInvasiveSpeciesConfig();
48682
+
48683
+ // Filter to show only specific keys if filterKeys is provided
48684
+ if (filterKeys && Array.isArray(filterKeys)) {
48685
+ invasiveSpeciesConfig = invasiveSpeciesConfig.filter(item => filterKeys.includes(item.key));
48686
+ }
48687
+ return /*#__PURE__*/jsxRuntime.jsx(Widget, {
48688
+ title: title,
48689
+ className: `with-border-header no-p-body`,
48690
+ ...props,
48691
+ children: /*#__PURE__*/jsxRuntime.jsx(InvasiveSpeciesWrapper, {
48692
+ $columnsPerRow: columnsPerRow,
48693
+ children: /*#__PURE__*/jsxRuntime.jsx(InvasiveSpeciesContainer, {
48694
+ $columnsPerRow: columnsPerRow,
48695
+ $itemWidth: itemWidth,
48696
+ $itemHeight: itemHeight,
48697
+ children: invasiveSpeciesConfig.map(item => {
48698
+ // If hasInvasiveSpecies is 'no', show all as inactive
48699
+ // If hasInvasiveSpecies is 'yes', show present ones as active
48700
+ const shouldShowAllAsNotPresent = hasInvasiveSpecies === 'no';
48701
+ const isPresent = !shouldShowAllAsNotPresent && Array.isArray(invasiveSpecies) && invasiveSpecies.includes(item.key);
48702
+ const shouldUseColored = isPresent;
48703
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
48704
+ title: t(`straatos::${item.key}`),
48705
+ children: /*#__PURE__*/jsxRuntime.jsx("img", {
48706
+ src: shouldUseColored ? item.img : item.disabled,
48707
+ className: `invasive-species-item`,
48708
+ alt: item.key
48709
+ }, item.key)
48710
+ }, item.key);
48711
+ })
48712
+ })
48713
+ })
48714
+ });
48715
+ }
48716
+ const InvasiveSpeciesWrapper = styled__default["default"].div`
48717
+ padding: 24px;
48718
+ width: 100%;
48719
+ ${props => props.$columnsPerRow ? `
48720
+ overflow-x: auto;
48721
+ ` : ''}
48722
+ `;
48723
+ const InvasiveSpeciesContainer = styled__default["default"].div`
48724
+ display: grid;
48725
+ grid-template-columns: ${props => props.$columnsPerRow ? `repeat(${props.$columnsPerRow}, 1fr)` : `repeat(auto-fit, minmax(${props.$itemWidth}px, 1fr))`};
48726
+ gap: 24px;
48727
+ width: 100%;
48728
+
48729
+ .invasive-species-item {
48730
+ width: 100%;
48731
+ aspect-ratio: ${props => props.$itemWidth / props.$itemHeight};
48732
+ border-radius: 7px;
48733
+ flex-shrink: 0;
48734
+ display: block;
48735
+ margin: 0;
48736
+ padding: 0;
48737
+ object-fit: contain;
48738
+ }
48739
+ `;
48740
+
48539
48741
  const RepeatableGroup = ({
48540
48742
  name = null,
48541
48743
  config = {},
@@ -50293,7 +50495,7 @@ function ColumnChart({
50293
50495
  className: "flex flex-1 flex-column justify-content-center",
50294
50496
  children: [/*#__PURE__*/jsxRuntime.jsx("div", {
50295
50497
  className: "flex justify-content-center",
50296
- children: /*#__PURE__*/jsxRuntime.jsx(Container$2, {
50498
+ children: /*#__PURE__*/jsxRuntime.jsx(Container$1, {
50297
50499
  ref: containerRef,
50298
50500
  height: height,
50299
50501
  isPdf: isPdf,
@@ -50451,7 +50653,7 @@ function DonutPie({
50451
50653
  className: "flex flex-1 flex-column justify-content-center",
50452
50654
  children: [/*#__PURE__*/jsxRuntime.jsx("div", {
50453
50655
  className: "flex justify-content-center",
50454
- children: /*#__PURE__*/jsxRuntime.jsx(Container$2, {
50656
+ children: /*#__PURE__*/jsxRuntime.jsx(Container$1, {
50455
50657
  ref: containerRef,
50456
50658
  style: {
50457
50659
  height
@@ -57359,7 +57561,7 @@ const SeedlingsHeight = ({
57359
57561
  });
57360
57562
  };
57361
57563
 
57362
- const Container$1 = styled__default["default"].div`
57564
+ const Container = styled__default["default"].div`
57363
57565
  display: grid;
57364
57566
  grid-template-columns: repeat(3, 1fr);
57365
57567
  gap: 24px;
@@ -57396,7 +57598,7 @@ const MangroveGrowthAndSurvival = ({
57396
57598
  title: t("Mangrove Growth and Survival"),
57397
57599
  className: "with-border-header h-w-btn-header",
57398
57600
  children: /*#__PURE__*/jsxRuntime.jsxs("section", {
57399
- children: [/*#__PURE__*/jsxRuntime.jsxs(Container$1, {
57601
+ children: [/*#__PURE__*/jsxRuntime.jsxs(Container, {
57400
57602
  children: [/*#__PURE__*/jsxRuntime.jsx(PlantedSpecies, {
57401
57603
  plantedSpecies: activityData?.plantedSpecies,
57402
57604
  mangroveSpecies: options?.mangroveSpecies,
@@ -57442,57 +57644,22 @@ const MangroveGrowthAndSurvival = ({
57442
57644
  });
57443
57645
  };
57444
57646
 
57445
- const FAUNA_KEYS = ['birds', 'juveniles', 'crabs', 'cymbium', 'fish', 'mongooses', 'mollusks', 'monkeys', 'oysters', 'snails', 'caterpillars', 'animal_tracks', 'other'];
57446
- const INVASIVE_SPECIES_KEYS = ['spiders', 'scaleInsects', 'caterpillars', 'unidentifiedPests', 'other'];
57447
- const formatFaunaLabel = key => {
57448
- return key.split('_').map(word => word.charAt(0).toUpperCase() + word.slice(1)).join(' ');
57449
- };
57450
- const formatInvasiveSpeciesLabel = key => {
57451
- return key.replace(/([A-Z])/g, ' $1').split(' ').map(word => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join(' ');
57452
- };
57453
- const createFaunaIndicatorConfig = (key, faunaPresent, t) => {
57454
- const isPresent = Array.isArray(faunaPresent) && faunaPresent.includes(key);
57455
- const label = formatFaunaLabel(key);
57456
- return {
57457
- label: t(label),
57458
- type: isPresent ? 'compliant' : 'notCompliant',
57459
- statusIcon: isPresent ? 'Check' : 'Close',
57460
- statusIconColor: isPresent ? '#12B76A' : '#6C737F',
57461
- statusBadgeBackgroundColor: isPresent ? undefined : '#F9FAFB',
57462
- statusBadgeBorderColor: isPresent ? undefined : '#E5E7EB'
57463
- };
57464
- };
57465
- const createInvasiveSpeciesIndicatorConfig = (key, invasiveSpecies, hasInvasiveSpecies, t) => {
57466
- const shouldShowAllAsNotPresent = hasInvasiveSpecies === 'no';
57467
- const shouldShowRedForPresent = hasInvasiveSpecies === 'yes';
57468
- const isPresent = !shouldShowAllAsNotPresent && Array.isArray(invasiveSpecies) && invasiveSpecies.includes(key);
57469
- const isRedBadge = isPresent && shouldShowRedForPresent;
57470
- const label = formatInvasiveSpeciesLabel(key);
57471
- return {
57472
- label: t(label),
57473
- type: isPresent ? 'compliant' : 'notCompliant',
57474
- statusIcon: isPresent ? 'Check' : 'Close',
57475
- statusIconColor: isRedBadge ? '#D92D20' : isPresent ? '#12B76A' : '#6C737F',
57476
- statusBadgeBackgroundColor: isRedBadge ? '#FEE4E2' : isPresent ? undefined : '#F9FAFB',
57477
- statusBadgeBorderColor: isRedBadge ? '#FDA29B' : isPresent ? undefined : '#E5E7EB'
57478
- };
57479
- };
57480
- const generateFaunaConfig = (faunaPresent, t) => {
57481
- return FAUNA_KEYS.map(key => createFaunaIndicatorConfig(key, faunaPresent, t));
57482
- };
57483
- const generateInvasiveSpeciesConfig = (invasiveSpecies, hasInvasiveSpecies, t) => {
57484
- return INVASIVE_SPECIES_KEYS.map(key => createInvasiveSpeciesIndicatorConfig(key, invasiveSpecies, hasInvasiveSpecies, t));
57485
- };
57486
-
57487
- const Container = styled__default["default"].div`
57488
- display: grid;
57489
- grid-template-columns: 70% 28.5%;
57647
+ const BiodiversityContainer = styled__default["default"].div`
57648
+ display: flex;
57490
57649
  gap: 24px;
57491
57650
  width: 100%;
57651
+
57492
57652
  @media (max-width: 768px) {
57493
- grid-template-columns: 1fr;
57653
+ flex-direction: column;
57494
57654
  }
57495
57655
  `;
57656
+ const FaunaSection = styled__default["default"].section`
57657
+ width: 60%;
57658
+ min-width: 0;
57659
+ `;
57660
+ const InvasiveSpeciesSection = styled__default["default"].section`
57661
+ width: 38.5%;
57662
+ `;
57496
57663
  const BiodiversityAndHabitat = ({
57497
57664
  faunaPresent = [],
57498
57665
  invasiveSpecies = [],
@@ -57500,28 +57667,32 @@ const BiodiversityAndHabitat = ({
57500
57667
  loading = false,
57501
57668
  t = s => s
57502
57669
  }) => {
57503
- const observedFaunaConfig = React.useMemo(() => generateFaunaConfig(faunaPresent, t), [faunaPresent, t]);
57504
- const invasiveSpeciesConfig = React.useMemo(() => generateInvasiveSpeciesConfig(invasiveSpecies, hasInvasiveSpecies, t), [invasiveSpecies, hasInvasiveSpecies, t]);
57505
57670
  return /*#__PURE__*/jsxRuntime.jsx(Widget, {
57506
57671
  title: t("Biodiversity & Habitat"),
57507
57672
  className: "with-border-header h-w-btn-header",
57508
- children: /*#__PURE__*/jsxRuntime.jsx("section", {
57509
- children: /*#__PURE__*/jsxRuntime.jsxs(Container, {
57510
- children: [/*#__PURE__*/jsxRuntime.jsx(ActivityIndicatorsWidget, {
57673
+ children: /*#__PURE__*/jsxRuntime.jsxs(BiodiversityContainer, {
57674
+ children: [/*#__PURE__*/jsxRuntime.jsx(FaunaSection, {
57675
+ children: /*#__PURE__*/jsxRuntime.jsx(FaunaWidget, {
57511
57676
  title: t("Observed Fauna"),
57512
- config: observedFaunaConfig,
57677
+ faunaPresent: faunaPresent,
57678
+ columnsPerRow: 5,
57679
+ itemWidth: 120,
57680
+ itemHeight: 120,
57513
57681
  loading: loading,
57514
- widgetClassName: "h-w-btn-header",
57515
57682
  t: t
57516
- }), /*#__PURE__*/jsxRuntime.jsx(ActivityIndicatorsWidget, {
57683
+ })
57684
+ }), /*#__PURE__*/jsxRuntime.jsx(InvasiveSpeciesSection, {
57685
+ children: /*#__PURE__*/jsxRuntime.jsx(InvasiveSpeciesWidget, {
57517
57686
  title: t("Invasive Species"),
57518
- config: invasiveSpeciesConfig,
57687
+ invasiveSpecies: invasiveSpecies,
57688
+ hasInvasiveSpecies: hasInvasiveSpecies,
57689
+ columnsPerRow: 3,
57690
+ itemWidth: 100,
57691
+ itemHeight: 100,
57519
57692
  loading: loading,
57520
- className: "single-column",
57521
- widgetClassName: "h-w-btn-header",
57522
57693
  t: t
57523
- })]
57524
- })
57694
+ })
57695
+ })]
57525
57696
  })
57526
57697
  });
57527
57698
  };
@@ -57720,39 +57891,40 @@ const usePrepareForm$1 = ({
57720
57891
  const [notFound, setNotFound] = React.useState(false);
57721
57892
  const prepareForm = currentView => {
57722
57893
  const dKey = namespaceConfig?.dataKey;
57723
- const nKey = `${APP}-${currentView}`;
57724
- if (hasKeyInObject(allData, dKey) && hasKeyInObject(allData[dKey], nKey)) {
57894
+ if (hasKeyInObject(allData, dKey)) {
57725
57895
  const {
57726
57896
  form = {},
57727
57897
  data = {},
57728
57898
  config = {},
57729
57899
  linkingForms = {}
57730
- } = JSON.parse(JSON.stringify(allData[dKey][nKey] || {}));
57731
- if (data.datastakeId === id || id === "user" || data.id === id) {
57732
- if (viewConfig.adminNamespaces.includes(namespace)) {
57733
- setForm(form);
57734
- } else {
57735
- setForm({
57736
- ...form,
57737
- linking: {
57738
- position: 100,
57739
- excludeFromEdit: true,
57740
- label: t("Linked Subjects"),
57741
- template: "linkingSubjects"
57742
- }
57743
- });
57744
- }
57745
- setData(data);
57746
- setGroups(config.groups || {});
57747
- setLinkingForms(linkingForms);
57748
- setLoading(false);
57749
- setNotFound(false);
57750
- } else if (!data.id) {
57751
- if (mode === "proxy") {
57752
- window.location.reload();
57753
- } else {
57900
+ } = JSON.parse(JSON.stringify(allData[dKey] || {}));
57901
+ if (Object.keys(form).length > 0) {
57902
+ if (data.datastakeId === id || id === "user" || data.id === id) {
57903
+ if (viewConfig.adminNamespaces.includes(namespace)) {
57904
+ setForm(form);
57905
+ } else {
57906
+ setForm({
57907
+ ...form,
57908
+ linking: {
57909
+ position: 100,
57910
+ excludeFromEdit: true,
57911
+ label: t("Linked Subjects"),
57912
+ template: "linkingSubjects"
57913
+ }
57914
+ });
57915
+ }
57916
+ setData(data);
57917
+ setGroups(config.groups || {});
57918
+ setLinkingForms(linkingForms);
57754
57919
  setLoading(false);
57755
- setNotFound(true);
57920
+ setNotFound(false);
57921
+ } else if (!data.id) {
57922
+ if (mode === "proxy") {
57923
+ window.location.reload();
57924
+ } else {
57925
+ setLoading(false);
57926
+ setNotFound(true);
57927
+ }
57756
57928
  }
57757
57929
  }
57758
57930
  }
@@ -57887,8 +58059,7 @@ const useCallToGetData = ({
57887
58059
  const isFirstRender = React.useRef(true);
57888
58060
  const callToGetData = (_doCall = false) => {
57889
58061
  const dKey = namespaceConfig?.dataKey;
57890
- const nKey = `${APP}-${getNkey(namespace || "")}`;
57891
- const doCall = _doCall ? true : hasKeyInObject(allData, dKey) && hasKeyInObject(allData[dKey], nKey) ? allData[dKey][nKey]?.data?.datastakeId !== id : true;
58062
+ const doCall = _doCall ? true : hasKeyInObject(allData, dKey) ? allData[dKey]?.data?.datastakeId !== id : true;
57892
58063
  if (doCall) {
57893
58064
  if (isSupported) {
57894
58065
  namespaceGet[namespace]();
@@ -58609,19 +58780,6 @@ const View = ({
58609
58780
  const actionButtons = React.useMemo(() => {
58610
58781
  return groupForm?.template === "linkingSubjects" ? pageActions.filter(v => v.key !== "edit") : pageActions;
58611
58782
  }, [groupForm, pageActions]);
58612
- console.log({
58613
- namespaceConfiguration,
58614
- namespaceConfig,
58615
- allData,
58616
- namespace,
58617
- id,
58618
- group,
58619
- subsection,
58620
- version,
58621
- source,
58622
- isSupported,
58623
- notFound
58624
- });
58625
58783
  if (!isSupported || notFound) {
58626
58784
  return /*#__PURE__*/jsxRuntime.jsx(Loading, {});
58627
58785
  }
@@ -58747,16 +58905,15 @@ const usePrepareForm = ({
58747
58905
  const prepareForm = (setExtra = true) => {
58748
58906
  if (isSupported) {
58749
58907
  const dKey = namespaceConfig?.dataKey;
58750
- const nKey = `${APP}-${namespaceConfig?.view}`;
58751
- if (hasKeyInObject(allData, dKey) && hasKeyInObject(allData[dKey], nKey)) {
58752
- const d = JSON.parse(JSON.stringify(allData[dKey][nKey].data || {}));
58908
+ if (hasKeyInObject(allData, dKey)) {
58909
+ const d = JSON.parse(JSON.stringify(allData[dKey].data || {}));
58753
58910
  Object.keys(d).forEach(k => {
58754
58911
  if (d[k] === null) {
58755
58912
  d[k] = undefined;
58756
58913
  }
58757
58914
  });
58758
58915
  if (d.datastakeId === id || d.applicationId === id || id === "user" || d.id === id) {
58759
- const formG = mapFormGroup(allData[dKey][nKey].form || {}, d);
58916
+ const formG = mapFormGroup(allData[dKey].form || {}, d);
58760
58917
  setForm(formG);
58761
58918
  if (setExtra) {
58762
58919
  if ((d || {}).risk && Array.isArray(formG) && formG.find(r => r.id === "risk")) {
@@ -58792,7 +58949,7 @@ const usePrepareForm = ({
58792
58949
  setOriginalData({
58793
58950
  ...d
58794
58951
  });
58795
- setLinkingForms(allData[dKey][nKey].linkingForms);
58952
+ setLinkingForms(allData[dKey].linkingForms);
58796
58953
  setLoading(false);
58797
58954
  return;
58798
58955
  }
@@ -58808,7 +58965,7 @@ const usePrepareForm = ({
58808
58965
  setOriginalData({
58809
58966
  ...d
58810
58967
  });
58811
- setLinkingForms(allData[dKey][nKey].linkingForms);
58968
+ setLinkingForms(allData[dKey].linkingForms);
58812
58969
  setLoading(false);
58813
58970
  }
58814
58971
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "datastake-daf",
3
- "version": "0.6.802",
3
+ "version": "0.6.804",
4
4
  "dependencies": {
5
5
  "@ant-design/icons": "^5.2.5",
6
6
  "@antv/g2": "^5.1.1",
@@ -0,0 +1,38 @@
1
+ <svg width="110" height="110" viewBox="0 0 110 110" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g filter="url(#filter0_ddd_3654_27690)">
3
+ <rect x="5" y="4" width="100" height="100" rx="8" fill="#FCFCFD" shape-rendering="crispEdges"/>
4
+ <rect x="5.5" y="4.5" width="99" height="99" rx="7.5" stroke="#F9FAFB" shape-rendering="crispEdges"/>
5
+ <path d="M55 45.25C55.9665 45.25 56.75 44.4665 56.75 43.5C56.75 42.5335 55.9665 41.75 55 41.75C54.0335 41.75 53.25 42.5335 53.25 43.5C53.25 44.4665 54.0335 45.25 55 45.25Z" fill="#E5E7EB"/>
6
+ <path d="M67.25 45.25C68.2165 45.25 69 44.4665 69 43.5C69 42.5335 68.2165 41.75 67.25 41.75C66.2835 41.75 65.5 42.5335 65.5 43.5C65.5 44.4665 66.2835 45.25 67.25 45.25Z" fill="#E5E7EB"/>
7
+ <path d="M42.75 45.25C43.7165 45.25 44.5 44.4665 44.5 43.5C44.5 42.5335 43.7165 41.75 42.75 41.75C41.7835 41.75 41 42.5335 41 43.5C41 44.4665 41.7835 45.25 42.75 45.25Z" fill="#E5E7EB"/>
8
+ <path d="M55 45.25C55.9665 45.25 56.75 44.4665 56.75 43.5C56.75 42.5335 55.9665 41.75 55 41.75C54.0335 41.75 53.25 42.5335 53.25 43.5C53.25 44.4665 54.0335 45.25 55 45.25Z" stroke="#E5E7EB" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
9
+ <path d="M67.25 45.25C68.2165 45.25 69 44.4665 69 43.5C69 42.5335 68.2165 41.75 67.25 41.75C66.2835 41.75 65.5 42.5335 65.5 43.5C65.5 44.4665 66.2835 45.25 67.25 45.25Z" stroke="#E5E7EB" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
10
+ <path d="M42.75 45.25C43.7165 45.25 44.5 44.4665 44.5 43.5C44.5 42.5335 43.7165 41.75 42.75 41.75C41.7835 41.75 41 42.5335 41 43.5C41 44.4665 41.7835 45.25 42.75 45.25Z" stroke="#E5E7EB" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
11
+ <path d="M39.0586 71.4717C41.8955 71.4717 43.6797 73.4336 43.6797 76.5713C43.6797 79.709 41.8955 81.6641 39.0586 81.6641C36.2148 81.6641 34.4375 79.709 34.4375 76.5713C34.4375 73.4336 36.2148 71.4717 39.0586 71.4717ZM39.0586 72.8184C37.1855 72.8184 36.0029 74.2676 36.0029 76.5713C36.0029 78.8682 37.1855 80.3174 39.0586 80.3174C40.9316 80.3174 42.1074 78.8682 42.1074 76.5713C42.1074 74.2676 40.9316 72.8184 39.0586 72.8184ZM45.4365 72.4082H46.9131V74.0762H48.335V75.2451H46.9131V79.3945C46.9131 80.0371 47.2002 80.3379 47.8223 80.3379C47.9795 80.3379 48.2324 80.3174 48.3281 80.3037V81.4727C48.1641 81.5137 47.8154 81.5479 47.4941 81.5479C46.0107 81.5479 45.4365 80.9805 45.4365 79.5449V75.2451H44.4111V74.0762H45.4365V72.4082ZM49.6475 81.5V71.1914H51.1172V75.3271H51.1514C51.5957 74.4521 52.3613 73.9941 53.4961 73.9941C55.1299 73.9941 56.1074 75.0811 56.1074 76.7559V81.5H54.624V77.043C54.624 75.9355 54.0703 75.2656 52.9834 75.2656C51.8281 75.2656 51.1309 76.0586 51.1309 77.248V81.5H49.6475ZM60.6875 75.1904C59.6211 75.1904 58.8486 75.9697 58.7666 77.1113H62.5332C62.499 75.9561 61.7676 75.1904 60.6875 75.1904ZM62.5264 79.3262H63.9414C63.7295 80.6592 62.4238 81.5889 60.7559 81.5889C58.6025 81.5889 57.2627 80.1396 57.2627 77.8154C57.2627 75.4912 58.6162 73.9805 60.6943 73.9805C62.7314 73.9805 64.0166 75.3955 64.0166 77.6445V78.1641H58.7598V78.2529C58.7598 79.5381 59.5664 80.3857 60.7832 80.3857C61.6445 80.3857 62.3213 79.9756 62.5264 79.3262ZM65.2129 81.5V74.0762H66.6279V75.3271H66.6553C66.8877 74.5 67.5713 74.001 68.4463 74.001C68.665 74.001 68.8496 74.0215 68.9658 74.0488V75.4365C68.8428 75.3887 68.583 75.3477 68.2891 75.3477C67.3115 75.3477 66.6963 76.0244 66.6963 77.0703V81.5H65.2129ZM69.793 76.1885C69.793 74.8828 70.9619 73.9873 72.6709 73.9873C74.2979 73.9873 75.4736 74.9033 75.5078 76.1953H74.1133C74.0518 75.5391 73.4844 75.1289 72.6367 75.1289C71.7959 75.1289 71.2354 75.5186 71.2354 76.1064C71.2354 76.5576 71.6045 76.8652 72.3906 77.0566L73.6211 77.3506C75.1182 77.7129 75.6719 78.2529 75.6719 79.3467C75.6719 80.6729 74.4141 81.5889 72.6162 81.5889C70.8867 81.5889 69.7041 80.6934 69.5947 79.3535H71.0576C71.1738 80.0645 71.748 80.4541 72.6914 80.4541C73.6143 80.4541 74.1953 80.0713 74.1953 79.4697C74.1953 78.998 73.9014 78.752 73.1221 78.5537L71.7959 78.2256C70.4561 77.8975 69.793 77.2139 69.793 76.1885Z" fill="#D2D6DB"/>
12
+ </g>
13
+ <defs>
14
+ <filter id="filter0_ddd_3654_27690" x="0" y="0" width="110" height="110" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
15
+ <feFlood flood-opacity="0" result="BackgroundImageFix"/>
16
+ <feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
17
+ <feOffset dy="1"/>
18
+ <feGaussianBlur stdDeviation="1"/>
19
+ <feComposite in2="hardAlpha" operator="out"/>
20
+ <feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0"/>
21
+ <feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_3654_27690"/>
22
+ <feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
23
+ <feMorphology radius="1" operator="erode" in="SourceAlpha" result="effect2_dropShadow_3654_27690"/>
24
+ <feOffset dy="1"/>
25
+ <feGaussianBlur stdDeviation="3"/>
26
+ <feComposite in2="hardAlpha" operator="out"/>
27
+ <feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.02 0"/>
28
+ <feBlend mode="normal" in2="effect1_dropShadow_3654_27690" result="effect2_dropShadow_3654_27690"/>
29
+ <feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
30
+ <feOffset dy="2"/>
31
+ <feGaussianBlur stdDeviation="2"/>
32
+ <feComposite in2="hardAlpha" operator="out"/>
33
+ <feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.02 0"/>
34
+ <feBlend mode="normal" in2="effect2_dropShadow_3654_27690" result="effect3_dropShadow_3654_27690"/>
35
+ <feBlend mode="normal" in="SourceGraphic" in2="effect3_dropShadow_3654_27690" result="shape"/>
36
+ </filter>
37
+ </defs>
38
+ </svg>
@@ -0,0 +1,38 @@
1
+ <svg width="110" height="110" viewBox="0 0 110 110" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g filter="url(#filter0_ddd_3654_27691)">
3
+ <rect x="5" y="4" width="100" height="100" rx="8" fill="white" shape-rendering="crispEdges"/>
4
+ <rect x="5.5" y="4.5" width="99" height="99" rx="7.5" stroke="#E5E7EB" shape-rendering="crispEdges"/>
5
+ <path d="M55 45.25C55.9665 45.25 56.75 44.4665 56.75 43.5C56.75 42.5335 55.9665 41.75 55 41.75C54.0335 41.75 53.25 42.5335 53.25 43.5C53.25 44.4665 54.0335 45.25 55 45.25Z" fill="#00AEB1"/>
6
+ <path d="M67.25 45.25C68.2165 45.25 69 44.4665 69 43.5C69 42.5335 68.2165 41.75 67.25 41.75C66.2835 41.75 65.5 42.5335 65.5 43.5C65.5 44.4665 66.2835 45.25 67.25 45.25Z" fill="#00AEB1"/>
7
+ <path d="M42.75 45.25C43.7165 45.25 44.5 44.4665 44.5 43.5C44.5 42.5335 43.7165 41.75 42.75 41.75C41.7835 41.75 41 42.5335 41 43.5C41 44.4665 41.7835 45.25 42.75 45.25Z" fill="#00AEB1"/>
8
+ <path d="M55 45.25C55.9665 45.25 56.75 44.4665 56.75 43.5C56.75 42.5335 55.9665 41.75 55 41.75C54.0335 41.75 53.25 42.5335 53.25 43.5C53.25 44.4665 54.0335 45.25 55 45.25Z" stroke="#00AEB1" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
9
+ <path d="M67.25 45.25C68.2165 45.25 69 44.4665 69 43.5C69 42.5335 68.2165 41.75 67.25 41.75C66.2835 41.75 65.5 42.5335 65.5 43.5C65.5 44.4665 66.2835 45.25 67.25 45.25Z" stroke="#00AEB1" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
10
+ <path d="M42.75 45.25C43.7165 45.25 44.5 44.4665 44.5 43.5C44.5 42.5335 43.7165 41.75 42.75 41.75C41.7835 41.75 41 42.5335 41 43.5C41 44.4665 41.7835 45.25 42.75 45.25Z" stroke="#00AEB1" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
11
+ <path d="M39.0586 71.4717C41.8955 71.4717 43.6797 73.4336 43.6797 76.5713C43.6797 79.709 41.8955 81.6641 39.0586 81.6641C36.2148 81.6641 34.4375 79.709 34.4375 76.5713C34.4375 73.4336 36.2148 71.4717 39.0586 71.4717ZM39.0586 72.8184C37.1855 72.8184 36.0029 74.2676 36.0029 76.5713C36.0029 78.8682 37.1855 80.3174 39.0586 80.3174C40.9316 80.3174 42.1074 78.8682 42.1074 76.5713C42.1074 74.2676 40.9316 72.8184 39.0586 72.8184ZM45.4365 72.4082H46.9131V74.0762H48.335V75.2451H46.9131V79.3945C46.9131 80.0371 47.2002 80.3379 47.8223 80.3379C47.9795 80.3379 48.2324 80.3174 48.3281 80.3037V81.4727C48.1641 81.5137 47.8154 81.5479 47.4941 81.5479C46.0107 81.5479 45.4365 80.9805 45.4365 79.5449V75.2451H44.4111V74.0762H45.4365V72.4082ZM49.6475 81.5V71.1914H51.1172V75.3271H51.1514C51.5957 74.4521 52.3613 73.9941 53.4961 73.9941C55.1299 73.9941 56.1074 75.0811 56.1074 76.7559V81.5H54.624V77.043C54.624 75.9355 54.0703 75.2656 52.9834 75.2656C51.8281 75.2656 51.1309 76.0586 51.1309 77.248V81.5H49.6475ZM60.6875 75.1904C59.6211 75.1904 58.8486 75.9697 58.7666 77.1113H62.5332C62.499 75.9561 61.7676 75.1904 60.6875 75.1904ZM62.5264 79.3262H63.9414C63.7295 80.6592 62.4238 81.5889 60.7559 81.5889C58.6025 81.5889 57.2627 80.1396 57.2627 77.8154C57.2627 75.4912 58.6162 73.9805 60.6943 73.9805C62.7314 73.9805 64.0166 75.3955 64.0166 77.6445V78.1641H58.7598V78.2529C58.7598 79.5381 59.5664 80.3857 60.7832 80.3857C61.6445 80.3857 62.3213 79.9756 62.5264 79.3262ZM65.2129 81.5V74.0762H66.6279V75.3271H66.6553C66.8877 74.5 67.5713 74.001 68.4463 74.001C68.665 74.001 68.8496 74.0215 68.9658 74.0488V75.4365C68.8428 75.3887 68.583 75.3477 68.2891 75.3477C67.3115 75.3477 66.6963 76.0244 66.6963 77.0703V81.5H65.2129ZM69.793 76.1885C69.793 74.8828 70.9619 73.9873 72.6709 73.9873C74.2979 73.9873 75.4736 74.9033 75.5078 76.1953H74.1133C74.0518 75.5391 73.4844 75.1289 72.6367 75.1289C71.7959 75.1289 71.2354 75.5186 71.2354 76.1064C71.2354 76.5576 71.6045 76.8652 72.3906 77.0566L73.6211 77.3506C75.1182 77.7129 75.6719 78.2529 75.6719 79.3467C75.6719 80.6729 74.4141 81.5889 72.6162 81.5889C70.8867 81.5889 69.7041 80.6934 69.5947 79.3535H71.0576C71.1738 80.0645 71.748 80.4541 72.6914 80.4541C73.6143 80.4541 74.1953 80.0713 74.1953 79.4697C74.1953 78.998 73.9014 78.752 73.1221 78.5537L71.7959 78.2256C70.4561 77.8975 69.793 77.2139 69.793 76.1885Z" fill="#6C737F"/>
12
+ </g>
13
+ <defs>
14
+ <filter id="filter0_ddd_3654_27691" x="0" y="0" width="110" height="110" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
15
+ <feFlood flood-opacity="0" result="BackgroundImageFix"/>
16
+ <feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
17
+ <feOffset dy="1"/>
18
+ <feGaussianBlur stdDeviation="1"/>
19
+ <feComposite in2="hardAlpha" operator="out"/>
20
+ <feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0"/>
21
+ <feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_3654_27691"/>
22
+ <feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
23
+ <feMorphology radius="1" operator="erode" in="SourceAlpha" result="effect2_dropShadow_3654_27691"/>
24
+ <feOffset dy="1"/>
25
+ <feGaussianBlur stdDeviation="3"/>
26
+ <feComposite in2="hardAlpha" operator="out"/>
27
+ <feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.02 0"/>
28
+ <feBlend mode="normal" in2="effect1_dropShadow_3654_27691" result="effect2_dropShadow_3654_27691"/>
29
+ <feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
30
+ <feOffset dy="2"/>
31
+ <feGaussianBlur stdDeviation="2"/>
32
+ <feComposite in2="hardAlpha" operator="out"/>
33
+ <feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.02 0"/>
34
+ <feBlend mode="normal" in2="effect2_dropShadow_3654_27691" result="effect3_dropShadow_3654_27691"/>
35
+ <feBlend mode="normal" in="SourceGraphic" in2="effect3_dropShadow_3654_27691" result="shape"/>
36
+ </filter>
37
+ </defs>
38
+ </svg>