@rolatech/angular-onboarding 20.3.0-beta.2 → 20.3.0-beta.4
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/README.md +1 -1
- package/fesm2022/rolatech-angular-onboarding-admin-onboarding-detail-page-DREEMvoT.mjs +720 -0
- package/fesm2022/rolatech-angular-onboarding-admin-onboarding-detail-page-DREEMvoT.mjs.map +1 -0
- package/fesm2022/rolatech-angular-onboarding-admin-onboarding-index-page-DP7wffLd.mjs +313 -0
- package/fesm2022/rolatech-angular-onboarding-admin-onboarding-index-page-DP7wffLd.mjs.map +1 -0
- package/fesm2022/rolatech-angular-onboarding-agent-apply-form-page-y02hYlN_.mjs +446 -0
- package/fesm2022/rolatech-angular-onboarding-agent-apply-form-page-y02hYlN_.mjs.map +1 -0
- package/fesm2022/rolatech-angular-onboarding-agent-apply-result-page-CEL4nWb_.mjs +141 -0
- package/fesm2022/rolatech-angular-onboarding-agent-apply-result-page-CEL4nWb_.mjs.map +1 -0
- package/fesm2022/rolatech-angular-onboarding-agent-apply-review-page-DG_D03YW.mjs +453 -0
- package/fesm2022/rolatech-angular-onboarding-agent-apply-review-page-DG_D03YW.mjs.map +1 -0
- package/fesm2022/{rolatech-angular-onboarding-agent-apply-shell-page-DibWYeD1.mjs → rolatech-angular-onboarding-agent-apply-shell-page-CaTvnFzk.mjs} +27 -40
- package/fesm2022/rolatech-angular-onboarding-agent-apply-shell-page-CaTvnFzk.mjs.map +1 -0
- package/fesm2022/{rolatech-angular-onboarding-agent-apply-start-page-DC7gyOnS.mjs → rolatech-angular-onboarding-agent-apply-start-page-BfqO2YWB.mjs} +31 -29
- package/fesm2022/rolatech-angular-onboarding-agent-apply-start-page-BfqO2YWB.mjs.map +1 -0
- package/fesm2022/{rolatech-angular-onboarding-agent-onboarding-documents-page-DWBGTj5J.mjs → rolatech-angular-onboarding-agent-onboarding-documents-page-BKDYZE0e.mjs} +79 -6
- package/fesm2022/rolatech-angular-onboarding-agent-onboarding-documents-page-BKDYZE0e.mjs.map +1 -0
- package/fesm2022/rolatech-angular-onboarding.mjs +2251 -233
- package/fesm2022/rolatech-angular-onboarding.mjs.map +1 -1
- package/package.json +1 -1
- package/types/rolatech-angular-onboarding.d.ts +219 -12
- package/fesm2022/rolatech-angular-onboarding-admin-onboarding-detail-page-DKJQX3cs.mjs +0 -224
- package/fesm2022/rolatech-angular-onboarding-admin-onboarding-detail-page-DKJQX3cs.mjs.map +0 -1
- package/fesm2022/rolatech-angular-onboarding-admin-onboarding-index-page-BO4pC_NU.mjs +0 -206
- package/fesm2022/rolatech-angular-onboarding-admin-onboarding-index-page-BO4pC_NU.mjs.map +0 -1
- package/fesm2022/rolatech-angular-onboarding-agent-apply-banking-page-VYNfR4fy.mjs +0 -133
- package/fesm2022/rolatech-angular-onboarding-agent-apply-banking-page-VYNfR4fy.mjs.map +0 -1
- package/fesm2022/rolatech-angular-onboarding-agent-apply-financial-page-Ck3Rowke.mjs +0 -132
- package/fesm2022/rolatech-angular-onboarding-agent-apply-financial-page-Ck3Rowke.mjs.map +0 -1
- package/fesm2022/rolatech-angular-onboarding-agent-apply-profile-page-DNepDxHu.mjs +0 -122
- package/fesm2022/rolatech-angular-onboarding-agent-apply-profile-page-DNepDxHu.mjs.map +0 -1
- package/fesm2022/rolatech-angular-onboarding-agent-apply-qualification-page-CSwupuKt.mjs +0 -108
- package/fesm2022/rolatech-angular-onboarding-agent-apply-qualification-page-CSwupuKt.mjs.map +0 -1
- package/fesm2022/rolatech-angular-onboarding-agent-apply-review-page-DugCjfvK.mjs +0 -182
- package/fesm2022/rolatech-angular-onboarding-agent-apply-review-page-DugCjfvK.mjs.map +0 -1
- package/fesm2022/rolatech-angular-onboarding-agent-apply-shell-page-DibWYeD1.mjs.map +0 -1
- package/fesm2022/rolatech-angular-onboarding-agent-apply-start-page-DC7gyOnS.mjs.map +0 -1
- package/fesm2022/rolatech-angular-onboarding-agent-apply-submitted-page-BMkV2V8K.mjs +0 -55
- package/fesm2022/rolatech-angular-onboarding-agent-apply-submitted-page-BMkV2V8K.mjs.map +0 -1
- package/fesm2022/rolatech-angular-onboarding-agent-onboarding-documents-page-DWBGTj5J.mjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rolatech-angular-onboarding-agent-apply-shell-page-CaTvnFzk.mjs","sources":["../../../../packages/angular-onboarding/src/lib/pages/agent-apply/agent-apply-shell-page.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, effect, inject, ViewEncapsulation } from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { ActivatedRoute, Router, RouterOutlet } from '@angular/router';\nimport { map, startWith } from 'rxjs';\nimport { OnboardingPageShell } from '../../components/onboarding/onboarding-page-shell';\nimport { OnboardingStatusBadge } from '../../components/onboarding/onboarding-status-badge';\nimport { OnboardingStepNav } from '../../components/onboarding/onboarding-step-nav';\nimport { ApplyStepNavItem } from '../../models/onboarding-ui.models';\nimport { AgentApplyFacade } from '../../store/agent-apply.facade';\n\n@Component({\n selector: 'rolatech-agent-apply-shell-page',\n standalone: true,\n imports: [RouterOutlet, OnboardingPageShell, OnboardingStatusBadge, OnboardingStepNav],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: { class: 'block' },\n template: `\n <rolatech-onboarding-page-shell\n title=\"PrimeCasa Agent Application\"\n subtitle=\"Complete the onboarding form, review the submission package, and then send it for manual approval.\"\n kicker=\"Public Apply\"\n >\n <div header-actions>\n <rolatech-onboarding-status-badge [status]=\"facade.status()\" />\n </div>\n\n <rolatech-onboarding-step-nav [steps]=\"steps()\" [activeStep]=\"activeStep()\" />\n\n @if (facade.error()) {\n <div class=\"rounded-2xl border border-(--rt-border-color) bg-(--rt-raised-background) px-4 py-3 text-sm text-rose-700\">\n {{ facade.error() }}\n </div>\n }\n\n @if (!facade.detail() && facade.loading()) {\n <div class=\"rounded-2xl border border-(--rt-border-color) bg-(--rt-base-background) px-4 py-6 text-sm text-(--rt-text-secondary) shadow-sm\">Loading application...</div>\n }\n\n <router-outlet />\n </rolatech-onboarding-page-shell>\n `,\n})\nexport class AgentApplyShellPage {\n readonly facade = inject(AgentApplyFacade);\n private readonly route = inject(ActivatedRoute);\n private readonly router = inject(Router);\n\n private readonly paramMap = toSignal(this.route.paramMap, {\n initialValue: this.route.snapshot.paramMap,\n });\n\n private readonly currentUrl = toSignal(\n this.router.events.pipe(\n startWith(null),\n map(() => this.router.url),\n ),\n {\n initialValue: this.router.url,\n },\n );\n\n readonly activeStep = computed(() => {\n const parts = this.currentUrl().split('/').filter(Boolean);\n const maybeStep = parts[parts.length - 1] ?? '';\n switch (maybeStep) {\n case 'form':\n case 'review':\n case 'result':\n return maybeStep;\n case 'profile':\n case 'qualification':\n case 'financial':\n case 'banking':\n return 'form';\n case 'submitted':\n return 'result';\n default:\n return 'form';\n }\n });\n\n readonly steps = computed<ApplyStepNavItem[]>(() => {\n const completion = this.facade.completion();\n\n return [\n {\n label: 'Application',\n step: 'form',\n link: ['form'],\n completed: completion.form,\n accessible: this.facade.canAccessStep('form'),\n },\n {\n label: 'Review',\n step: 'review',\n link: ['review'],\n completed: completion.form,\n accessible: this.facade.canAccessStep('review'),\n },\n {\n label: 'Result',\n step: 'result',\n link: ['result'],\n completed: this.facade.canAccessStep('result'),\n accessible: this.facade.canAccessStep('result'),\n },\n ];\n });\n\n constructor() {\n effect(() => {\n const applicationId = this.paramMap().get('applicationId');\n\n if (!applicationId) {\n return;\n }\n\n void this.facade.ensureLoaded(applicationId);\n });\n }\n}\n"],"names":[],"mappings":";;;;;;;MA2Ca,mBAAmB,CAAA;AACrB,IAAA,MAAM,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACzB,IAAA,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC;AAC9B,IAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;IAEvB,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAA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plyStartPage {
|
|
|
25
25
|
if (!response) {
|
|
26
26
|
return;
|
|
27
27
|
}
|
|
28
|
-
await this.router.navigate([response.id, '
|
|
28
|
+
await this.router.navigate([response.id, 'form'], {
|
|
29
29
|
relativeTo: this.route,
|
|
30
30
|
});
|
|
31
31
|
}
|
|
@@ -33,27 +33,26 @@ class AgentApplyStartPage {
|
|
|
33
33
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.1", type: AgentApplyStartPage, isStandalone: true, selector: "rolatech-agent-apply-start-page", host: { classAttribute: "block" }, providers: [AgentApplyFacade], ngImport: i0, template: `
|
|
34
34
|
<rolatech-onboarding-page-shell
|
|
35
35
|
title="Apply to Join PrimeCasa"
|
|
36
|
-
subtitle="
|
|
36
|
+
subtitle="Choose the applicant profile you are applying under. The onboarding form will adapt to the rules for your identity type and operating region."
|
|
37
37
|
kicker="Public Apply"
|
|
38
38
|
>
|
|
39
|
-
<form [formGroup]="form" class="rounded-
|
|
40
|
-
<div class="
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
<input formControlName="applicationId" class="h-11 rounded-xl border border-(--rt-border-color) px-3" />
|
|
44
|
-
</label>
|
|
39
|
+
<form [formGroup]="form" class="space-y-6 rounded-3xl border border-(--rt-border-color) bg-(--rt-base-background) p-6 shadow-sm">
|
|
40
|
+
<div class="rounded-2xl border border-(--rt-border-color) bg-(--rt-raised-background) px-4 py-3 text-sm text-(--rt-text-primary)">
|
|
41
|
+
You can complete the application as a draft, leave the page, and continue later. Required document and VAT rules will change based on the choices below.
|
|
42
|
+
</div>
|
|
45
43
|
|
|
46
|
-
|
|
44
|
+
<div class="grid gap-4 md:grid-cols-2">
|
|
45
|
+
<label class="grid gap-2 md:col-span-2">
|
|
47
46
|
<span class="text-sm font-medium text-(--rt-text-secondary)">Applicant Type</span>
|
|
48
|
-
<select formControlName="applicantType" class="h-11 rounded-xl border border-(--rt-border-color) px-3">
|
|
47
|
+
<select formControlName="applicantType" class="h-11 rounded-xl border border-(--rt-border-color) bg-(--rt-raised-background) px-3 text-(--rt-text-primary)">
|
|
49
48
|
<option value="INDIVIDUAL">Individual</option>
|
|
50
|
-
<option value="COMPANY">
|
|
49
|
+
<option value="COMPANY">Corporate Partner</option>
|
|
51
50
|
</select>
|
|
52
51
|
</label>
|
|
53
52
|
|
|
54
53
|
<label class="grid gap-2 md:col-span-2">
|
|
55
54
|
<span class="text-sm font-medium text-(--rt-text-secondary)">Company Country</span>
|
|
56
|
-
<select formControlName="companyCountry" class="h-11 rounded-xl border border-(--rt-border-color) px-3">
|
|
55
|
+
<select formControlName="companyCountry" class="h-11 rounded-xl border border-(--rt-border-color) bg-(--rt-raised-background) px-3 text-(--rt-text-primary)">
|
|
57
56
|
<option value="UK">United Kingdom</option>
|
|
58
57
|
<option value="CN">China</option>
|
|
59
58
|
<option value="OTHER">Other</option>
|
|
@@ -62,7 +61,9 @@ class AgentApplyStartPage {
|
|
|
62
61
|
</div>
|
|
63
62
|
|
|
64
63
|
@if (facade.error()) {
|
|
65
|
-
<p class="mt-4 rounded-xl border border-
|
|
64
|
+
<p class="mt-4 rounded-xl border border-(--rt-border-color) bg-(--rt-raised-background) px-3 py-2 text-sm text-rose-700">
|
|
65
|
+
{{ facade.error() }}
|
|
66
|
+
</p>
|
|
66
67
|
}
|
|
67
68
|
|
|
68
69
|
<div class="mt-6 flex justify-end">
|
|
@@ -72,12 +73,12 @@ class AgentApplyStartPage {
|
|
|
72
73
|
[disabled]="form.invalid || facade.loading()"
|
|
73
74
|
(click)="onStart()"
|
|
74
75
|
>
|
|
75
|
-
Create Application
|
|
76
|
+
Create Application Draft
|
|
76
77
|
</button>
|
|
77
78
|
</div>
|
|
78
79
|
</form>
|
|
79
80
|
</rolatech-onboarding-page-shell>
|
|
80
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.
|
|
81
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: OnboardingPageShell, selector: "rolatech-onboarding-page-shell", inputs: ["title", "subtitle", "kicker"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
81
82
|
}
|
|
82
83
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: AgentApplyStartPage, decorators: [{
|
|
83
84
|
type: Component,
|
|
@@ -92,27 +93,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
92
93
|
template: `
|
|
93
94
|
<rolatech-onboarding-page-shell
|
|
94
95
|
title="Apply to Join PrimeCasa"
|
|
95
|
-
subtitle="
|
|
96
|
+
subtitle="Choose the applicant profile you are applying under. The onboarding form will adapt to the rules for your identity type and operating region."
|
|
96
97
|
kicker="Public Apply"
|
|
97
98
|
>
|
|
98
|
-
<form [formGroup]="form" class="rounded-
|
|
99
|
-
<div class="
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
<input formControlName="applicationId" class="h-11 rounded-xl border border-(--rt-border-color) px-3" />
|
|
103
|
-
</label>
|
|
99
|
+
<form [formGroup]="form" class="space-y-6 rounded-3xl border border-(--rt-border-color) bg-(--rt-base-background) p-6 shadow-sm">
|
|
100
|
+
<div class="rounded-2xl border border-(--rt-border-color) bg-(--rt-raised-background) px-4 py-3 text-sm text-(--rt-text-primary)">
|
|
101
|
+
You can complete the application as a draft, leave the page, and continue later. Required document and VAT rules will change based on the choices below.
|
|
102
|
+
</div>
|
|
104
103
|
|
|
105
|
-
|
|
104
|
+
<div class="grid gap-4 md:grid-cols-2">
|
|
105
|
+
<label class="grid gap-2 md:col-span-2">
|
|
106
106
|
<span class="text-sm font-medium text-(--rt-text-secondary)">Applicant Type</span>
|
|
107
|
-
<select formControlName="applicantType" class="h-11 rounded-xl border border-(--rt-border-color) px-3">
|
|
107
|
+
<select formControlName="applicantType" class="h-11 rounded-xl border border-(--rt-border-color) bg-(--rt-raised-background) px-3 text-(--rt-text-primary)">
|
|
108
108
|
<option value="INDIVIDUAL">Individual</option>
|
|
109
|
-
<option value="COMPANY">
|
|
109
|
+
<option value="COMPANY">Corporate Partner</option>
|
|
110
110
|
</select>
|
|
111
111
|
</label>
|
|
112
112
|
|
|
113
113
|
<label class="grid gap-2 md:col-span-2">
|
|
114
114
|
<span class="text-sm font-medium text-(--rt-text-secondary)">Company Country</span>
|
|
115
|
-
<select formControlName="companyCountry" class="h-11 rounded-xl border border-(--rt-border-color) px-3">
|
|
115
|
+
<select formControlName="companyCountry" class="h-11 rounded-xl border border-(--rt-border-color) bg-(--rt-raised-background) px-3 text-(--rt-text-primary)">
|
|
116
116
|
<option value="UK">United Kingdom</option>
|
|
117
117
|
<option value="CN">China</option>
|
|
118
118
|
<option value="OTHER">Other</option>
|
|
@@ -121,7 +121,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
121
121
|
</div>
|
|
122
122
|
|
|
123
123
|
@if (facade.error()) {
|
|
124
|
-
<p class="mt-4 rounded-xl border border-
|
|
124
|
+
<p class="mt-4 rounded-xl border border-(--rt-border-color) bg-(--rt-raised-background) px-3 py-2 text-sm text-rose-700">
|
|
125
|
+
{{ facade.error() }}
|
|
126
|
+
</p>
|
|
125
127
|
}
|
|
126
128
|
|
|
127
129
|
<div class="mt-6 flex justify-end">
|
|
@@ -131,7 +133,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
131
133
|
[disabled]="form.invalid || facade.loading()"
|
|
132
134
|
(click)="onStart()"
|
|
133
135
|
>
|
|
134
|
-
Create Application
|
|
136
|
+
Create Application Draft
|
|
135
137
|
</button>
|
|
136
138
|
</div>
|
|
137
139
|
</form>
|
|
@@ -141,4 +143,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
141
143
|
}] });
|
|
142
144
|
|
|
143
145
|
export { AgentApplyStartPage };
|
|
144
|
-
//# sourceMappingURL=rolatech-angular-onboarding-agent-apply-start-page-
|
|
146
|
+
//# sourceMappingURL=rolatech-angular-onboarding-agent-apply-start-page-BfqO2YWB.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rolatech-angular-onboarding-agent-apply-start-page-BfqO2YWB.mjs","sources":["../../../../packages/angular-onboarding/src/lib/pages/agent-apply/agent-apply-start-page.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, inject, ViewEncapsulation } from '@angular/core';\nimport { FormBuilder, ReactiveFormsModule, Validators } from '@angular/forms';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { CreateOnboardingApplicationRequest } from '@rolatech/angular-services';\nimport { OnboardingPageShell } from '../../components/onboarding/onboarding-page-shell';\nimport { AgentApplyFacade } from '../../store/agent-apply.facade';\n\n@Component({\n selector: 'rolatech-agent-apply-start-page',\n standalone: true,\n imports: [ReactiveFormsModule, OnboardingPageShell],\n providers: [AgentApplyFacade],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: { class: 'block' },\n template: `\n <rolatech-onboarding-page-shell\n title=\"Apply to Join PrimeCasa\"\n subtitle=\"Choose the applicant profile you are applying under. The onboarding form will adapt to the rules for your identity type and operating region.\"\n kicker=\"Public Apply\"\n >\n <form [formGroup]=\"form\" class=\"space-y-6 rounded-3xl border border-(--rt-border-color) bg-(--rt-base-background) p-6 shadow-sm\">\n <div class=\"rounded-2xl border border-(--rt-border-color) bg-(--rt-raised-background) px-4 py-3 text-sm text-(--rt-text-primary)\">\n You can complete the application as a draft, leave the page, and continue later. Required document and VAT rules will change based on the choices below.\n </div>\n\n <div class=\"grid gap-4 md:grid-cols-2\">\n <label class=\"grid gap-2 md:col-span-2\">\n <span class=\"text-sm font-medium text-(--rt-text-secondary)\">Applicant Type</span>\n <select formControlName=\"applicantType\" class=\"h-11 rounded-xl border border-(--rt-border-color) bg-(--rt-raised-background) px-3 text-(--rt-text-primary)\">\n <option value=\"INDIVIDUAL\">Individual</option>\n <option value=\"COMPANY\">Corporate Partner</option>\n </select>\n </label>\n\n <label class=\"grid gap-2 md:col-span-2\">\n <span class=\"text-sm font-medium text-(--rt-text-secondary)\">Company Country</span>\n <select formControlName=\"companyCountry\" class=\"h-11 rounded-xl border border-(--rt-border-color) bg-(--rt-raised-background) px-3 text-(--rt-text-primary)\">\n <option value=\"UK\">United Kingdom</option>\n <option value=\"CN\">China</option>\n <option value=\"OTHER\">Other</option>\n </select>\n </label>\n </div>\n\n @if (facade.error()) {\n <p class=\"mt-4 rounded-xl border border-(--rt-border-color) bg-(--rt-raised-background) px-3 py-2 text-sm text-rose-700\">\n {{ facade.error() }}\n </p>\n }\n\n <div class=\"mt-6 flex justify-end\">\n <button\n type=\"button\"\n class=\"rounded-xl bg-(--rt-brand-color) px-5 py-2.5 text-sm font-semibold text-(--rt-text-primary-inverse) transition hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-60\"\n [disabled]=\"form.invalid || facade.loading()\"\n (click)=\"onStart()\"\n >\n Create Application Draft\n </button>\n </div>\n </form>\n </rolatech-onboarding-page-shell>\n `,\n})\nexport class AgentApplyStartPage {\n readonly facade = inject(AgentApplyFacade);\n private readonly fb = inject(FormBuilder);\n private readonly router = inject(Router);\n private readonly route = inject(ActivatedRoute);\n\n readonly form = this.fb.nonNullable.group({\n applicationId: ['primecasa', [Validators.required]],\n applicantType: ['INDIVIDUAL', [Validators.required]],\n companyCountry: ['UK', [Validators.required]],\n });\n\n async onStart(): Promise<void> {\n if (this.form.invalid) {\n this.form.markAllAsTouched();\n return;\n }\n\n const payload = this.form.getRawValue() as CreateOnboardingApplicationRequest;\n const response = await this.facade.start(payload);\n\n if (!response) {\n return;\n }\n\n await this.router.navigate([response.id, 'form'], {\n relativeTo: this.route,\n });\n }\n}\n"],"names":[],"mappings":";;;;;;;MAiEa,mBAAmB,CAAA;AACrB,IAAA,MAAM,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACzB,IAAA,EAAE,GAAG,MAAM,CAAC,WAAW,CAAC;AACxB,IAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AACvB,IAAA,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC;IAEtC,IAAI,GAAG,IAAI,CAAC,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC;QACxC,aAAa,EAAE,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;QACnD,aAAa,EAAE,CAAC,YAAY,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;QACpD,cAAc,EAAE,CAAC,IAAI,EAAE,CAAC,UAAU,CA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AAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FAuDvC,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBA1D/B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,iCAAiC;AAC3C,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,OAAO,EAAE,CAAC,mBAAmB,EAAE,mBAAmB,CAAC;oBACnD,SAAS,EAAE,CAAC,gBAAgB,CAAC;oBAC7B,eAAe,EAAE,uBAAuB,CAAC,MAAM;oBAC/C,aAAa,EAAE,iBAAiB,CAAC,IAAI;AACrC,oBAAA,IAAI,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE;AACxB,oBAAA,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDT,EAAA,CAAA;AACF,iBAAA;;;;;"}
|
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
-
import { onboardingDocumentTypeLabel } from '@rolatech/angular-services';
|
|
4
|
-
import {
|
|
2
|
+
import { inject, signal, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { OnboardingDocumentService, onboardingDocumentTypeLabel } from '@rolatech/angular-services';
|
|
4
|
+
import { firstValueFrom } from 'rxjs';
|
|
5
|
+
import { AgentOnboardingFacade, OnboardingDocumentUploader, OnboardingDocumentPreviewDialog } from './rolatech-angular-onboarding.mjs';
|
|
5
6
|
|
|
6
7
|
class AgentOnboardingDocumentsPage {
|
|
7
8
|
facade = inject(AgentOnboardingFacade);
|
|
9
|
+
onboardingDocumentService = inject(OnboardingDocumentService);
|
|
8
10
|
documentTypeLabel = onboardingDocumentTypeLabel;
|
|
11
|
+
previewOpen = signal(false, ...(ngDevMode ? [{ debugName: "previewOpen" }] : []));
|
|
12
|
+
previewLoading = signal(false, ...(ngDevMode ? [{ debugName: "previewLoading" }] : []));
|
|
13
|
+
previewError = signal(null, ...(ngDevMode ? [{ debugName: "previewError" }] : []));
|
|
14
|
+
previewUrl = signal(null, ...(ngDevMode ? [{ debugName: "previewUrl" }] : []));
|
|
15
|
+
previewTitle = signal(null, ...(ngDevMode ? [{ debugName: "previewTitle" }] : []));
|
|
16
|
+
previewSubtitle = signal(null, ...(ngDevMode ? [{ debugName: "previewSubtitle" }] : []));
|
|
17
|
+
previewDocumentId = signal(null, ...(ngDevMode ? [{ debugName: "previewDocumentId" }] : []));
|
|
9
18
|
async onUpload(documentType, file, replacedDocumentId) {
|
|
10
19
|
if (!replacedDocumentId) {
|
|
11
20
|
return;
|
|
@@ -15,6 +24,44 @@ class AgentOnboardingDocumentsPage {
|
|
|
15
24
|
async resubmit() {
|
|
16
25
|
await this.facade.resubmit();
|
|
17
26
|
}
|
|
27
|
+
previewBusy(documentId) {
|
|
28
|
+
return this.previewLoading() && this.previewDocumentId() === documentId;
|
|
29
|
+
}
|
|
30
|
+
async openDocumentPreview(documentId, label, filename) {
|
|
31
|
+
this.previewOpen.set(true);
|
|
32
|
+
this.previewLoading.set(true);
|
|
33
|
+
this.previewError.set(null);
|
|
34
|
+
this.previewUrl.set(null);
|
|
35
|
+
this.previewTitle.set(label);
|
|
36
|
+
this.previewSubtitle.set(filename || null);
|
|
37
|
+
this.previewDocumentId.set(documentId);
|
|
38
|
+
try {
|
|
39
|
+
const response = await firstValueFrom(this.onboardingDocumentService.getPreviewUrl(documentId));
|
|
40
|
+
this.previewUrl.set(response.previewUrl);
|
|
41
|
+
this.previewDocumentId.set(response.documentId);
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
this.previewError.set(this.toErrorMessage(error));
|
|
45
|
+
}
|
|
46
|
+
finally {
|
|
47
|
+
this.previewLoading.set(false);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
closeDocumentPreview() {
|
|
51
|
+
this.previewOpen.set(false);
|
|
52
|
+
this.previewLoading.set(false);
|
|
53
|
+
this.previewError.set(null);
|
|
54
|
+
this.previewUrl.set(null);
|
|
55
|
+
this.previewTitle.set(null);
|
|
56
|
+
this.previewSubtitle.set(null);
|
|
57
|
+
this.previewDocumentId.set(null);
|
|
58
|
+
}
|
|
59
|
+
toErrorMessage(error) {
|
|
60
|
+
if (error instanceof Error && error.message) {
|
|
61
|
+
return error.message;
|
|
62
|
+
}
|
|
63
|
+
return 'Unable to load the document preview.';
|
|
64
|
+
}
|
|
18
65
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: AgentOnboardingDocumentsPage, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
19
66
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.1", type: AgentOnboardingDocumentsPage, isStandalone: true, selector: "rolatech-agent-onboarding-documents-page", host: { classAttribute: "block" }, ngImport: i0, template: `
|
|
20
67
|
@if (facade.documents().length === 0) {
|
|
@@ -30,7 +77,10 @@ class AgentOnboardingDocumentsPage {
|
|
|
30
77
|
[document]="documentItem"
|
|
31
78
|
[comment]="documentItem.reviewerComment || null"
|
|
32
79
|
[busy]="facade.saving()"
|
|
80
|
+
[canPreview]="true"
|
|
81
|
+
[previewBusy]="previewBusy(documentItem.id)"
|
|
33
82
|
(fileSelected)="onUpload($event.documentType, $event.file, $event.replacedDocumentId)"
|
|
83
|
+
(previewRequested)="openDocumentPreview(documentItem.id, documentTypeLabel(documentItem.documentType), documentItem.originalFilename)"
|
|
34
84
|
/>
|
|
35
85
|
}
|
|
36
86
|
|
|
@@ -48,14 +98,24 @@ class AgentOnboardingDocumentsPage {
|
|
|
48
98
|
}
|
|
49
99
|
</section>
|
|
50
100
|
}
|
|
51
|
-
|
|
101
|
+
|
|
102
|
+
<rolatech-onboarding-document-preview-dialog
|
|
103
|
+
[open]="previewOpen()"
|
|
104
|
+
[title]="previewTitle()"
|
|
105
|
+
[subtitle]="previewSubtitle()"
|
|
106
|
+
[url]="previewUrl()"
|
|
107
|
+
[loading]="previewLoading()"
|
|
108
|
+
[error]="previewError()"
|
|
109
|
+
(closeRequested)="closeDocumentPreview()"
|
|
110
|
+
/>
|
|
111
|
+
`, isInline: true, dependencies: [{ kind: "component", type: OnboardingDocumentUploader, selector: "rolatech-onboarding-document-uploader", inputs: ["label", "helperText", "documentType", "document", "warning", "comment", "busy", "locked", "uploading", "progress", "pendingFilename", "uploadError", "acceptedTypes", "canPreview", "previewBusy"], outputs: ["fileSelected", "previewRequested"] }, { kind: "component", type: OnboardingDocumentPreviewDialog, selector: "rolatech-onboarding-document-preview-dialog", inputs: ["open", "title", "subtitle", "url", "loading", "error"], outputs: ["closeRequested"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
52
112
|
}
|
|
53
113
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: AgentOnboardingDocumentsPage, decorators: [{
|
|
54
114
|
type: Component,
|
|
55
115
|
args: [{
|
|
56
116
|
selector: 'rolatech-agent-onboarding-documents-page',
|
|
57
117
|
standalone: true,
|
|
58
|
-
imports: [OnboardingDocumentUploader],
|
|
118
|
+
imports: [OnboardingDocumentUploader, OnboardingDocumentPreviewDialog],
|
|
59
119
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
60
120
|
encapsulation: ViewEncapsulation.None,
|
|
61
121
|
host: { class: 'block' },
|
|
@@ -73,7 +133,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
73
133
|
[document]="documentItem"
|
|
74
134
|
[comment]="documentItem.reviewerComment || null"
|
|
75
135
|
[busy]="facade.saving()"
|
|
136
|
+
[canPreview]="true"
|
|
137
|
+
[previewBusy]="previewBusy(documentItem.id)"
|
|
76
138
|
(fileSelected)="onUpload($event.documentType, $event.file, $event.replacedDocumentId)"
|
|
139
|
+
(previewRequested)="openDocumentPreview(documentItem.id, documentTypeLabel(documentItem.documentType), documentItem.originalFilename)"
|
|
77
140
|
/>
|
|
78
141
|
}
|
|
79
142
|
|
|
@@ -91,9 +154,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
91
154
|
}
|
|
92
155
|
</section>
|
|
93
156
|
}
|
|
157
|
+
|
|
158
|
+
<rolatech-onboarding-document-preview-dialog
|
|
159
|
+
[open]="previewOpen()"
|
|
160
|
+
[title]="previewTitle()"
|
|
161
|
+
[subtitle]="previewSubtitle()"
|
|
162
|
+
[url]="previewUrl()"
|
|
163
|
+
[loading]="previewLoading()"
|
|
164
|
+
[error]="previewError()"
|
|
165
|
+
(closeRequested)="closeDocumentPreview()"
|
|
166
|
+
/>
|
|
94
167
|
`,
|
|
95
168
|
}]
|
|
96
169
|
}] });
|
|
97
170
|
|
|
98
171
|
export { AgentOnboardingDocumentsPage };
|
|
99
|
-
//# sourceMappingURL=rolatech-angular-onboarding-agent-onboarding-documents-page-
|
|
172
|
+
//# sourceMappingURL=rolatech-angular-onboarding-agent-onboarding-documents-page-BKDYZE0e.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rolatech-angular-onboarding-agent-onboarding-documents-page-BKDYZE0e.mjs","sources":["../../../../packages/angular-onboarding/src/lib/pages/agent-onboarding/agent-onboarding-documents-page.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, inject, signal, ViewEncapsulation } from '@angular/core';\nimport { onboardingDocumentTypeLabel, OnboardingDocumentService, OnboardingDocumentType } from '@rolatech/angular-services';\nimport { firstValueFrom } from 'rxjs';\nimport { OnboardingDocumentPreviewDialog } from '../../components/onboarding/onboarding-document-preview-dialog';\nimport { OnboardingDocumentUploader } from '../../components/onboarding/onboarding-document-uploader';\nimport { AgentOnboardingFacade } from '../../store/agent-onboarding.facade';\n\n@Component({\n selector: 'rolatech-agent-onboarding-documents-page',\n standalone: true,\n imports: [OnboardingDocumentUploader, OnboardingDocumentPreviewDialog],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: { class: 'block' },\n template: `\n @if (facade.documents().length === 0) {\n <div class=\"rounded-2xl border border-(--rt-border-color) bg-(--rt-base-background) p-5 text-sm text-(--rt-text-secondary) shadow-sm\">\n No documents uploaded yet for this onboarding application.\n </div>\n } @else {\n <section class=\"space-y-4\">\n @for (documentItem of facade.documents(); track documentItem.id) {\n <rolatech-onboarding-document-uploader\n [label]=\"documentTypeLabel(documentItem.documentType)\"\n [documentType]=\"documentItem.documentType\"\n [document]=\"documentItem\"\n [comment]=\"documentItem.reviewerComment || null\"\n [busy]=\"facade.saving()\"\n [canPreview]=\"true\"\n [previewBusy]=\"previewBusy(documentItem.id)\"\n (fileSelected)=\"onUpload($event.documentType, $event.file, $event.replacedDocumentId)\"\n (previewRequested)=\"openDocumentPreview(documentItem.id, documentTypeLabel(documentItem.documentType), documentItem.originalFilename)\"\n />\n }\n\n @if (facade.status() === 'NEED_MORE_INFO') {\n <div class=\"flex justify-end\">\n <button\n type=\"button\"\n class=\"rounded-xl bg-(--rt-brand-color) px-5 py-2.5 text-sm font-semibold text-(--rt-text-primary-inverse) transition hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-60\"\n [disabled]=\"facade.saving()\"\n (click)=\"resubmit()\"\n >\n Resubmit for Review\n </button>\n </div>\n }\n </section>\n }\n\n <rolatech-onboarding-document-preview-dialog\n [open]=\"previewOpen()\"\n [title]=\"previewTitle()\"\n [subtitle]=\"previewSubtitle()\"\n [url]=\"previewUrl()\"\n [loading]=\"previewLoading()\"\n [error]=\"previewError()\"\n (closeRequested)=\"closeDocumentPreview()\"\n />\n `,\n})\nexport class AgentOnboardingDocumentsPage {\n readonly facade = inject(AgentOnboardingFacade);\n private readonly onboardingDocumentService = inject(OnboardingDocumentService);\n readonly documentTypeLabel = onboardingDocumentTypeLabel;\n readonly previewOpen = signal(false);\n readonly previewLoading = signal(false);\n readonly previewError = signal<string | null>(null);\n readonly previewUrl = signal<string | null>(null);\n readonly previewTitle = signal<string | null>(null);\n readonly previewSubtitle = signal<string | null>(null);\n readonly previewDocumentId = signal<string | null>(null);\n\n async onUpload(documentType: OnboardingDocumentType, file: File, replacedDocumentId?: string): Promise<void> {\n if (!replacedDocumentId) {\n return;\n }\n\n await this.facade.reuploadDocument(documentType, file, replacedDocumentId);\n }\n\n async resubmit(): Promise<void> {\n await this.facade.resubmit();\n }\n\n previewBusy(documentId: string): boolean {\n return this.previewLoading() && this.previewDocumentId() === documentId;\n }\n\n async openDocumentPreview(documentId: string, label: string, filename: string): Promise<void> {\n this.previewOpen.set(true);\n this.previewLoading.set(true);\n this.previewError.set(null);\n this.previewUrl.set(null);\n this.previewTitle.set(label);\n this.previewSubtitle.set(filename || null);\n this.previewDocumentId.set(documentId);\n\n try {\n const response = await firstValueFrom(this.onboardingDocumentService.getPreviewUrl(documentId));\n this.previewUrl.set(response.previewUrl);\n this.previewDocumentId.set(response.documentId);\n } catch (error) {\n this.previewError.set(this.toErrorMessage(error));\n } finally {\n this.previewLoading.set(false);\n }\n }\n\n closeDocumentPreview(): void {\n this.previewOpen.set(false);\n this.previewLoading.set(false);\n this.previewError.set(null);\n this.previewUrl.set(null);\n this.previewTitle.set(null);\n this.previewSubtitle.set(null);\n this.previewDocumentId.set(null);\n }\n\n private toErrorMessage(error: unknown): string {\n if (error instanceof Error && error.message) {\n return error.message;\n }\n\n return 'Unable to load the document preview.';\n }\n}\n"],"names":[],"mappings":";;;;;;MA6Da,4BAA4B,CAAA;AAC9B,IAAA,MAAM,GAAG,MAAM,CAAC,qBAAqB,CAAC;AAC9B,IAAA,yBAAyB,GAAG,MAAM,CAAC,yBAAyB,CAAC;IACrE,iBAAiB,GAAG,2BAA2B;AAC/C,IAAA,WAAW,GAAG,MA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