@thecb/components 5.8.1-beta.4 → 5.8.1-beta.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thecb/components",
3
- "version": "5.8.1-beta.4",
3
+ "version": "5.8.1-beta.5",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -30,8 +30,16 @@ const Obligation = ({
30
30
  inactiveLookupInput = "Account",
31
31
  inactiveLookupValue = ""
32
32
  }) => {
33
- const obligation = obligations[0];
34
- const customAttributes = obligation?.customAttributes ?? {};
33
+ /*
34
+ The value of obligations is always an array. It can contain:
35
+ - A single obligation
36
+ - A group of obligations (a "collection")
37
+
38
+ The top level desc/subdesc for all obligations in a collection is the same
39
+ (Collection accounts look different in the Account Details page)
40
+ */
41
+ const firstObligation = obligations[0];
42
+ const customAttributes = firstObligation?.customAttributes ?? {};
35
43
  const boxShadowValue =
36
44
  "0px 4px 4px rgba(41, 42, 51, 0.1), 0px 1px 1px 2px rgba(41, 42, 51, 0.1);";
37
45
  const activeObligation = (
@@ -40,13 +48,13 @@ const Obligation = ({
40
48
  borderRadius="4px"
41
49
  boxShadow={boxShadowValue}
42
50
  as="section"
43
- aria-label={`${obligation?.description ??
44
- "account"} ${obligation?.subDescription ?? obligationAssocID}`}
51
+ aria-label={`${firstObligation?.description ??
52
+ "account"} ${firstObligation?.subDescription ?? obligationAssocID}`}
45
53
  >
46
54
  <Box background={WHITE}>
47
55
  <Stack childGap="14px">
48
56
  <Box
49
- key={`${obligations?.[0].id}-top`}
57
+ key={`${firstObligation?.id}-top`}
50
58
  padding="0 8px"
51
59
  minWidth="100%"
52
60
  >
@@ -68,8 +76,8 @@ const Obligation = ({
68
76
  />
69
77
  )}
70
78
  <TitleModule
71
- title={obligation?.description}
72
- subtitle={obligation?.subDescription}
79
+ title={firstObligation?.description}
80
+ subtitle={firstObligation?.subDescription}
73
81
  titleColor={BRIGHT_GREY}
74
82
  isMobile={isMobile}
75
83
  />