@rolatech/angular-user 19.0.0-beta.18 → 19.1.0-beta.3
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/fesm2022/rolatech-angular-user.mjs +426 -31
- package/fesm2022/rolatech-angular-user.mjs.map +1 -1
- package/index.d.ts +209 -1
- package/package.json +5 -5
- package/lib/components/user-item/user-item.component.d.ts +0 -13
- package/lib/components/user-layout/user-layout.component.d.ts +0 -29
- package/lib/pages/user-community/user-community.component.d.ts +0 -9
- package/lib/pages/user-follow-info/user-follow-info.component.d.ts +0 -30
- package/lib/pages/user-info/user-info.component.d.ts +0 -16
- package/lib/pages/user-store/user-store.component.d.ts +0 -13
- package/lib/pages/user.routes.d.ts +0 -15
- package/lib/user-data.service.d.ts +0 -8
|
@@ -1,29 +1,424 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import * as
|
|
2
|
+
import { inject, Component, viewChild, input, Injectable, model, effect, ViewEncapsulation, output, HostBinding, signal } from '@angular/core';
|
|
3
|
+
import { CommonModule } from '@angular/common';
|
|
4
|
+
import { BaseComponent, ContainerComponent, ToolbarComponent, RichLabelComponent, EmptyComponent, AcceptDialogComponent, RejectDialogComponent, PdfViewerComponent, TabsComponent, TabComponent, AvatarComponent, RichViewComponent, RichItemComponent } from '@rolatech/angular-components';
|
|
5
|
+
import { AuthAgentService, AuthUserService, AuthService } from '@rolatech/angular-auth';
|
|
6
|
+
import * as i1 from '@angular/material/form-field';
|
|
7
|
+
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
8
|
+
import * as i2 from '@angular/material/input';
|
|
9
|
+
import { MatInputModule } from '@angular/material/input';
|
|
10
|
+
import * as i3 from '@angular/forms';
|
|
11
|
+
import { FormsModule } from '@angular/forms';
|
|
12
|
+
import * as i2$1 from '@angular/material/button';
|
|
7
13
|
import { MatButtonModule } from '@angular/material/button';
|
|
8
|
-
import * as
|
|
14
|
+
import * as i5 from '@angular/material/progress-spinner';
|
|
15
|
+
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
|
16
|
+
import * as i1$1 from '@angular/material/paginator';
|
|
17
|
+
import { MatPaginator, MatPaginatorModule } from '@angular/material/paginator';
|
|
18
|
+
import * as i3$1 from '@angular/material/icon';
|
|
9
19
|
import { MatIconModule } from '@angular/material/icon';
|
|
20
|
+
import * as i4 from '@angular/material/menu';
|
|
21
|
+
import { MatMenuModule } from '@angular/material/menu';
|
|
10
22
|
import { RouterLink, RouterOutlet, ActivatedRoute } from '@angular/router';
|
|
23
|
+
import { BehaviorSubject } from 'rxjs';
|
|
11
24
|
import { CourseService } from '@rolatech/angular-course';
|
|
12
|
-
import { CommonModule } from '@angular/common';
|
|
13
25
|
import { ProductService } from '@rolatech/angular-services';
|
|
14
26
|
import { Title } from '@angular/platform-browser';
|
|
15
27
|
import { map } from 'lodash';
|
|
16
28
|
|
|
29
|
+
var AgentApplicationStatus;
|
|
30
|
+
(function (AgentApplicationStatus) {
|
|
31
|
+
AgentApplicationStatus["PENDING"] = "Pending";
|
|
32
|
+
AgentApplicationStatus["APPROVED"] = "Approved";
|
|
33
|
+
AgentApplicationStatus["REJECTED"] = "Rejected";
|
|
34
|
+
})(AgentApplicationStatus || (AgentApplicationStatus = {}));
|
|
35
|
+
|
|
36
|
+
class AgentApplicationDetailComponent extends BaseComponent {
|
|
37
|
+
authAgentService = inject(AuthAgentService);
|
|
38
|
+
application = {
|
|
39
|
+
firstName: '',
|
|
40
|
+
lastName: '',
|
|
41
|
+
email: '',
|
|
42
|
+
phone: '',
|
|
43
|
+
businessName: '',
|
|
44
|
+
website: '',
|
|
45
|
+
};
|
|
46
|
+
applicationStatus = AgentApplicationStatus;
|
|
47
|
+
ngOnInit() {
|
|
48
|
+
this.getApplication();
|
|
49
|
+
}
|
|
50
|
+
getApplication() {
|
|
51
|
+
this.authAgentService.myApplication().subscribe({
|
|
52
|
+
next: (res) => {
|
|
53
|
+
this.application = res.data;
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: AgentApplicationDetailComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
58
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.3", type: AgentApplicationDetailComponent, isStandalone: true, selector: "rolatech-agent-application-detail", usesInheritance: true, ngImport: i0, template: "<rolatech-container>\n <rolatech-toolbar title=\"My application\" large>\n <div class=\"text-lg font-bold\">\n {{ applicationStatus[application.status] }}\n </div>\n </rolatech-toolbar>\n\n <div>\n <hr class=\"my-3\" />\n <div>\n <div class=\"text-lg font-bold py-2\" i18n>Application details</div>\n <div class=\"flex overflow-x-scroll scrollbar-hide\">\n <div class=\"flex flex-col w-full\">\n <rolatech-rich-label label=\"FirstName\" [title]=\"application.firstName\"></rolatech-rich-label>\n <rolatech-rich-label label=\"Email\" [title]=\"application.email\"></rolatech-rich-label>\n <rolatech-rich-label label=\"Phone\" [title]=\"application.phone\"></rolatech-rich-label>\n <rolatech-rich-label label=\"Business Name\" [title]=\"application.businessName\"></rolatech-rich-label>\n <rolatech-rich-label label=\"Experience Years\" [title]=\"application.experienceYears\"></rolatech-rich-label>\n <rolatech-rich-label label=\"Created At\" [title]=\"application.createdAt\"></rolatech-rich-label>\n </div>\n </div>\n <hr class=\"my-3\" />\n </div>\n <div>\n <div class=\"text-lg font-bold py-2\" i18n>Documents</div>\n @if (application.documents?.length > 0) {\n @for (item of application.documents; track $index) {\n <a class=\"underline underline-offset-4\" [href]=\"item\" target=\"_blank\">Document: {{ $index + 1 }}</a>\n }\n } @else {\n <rolatech-empty></rolatech-empty>\n }\n </div>\n </div>\n</rolatech-container>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: ContainerComponent, selector: "rolatech-container" }, { kind: "component", type: ToolbarComponent, selector: "rolatech-toolbar", inputs: ["title", "subtitle", "back", "link", "large", "divider"] }, { kind: "component", type: RichLabelComponent, selector: "rolatech-rich-label", inputs: ["label", "title"] }, { kind: "component", type: EmptyComponent, selector: "rolatech-empty" }] });
|
|
59
|
+
}
|
|
60
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: AgentApplicationDetailComponent, decorators: [{
|
|
61
|
+
type: Component,
|
|
62
|
+
args: [{ selector: 'rolatech-agent-application-detail', imports: [CommonModule, ContainerComponent, ToolbarComponent, RichLabelComponent, EmptyComponent], template: "<rolatech-container>\n <rolatech-toolbar title=\"My application\" large>\n <div class=\"text-lg font-bold\">\n {{ applicationStatus[application.status] }}\n </div>\n </rolatech-toolbar>\n\n <div>\n <hr class=\"my-3\" />\n <div>\n <div class=\"text-lg font-bold py-2\" i18n>Application details</div>\n <div class=\"flex overflow-x-scroll scrollbar-hide\">\n <div class=\"flex flex-col w-full\">\n <rolatech-rich-label label=\"FirstName\" [title]=\"application.firstName\"></rolatech-rich-label>\n <rolatech-rich-label label=\"Email\" [title]=\"application.email\"></rolatech-rich-label>\n <rolatech-rich-label label=\"Phone\" [title]=\"application.phone\"></rolatech-rich-label>\n <rolatech-rich-label label=\"Business Name\" [title]=\"application.businessName\"></rolatech-rich-label>\n <rolatech-rich-label label=\"Experience Years\" [title]=\"application.experienceYears\"></rolatech-rich-label>\n <rolatech-rich-label label=\"Created At\" [title]=\"application.createdAt\"></rolatech-rich-label>\n </div>\n </div>\n <hr class=\"my-3\" />\n </div>\n <div>\n <div class=\"text-lg font-bold py-2\" i18n>Documents</div>\n @if (application.documents?.length > 0) {\n @for (item of application.documents; track $index) {\n <a class=\"underline underline-offset-4\" [href]=\"item\" target=\"_blank\">Document: {{ $index + 1 }}</a>\n }\n } @else {\n <rolatech-empty></rolatech-empty>\n }\n </div>\n </div>\n</rolatech-container>\n" }]
|
|
63
|
+
}] });
|
|
64
|
+
|
|
65
|
+
class AgentApplicationComponent extends BaseComponent {
|
|
66
|
+
authAgentService = inject(AuthAgentService);
|
|
67
|
+
application = {
|
|
68
|
+
firstName: '',
|
|
69
|
+
lastName: '',
|
|
70
|
+
email: '',
|
|
71
|
+
phone: '',
|
|
72
|
+
businessName: '',
|
|
73
|
+
website: '',
|
|
74
|
+
};
|
|
75
|
+
selectedFiles = [];
|
|
76
|
+
sending = false;
|
|
77
|
+
ngOnInit() {
|
|
78
|
+
this.getApplication();
|
|
79
|
+
}
|
|
80
|
+
getApplication() {
|
|
81
|
+
this.authAgentService.myApplication().subscribe({
|
|
82
|
+
next: (res) => {
|
|
83
|
+
this.application = res.data;
|
|
84
|
+
if (res.data) {
|
|
85
|
+
this.router.navigate([`./${res.data.id}`], {
|
|
86
|
+
relativeTo: this.route,
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
onFileSelected(event) {
|
|
93
|
+
const input = event.target;
|
|
94
|
+
if (input?.files?.length) {
|
|
95
|
+
this.selectedFiles = Array.from(input.files);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
submitApplication() {
|
|
99
|
+
this.sending = true;
|
|
100
|
+
const formData = new FormData();
|
|
101
|
+
formData.append('application', new Blob([JSON.stringify(this.application)], { type: 'application/json' }));
|
|
102
|
+
for (const file of this.selectedFiles) {
|
|
103
|
+
formData.append('documents', file);
|
|
104
|
+
}
|
|
105
|
+
this.authAgentService.apply(formData).subscribe({
|
|
106
|
+
next: (res) => {
|
|
107
|
+
this.sending = false;
|
|
108
|
+
this.snackBarService.open('Sent successfully');
|
|
109
|
+
this.router.navigate([`./${res.data.id}`], {
|
|
110
|
+
relativeTo: this.route,
|
|
111
|
+
});
|
|
112
|
+
},
|
|
113
|
+
error: (error) => {
|
|
114
|
+
this.sending = false;
|
|
115
|
+
this.snackBarService.open(error.message);
|
|
116
|
+
},
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: AgentApplicationComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
120
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.3", type: AgentApplicationComponent, isStandalone: true, selector: "rolatech-agent-application", usesInheritance: true, ngImport: i0, template: "<section id=\"application\" class=\"p-10\">\n <h2 class=\"text-2xl font-semibold text-center mb-6\">Agent Application Form</h2>\n <form class=\"max-w-2xl mx-auto space-y-4\" (submit)=\"submitApplication()\">\n <mat-form-field class=\"w-full\">\n <mat-label>First Name</mat-label>\n <input matInput [(ngModel)]=\"application.firstName\" name=\"firstName\" required />\n </mat-form-field>\n\n <mat-form-field class=\"w-full\">\n <mat-label>Last Name</mat-label>\n <input matInput [(ngModel)]=\"application.lastName\" name=\"lastName\" required />\n </mat-form-field>\n\n <mat-form-field class=\"w-full\">\n <mat-label>Email Address</mat-label>\n <input matInput [(ngModel)]=\"application.email\" name=\"email\" type=\"email\" required />\n </mat-form-field>\n\n <mat-form-field class=\"w-full\">\n <mat-label>Phone Number</mat-label>\n <input matInput [(ngModel)]=\"application.phone\" name=\"phone\" type=\"tel\" required />\n </mat-form-field>\n\n <mat-form-field class=\"w-full\">\n <mat-label>Business Name</mat-label>\n <input matInput [(ngModel)]=\"application.businessName\" name=\"businessName\" required />\n </mat-form-field>\n\n <mat-form-field class=\"w-full\">\n <mat-label>WebSite</mat-label>\n <input matInput [(ngModel)]=\"application.website\" name=\"website\" />\n </mat-form-field>\n\n <mat-form-field class=\"w-full\">\n <mat-label>Experience Years</mat-label>\n <input matInput [(ngModel)]=\"application.experienceYears\" name=\"experienceYears\" required />\n </mat-form-field>\n\n <div>\n <div class=\"mb-2\">\n <div class=\"text-xl font-bold\" i18n>Upload Certification (PDF)</div>\n <div class=\"text-sm opacity-70\" i18n>Safeagent, UKALA, or Propertymark certification</div>\n </div>\n <input type=\"file\" (change)=\"onFileSelected($event)\" accept=\".pdf\" required />\n </div>\n\n <button mat-flat-button type=\"submit\" [disabled]=\"sending\">\n <span style=\"display: flex; align-items: center\">\n @if (sending) {\n <mat-progress-spinner diameter=\"20\" mode=\"indeterminate\" [style.marginRight.px]=\"8\"></mat-progress-spinner>\n }\n {{ sending ? 'Requesting...' : 'Submit Application' }}\n </span>\n </button>\n <!-- <button mat-flat-button type=\"submit\">Submit Application</button> -->\n </form>\n</section>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1.MatLabel, selector: "mat-label" }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i3.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i5.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }] });
|
|
121
|
+
}
|
|
122
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: AgentApplicationComponent, decorators: [{
|
|
123
|
+
type: Component,
|
|
124
|
+
args: [{ selector: 'rolatech-agent-application', imports: [CommonModule, MatFormFieldModule, MatInputModule, FormsModule, MatButtonModule, MatProgressSpinnerModule], template: "<section id=\"application\" class=\"p-10\">\n <h2 class=\"text-2xl font-semibold text-center mb-6\">Agent Application Form</h2>\n <form class=\"max-w-2xl mx-auto space-y-4\" (submit)=\"submitApplication()\">\n <mat-form-field class=\"w-full\">\n <mat-label>First Name</mat-label>\n <input matInput [(ngModel)]=\"application.firstName\" name=\"firstName\" required />\n </mat-form-field>\n\n <mat-form-field class=\"w-full\">\n <mat-label>Last Name</mat-label>\n <input matInput [(ngModel)]=\"application.lastName\" name=\"lastName\" required />\n </mat-form-field>\n\n <mat-form-field class=\"w-full\">\n <mat-label>Email Address</mat-label>\n <input matInput [(ngModel)]=\"application.email\" name=\"email\" type=\"email\" required />\n </mat-form-field>\n\n <mat-form-field class=\"w-full\">\n <mat-label>Phone Number</mat-label>\n <input matInput [(ngModel)]=\"application.phone\" name=\"phone\" type=\"tel\" required />\n </mat-form-field>\n\n <mat-form-field class=\"w-full\">\n <mat-label>Business Name</mat-label>\n <input matInput [(ngModel)]=\"application.businessName\" name=\"businessName\" required />\n </mat-form-field>\n\n <mat-form-field class=\"w-full\">\n <mat-label>WebSite</mat-label>\n <input matInput [(ngModel)]=\"application.website\" name=\"website\" />\n </mat-form-field>\n\n <mat-form-field class=\"w-full\">\n <mat-label>Experience Years</mat-label>\n <input matInput [(ngModel)]=\"application.experienceYears\" name=\"experienceYears\" required />\n </mat-form-field>\n\n <div>\n <div class=\"mb-2\">\n <div class=\"text-xl font-bold\" i18n>Upload Certification (PDF)</div>\n <div class=\"text-sm opacity-70\" i18n>Safeagent, UKALA, or Propertymark certification</div>\n </div>\n <input type=\"file\" (change)=\"onFileSelected($event)\" accept=\".pdf\" required />\n </div>\n\n <button mat-flat-button type=\"submit\" [disabled]=\"sending\">\n <span style=\"display: flex; align-items: center\">\n @if (sending) {\n <mat-progress-spinner diameter=\"20\" mode=\"indeterminate\" [style.marginRight.px]=\"8\"></mat-progress-spinner>\n }\n {{ sending ? 'Requesting...' : 'Submit Application' }}\n </span>\n </button>\n <!-- <button mat-flat-button type=\"submit\">Submit Application</button> -->\n </form>\n</section>\n" }]
|
|
125
|
+
}] });
|
|
126
|
+
|
|
127
|
+
class UserIndexComponent extends BaseComponent {
|
|
128
|
+
authUserService = inject(AuthUserService);
|
|
129
|
+
paginator = viewChild(MatPaginator);
|
|
130
|
+
users = [];
|
|
131
|
+
pageEvent;
|
|
132
|
+
isLoading = false;
|
|
133
|
+
isSearch = false;
|
|
134
|
+
length = 100;
|
|
135
|
+
pageSize = 15;
|
|
136
|
+
pageSizeOptions = [5, 10, 25, 100];
|
|
137
|
+
orderOptions = [
|
|
138
|
+
{
|
|
139
|
+
key: 'createdAt',
|
|
140
|
+
value: 'Created At',
|
|
141
|
+
icon: 'arrow_upward',
|
|
142
|
+
sort: 'asc',
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
key: 'createdAt',
|
|
146
|
+
value: 'Created At',
|
|
147
|
+
icon: 'arrow_downward',
|
|
148
|
+
sort: 'desc',
|
|
149
|
+
},
|
|
150
|
+
];
|
|
151
|
+
orderString = 'createdAt desc';
|
|
152
|
+
ngOnInit() {
|
|
153
|
+
this.findAll();
|
|
154
|
+
}
|
|
155
|
+
findAll(event) {
|
|
156
|
+
this.isLoading = true;
|
|
157
|
+
this.isSearch = false;
|
|
158
|
+
const page = event ? event.pageIndex + 1 : 1;
|
|
159
|
+
const limit = event ? event.pageSize : 15;
|
|
160
|
+
const sort = this.orderString;
|
|
161
|
+
const options = {
|
|
162
|
+
page,
|
|
163
|
+
limit,
|
|
164
|
+
sort,
|
|
165
|
+
};
|
|
166
|
+
this.authUserService.findAll(options).subscribe({
|
|
167
|
+
next: (res) => {
|
|
168
|
+
this.users = res.data;
|
|
169
|
+
this.length = res.meta.pagination.count;
|
|
170
|
+
this.isLoading = false;
|
|
171
|
+
},
|
|
172
|
+
error: (error) => {
|
|
173
|
+
this.isLoading = false;
|
|
174
|
+
this.snackBarService.open(error.message);
|
|
175
|
+
},
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
search(e) {
|
|
179
|
+
this.isLoading = true;
|
|
180
|
+
const word = e.target.value;
|
|
181
|
+
const options = {
|
|
182
|
+
filter: `name:${word}`,
|
|
183
|
+
};
|
|
184
|
+
this.authUserService.findAll(options).subscribe({
|
|
185
|
+
next: (res) => {
|
|
186
|
+
this.users = res.data;
|
|
187
|
+
this.length = res.meta.pagination.count;
|
|
188
|
+
this.isLoading = false;
|
|
189
|
+
},
|
|
190
|
+
error: (error) => {
|
|
191
|
+
this.isLoading = false;
|
|
192
|
+
this.snackBarService.open(error.message);
|
|
193
|
+
},
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
onClick(item) {
|
|
197
|
+
this.orderString = item.key + ' ' + item.sort;
|
|
198
|
+
this.paginator()?.firstPage();
|
|
199
|
+
this.findAll(null);
|
|
200
|
+
}
|
|
201
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: UserIndexComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
202
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.3", type: UserIndexComponent, isStandalone: true, selector: "rolatech-user-index", viewQueries: [{ propertyName: "paginator", first: true, predicate: MatPaginator, descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<rolatech-toolbar title=\"Users\">\n <button mat-icon-button (click)=\"isSearch = true\">\n <mat-icon>search</mat-icon>\n </button>\n <button mat-icon-button [matMenuTriggerFor]=\"beforeMenu\">\n <mat-icon>sort</mat-icon>\n </button>\n <mat-menu #beforeMenu=\"matMenu\" xPosition=\"before\">\n @for (item of orderOptions; track item) {\n <button mat-menu-item (click)=\"onClick(item)\">\n <span>{{ item.value }}</span>\n <mat-icon>{{ item.icon }}</mat-icon>\n </button>\n }\n </mat-menu>\n</rolatech-toolbar>\n<div class=\"px-4\">\n @if (isSearch) {\n <mat-form-field floatLabel=\"auto\" subscriptSizing=\"dynamic\">\n <input type=\"text\" matInput placeholder=\"Name\" (keyup.enter)=\"search($event)\" />\n <button matSuffix mat-icon-button (click)=\"findAll(null); isSearch = false\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n }\n <div>\n @for (user of users; track $index) {\n <div class=\"flex w-full justify-between items-center py-2 hover:bg-[--rt-raised-background] cursor-pointer\">\n <div class=\"flex items-center\">\n <div class=\"bg-[--rt-brand-color] w-12 h-12 rounded-full\">\n @if (user.avatar) {\n <img class=\"w-12 h-12 object-cover rounded-full\" [src]=\"user.avatar\" alt=\"avatar img\" />\n }\n </div>\n <div class=\"flex flex-col ml-3\">\n <a class=\"text-lg font-bold\">\n <span>{{ user.name }}</span>\n </a>\n <a class=\"text-md\">\n <span>{{ user.username }}</span>\n </a>\n </div>\n </div>\n </div>\n <hr />\n }\n </div>\n</div>\n\n<mat-paginator\n #paginator\n [length]=\"length\"\n [pageSize]=\"pageSize\"\n [pageSizeOptions]=\"pageSizeOptions\"\n (page)=\"pageEvent = findAll($event)\"\n hidePageSize\n showFirstLastButtons\n>\n</mat-paginator>\n", styles: ["mat-form-field{width:100%}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: ToolbarComponent, selector: "rolatech-toolbar", inputs: ["title", "subtitle", "back", "link", "large", "divider"] }, { kind: "ngmodule", type: MatPaginatorModule }, { kind: "component", type: i1$1.MatPaginator, selector: "mat-paginator", inputs: ["color", "pageIndex", "length", "pageSize", "pageSizeOptions", "hidePageSize", "showFirstLastButtons", "selectConfig", "disabled"], outputs: ["page"], exportAs: ["matPaginator"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i4.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i4.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i4.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }] });
|
|
203
|
+
}
|
|
204
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: UserIndexComponent, decorators: [{
|
|
205
|
+
type: Component,
|
|
206
|
+
args: [{ selector: 'rolatech-user-index', imports: [
|
|
207
|
+
CommonModule,
|
|
208
|
+
ToolbarComponent,
|
|
209
|
+
MatPaginatorModule,
|
|
210
|
+
MatButtonModule,
|
|
211
|
+
MatIconModule,
|
|
212
|
+
MatMenuModule,
|
|
213
|
+
MatFormFieldModule,
|
|
214
|
+
MatInputModule,
|
|
215
|
+
], template: "<rolatech-toolbar title=\"Users\">\n <button mat-icon-button (click)=\"isSearch = true\">\n <mat-icon>search</mat-icon>\n </button>\n <button mat-icon-button [matMenuTriggerFor]=\"beforeMenu\">\n <mat-icon>sort</mat-icon>\n </button>\n <mat-menu #beforeMenu=\"matMenu\" xPosition=\"before\">\n @for (item of orderOptions; track item) {\n <button mat-menu-item (click)=\"onClick(item)\">\n <span>{{ item.value }}</span>\n <mat-icon>{{ item.icon }}</mat-icon>\n </button>\n }\n </mat-menu>\n</rolatech-toolbar>\n<div class=\"px-4\">\n @if (isSearch) {\n <mat-form-field floatLabel=\"auto\" subscriptSizing=\"dynamic\">\n <input type=\"text\" matInput placeholder=\"Name\" (keyup.enter)=\"search($event)\" />\n <button matSuffix mat-icon-button (click)=\"findAll(null); isSearch = false\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n }\n <div>\n @for (user of users; track $index) {\n <div class=\"flex w-full justify-between items-center py-2 hover:bg-[--rt-raised-background] cursor-pointer\">\n <div class=\"flex items-center\">\n <div class=\"bg-[--rt-brand-color] w-12 h-12 rounded-full\">\n @if (user.avatar) {\n <img class=\"w-12 h-12 object-cover rounded-full\" [src]=\"user.avatar\" alt=\"avatar img\" />\n }\n </div>\n <div class=\"flex flex-col ml-3\">\n <a class=\"text-lg font-bold\">\n <span>{{ user.name }}</span>\n </a>\n <a class=\"text-md\">\n <span>{{ user.username }}</span>\n </a>\n </div>\n </div>\n </div>\n <hr />\n }\n </div>\n</div>\n\n<mat-paginator\n #paginator\n [length]=\"length\"\n [pageSize]=\"pageSize\"\n [pageSizeOptions]=\"pageSizeOptions\"\n (page)=\"pageEvent = findAll($event)\"\n hidePageSize\n showFirstLastButtons\n>\n</mat-paginator>\n", styles: ["mat-form-field{width:100%}\n"] }]
|
|
216
|
+
}] });
|
|
217
|
+
|
|
218
|
+
class AgentManageApplicationDetailComponent extends BaseComponent {
|
|
219
|
+
authAgentService = inject(AuthAgentService);
|
|
220
|
+
application;
|
|
221
|
+
status = AgentApplicationStatus;
|
|
222
|
+
ngOnInit() {
|
|
223
|
+
this.getApplication();
|
|
224
|
+
}
|
|
225
|
+
getApplication() {
|
|
226
|
+
this.authAgentService.getApplication(this.id).subscribe({
|
|
227
|
+
next: (res) => {
|
|
228
|
+
this.application = res.data;
|
|
229
|
+
},
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
approve() {
|
|
233
|
+
const dialogRef = this.dialog.open(AcceptDialogComponent, {
|
|
234
|
+
width: '400px',
|
|
235
|
+
data: {
|
|
236
|
+
title: 'Approve',
|
|
237
|
+
message: 'Approve this agent application?',
|
|
238
|
+
},
|
|
239
|
+
});
|
|
240
|
+
dialogRef.afterClosed().subscribe((result) => {
|
|
241
|
+
if (result) {
|
|
242
|
+
this.authAgentService.approve(this.id).subscribe({
|
|
243
|
+
next: (res) => {
|
|
244
|
+
console.log(res);
|
|
245
|
+
// this.application.status = 'APPROVED';
|
|
246
|
+
// this.application.status = AgentApplicationStatus['APPROVED' as keyof typeof AgentApplicationStatus];
|
|
247
|
+
this.application.status = 'APPROVED';
|
|
248
|
+
this.snackBarService.open('Approved');
|
|
249
|
+
},
|
|
250
|
+
error: (e) => {
|
|
251
|
+
this.snackBarService.open(e.message);
|
|
252
|
+
},
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
reject() {
|
|
258
|
+
const dialogRef = this.dialog.open(RejectDialogComponent, {
|
|
259
|
+
width: '400px',
|
|
260
|
+
data: {
|
|
261
|
+
content: '',
|
|
262
|
+
},
|
|
263
|
+
});
|
|
264
|
+
dialogRef.afterClosed().subscribe((result) => {
|
|
265
|
+
if (result) {
|
|
266
|
+
this.authAgentService.reject(this.id, result).subscribe({
|
|
267
|
+
next: (res) => {
|
|
268
|
+
this.application.status = 'REJECTED';
|
|
269
|
+
this.snackBarService.open('Rejected');
|
|
270
|
+
},
|
|
271
|
+
error: (e) => {
|
|
272
|
+
this.snackBarService.open(e.message);
|
|
273
|
+
},
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: AgentManageApplicationDetailComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
279
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.3", type: AgentManageApplicationDetailComponent, isStandalone: true, selector: "rolatech-agent-manage-application-detail", usesInheritance: true, ngImport: i0, template: "@if (application) {\n <rolatech-toolbar [title]=\"status[application.status]\" large link=\"../../\">\n @if (application.status.toString() === 'PENDING') {\n <button mat-flat-button (click)=\"approve()\" i18n>Approve</button>\n <button mat-button (click)=\"reject()\" i18n>Reject</button>\n }\n </rolatech-toolbar>\n <div class=\"px-4\">\n <div>\n <div class=\"text-lg font-bold py-2\">User details</div>\n <div class=\"flex\">\n <div class=\"bg-[--rt-brand-color] min-w-12 max-h-12 rounded-full mr-3\">\n @if (application.user.avatar) {\n <img class=\"w-12 h-12 object-cover rounded-full\" [src]=\"application.user.avatar\" alt=\"avatar img\" />\n }\n </div>\n <div class=\"flex flex-col w-full\">\n @if (application.user.firstName) {\n <div>{{ application.user.firstName }}, {{ application.user.lastName }}</div>\n } @else {\n @if (application.user.name) {\n <div>{{ application.user.name }}</div>\n }\n }\n <div class=\"inline-flex gap-1 mt-2\">\n <div>\n <span i18n>Phone: </span>\n <span class=\"mr-1\">{{ application.phone }}</span>\n </div>\n <div>\n <span i18n>Email: </span>\n <span class=\"mr-1\">{{ application.email }}</span>\n </div>\n </div>\n </div>\n </div>\n </div>\n <hr class=\"my-3\" />\n <div>\n <div class=\"text-lg font-bold py-2\">Application details</div>\n <div class=\"flex overflow-x-scroll scrollbar-hide\">\n <div class=\"flex flex-col w-full\">\n <rolatech-rich-label label=\"Business Name\" [title]=\"application.businessName\"></rolatech-rich-label>\n <rolatech-rich-label label=\"Experience Years\" [title]=\"application.experienceYears\"></rolatech-rich-label>\n <rolatech-rich-label label=\"Created At\" [title]=\"application.createdAt\"></rolatech-rich-label>\n </div>\n </div>\n <hr class=\"my-3\" />\n </div>\n <div>\n <div class=\"text-lg font-bold py-2\">Documents</div>\n @if (application.documents.length > 0) {\n @for (item of application.documents; track $index) {\n <a class=\"underline underline-offset-4\" [href]=\"item\" target=\"_blank\">Document: {{ $index + 1 }}</a>\n }\n } @else {\n <rolatech-empty></rolatech-empty>\n }\n </div>\n </div>\n}\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: ToolbarComponent, selector: "rolatech-toolbar", inputs: ["title", "subtitle", "back", "link", "large", "divider"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: RichLabelComponent, selector: "rolatech-rich-label", inputs: ["label", "title"] }, { kind: "component", type: EmptyComponent, selector: "rolatech-empty" }] });
|
|
280
|
+
}
|
|
281
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: AgentManageApplicationDetailComponent, decorators: [{
|
|
282
|
+
type: Component,
|
|
283
|
+
args: [{ selector: 'rolatech-agent-manage-application-detail', imports: [CommonModule, ToolbarComponent, MatButtonModule, RichLabelComponent, EmptyComponent], template: "@if (application) {\n <rolatech-toolbar [title]=\"status[application.status]\" large link=\"../../\">\n @if (application.status.toString() === 'PENDING') {\n <button mat-flat-button (click)=\"approve()\" i18n>Approve</button>\n <button mat-button (click)=\"reject()\" i18n>Reject</button>\n }\n </rolatech-toolbar>\n <div class=\"px-4\">\n <div>\n <div class=\"text-lg font-bold py-2\">User details</div>\n <div class=\"flex\">\n <div class=\"bg-[--rt-brand-color] min-w-12 max-h-12 rounded-full mr-3\">\n @if (application.user.avatar) {\n <img class=\"w-12 h-12 object-cover rounded-full\" [src]=\"application.user.avatar\" alt=\"avatar img\" />\n }\n </div>\n <div class=\"flex flex-col w-full\">\n @if (application.user.firstName) {\n <div>{{ application.user.firstName }}, {{ application.user.lastName }}</div>\n } @else {\n @if (application.user.name) {\n <div>{{ application.user.name }}</div>\n }\n }\n <div class=\"inline-flex gap-1 mt-2\">\n <div>\n <span i18n>Phone: </span>\n <span class=\"mr-1\">{{ application.phone }}</span>\n </div>\n <div>\n <span i18n>Email: </span>\n <span class=\"mr-1\">{{ application.email }}</span>\n </div>\n </div>\n </div>\n </div>\n </div>\n <hr class=\"my-3\" />\n <div>\n <div class=\"text-lg font-bold py-2\">Application details</div>\n <div class=\"flex overflow-x-scroll scrollbar-hide\">\n <div class=\"flex flex-col w-full\">\n <rolatech-rich-label label=\"Business Name\" [title]=\"application.businessName\"></rolatech-rich-label>\n <rolatech-rich-label label=\"Experience Years\" [title]=\"application.experienceYears\"></rolatech-rich-label>\n <rolatech-rich-label label=\"Created At\" [title]=\"application.createdAt\"></rolatech-rich-label>\n </div>\n </div>\n <hr class=\"my-3\" />\n </div>\n <div>\n <div class=\"text-lg font-bold py-2\">Documents</div>\n @if (application.documents.length > 0) {\n @for (item of application.documents; track $index) {\n <a class=\"underline underline-offset-4\" [href]=\"item\" target=\"_blank\">Document: {{ $index + 1 }}</a>\n }\n } @else {\n <rolatech-empty></rolatech-empty>\n }\n </div>\n </div>\n}\n" }]
|
|
284
|
+
}] });
|
|
285
|
+
|
|
286
|
+
class AgentApplicationItemComponent {
|
|
287
|
+
application = input.required();
|
|
288
|
+
status = AgentApplicationStatus;
|
|
289
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: AgentApplicationItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
290
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.3", type: AgentApplicationItemComponent, isStandalone: true, selector: "rolatech-agent-application-item", inputs: { application: { classPropertyName: "application", publicName: "application", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<div class=\"flex flex-col hover:bg-[--rt-raised-background] cursor-pointer p-3\">\n <div class=\"flex justify-between w-full mb-2\">\n <a class=\"flex items-center gap-3\">\n <span>Application ID: {{ application().id }}</span>\n </a>\n <span class=\"font-medium text-sm\">{{ status[application().status] }}</span>\n </div>\n <div class=\"flex overflow-x-scroll scrollbar-hide\">\n <div class=\"bg-[--rt-brand-color] min-w-12 max-h-12 rounded-full mr-3\">\n @if (application().user.avatar) {\n <img class=\"w-12 h-12 object-cover rounded-full\" [src]=\"application().user.avatar\" alt=\"avatar img\" />\n }\n </div>\n <div class=\"flex flex-col w-full\">\n <div>{{ application().businessName }}</div>\n <div class=\"inline-flex gap-1 mt-2\">\n <div>\n <span i18n>Phone: </span>\n <span class=\"mr-1\">{{ application().experienceYears }}</span>\n </div>\n <div>\n <span i18n>Email: </span>\n <span class=\"mr-1\">{{ application().user.email }}</span>\n </div>\n </div>\n <div class=\"flex justify-end\">\n <span class=\"text-sm opacity-70\">{{ application().createdAt }}</span>\n </div>\n </div>\n </div>\n <hr />\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: MatIconModule }] });
|
|
291
|
+
}
|
|
292
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: AgentApplicationItemComponent, decorators: [{
|
|
293
|
+
type: Component,
|
|
294
|
+
args: [{ selector: 'rolatech-agent-application-item', imports: [MatIconModule], template: "<div class=\"flex flex-col hover:bg-[--rt-raised-background] cursor-pointer p-3\">\n <div class=\"flex justify-between w-full mb-2\">\n <a class=\"flex items-center gap-3\">\n <span>Application ID: {{ application().id }}</span>\n </a>\n <span class=\"font-medium text-sm\">{{ status[application().status] }}</span>\n </div>\n <div class=\"flex overflow-x-scroll scrollbar-hide\">\n <div class=\"bg-[--rt-brand-color] min-w-12 max-h-12 rounded-full mr-3\">\n @if (application().user.avatar) {\n <img class=\"w-12 h-12 object-cover rounded-full\" [src]=\"application().user.avatar\" alt=\"avatar img\" />\n }\n </div>\n <div class=\"flex flex-col w-full\">\n <div>{{ application().businessName }}</div>\n <div class=\"inline-flex gap-1 mt-2\">\n <div>\n <span i18n>Phone: </span>\n <span class=\"mr-1\">{{ application().experienceYears }}</span>\n </div>\n <div>\n <span i18n>Email: </span>\n <span class=\"mr-1\">{{ application().user.email }}</span>\n </div>\n </div>\n <div class=\"flex justify-end\">\n <span class=\"text-sm opacity-70\">{{ application().createdAt }}</span>\n </div>\n </div>\n </div>\n <hr />\n</div>\n" }]
|
|
295
|
+
}] });
|
|
296
|
+
|
|
297
|
+
class AgentManageApplicationIndexComponent extends BaseComponent {
|
|
298
|
+
authAgentService = inject(AuthAgentService);
|
|
299
|
+
applications = [];
|
|
300
|
+
select = 0;
|
|
301
|
+
links = [
|
|
302
|
+
{
|
|
303
|
+
name: 'All',
|
|
304
|
+
icon: 'dashboard',
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
name: 'Pending',
|
|
308
|
+
icon: 'category',
|
|
309
|
+
status: 'pending',
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
name: 'Approved',
|
|
313
|
+
icon: 'category',
|
|
314
|
+
status: 'approved',
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
name: 'Rejected',
|
|
318
|
+
icon: 'category',
|
|
319
|
+
status: 'rejected',
|
|
320
|
+
},
|
|
321
|
+
];
|
|
322
|
+
filterOptions = {
|
|
323
|
+
type: '',
|
|
324
|
+
status: '',
|
|
325
|
+
};
|
|
326
|
+
ngOnInit() {
|
|
327
|
+
this.route.queryParams.subscribe(({ status }) => {
|
|
328
|
+
this.select = this.links.findIndex((item) => item.status === status);
|
|
329
|
+
if (status) {
|
|
330
|
+
this.filterOptions.status = status.toUpperCase();
|
|
331
|
+
}
|
|
332
|
+
else {
|
|
333
|
+
delete this.filterOptions.status;
|
|
334
|
+
}
|
|
335
|
+
this.findApplications();
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
findApplications() {
|
|
339
|
+
const options = {
|
|
340
|
+
sort: 'updatedAt desc',
|
|
341
|
+
};
|
|
342
|
+
const filterString = this.convertFilterOptions(this.filterOptions);
|
|
343
|
+
if (filterString) {
|
|
344
|
+
options['filter'] = filterString;
|
|
345
|
+
}
|
|
346
|
+
this.authAgentService.findAllApplications(options).subscribe({
|
|
347
|
+
next: (res) => {
|
|
348
|
+
this.applications = res.data;
|
|
349
|
+
},
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
convertFilterOptions(jsonObj) {
|
|
353
|
+
return Object.entries(jsonObj)
|
|
354
|
+
.filter(([key, value]) => value !== '' && value !== undefined)
|
|
355
|
+
.map(([key, value]) => {
|
|
356
|
+
return `${key}:${value}`;
|
|
357
|
+
})
|
|
358
|
+
.join(',');
|
|
359
|
+
}
|
|
360
|
+
viewPdf(url) {
|
|
361
|
+
console.log(url);
|
|
362
|
+
const options = {
|
|
363
|
+
title: '',
|
|
364
|
+
component: PdfViewerComponent,
|
|
365
|
+
data: {
|
|
366
|
+
url: url,
|
|
367
|
+
},
|
|
368
|
+
};
|
|
369
|
+
this.dialogService.open(options);
|
|
370
|
+
this.dialogService.confirmed();
|
|
371
|
+
}
|
|
372
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: AgentManageApplicationIndexComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
373
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.3", type: AgentManageApplicationIndexComponent, isStandalone: true, selector: "rolatech-agent-manage-application-index", usesInheritance: true, ngImport: i0, template: "<rolatech-toolbar title=\"Applications\">\n <div class=\"flex items-center gap-2\"></div>\n</rolatech-toolbar>\n<rolatech-tabs [select]=\"select\">\n @for (item of links; track item) {\n @if (item.status) {\n <rolatech-tab [label]=\"item.name\" routerLink=\"./\" [queryParams]=\"{ status: item.status }\"></rolatech-tab>\n } @else {\n <rolatech-tab [label]=\"item.name\" routerLink=\"./\"></rolatech-tab>\n }\n }\n</rolatech-tabs>\n<div>\n @if (applications) {\n @for (application of applications; track $index) {\n <rolatech-agent-application-item\n [application]=\"application\"\n [routerLink]=\"['./', application.id]\"\n ></rolatech-agent-application-item>\n }\n } @else {\n <rolatech-empty></rolatech-empty>\n }\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: ToolbarComponent, selector: "rolatech-toolbar", inputs: ["title", "subtitle", "back", "link", "large", "divider"] }, { kind: "component", type: TabsComponent, selector: "rolatech-tabs", inputs: ["select", "loading"], outputs: ["selectChange"] }, { kind: "component", type: TabComponent, selector: "rolatech-tab", inputs: ["label"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: AgentApplicationItemComponent, selector: "rolatech-agent-application-item", inputs: ["application"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: EmptyComponent, selector: "rolatech-empty" }] });
|
|
374
|
+
}
|
|
375
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: AgentManageApplicationIndexComponent, decorators: [{
|
|
376
|
+
type: Component,
|
|
377
|
+
args: [{ selector: 'rolatech-agent-manage-application-index', imports: [
|
|
378
|
+
CommonModule,
|
|
379
|
+
ToolbarComponent,
|
|
380
|
+
TabsComponent,
|
|
381
|
+
TabComponent,
|
|
382
|
+
MatButtonModule,
|
|
383
|
+
MatIconModule,
|
|
384
|
+
AgentApplicationItemComponent,
|
|
385
|
+
RouterLink,
|
|
386
|
+
EmptyComponent,
|
|
387
|
+
], template: "<rolatech-toolbar title=\"Applications\">\n <div class=\"flex items-center gap-2\"></div>\n</rolatech-toolbar>\n<rolatech-tabs [select]=\"select\">\n @for (item of links; track item) {\n @if (item.status) {\n <rolatech-tab [label]=\"item.name\" routerLink=\"./\" [queryParams]=\"{ status: item.status }\"></rolatech-tab>\n } @else {\n <rolatech-tab [label]=\"item.name\" routerLink=\"./\"></rolatech-tab>\n }\n }\n</rolatech-tabs>\n<div>\n @if (applications) {\n @for (application of applications; track $index) {\n <rolatech-agent-application-item\n [application]=\"application\"\n [routerLink]=\"['./', application.id]\"\n ></rolatech-agent-application-item>\n }\n } @else {\n <rolatech-empty></rolatech-empty>\n }\n</div>\n" }]
|
|
388
|
+
}] });
|
|
389
|
+
|
|
390
|
+
const agentManageApplicationRoutes = [
|
|
391
|
+
{
|
|
392
|
+
path: '',
|
|
393
|
+
component: AgentManageApplicationIndexComponent,
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
path: ':id',
|
|
397
|
+
component: AgentManageApplicationDetailComponent,
|
|
398
|
+
},
|
|
399
|
+
];
|
|
400
|
+
|
|
401
|
+
const agentRoutes = [
|
|
402
|
+
{
|
|
403
|
+
path: 'application',
|
|
404
|
+
component: AgentApplicationComponent,
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
path: 'application/:id',
|
|
408
|
+
component: AgentApplicationDetailComponent,
|
|
409
|
+
},
|
|
410
|
+
];
|
|
411
|
+
|
|
17
412
|
class UserDataService {
|
|
18
413
|
userInfo = new BehaviorSubject(null);
|
|
19
414
|
data = this.userInfo.asObservable();
|
|
20
415
|
send(data) {
|
|
21
416
|
this.userInfo.next(data);
|
|
22
417
|
}
|
|
23
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
24
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
418
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: UserDataService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
419
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: UserDataService, providedIn: 'root' });
|
|
25
420
|
}
|
|
26
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
421
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: UserDataService, decorators: [{
|
|
27
422
|
type: Injectable,
|
|
28
423
|
args: [{
|
|
29
424
|
providedIn: 'root',
|
|
@@ -106,10 +501,10 @@ class UserLayoutComponent extends BaseComponent {
|
|
|
106
501
|
},
|
|
107
502
|
});
|
|
108
503
|
}
|
|
109
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
110
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
504
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: UserLayoutComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
505
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.3", type: UserLayoutComponent, isStandalone: true, selector: "rolatech-user-layout", inputs: { selectIndex: { classPropertyName: "selectIndex", publicName: "selectIndex", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectIndex: "selectIndexChange" }, usesInheritance: true, ngImport: i0, template: "<rolatech-container>\n @if (userInfo) {\n <div>\n <div class=\"h-8\"></div>\n <div class=\"flex\">\n <div\n class=\"w-[80px] h-[80px] md:w-36 md:h-36 sm:w-28 sm:h-28 rounded-full border-white mr-4 bg-[--rt-raised-background]\"\n >\n @defer {\n <rolatech-avatar [src]=\"userInfo.avatar + '!w400'\" size=\"full\"> </rolatech-avatar>\n }\n </div>\n <div class=\"flex flex-col flex-grow\">\n <div class=\"flex justify-between items-center sm:mt-1\">\n <div class=\"flex items-center gap-2\">\n <div class=\"text-xl md:text-2xl font-medium\">\n <span>{{ userInfo.name }}</span>\n </div>\n <mat-icon color=\"primary\">verified</mat-icon>\n </div>\n <div>\n @if (isFollowed) {\n <button mat-flat-button (click)=\"unfollow()\" class=\"w-28 max-h-8\" i18n>Unfollow</button>\n } @else {\n <button mat-flat-button (click)=\"follow()\" class=\"w-28 max-h-8\" i18n>Follow</button>\n }\n </div>\n </div>\n <div class=\"text-sm text-[--rt-text-secondary]\">\n <div class=\"flex gap-3 py-2 items-center\">\n <a>\n <span>@{{ userInfo.username }}</span>\n </a>\n <a class=\"cursor-pointer hover:text-orange-600\" [routerLink]=\"['./following']\">\n <span class=\"font-bold\">{{ statsData?.following }}</span>\n <span class=\"ml-1\" i18n>Following</span>\n </a>\n <a class=\"cursor-pointer hover:text-orange-600\" [routerLink]=\"['./followers']\">\n <span class=\"font-bold\">{{ statsData?.followers }}</span>\n <span class=\"ml-1\" i18n>Followers</span>\n </a>\n </div>\n <div class=\"mb-3\">\n <div>\n {{ userInfo.bio }}\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"py-2\">\n <rolatech-tabs [(select)]=\"selectIndex\" ngSkipHydration>\n <rolatech-tab label=\"Course\" routerLink=\"./\"></rolatech-tab>\n <rolatech-tab label=\"Community\" routerLink=\"./community\"></rolatech-tab>\n <rolatech-tab label=\"Store\" routerLink=\"./store\"></rolatech-tab>\n </rolatech-tabs>\n </div>\n\n <router-outlet></router-outlet>\n </div>\n }\n</rolatech-container>\n", styles: ["mat-icon{transform:scale(.8);color:var(--rt-brand-color)}\n"], dependencies: [{ kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: ContainerComponent, selector: "rolatech-container" }, { kind: "component", type: TabsComponent, selector: "rolatech-tabs", inputs: ["select", "loading"], outputs: ["selectChange"] }, { kind: "component", type: TabComponent, selector: "rolatech-tab", inputs: ["label"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "directive", type: RouterOutlet, selector: "router-outlet", inputs: ["name", "routerOutletData"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }], deferBlockDependencies: [() => [AvatarComponent]] });
|
|
111
506
|
}
|
|
112
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
507
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: UserLayoutComponent, decorators: [{
|
|
113
508
|
type: Component,
|
|
114
509
|
args: [{ selector: 'rolatech-user-layout', imports: [
|
|
115
510
|
MatIconModule,
|
|
@@ -122,7 +517,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImpor
|
|
|
122
517
|
TabsComponent,
|
|
123
518
|
TabComponent,
|
|
124
519
|
RouterOutlet,
|
|
125
|
-
], template: "<rolatech-container>\n @if (userInfo) {\n <div>\n <div class=\"h-8\"></div>\n <div class=\"flex\">\n <div\n class=\"w-[80px] h-[80px] md:w-36 md:h-36 sm:w-28 sm:h-28 rounded-full border-white mr-4 bg-[--rt-raised-background]\"\n >\n @defer {\n <rolatech-avatar [src]=\"userInfo.avatar + '!w400'\" size=\"full\"> </rolatech-avatar>\n }\n </div>\n <div class=\"flex flex-col flex-grow\">\n <div class=\"flex justify-between items-center sm:mt-1\">\n <div class=\"flex items-center gap-2\">\n <div class=\"text-xl md:text-2xl font-medium\">\n <span>{{ userInfo.name }}</span>\n </div>\n <mat-icon color=\"primary\">verified</mat-icon>\n </div>\n <div>\n @if (isFollowed) {\n <button mat-flat-button (click)=\"unfollow()\" class=\"w-28 max-h-8\"
|
|
520
|
+
], template: "<rolatech-container>\n @if (userInfo) {\n <div>\n <div class=\"h-8\"></div>\n <div class=\"flex\">\n <div\n class=\"w-[80px] h-[80px] md:w-36 md:h-36 sm:w-28 sm:h-28 rounded-full border-white mr-4 bg-[--rt-raised-background]\"\n >\n @defer {\n <rolatech-avatar [src]=\"userInfo.avatar + '!w400'\" size=\"full\"> </rolatech-avatar>\n }\n </div>\n <div class=\"flex flex-col flex-grow\">\n <div class=\"flex justify-between items-center sm:mt-1\">\n <div class=\"flex items-center gap-2\">\n <div class=\"text-xl md:text-2xl font-medium\">\n <span>{{ userInfo.name }}</span>\n </div>\n <mat-icon color=\"primary\">verified</mat-icon>\n </div>\n <div>\n @if (isFollowed) {\n <button mat-flat-button (click)=\"unfollow()\" class=\"w-28 max-h-8\" i18n>Unfollow</button>\n } @else {\n <button mat-flat-button (click)=\"follow()\" class=\"w-28 max-h-8\" i18n>Follow</button>\n }\n </div>\n </div>\n <div class=\"text-sm text-[--rt-text-secondary]\">\n <div class=\"flex gap-3 py-2 items-center\">\n <a>\n <span>@{{ userInfo.username }}</span>\n </a>\n <a class=\"cursor-pointer hover:text-orange-600\" [routerLink]=\"['./following']\">\n <span class=\"font-bold\">{{ statsData?.following }}</span>\n <span class=\"ml-1\" i18n>Following</span>\n </a>\n <a class=\"cursor-pointer hover:text-orange-600\" [routerLink]=\"['./followers']\">\n <span class=\"font-bold\">{{ statsData?.followers }}</span>\n <span class=\"ml-1\" i18n>Followers</span>\n </a>\n </div>\n <div class=\"mb-3\">\n <div>\n {{ userInfo.bio }}\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"py-2\">\n <rolatech-tabs [(select)]=\"selectIndex\" ngSkipHydration>\n <rolatech-tab label=\"Course\" routerLink=\"./\"></rolatech-tab>\n <rolatech-tab label=\"Community\" routerLink=\"./community\"></rolatech-tab>\n <rolatech-tab label=\"Store\" routerLink=\"./store\"></rolatech-tab>\n </rolatech-tabs>\n </div>\n\n <router-outlet></router-outlet>\n </div>\n }\n</rolatech-container>\n", styles: ["mat-icon{transform:scale(.8);color:var(--rt-brand-color)}\n"] }]
|
|
126
521
|
}], ctorParameters: () => [] });
|
|
127
522
|
|
|
128
523
|
class UserInfoComponent extends BaseComponent {
|
|
@@ -152,10 +547,10 @@ class UserInfoComponent extends BaseComponent {
|
|
|
152
547
|
},
|
|
153
548
|
});
|
|
154
549
|
}
|
|
155
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
156
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
550
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: UserInfoComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
551
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.3", type: UserInfoComponent, isStandalone: true, selector: "rolatech-user-info", usesInheritance: true, ngImport: i0, template: "<rolatech-rich-view list>\n @for (item of courses; track $index) {\n <rolatech-rich-item\n [title]=\"item.name\"\n [thumbnail]=\"item.media[0].url + '!w400'\"\n [price]=\"(item.pricing[0].total / 100).toFixed(2)\"\n [routerLink]=\"['/courses', item.id]\"\n class=\"cursor-pointer hover:bg-[--rt-raised-background]\"\n ></rolatech-rich-item>\n }\n</rolatech-rich-view>\n", styles: [""], dependencies: [{ kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: RichViewComponent, selector: "rolatech-rich-view", inputs: ["list", "wrap"] }, { kind: "component", type: RichItemComponent, selector: "rolatech-rich-item", inputs: ["list", "thumbnail", "avatar", "title", "subtitle", "price", "thumbnailRatio", "currencySymbol"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
157
552
|
}
|
|
158
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
553
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: UserInfoComponent, decorators: [{
|
|
159
554
|
type: Component,
|
|
160
555
|
args: [{ selector: 'rolatech-user-info', imports: [RouterLink, RichViewComponent, RichItemComponent], encapsulation: ViewEncapsulation.None, template: "<rolatech-rich-view list>\n @for (item of courses; track $index) {\n <rolatech-rich-item\n [title]=\"item.name\"\n [thumbnail]=\"item.media[0].url + '!w400'\"\n [price]=\"(item.pricing[0].total / 100).toFixed(2)\"\n [routerLink]=\"['/courses', item.id]\"\n class=\"cursor-pointer hover:bg-[--rt-raised-background]\"\n ></rolatech-rich-item>\n }\n</rolatech-rich-view>\n" }]
|
|
161
556
|
}], ctorParameters: () => [] });
|
|
@@ -167,10 +562,10 @@ class UserCommunityComponent {
|
|
|
167
562
|
next: (userInfo) => { },
|
|
168
563
|
});
|
|
169
564
|
}
|
|
170
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
171
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
565
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: UserCommunityComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
566
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.3", type: UserCommunityComponent, isStandalone: true, selector: "rolatech-user-community", ngImport: i0, template: "<rolatech-empty></rolatech-empty>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: EmptyComponent, selector: "rolatech-empty" }], encapsulation: i0.ViewEncapsulation.None });
|
|
172
567
|
}
|
|
173
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
568
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: UserCommunityComponent, decorators: [{
|
|
174
569
|
type: Component,
|
|
175
570
|
args: [{ selector: 'rolatech-user-community', imports: [CommonModule, EmptyComponent], encapsulation: ViewEncapsulation.None, template: "<rolatech-empty></rolatech-empty>\n" }]
|
|
176
571
|
}] });
|
|
@@ -197,10 +592,10 @@ class UserStoreComponent {
|
|
|
197
592
|
},
|
|
198
593
|
});
|
|
199
594
|
}
|
|
200
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
201
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
595
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: UserStoreComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
596
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.3", type: UserStoreComponent, isStandalone: true, selector: "rolatech-user-store", ngImport: i0, template: "@if (products) {\n <div>\n <rolatech-rich-view wrap>\n @for (item of products; track item) {\n @defer {\n <rolatech-rich-item\n [routerLink]=\"['/products', item.id]\"\n [thumbnail]=\"item.media ? item.media[0].url + '!w400' : ''\"\n [title]=\"item.name\"\n [subtitle]=\"item.description\"\n [price]=\"(item.price / 100).toFixed(2)\"\n thumbnailRatio=\"square\"\n ></rolatech-rich-item>\n }\n }\n </rolatech-rich-view>\n </div>\n} @else {\n <rolatech-empty></rolatech-empty>\n}\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: EmptyComponent, selector: "rolatech-empty" }, { kind: "component", type: RichViewComponent, selector: "rolatech-rich-view", inputs: ["list", "wrap"] }], encapsulation: i0.ViewEncapsulation.None, deferBlockDependencies: [() => [RichItemComponent, import('@angular/router').then(m => m.RouterLink)]] });
|
|
202
597
|
}
|
|
203
|
-
i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "
|
|
598
|
+
i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "20.0.3", ngImport: i0, type: UserStoreComponent, resolveDeferredDeps: () => [import('@angular/router').then(m => m.RouterLink)], resolveMetadata: RouterLink => ({ decorators: [{
|
|
204
599
|
type: Component,
|
|
205
600
|
args: [{ selector: 'rolatech-user-store', imports: [CommonModule, EmptyComponent, RichViewComponent, RichItemComponent, RouterLink], encapsulation: ViewEncapsulation.None, template: "@if (products) {\n <div>\n <rolatech-rich-view wrap>\n @for (item of products; track item) {\n @defer {\n <rolatech-rich-item\n [routerLink]=\"['/products', item.id]\"\n [thumbnail]=\"item.media ? item.media[0].url + '!w400' : ''\"\n [title]=\"item.name\"\n [subtitle]=\"item.description\"\n [price]=\"(item.price / 100).toFixed(2)\"\n thumbnailRatio=\"square\"\n ></rolatech-rich-item>\n }\n }\n </rolatech-rich-view>\n </div>\n} @else {\n <rolatech-empty></rolatech-empty>\n}\n" }]
|
|
206
601
|
}], ctorParameters: null, propDecorators: null }) });
|
|
@@ -218,12 +613,12 @@ class UserItemComponent {
|
|
|
218
613
|
onUnFollow() {
|
|
219
614
|
this.unfollow.emit(this.user().username);
|
|
220
615
|
}
|
|
221
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
222
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
616
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: UserItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
617
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.3", type: UserItemComponent, isStandalone: true, selector: "rolatech-user-item", inputs: { user: { classPropertyName: "user", publicName: "user", isSignal: true, isRequired: false, transformFunction: null }, isFollowing: { classPropertyName: "isFollowing", publicName: "isFollowing", isSignal: true, isRequired: false, transformFunction: null }, own: { classPropertyName: "own", publicName: "own", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { follow: "follow", unfollow: "unfollow" }, host: { properties: { "class.rolatech-user-item": "this.hasClass" } }, ngImport: i0, template: "<div class=\"flex w-full justify-between items-center p-2 hover:bg-[--rt-raised-background] cursor-pointer\">\n <div class=\"flex items-center\">\n <div class=\"bg-[--rt-brand-color] w-12 h-12 rounded-full\">\n @if (user().avatar) {\n <img class=\"w-12 h-12 object-cover rounded-full\" [src]=\"user().avatar\" alt=\"avatar img\" />\n }\n </div>\n <div class=\"flex flex-col ml-3\">\n <a class=\"text-lg font-bold\">\n <span>{{ user().name }}</span>\n </a>\n <a class=\"text-md\">\n <span>{{ user().username }}</span>\n </a>\n </div>\n </div>\n @if (!own()) {\n @if (isFollowing()) {\n <button mat-flat-button class=\"w-28 max-h-8\" (click)=\"onUnFollow()\" i18n>Unfollow</button>\n } @else {\n <button mat-flat-button class=\"w-28 max-h-8\" (click)=\"onFollow()\" i18n>Follow</button>\n }\n }\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
223
618
|
}
|
|
224
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
619
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: UserItemComponent, decorators: [{
|
|
225
620
|
type: Component,
|
|
226
|
-
args: [{ selector: 'rolatech-user-item', imports: [CommonModule, MatButtonModule], encapsulation: ViewEncapsulation.None, template: "<div class=\"flex w-full justify-between items-center p-2 hover:bg-[--rt-raised-background] cursor-pointer\">\n <div class=\"flex items-center\">\n <div class=\"bg-[--rt-brand-color] w-12 h-12 rounded-full\">\n @if (user().avatar) {\n <img class=\"w-12 h-12 object-cover rounded-full\" [src]=\"user().avatar\" alt=\"avatar img\" />\n }\n </div>\n <div class=\"flex flex-col ml-3\">\n <a class=\"text-lg font-bold\">\n <span>{{ user().name }}</span>\n </a>\n <a class=\"text-md\">\n <span>{{ user().username }}</span>\n </a>\n </div>\n </div>\n @if (!own()) {\n @if (isFollowing()) {\n <button mat-flat-button class=\"w-28 max-h-8\" (click)=\"onUnFollow()\"
|
|
621
|
+
args: [{ selector: 'rolatech-user-item', imports: [CommonModule, MatButtonModule], encapsulation: ViewEncapsulation.None, template: "<div class=\"flex w-full justify-between items-center p-2 hover:bg-[--rt-raised-background] cursor-pointer\">\n <div class=\"flex items-center\">\n <div class=\"bg-[--rt-brand-color] w-12 h-12 rounded-full\">\n @if (user().avatar) {\n <img class=\"w-12 h-12 object-cover rounded-full\" [src]=\"user().avatar\" alt=\"avatar img\" />\n }\n </div>\n <div class=\"flex flex-col ml-3\">\n <a class=\"text-lg font-bold\">\n <span>{{ user().name }}</span>\n </a>\n <a class=\"text-md\">\n <span>{{ user().username }}</span>\n </a>\n </div>\n </div>\n @if (!own()) {\n @if (isFollowing()) {\n <button mat-flat-button class=\"w-28 max-h-8\" (click)=\"onUnFollow()\" i18n>Unfollow</button>\n } @else {\n <button mat-flat-button class=\"w-28 max-h-8\" (click)=\"onFollow()\" i18n>Follow</button>\n }\n }\n</div>\n" }]
|
|
227
622
|
}], propDecorators: { hasClass: [{
|
|
228
623
|
type: HostBinding,
|
|
229
624
|
args: ['class.rolatech-user-item']
|
|
@@ -339,10 +734,10 @@ class UserFollowInfoComponent {
|
|
|
339
734
|
item.isFollowing = friendships[item.id].following;
|
|
340
735
|
});
|
|
341
736
|
}
|
|
342
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
343
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
737
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: UserFollowInfoComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
738
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.3", type: UserFollowInfoComponent, isStandalone: true, selector: "rolatech-user-follow-info", ngImport: i0, template: "<rolatech-container>\n <rolatech-toolbar [title]=\"userInfo?.name\" link=\"../\" [subtitle]=\"userInfo?.username\"></rolatech-toolbar>\n <div class=\"mb-3\"></div>\n\n <rolatech-tabs [(select)]=\"tabIndex\">\n <rolatech-tab label=\"\u5173\u6CE8\" [routerLink]=\"['../', 'following']\"></rolatech-tab>\n <rolatech-tab label=\"\u7C89\u4E1D\" [routerLink]=\"['../', 'followers']\"></rolatech-tab>\n </rolatech-tabs>\n <div class=\"mb-3\"></div>\n @for (user of users; track $index) {\n <rolatech-user-item\n [user]=\"user\"\n [routerLink]=\"'/@' + user.username\"\n [isFollowing]=\"user.isFollowing\"\n (follow)=\"follow(user)\"\n (unfollow)=\"unfollow(user)\"\n [own]=\"user.id === myId\"\n ></rolatech-user-item>\n }\n</rolatech-container>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: TabsComponent, selector: "rolatech-tabs", inputs: ["select", "loading"], outputs: ["selectChange"] }, { kind: "component", type: TabComponent, selector: "rolatech-tab", inputs: ["label"] }, { kind: "component", type: ContainerComponent, selector: "rolatech-container" }, { kind: "component", type: ToolbarComponent, selector: "rolatech-toolbar", inputs: ["title", "subtitle", "back", "link", "large", "divider"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: UserItemComponent, selector: "rolatech-user-item", inputs: ["user", "isFollowing", "own"], outputs: ["follow", "unfollow"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
344
739
|
}
|
|
345
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
740
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: UserFollowInfoComponent, decorators: [{
|
|
346
741
|
type: Component,
|
|
347
742
|
args: [{ selector: 'rolatech-user-follow-info', imports: [CommonModule, TabsComponent, TabComponent, ContainerComponent, ToolbarComponent, RouterLink, UserItemComponent], encapsulation: ViewEncapsulation.None, template: "<rolatech-container>\n <rolatech-toolbar [title]=\"userInfo?.name\" link=\"../\" [subtitle]=\"userInfo?.username\"></rolatech-toolbar>\n <div class=\"mb-3\"></div>\n\n <rolatech-tabs [(select)]=\"tabIndex\">\n <rolatech-tab label=\"\u5173\u6CE8\" [routerLink]=\"['../', 'following']\"></rolatech-tab>\n <rolatech-tab label=\"\u7C89\u4E1D\" [routerLink]=\"['../', 'followers']\"></rolatech-tab>\n </rolatech-tabs>\n <div class=\"mb-3\"></div>\n @for (user of users; track $index) {\n <rolatech-user-item\n [user]=\"user\"\n [routerLink]=\"'/@' + user.username\"\n [isFollowing]=\"user.isFollowing\"\n (follow)=\"follow(user)\"\n (unfollow)=\"unfollow(user)\"\n [own]=\"user.id === myId\"\n ></rolatech-user-item>\n }\n</rolatech-container>\n" }]
|
|
348
743
|
}], ctorParameters: () => [] });
|
|
@@ -376,5 +771,5 @@ const userRoutes = [
|
|
|
376
771
|
* Generated bundle index. Do not edit.
|
|
377
772
|
*/
|
|
378
773
|
|
|
379
|
-
export { userRoutes };
|
|
774
|
+
export { AgentApplicationComponent, AgentApplicationDetailComponent, UserIndexComponent, agentManageApplicationRoutes, agentRoutes, userRoutes };
|
|
380
775
|
//# sourceMappingURL=rolatech-angular-user.mjs.map
|