saafe-redirection-flow 2.2.0 → 2.2.1

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/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## [2.2.1](https://gitlab.com/Networth360/saafe-redirection/compare/v2.2.0...v2.2.1) (2025-07-24)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * linked accounts under manual discovery ([e2c0eb1](https://gitlab.com/Networth360/saafe-redirection/commit/e2c0eb18f291b2ddc8e5c6569b99695337e3d560))
7
+ * linked accounts under manual discovery flow ([5eeaa12](https://gitlab.com/Networth360/saafe-redirection/commit/5eeaa127370b6d9cb3c413744e62b9c91ea4579a))
8
+
1
9
  # [2.2.0](https://gitlab.com/Networth360/saafe-redirection/compare/v2.1.0...v2.2.0) (2025-07-16)
2
10
 
3
11
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "saafe-redirection-flow",
3
- "version": "2.2.0",
3
+ "version": "2.2.1",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite",
Binary file
@@ -23,12 +23,16 @@ const LinkedAccountTypeAccordion = ({ category, subType, shouldShowDiscoveryMore
23
23
  const { accountForConsent, setAccountForConsent } = useFipStore();
24
24
  const [open, setOpen] = useState(false);
25
25
 
26
- const toggleBankSelection = (bankId: string) => {
27
- setAccountForConsent(accountForConsent.includes(bankId)
28
- ? accountForConsent.filter(id => id !== bankId)
29
- : [...accountForConsent, bankId]
30
- );
31
- };
26
+ const toggleBankSelection = (bankId: string, event : React.MouseEvent ) => {
27
+ if (event) {
28
+ event.stopPropagation();
29
+ }
30
+
31
+ setAccountForConsent(accountForConsent.includes(bankId)
32
+ ? accountForConsent.filter(id => id !== bankId)
33
+ : [...accountForConsent, bankId]
34
+ );
35
+ };
32
36
 
33
37
  // flattened array for achieving select all functionality
34
38
  const flattenSubType = Object.values(subType || {}).flat();
@@ -57,7 +61,7 @@ const LinkedAccountTypeAccordion = ({ category, subType, shouldShowDiscoveryMore
57
61
  <div>
58
62
  <div className='flex items-center text-stone-400 justify-between gap-2 cursor-pointer'>
59
63
  <div className='flex flex-col justify-center relative'>
60
- <p className="text-md text-stone-500 dark:text-gray-200 font-bold">
64
+ <p className="text-md text-stone-500 dark:text-gray-200 font-semibold">
61
65
  {category === "BANK" ? "Bank Account" : `${category}`}
62
66
  </p>
63
67
  <p className="text-sm text-stone-700 dark:text-gray-400">
@@ -66,7 +70,7 @@ const LinkedAccountTypeAccordion = ({ category, subType, shouldShowDiscoveryMore
66
70
  </div>
67
71
  <div>
68
72
  <ChevronDownIcon
69
- size={20}
73
+ size={18}
70
74
  className={`h-5 w-5 transition-transform duration-300 ${
71
75
  open ? "rotate-180" : "rotate-0"
72
76
  }`}
@@ -75,18 +79,19 @@ const LinkedAccountTypeAccordion = ({ category, subType, shouldShowDiscoveryMore
75
79
  </div>
76
80
  </div>
77
81
  </CollapsibleTrigger>
78
- <CollapsibleContent open={open}>
79
- <div className='flex flex-col gap-2 mt-4'>
80
- <div className="flex justify-between items-center">
81
- <SectionTitle title={"Linked accounts"} rightSection={
82
- open ? (
82
+ <CollapsibleContent open={open}>
83
+ <div className='flex flex-col gap-2 mt-4'>
84
+ <div className="flex justify-between items-center">
85
+ <SectionTitle className='text-sm md:text-sm font-none' title={"Linked accounts"} rightSection={
86
+ open ? (
83
87
  <div className="flex justify-end">
84
88
  <AnimatedButton
85
89
  variant={'text'}
86
90
  size={'text'}
87
91
  className='text-primary'
88
92
  onClick={(e) => {
89
- e.stopPropagation();
93
+ // e.stopPropagation();
94
+ e.preventDefault();
90
95
  handleSelectAll();
91
96
  }}
92
97
  >
@@ -96,56 +101,62 @@ const LinkedAccountTypeAccordion = ({ category, subType, shouldShowDiscoveryMore
96
101
  </AnimatedButton>
97
102
  </div>
98
103
  ) : null
99
- }/>
100
- </div>
101
- {Object.entries(subType || {}).map(([fiType, accounts], index) => {
102
- return (
103
- <div key={fiType}>
104
- <p className="text-stone-400">{fiType}</p>
105
- {accounts.map(account => {
106
- return (
107
- <div className='mt-2 flex flex-col gap-2' key={account.linkRefNumber}>
108
- <OuterCard
109
- selected={accountForConsent.includes(account.linkRefNumber)}
110
- onSelect={() => toggleBankSelection(account.linkRefNumber)}
111
- >
112
- <BankCard
113
- bankName={account.bankName}
114
- image={account.logoUrl}
115
- subText={`${account.accountType} | **${formatAccountNumber(account.maskedAccNumber)}`}
116
- rightSection={
117
- <Checkbox
118
- id={`checkbox-${account.linkRefNumber}`}
119
- checked={accountForConsent.includes(account.linkRefNumber)}
120
- onCheckedChange={() => toggleBankSelection(account.linkRefNumber)}
121
- />
122
- }
123
- />
124
- </OuterCard>
125
- </div>
126
- );
127
- })}
128
- </div>
129
- );
130
- })}
104
+ }/>
131
105
  </div>
132
- {shouldShowDiscoveryMore(category || '') && (
133
- <Button
134
- variant={'outline'}
135
- className='bg-primary-foreground text-primary border-primary hover:bg-primary/10 h-[50px] w-full mt-4'
136
- onClick={() => handleDiscoveryMore(category || '')}
137
- size={'lg'}
138
- >
139
- <div className='flex items-center gap-2 text-md text-primary font-[600] dark:text-muted-secondary'>
140
- <PlusIcon
141
- strokeWidth='2.3'
142
- className='size-5 text-primary dark:text-muted-secondary'
143
- />
144
- {t('discoverMore')}
106
+
107
+ {Object.entries(subType || {}).map(([fiType, accounts], index) => {
108
+ return (
109
+ <div key={fiType}>
110
+ <p className="text-stone-400 text-sm md:text-sm">{fiType}</p>
111
+ {accounts.map(account => {
112
+ const isSelected = accountForConsent.includes(account.linkRefNumber);
113
+
114
+ return (
115
+ <div className='mt-2 flex flex-col gap-2' key={account.linkRefNumber} onClick={() => toggleBankSelection(account.linkRefNumber)}>
116
+ <OuterCard
117
+ selected={isSelected}
118
+ onSelect={() => toggleBankSelection(account.linkRefNumber)}
119
+ >
120
+ <BankCard
121
+ bankName={account.bankName}
122
+ image={account.logoUrl}
123
+ subText={`${account.accountType} | **${formatAccountNumber(account.maskedAccNumber)}`}
124
+ rightSection={
125
+ <Checkbox
126
+ id={`checkbox-${account.linkRefNumber}`}
127
+ checked={isSelected}
128
+ onCheckedChange={() => toggleBankSelection(account.linkRefNumber)}
129
+ onClick={(e) => e.stopPropagation()}
130
+
131
+ />
132
+ }
133
+ />
134
+ </OuterCard>
135
+ </div>
136
+ );
137
+ })}
145
138
  </div>
146
- </Button>
147
- )}
148
- </CollapsibleContent>
139
+ );
140
+ })}
141
+ </div>
142
+
143
+ {shouldShowDiscoveryMore(category || '') && (
144
+ <Button
145
+ variant={'outline'}
146
+ className='bg-primary-foreground text-primary border-primary hover:bg-primary/10 h-[50px] w-full mt-4'
147
+ onClick={() => handleDiscoveryMore(category || '')}
148
+ size={'lg'}
149
+ >
150
+ <div className='flex items-center gap-2 text-md text-primary font-[600] dark:text-muted-secondary'>
151
+ <PlusIcon
152
+ strokeWidth='2.3'
153
+ className='size-5 text-primary dark:text-muted-secondary'
154
+ />
155
+ {t('discoverMore')}
156
+ </div>
157
+ </Button>
158
+ )}
159
+ </ CollapsibleContent>
149
160
  </Collapsible>
150
161
  </div>
151
162
  );
@@ -59,9 +59,10 @@ const AuthGuard = ({ children, requireAuth = true }: AuthGuardProps) => {
59
59
  // }
60
60
  // }
61
61
 
62
- if (decodedInfo.isUserPresent) {
63
- return <Navigate to="/link-accounts/old-user" replace />;
64
- } else if (decodedInfo?.fiTypesRequiredForConsent.length > 0) {
62
+ // if (decodedInfo.isUserPresent) {
63
+ // return <Navigate to="/link-accounts/old-user" replace />;
64
+ // } else
65
+ if (decodedInfo?.fiTypesRequiredForConsent.length > 0) {
65
66
  const fiTypes = extractCategories(decodedInfo?.fiTypesRequiredForConsent);
66
67
  setActiveCategory(fiTypes?.[0]);
67
68
  return <Navigate to={`/link-accounts/${fiTypes?.[0]?.toLowerCase()}`} replace />;
@@ -68,8 +68,11 @@ const AppBar = ({
68
68
  if (currentIndex < categories.length - 1) {
69
69
  // Move to the next category
70
70
  const nextCategory = categories[currentIndex + 1]
71
- setActiveCategory(nextCategory)
71
+
72
72
 
73
+ // setActiveCategory(nextCategory) //BUG : Changing activeCategory to BANK
74
+
75
+
73
76
  // Navigate directly to the next category path for proper step highlighting
74
77
  navigate(`/link-accounts/${nextCategory.toLowerCase()}`, {
75
78
  state: {
@@ -14,9 +14,9 @@ const SectionTitle = ({
14
14
  return (
15
15
  <div className='w-full flex flex-col'>
16
16
  <div
17
- className={`flex items-center gap-4 w-full justify-between ${className}`}
17
+ className={`flex items-center gap-4 w-full justify-between text-sm md:text-lg ${className}`}
18
18
  >
19
- <p className='text-sm md:text-lg font-[600] text-consent-primary dark:text-muted-foreground'>
19
+ <p className='font-[600] text-consent-primary dark:text-muted-foreground'>
20
20
  {title}
21
21
  </p>
22
22
  <div>{rightSection ? rightSection : null}</div>
@@ -6,7 +6,7 @@ import { useRedirectStore } from "@/store/redirect.store";
6
6
  /**
7
7
  * Helper function to extract categories from API response
8
8
  */
9
- const extractCategoriesFromResponse = (data: FipResponseData): string[] => {
9
+ export const extractCategoriesFromResponse = (data: FipResponseData): string[] => {
10
10
  // If response is not an object, return empty array
11
11
  if (!data || typeof data !== "object") return [];
12
12