saafe-redirection-flow 2.2.0 → 2.2.2
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 +15 -0
- package/package.json +1 -1
- package/src/components/LinkedAccountTypeAccordion.tsx +73 -62
- package/src/components/auth/AuthGuard.tsx +4 -3
- package/src/components/title/AppBar.tsx +4 -1
- package/src/components/title/SectionTitle.tsx +2 -2
- package/src/hooks/use-fip-query.ts +1 -1
- package/src/pages/accounts/AccountsToProceed.tsx +520 -413
- package/src/pages/accounts/DiscoverAccount.tsx +127 -100
- package/src/store/fip.store.ts +1 -0
- package/src/utils/removeUnderscore.ts +3 -0
- package/stage-aa-240.zip +0 -0
- package/aa-redirection-1607251826.zip +0 -0
|
@@ -594,111 +594,133 @@ const DiscoverAccount = ({ state, currentCategory }: DiscoverAccountProps) => {
|
|
|
594
594
|
{t('youCanAddUpTo3Numbers')}
|
|
595
595
|
</p>
|
|
596
596
|
</div>
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
597
|
+
{identifiers?.find(i => i.type === 'DOB') ? (
|
|
598
|
+
<>
|
|
599
|
+
<SectionTitle className='mt-6' title={`DOB*`} />
|
|
600
|
+
<div className='flex flex-col gap-1 md:w-[50%] w-full gap-2'>
|
|
601
|
+
<Popover open={isPopoverOpen} onOpenChange={setIsPopoverOpen}>
|
|
602
|
+
<PopoverTrigger asChild>
|
|
603
|
+
<div
|
|
604
|
+
className={`flex h-[56px] w-full items-center justify-between rounded-md border bg-white border-gray-200 dark:border-gray-700 dark:bg-input/30 px-3 py-2 text-muted-foreground cursor-pointer`}
|
|
605
|
+
>
|
|
606
|
+
{/* From backend we are getting data into two types of format */}
|
|
607
|
+
{(() => {
|
|
608
|
+
const rawValue = identifiers.find(i => i.type === 'DOB')?.value || '';
|
|
609
|
+
const dobString = decodeURIComponent(rawValue);
|
|
610
|
+
|
|
611
|
+
let dob: Date | null = null;
|
|
612
|
+
// Check for DD/MM/YYYY format
|
|
613
|
+
if (dobString.includes('/')) {
|
|
614
|
+
const [day, month, year] = dobString.split('/');
|
|
615
|
+
if (!isNaN(Number(day)) && !isNaN(Number(month)) && !isNaN(Number(year))) {
|
|
616
|
+
dob = new Date(Number(year), Number(month) - 1, Number(day));
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
// Else treat as ISO
|
|
620
|
+
else if (!isNaN(Date.parse(dobString))) {
|
|
621
|
+
dob = new Date(dobString);
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
return dob ? (
|
|
625
|
+
<span>
|
|
626
|
+
{dob.toLocaleDateString('en-IN', {
|
|
627
|
+
year: 'numeric',
|
|
628
|
+
month: 'long',
|
|
629
|
+
day: 'numeric'
|
|
630
|
+
})}
|
|
631
|
+
</span>
|
|
632
|
+
) : (
|
|
633
|
+
<span className='text-muted-foreground'>Pick a date</span>
|
|
634
|
+
);
|
|
635
|
+
})()}
|
|
636
|
+
<CalendarIcon
|
|
637
|
+
className={`h-4 w-4 ${decodedInfo?.dob ? 'opacity-30' : 'opacity-50'}`}
|
|
638
|
+
/>
|
|
639
|
+
</div>
|
|
640
|
+
</PopoverTrigger>
|
|
641
|
+
<PopoverContent className='w-auto p-0' align='start'>
|
|
642
|
+
<Calendar
|
|
643
|
+
mode='single'
|
|
644
|
+
captionLayout="dropdown"
|
|
645
|
+
hideNavigation
|
|
646
|
+
components={{
|
|
647
|
+
DropdownNav: (props: DropdownNavProps) => (
|
|
648
|
+
<div className="flex w-full items-center gap-2">{props.children}</div>
|
|
649
|
+
),
|
|
650
|
+
Dropdown: (props: DropdownProps) => (
|
|
651
|
+
<Select
|
|
652
|
+
value={String(props.value)}
|
|
653
|
+
onValueChange={(value) => {
|
|
654
|
+
if (props.onChange) {
|
|
655
|
+
handleCalendarChange(value, props.onChange);
|
|
656
|
+
}
|
|
657
|
+
}}
|
|
658
|
+
>
|
|
659
|
+
<SelectTrigger className="h-8 w-fit font-medium first:grow">
|
|
660
|
+
<SelectValue />
|
|
661
|
+
</SelectTrigger>
|
|
662
|
+
<SelectContent className="max-h-[min(26rem,var(--radix-select-content-available-height))]">
|
|
663
|
+
{props.options?.map(option => (
|
|
664
|
+
<SelectItem
|
|
665
|
+
key={option.value}
|
|
666
|
+
value={String(option.value)}
|
|
667
|
+
disabled={option.disabled}
|
|
668
|
+
>
|
|
669
|
+
{option.label}
|
|
670
|
+
</SelectItem>
|
|
671
|
+
))}
|
|
672
|
+
</SelectContent>
|
|
673
|
+
</Select>
|
|
674
|
+
)
|
|
675
|
+
}}
|
|
676
|
+
selected={(() => {
|
|
677
|
+
const rawValue = identifiers.find(i => i.type === 'DOB')?.value || '';
|
|
678
|
+
const dobString = decodeURIComponent(rawValue);
|
|
679
|
+
if (dobString.includes('/')) {
|
|
680
|
+
const [day, month, year] = dobString.split('/');
|
|
681
|
+
if (!isNaN(Number(day)) && !isNaN(Number(month)) && !isNaN(Number(year))) {
|
|
682
|
+
return new Date(Number(year), Number(month) - 1, Number(day));
|
|
683
|
+
}
|
|
684
|
+
} else if (!isNaN(Date.parse(dobString))) {
|
|
685
|
+
return new Date(dobString);
|
|
686
|
+
}
|
|
687
|
+
return undefined;
|
|
688
|
+
})()}
|
|
689
|
+
onSelect={(date) => {
|
|
690
|
+
if (date) {
|
|
691
|
+
const dateValue = `${String(date.getDate()).padStart(2, '0')}/${String(date.getMonth() + 1).padStart(2, '0')}/${date.getFullYear()}`;
|
|
692
|
+
|
|
693
|
+
const result = [...identifiers];
|
|
694
|
+
const dobIndex = result.findIndex(i => i.type === 'DOB');
|
|
695
|
+
if (dobIndex !== -1) {
|
|
696
|
+
result.splice(dobIndex, 1, {
|
|
697
|
+
...result[dobIndex],
|
|
698
|
+
value: dateValue
|
|
699
|
+
});
|
|
700
|
+
}
|
|
701
|
+
setIdentifiers(result);
|
|
702
|
+
|
|
703
|
+
const { updateIdentifiers } = useRedirectStore.getState();
|
|
704
|
+
updateIdentifiers(undefined, dateValue);
|
|
705
|
+
|
|
706
|
+
setIsPopoverOpen(false);
|
|
707
|
+
}
|
|
708
|
+
}}
|
|
709
|
+
initialFocus
|
|
710
|
+
/>
|
|
711
|
+
</PopoverContent>
|
|
712
|
+
</Popover>
|
|
713
|
+
</div>
|
|
714
|
+
|
|
715
|
+
</>
|
|
716
|
+
) : null}
|
|
717
|
+
|
|
697
718
|
{identifiers?.find(i => i.type == 'PAN') ? (
|
|
698
719
|
<>
|
|
699
720
|
<SectionTitle className='mt-6' title={`PAN*`} />
|
|
700
721
|
<div className='flex flex-col gap-1 md:w-[50%] w-full gap-2'>
|
|
701
722
|
<Input
|
|
723
|
+
maxLength={10}
|
|
702
724
|
type='text'
|
|
703
725
|
className={`h-[56px] bg-white border-gray-200 dark:border-gray-700 text-consent-primary text-md ${validationError.PAN ? 'border-red-500' : ''}`}
|
|
704
726
|
placeholder={`Enter PAN`}
|
|
@@ -717,6 +739,11 @@ const DiscoverAccount = ({ state, currentCategory }: DiscoverAccountProps) => {
|
|
|
717
739
|
...result[panIndex],
|
|
718
740
|
value: panValue
|
|
719
741
|
}
|
|
742
|
+
|
|
743
|
+
|
|
744
|
+
if (panIndex === -1) {
|
|
745
|
+
console.log("Just pretending that I am coding.")
|
|
746
|
+
}
|
|
720
747
|
setIdentifiers(result)
|
|
721
748
|
|
|
722
749
|
// Also update redirect store immediately
|
package/src/store/fip.store.ts
CHANGED
|
@@ -424,6 +424,7 @@ export const useFipStore = create<FipState>()(
|
|
|
424
424
|
name: 'saafe-fip-storage',
|
|
425
425
|
storage: createJSONStorage(() => sessionStorage),
|
|
426
426
|
partialize: state => ({
|
|
427
|
+
// groupedFip: state.groupedFips,
|
|
427
428
|
selectedFips: state.selectedFips,
|
|
428
429
|
activeCategory: state.activeCategory,
|
|
429
430
|
selectedMobileNumber: state.selectedMobileNumber,
|
package/stage-aa-240.zip
ADDED
|
Binary file
|
|
Binary file
|