fas-admin 0.0.93 → 0.0.94

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.
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, Injectable, Inject, model, effect, untracked, Component, Input, inject, signal, EventEmitter, Output, NgModule } from '@angular/core';
2
+ import { InjectionToken, Injectable, Inject, model, effect, untracked, Component, Input, inject, signal, EventEmitter, Output, NgModule, ViewChild } from '@angular/core';
3
3
  import { BehaviorSubject, Subject, Subscription, of, map } from 'rxjs';
4
4
  import * as i1 from '@angular/common/http';
5
5
  import { HttpParams, HttpHeaders, HttpClient, HttpClientModule } from '@angular/common/http';
@@ -3035,138 +3035,111 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.2", ngImpor
3035
3035
  args: [{ selector: 'lib-users', template: "<div class=\"font-semibold text-3xl mb-3\">U\u017Cytkownicy</div>\n<lib-users-list></lib-users-list>\n" }]
3036
3036
  }] });
3037
3037
 
3038
+ class OperatorIssueReportsService {
3039
+ constructor(http, apiUrl) {
3040
+ this.http = http;
3041
+ this.apiUrl = apiUrl;
3042
+ this.baseUrl = `${this.apiUrl}/OperatorIssueReports`;
3043
+ }
3044
+ get() {
3045
+ const headers = this.createHeaders();
3046
+ return this.http.get(this.baseUrl, { headers });
3047
+ }
3048
+ createHeaders() {
3049
+ let headers = new HttpHeaders();
3050
+ const token = localStorage.getItem('authToken');
3051
+ if (token) {
3052
+ headers = headers.set('Authorization', `Bearer ${token}`);
3053
+ }
3054
+ return headers;
3055
+ }
3056
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.2", ngImport: i0, type: OperatorIssueReportsService, deps: [{ token: i1.HttpClient }, { token: API_URL }], target: i0.ɵɵFactoryTarget.Injectable }); }
3057
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.2", ngImport: i0, type: OperatorIssueReportsService, providedIn: 'root' }); }
3058
+ }
3059
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.2", ngImport: i0, type: OperatorIssueReportsService, decorators: [{
3060
+ type: Injectable,
3061
+ args: [{ providedIn: 'root' }]
3062
+ }], ctorParameters: () => [{ type: i1.HttpClient }, { type: undefined, decorators: [{
3063
+ type: Inject,
3064
+ args: [API_URL]
3065
+ }] }] });
3066
+
3067
+ class OperatorAppRatingsService {
3068
+ constructor(http, apiUrl) {
3069
+ this.http = http;
3070
+ this.apiUrl = apiUrl;
3071
+ this.baseUrl = `${this.apiUrl}/OperatorAppRatings`;
3072
+ }
3073
+ get() {
3074
+ const headers = this.createHeaders();
3075
+ return this.http.get(this.baseUrl, { headers });
3076
+ }
3077
+ createHeaders() {
3078
+ let headers = new HttpHeaders();
3079
+ const token = localStorage.getItem('authToken');
3080
+ if (token) {
3081
+ headers = headers.set('Authorization', `Bearer ${token}`);
3082
+ }
3083
+ return headers;
3084
+ }
3085
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.2", ngImport: i0, type: OperatorAppRatingsService, deps: [{ token: i1.HttpClient }, { token: API_URL }], target: i0.ɵɵFactoryTarget.Injectable }); }
3086
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.2", ngImport: i0, type: OperatorAppRatingsService, providedIn: 'root' }); }
3087
+ }
3088
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.2", ngImport: i0, type: OperatorAppRatingsService, decorators: [{
3089
+ type: Injectable,
3090
+ args: [{ providedIn: 'root' }]
3091
+ }], ctorParameters: () => [{ type: i1.HttpClient }, { type: undefined, decorators: [{
3092
+ type: Inject,
3093
+ args: [API_URL]
3094
+ }] }] });
3095
+
3038
3096
  class RatingsComponent {
3039
- constructor() {
3040
- this.mockIndex = 0;
3041
- this.systemColumns = [
3042
- {
3043
- field: 'creationDate',
3044
- header: 'Data utworzenia',
3045
- sortable: true,
3046
- dateField: true,
3047
- columnClass: 'flex justify-content-between align-items-center',
3048
- actions: [
3049
- {
3050
- label: 'Szczegóły',
3051
- buttonClass: 'white-button appear',
3052
- icoSuffix: 'pi pi-arrow-right',
3053
- },
3054
- ],
3055
- },
3056
- {
3057
- field: 'userName',
3058
- header: 'Nazwa',
3059
- },
3060
- {
3061
- field: 'subscriptionType',
3062
- header: 'Treść',
3063
- },
3064
- {
3065
- field: 'subscriptionType',
3066
- header: 'Status',
3067
- },
3068
- {
3069
- field: 'subscriptionType',
3070
- header: 'Częstotliwość',
3071
- },
3072
- {
3073
- field: 'subscriptionType',
3074
- header: 'Grupa',
3075
- },
3076
- {
3077
- field: 'actions',
3078
- header: 'Akcje',
3079
- sortable: false,
3080
- columnClass: 'flex justify-content-center align-items-center gap-2',
3081
- actions: [
3082
- {
3083
- label: '',
3084
- tooltip: 'Edytuj',
3085
- buttonClass: 'pi pi-pencil cursor-pointer text-center appear transparent-button',
3086
- },
3087
- {
3088
- label: '',
3089
- tooltip: '',
3090
- buttonClass: 'pi pi-play cursor-pointer text-center appear transparent-button',
3091
- },
3092
- {
3093
- label: '',
3094
- tooltip: '',
3095
- buttonClass: 'pi pi-trash cursor-pointer text-center appear transparent-button',
3096
- },
3097
- ],
3098
- },
3097
+ constructor(apiUrl) {
3098
+ this.apiUrl = apiUrl;
3099
+ this._issueReportsService = inject(OperatorIssueReportsService);
3100
+ this._appRatingsService = inject(OperatorAppRatingsService);
3101
+ this.attachmentColumnTemplates = {};
3102
+ this.fetchIssueReports = () => this._issueReportsService.get();
3103
+ this.fetchAppRatings = () => this._appRatingsService.get();
3104
+ this.issueColumns = [
3105
+ { field: 'created', columnHeader: 'Data zgłoszenia', dateField: true, sortable: true },
3106
+ { field: 'createdByEmail', columnHeader: 'Użytkownik' },
3107
+ { field: 'description', columnHeader: 'Opis' },
3108
+ { field: 'attachmentUrl', columnHeader: 'Zdjęcie', columnTemplateKey: 'attachment' },
3099
3109
  ];
3100
- this.marketingColumns = [
3101
- {
3102
- field: 'creationDate',
3103
- header: 'Data utworzenia',
3104
- sortable: true,
3105
- dateField: true,
3106
- columnClass: 'flex justify-content-between align-items-center',
3107
- actions: [
3108
- {
3109
- label: 'Szczegóły',
3110
- buttonClass: 'white-button appear',
3111
- icoSuffix: 'pi pi-arrow-right',
3112
- },
3113
- ],
3114
- },
3115
- {
3116
- field: 'userName',
3117
- header: 'Nazwa',
3118
- },
3119
- {
3120
- field: 'subscriptionType',
3121
- header: 'Treść',
3122
- },
3110
+ this.ratingColumns = [
3111
+ { field: 'created', columnHeader: 'Data oceny', dateField: true, sortable: true },
3112
+ { field: 'createdByEmail', columnHeader: 'Użytkownik' },
3123
3113
  {
3124
- field: 'subscriptionType',
3125
- header: 'Status',
3126
- },
3127
- {
3128
- field: 'subscriptionType',
3129
- header: 'Częstotliwość',
3130
- },
3131
- {
3132
- field: 'subscriptionType',
3133
- header: 'Grupa',
3134
- },
3135
- {
3136
- field: 'actions',
3137
- header: 'Akcje',
3138
- sortable: false,
3139
- columnClass: 'flex justify-content-center align-items-center gap-2',
3140
- actions: [
3141
- {
3142
- label: '',
3143
- tooltip: 'Edytuj',
3144
- buttonClass: 'pi pi-pencil cursor-pointer text-center appear transparent-button',
3145
- },
3146
- {
3147
- label: '',
3148
- tooltip: '',
3149
- buttonClass: 'pi pi-play cursor-pointer text-center appear transparent-button',
3150
- },
3151
- {
3152
- label: '',
3153
- tooltip: '',
3154
- buttonClass: 'pi pi-trash cursor-pointer text-center appear transparent-button',
3155
- },
3156
- ],
3114
+ field: 'rating',
3115
+ columnHeader: 'Ocena',
3116
+ valueFunction: (data) => '★'.repeat(data.rating) + '☆'.repeat(5 - data.rating),
3157
3117
  },
3118
+ { field: 'feedback', columnHeader: 'Opinia' },
3119
+ { field: 'attachmentUrl', columnHeader: 'Zdjęcie', columnTemplateKey: 'attachment' },
3158
3120
  ];
3159
3121
  }
3160
- ngOnInit() {
3161
- this.mockList = MOCK_DATA$1;
3122
+ ngAfterViewInit() {
3123
+ this.attachmentColumnTemplates = { attachment: this.attachmentTemplate };
3124
+ }
3125
+ resolveUrl(url) {
3126
+ if (!url)
3127
+ return undefined;
3128
+ return url.startsWith('http') ? url : `${this.apiUrl}${url}`;
3162
3129
  }
3163
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.2", ngImport: i0, type: RatingsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
3164
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.2", type: RatingsComponent, selector: "lib-ratings", ngImport: i0, template: "<p-tabView styleClass=\"tabview-lg\">\n <p-tabPanel header=\"Sugestie\"> \n\n <fas-services-table\n [value]=\"mockList\"\n [columns]=\"systemColumns\"\n [rows]=\"10\"\n [paginator]=\"true\"\n dataKey=\"\"\n [showCheckbox]=\"true\"\n [showCurrentPageReport]=\"false\"\n >\n </fas-services-table>\n </p-tabPanel>\n <p-tabPanel header=\"Oceny\"> \n <fas-services-table\n [value]=\"mockList\"\n [columns]=\"marketingColumns\"\n [rows]=\"10\"\n [paginator]=\"true\"\n dataKey=\"\"\n [showCheckbox]=\"true\"\n [showCurrentPageReport]=\"false\"\n >\n </fas-services-table>\n </p-tabPanel>\n</p-tabView>\n\n\n\n", styles: [""], dependencies: [{ kind: "component", type: i1$4.FasServiceTableComponent, selector: "fas-services-table", inputs: ["value", "columns", "rows", "scrollHeight", "rowsPerPageOptions", "paginator", "globalFilterFields", "dataKey", "showCurrentPageReport", "loading", "styleClass", "showCheckbox", "selection", "lazy", "first", "customFunction", "showEmptyColumn", "footerButtonOptions", "rowClickFunction", "isOutlineHeadlight", "isInsideHeadlight", "checkboxSelectHeadlight", "customSelectHeadlight", "showFooterPageReport", "isTransparentHeader", "customResultsName", "totalRecords"], outputs: ["pageChange", "selectionChange", "lazyLoad"] }, { kind: "component", type: i2$2.TabView, selector: "p-tabView", inputs: ["style", "styleClass", "controlClose", "scrollable", "activeIndex", "selectOnFocus", "nextButtonAriaLabel", "prevButtonAriaLabel", "autoHideButtons", "tabindex"], outputs: ["onChange", "onClose", "activeIndexChange"] }, { kind: "component", type: i2$2.TabPanel, selector: "p-tabPanel", inputs: ["closable", "headerStyle", "headerStyleClass", "cache", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "selected", "disabled", "header", "leftIcon", "rightIcon"] }] }); }
3130
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.2", ngImport: i0, type: RatingsComponent, deps: [{ token: API_URL }], target: i0.ɵɵFactoryTarget.Component }); }
3131
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.2", type: RatingsComponent, selector: "lib-ratings", viewQueries: [{ propertyName: "attachmentTemplate", first: true, predicate: ["attachmentTemplate"], descendants: true }], ngImport: i0, template: "<ng-template #attachmentTemplate let-rowData>\n <a *ngIf=\"rowData.attachmentUrl\" [href]=\"resolveUrl(rowData.attachmentUrl)\" target=\"_blank\" rel=\"noopener\">\n <img [src]=\"resolveUrl(rowData.attachmentUrl)\" style=\"max-height:60px;max-width:100px;object-fit:contain;border-radius:4px;\" />\n </a>\n</ng-template>\n\n<p-tabView styleClass=\"tabview-lg\">\n <p-tabPanel header=\"Zg\u0142oszenia b\u0142\u0119d\u00F3w\">\n <fas-service-dynamic-table\n [columns]=\"issueColumns\"\n [columnTemplates]=\"attachmentColumnTemplates\"\n [fullDataService]=\"fetchIssueReports\"\n dataMode=\"client\"\n ></fas-service-dynamic-table>\n </p-tabPanel>\n\n <p-tabPanel header=\"Oceny aplikacji\">\n <fas-service-dynamic-table\n [columns]=\"ratingColumns\"\n [columnTemplates]=\"attachmentColumnTemplates\"\n [fullDataService]=\"fetchAppRatings\"\n dataMode=\"client\"\n ></fas-service-dynamic-table>\n </p-tabPanel>\n</p-tabView>\n", styles: [""], dependencies: [{ kind: "component", type: i1$4.FasServiceDynamicTableComponent, selector: "fas-service-dynamic-table", inputs: ["dataMode", "columns", "columnTemplates", "dataService", "fullDataService", "initialPageSize", "showGlobalSearch", "resetTrigger", "refreshCurrentPage", "selectionMode", "rowSelectFunction", "rowUnSelectFunction", "dateFormat", "isTransparentHeader", "showCheckbox", "tableRowClassName", "rowHover", "paginator", "styleClass"], outputs: ["dataLoaded"] }, { kind: "component", type: i2$2.TabView, selector: "p-tabView", inputs: ["style", "styleClass", "controlClose", "scrollable", "activeIndex", "selectOnFocus", "nextButtonAriaLabel", "prevButtonAriaLabel", "autoHideButtons", "tabindex"], outputs: ["onChange", "onClose", "activeIndexChange"] }, { kind: "component", type: i2$2.TabPanel, selector: "p-tabPanel", inputs: ["closable", "headerStyle", "headerStyleClass", "cache", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "selected", "disabled", "header", "leftIcon", "rightIcon"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
3165
3132
  }
3166
3133
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.2", ngImport: i0, type: RatingsComponent, decorators: [{
3167
3134
  type: Component,
3168
- args: [{ selector: 'lib-ratings', template: "<p-tabView styleClass=\"tabview-lg\">\n <p-tabPanel header=\"Sugestie\"> \n\n <fas-services-table\n [value]=\"mockList\"\n [columns]=\"systemColumns\"\n [rows]=\"10\"\n [paginator]=\"true\"\n dataKey=\"\"\n [showCheckbox]=\"true\"\n [showCurrentPageReport]=\"false\"\n >\n </fas-services-table>\n </p-tabPanel>\n <p-tabPanel header=\"Oceny\"> \n <fas-services-table\n [value]=\"mockList\"\n [columns]=\"marketingColumns\"\n [rows]=\"10\"\n [paginator]=\"true\"\n dataKey=\"\"\n [showCheckbox]=\"true\"\n [showCurrentPageReport]=\"false\"\n >\n </fas-services-table>\n </p-tabPanel>\n</p-tabView>\n\n\n\n" }]
3169
- }] });
3135
+ args: [{ selector: 'lib-ratings', template: "<ng-template #attachmentTemplate let-rowData>\n <a *ngIf=\"rowData.attachmentUrl\" [href]=\"resolveUrl(rowData.attachmentUrl)\" target=\"_blank\" rel=\"noopener\">\n <img [src]=\"resolveUrl(rowData.attachmentUrl)\" style=\"max-height:60px;max-width:100px;object-fit:contain;border-radius:4px;\" />\n </a>\n</ng-template>\n\n<p-tabView styleClass=\"tabview-lg\">\n <p-tabPanel header=\"Zg\u0142oszenia b\u0142\u0119d\u00F3w\">\n <fas-service-dynamic-table\n [columns]=\"issueColumns\"\n [columnTemplates]=\"attachmentColumnTemplates\"\n [fullDataService]=\"fetchIssueReports\"\n dataMode=\"client\"\n ></fas-service-dynamic-table>\n </p-tabPanel>\n\n <p-tabPanel header=\"Oceny aplikacji\">\n <fas-service-dynamic-table\n [columns]=\"ratingColumns\"\n [columnTemplates]=\"attachmentColumnTemplates\"\n [fullDataService]=\"fetchAppRatings\"\n dataMode=\"client\"\n ></fas-service-dynamic-table>\n </p-tabPanel>\n</p-tabView>\n" }]
3136
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
3137
+ type: Inject,
3138
+ args: [API_URL]
3139
+ }] }], propDecorators: { attachmentTemplate: [{
3140
+ type: ViewChild,
3141
+ args: ['attachmentTemplate']
3142
+ }] } });
3170
3143
 
3171
3144
  class OperatorFaqCategoriesService {
3172
3145
  constructor(http, apiUrl) {
@@ -4243,7 +4216,7 @@ const FAS_DEFAULT_BUTTON_LIST = [
4243
4216
  { label: 'Operatorzy', icon: 'pi pi-users', routerUrl: 'operators' },
4244
4217
  { label: 'Użytkownicy', icon: 'pi pi-id-card', routerUrl: 'users' },
4245
4218
  { label: 'Notyfikacje', icon: 'pi pi-bell', routerUrl: 'notifications' },
4246
- { label: 'Oceny/sugestie', icon: 'pi pi-star', routerUrl: 'ratings' },
4219
+ { label: 'Zgłoszenia / Opinie', icon: 'pi pi-flag', routerUrl: 'ratings' },
4247
4220
  { label: 'Centrum pomocy', icon: 'pi pi-question-circle', routerUrl: 'faq' },
4248
4221
  ];
4249
4222
  const FAS_DEFAULT_ROUTING_PATHS = [
@@ -4809,12 +4782,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.2", ngImpor
4809
4782
 
4810
4783
  class RatingsModule {
4811
4784
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.2", ngImport: i0, type: RatingsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
4812
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.2.2", ngImport: i0, type: RatingsModule, declarations: [RatingsComponent], imports: [FasServiceTableComponent,
4785
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.2.2", ngImport: i0, type: RatingsModule, declarations: [RatingsComponent], imports: [FasServiceDynamicTableComponent,
4813
4786
  DynamicDialogModule,
4814
4787
  TabViewModule,
4815
4788
  CommonModule,
4816
4789
  ButtonModule] }); }
4817
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.2.2", ngImport: i0, type: RatingsModule, imports: [FasServiceTableComponent,
4790
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.2.2", ngImport: i0, type: RatingsModule, imports: [FasServiceDynamicTableComponent,
4818
4791
  DynamicDialogModule,
4819
4792
  TabViewModule,
4820
4793
  CommonModule,
@@ -4825,7 +4798,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.2", ngImpor
4825
4798
  args: [{
4826
4799
  declarations: [RatingsComponent],
4827
4800
  imports: [
4828
- FasServiceTableComponent,
4801
+ FasServiceDynamicTableComponent,
4829
4802
  DynamicDialogModule,
4830
4803
  TabViewModule,
4831
4804
  CommonModule,