Commit 4dd19fa0 authored by Marco Ortiz's avatar Marco Ortiz

Preparación para la integración con el nuevo jenkins

parent 9fb7b93f
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -11,18 +11,22 @@ import { TranslateModule, TranslateLoader, TranslateService } from '@ngx-transla
// XDF
import { XdfLayoutsModule, SettingsService, ByteSettingsService, SettingsFakeBackendInterceptor } from '@xdf/layouts';
import { XdfSecurityModule, ByteAuthenticationService, AuthGuard, OAuthGuard, OAuthAuthenticationService, ResourceAuthGuard, AuthenticationFakeBackendInterceptor, ProgramsFakeBackendInterceptor } from '@xdf/security';
import { XdfCommonsModule, NotificationService, ToastNotificationService, AuthenticationService, INITSERVICE_OPTIONS, InitCommonsService, ErrorsHandler } from '@xdf/commons';
import { XdfSecurityModule, ByteAuthenticationService, AuthGuard, OAuthGuard, OAuthAuthenticationService } from '@xdf/security';
import { ResourceAuthGuard, AuthenticationFakeBackendInterceptor, ProgramsFakeBackendInterceptor } from '@xdf/security';
import { XdfCommonsModule, NotificationService, ToastNotificationService, AuthenticationService } from '@xdf/commons';
import { INITSERVICE_OPTIONS, InitCommonsService, ErrorsHandler } from '@xdf/commons';
//Components
// Components
import { AppComponent } from './app.component';
import { HomeComponent } from './views/home/home.component';
import { ToastrModule } from 'ngx-toastr';
import localeEs from '@angular/common/locales/es-PE';
import localeEn from '@angular/common/locales/en';
import { MAT_DATE_LOCALE, MatDialog, MatButtonModule, MatDialogModule, MatPaginatorIntl, DateAdapter, MAT_DATE_FORMATS, MatIconModule } from '@angular/material';
import { XdfGalleryModule, CustomMatPaginatorIntl, DATERANGEPICKER_LOCALE, DaterangepickerLocaleService, ConflictErrorDialogService, HttpErrorHandleInterceptor } from '@xdf/gallery';
import { MAT_DATE_LOCALE, MatDialog, MatButtonModule, MatDialogModule, MatPaginatorIntl, DateAdapter } from '@angular/material';
import { MAT_DATE_FORMATS, MatIconModule } from '@angular/material';
import { XdfGalleryModule, CustomMatPaginatorIntl, DATERANGEPICKER_LOCALE, DaterangepickerLocaleService } from '@xdf/gallery';
import { ConflictErrorDialogService, HttpErrorHandleInterceptor } from '@xdf/gallery';
import { BytebotSettingsService } from './services/bytebot-settings-service';
import { MultiTranslateHttpLoader } from 'ngx-translate-multi-http-loader';
......@@ -126,7 +130,7 @@ export function createTranslateLoader(http: HttpClient) {
{ provide: HTTP_INTERCEPTORS, useClass: SettingsFakeBackendInterceptor, multi: true },
{ provide: HTTP_INTERCEPTORS, useClass: CustomProgramsFakeBackendInterceptor, multi: true },
{ provide: HTTP_INTERCEPTORS, useClass: AgentFakeBackendInterceptor, multi: true },
//{ provide: HTTP_INTERCEPTORS, useClass: OperativeDashboardFakeBackendInterceptor, multi: true },
// { provide: HTTP_INTERCEPTORS, useClass: OperativeDashboardFakeBackendInterceptor, multi: true },
{ provide: APP_INITIALIZER, useFactory: init_app, deps: [InitCommonsService, TranslateService], multi: true }
......
......@@ -34,7 +34,7 @@ const tableData: Array<any> = [
status: 'Activo',
country: 'Perú',
timezone: 'GMT-5',
avatar: 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxISEhUSEhIVFhUXFRgVFxUVFRUXFRcVFRcXGBgVFRUYHSggGBolHRUVITEhJSkrLi4uFx8zODMtNygtLisBCgoKDg0OGhAQGi0lICYvLS0vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKy0tLS0tLS0tLf/AABEIAOEA4QMBIgACEQEDEQH/xAAbAAABBQEBAAAAAAAAAAAAAAAAAQIDBAUGB//EAEQQAAEDAQUFBAcGAwcEAwAAAAEAAhEDBAUSITFBUWFxgQYikbETMkKhwdHwI2JygrLhM1LCJDRzkqLS8QcUQ4MVU2P/xAAZAQADAQEBAAAAAAAAAAAAAAAAAQIDBAX/xAAmEQEBAQACAgEFAAEFAAAAAAAAAQIDESExEgQiMkFREzNCYXGB/9oADAMBAAIRAxEAPwDyVCELsbBCEIAQhCDCEqEwEsIhLCZkhLCUBLCfQNhCZ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ibS7qufmkm+oz5PGuoybYO+eahAVi3+u7moaawQtXs2HN/w2qm1Xr59dv4G+QVFif7CVgT4SMCeQmCAJtc5KQBQ2k6IC12fp4rQwcz4NKkoMxvHEyeQkmfBL2aMVS7+Vjj4fRT7vESdzY8SPkUQluk2S531qlvXSmPrVTUmww+CqXvV9TkmEl/Pypj7o/ST8VkWezYw+NREe9Wr0r4ngbgPIBTXXRinj/me4dGBv+4q+LM1vqrxO70yBZipWNy0g7/3WpXswOckck6mIg6kbf20Va+n1Kq8eoiuq7DVcWvfAaC6SYbkMhO8nKI381fvK008LKVFuFjWtxnPv1AO87MmG6wOJO1VHPO/wUZVY4vj5p5x15ppSFKUi0WEJEJEVKmpyAUJ4TAnNVxUStUjVECpAtsrhK471Ab3vd+gf0lRWIfbu6qV4+3oA/wD14vF7z5QortE1X9V53Le91y7v3VmXh65Vekd6tW/U81Uas0rl8euPwj3AKmxWLa+Qw/djqMvgqwKAssT8KioaqcjimAAqlcyVahUXHNKhqXMIbVd9xzR1Y6fgrVCnDRvcZ6aD4+Kq2AEUwB7RcPEQPetJrNm4R4JwjK1eGLOvB8lnIea1bbY+6MjsVK22b7Sk3fh+veg2fawcTpWzYf7vT/HV/oUV6WSKj+BHkPmprK2KFMcah8XAfBbfT/6kacX5Fco3J7lG5d2q6KYSmlOKYVjUUhSIQVCSIRKEAqEIQChPCVCuKhwUqELXKoe7+80f8Fvk5V7n/iv5oQvO3+VcuvbPvHU8z5qi1CFmSSr6revmo2oQmFlmqnCEJg6poswoQlQ2Lu0o/jH6ytaybefxQhOE0Ly0HTyase8v7zR6ebUIToTXl/Frfj+AUf8A4qXJ/wCsoQtuD82nF+SIqNyELs06KYmlCFlU01IUIUJCEIQT/9k='
avatar: 'https://www.w3schools.com/howto/img_avatar.png'
},
{
id: 364,
......@@ -61,27 +61,27 @@ const data: Array<any> = [
const countries: Array<any> = [
{
"id": 1,
"name": "Perú",
"timezones": [
"GMT-5"
id: 1,
name: 'Perú',
timezones: [
'GMT-5'
]
},
{
"id": 2,
"name": "Argentina",
"timezones": [
"GMT-3"
id: 2,
name: 'Argentina',
timezones: [
'GMT-3'
]
},
{
"id": 3,
"name": "Brazil",
"timezones": [
"GMT-5",
"GMT-4",
"GMT-3",
"GMT-2"
id: 3,
name: 'Brazil',
timezones: [
'GMT-5',
'GMT-4',
'GMT-3',
'GMT-2'
]
}
];
......@@ -163,7 +163,7 @@ const channels = [
maxlength: 200,
type: 'text',
required: true,
traductions: { "es": "URL de devolución de llamada", "en": "Webhook" }
traductions: { es: 'URL de devolución de llamada', en: 'Webhook' }
},
{
name: 'verification-token',
......@@ -171,7 +171,7 @@ const channels = [
maxlength: 80,
type: 'text',
required: true,
traductions: { "es": "Token de verificación", "en": "Verification token" }
traductions: { es: 'Token de verificación', en: 'Verification token' }
},
{
name: 'access-token',
......@@ -179,7 +179,7 @@ const channels = [
maxlength: 80,
type: 'text',
required: true,
traductions: { "es": "Token de acceso", "en": "Access token" }
traductions: { es: 'Token de acceso', en: 'Access token' }
}
]
},
......@@ -194,7 +194,7 @@ const channels = [
maxlength: 80,
type: 'text',
required: true,
traductions: { "es": "Identificador de cuenta", "en": "Account identifier" }
traductions: { es: 'Identificador de cuenta', en: 'Account identifier' }
},
{
name: 'authentication-token',
......@@ -202,27 +202,27 @@ const channels = [
maxlength: 80,
type: 'text',
required: true,
traductions: { "es": "Token de autenticación", "en": "Authentication token" }
traductions: { es: 'Token de autenticación', en: 'Authentication token' }
},
{
name: 'twillio-number',
label: 'twillio-number',
type: 'number',
required: true,
traductions: { "es": "Número de Twillio", "en": "Twillio number" }
traductions: { es: 'Número de Twillio', en: 'Twillio number' }
}
]
}
];
const fileOK = {
"uuid": "6850b631-5cb1-4614-8f0e-e43441d7bd35",
"id": 100,
"fileName": "vacaciones-preguntas.xls",
"description": "Preguntas Vacaciones",
"status": "PS",
"user": "",
"uploadDate": ""
uuid: '6850b631-5cb1-4614-8f0e-e43441d7bd35',
id: 100,
fileName: 'vacaciones-preguntas.xls',
description: 'Preguntas Vacaciones',
status: 'PS',
user: '',
uploadDate: ''
};
@Injectable()
......@@ -257,16 +257,16 @@ export class AgentFakeBackendInterceptor implements HttpInterceptor {
}
}
function pagination(data: any) {
data.totalItems = tableData.length;
function pagination(dataRecibida: any) {
dataRecibida.totalItems = tableData.length;
const pageNumber = data.currentPage;
const pageSize = data.itemsPerPage ? data.itemsPerPage : 5;
const pageNumber = dataRecibida.currentPage;
const pageSize = dataRecibida.itemsPerPage ? dataRecibida.itemsPerPage : 5;
data.totalPages = Math.ceil(data.totalItems / pageSize);
dataRecibida.totalPages = Math.ceil(dataRecibida.totalItems / pageSize);
if (data.sortFields.length > 0) {
const sortField: any = data.sortFields[0];
if (dataRecibida.sortFields.length > 0) {
const sortField: any = dataRecibida.sortFields[0];
if (sortField.direction === DIRECTION.asc) {
tableData.sort((a, b) => {
if (JSON.stringify(a[sortField.field]) > JSON.stringify(b[sortField.field])) {
......@@ -288,9 +288,9 @@ export class AgentFakeBackendInterceptor implements HttpInterceptor {
}
}
data.data = tableData.slice(pageNumber * pageSize, (pageNumber + 1) * pageSize);
dataRecibida.data = tableData.slice(pageNumber * pageSize, (pageNumber + 1) * pageSize);
return ok(data);
return ok(dataRecibida);
}
......
......@@ -6,17 +6,17 @@ import {
HttpInterceptor,
HttpErrorResponse
} from '@angular/common/http';
import { Observable, throwError, of, EMPTY } from 'rxjs';
import { Observable, throwError, of, EMPTY } from 'rxjs';
import { Injectable } from '@angular/core';
import { catchError, tap, map } from 'rxjs/operators';
import { TranslateService } from '@ngx-translate/core';
import { NotificationService, NotificationType, AuthenticationService } from '@xdf/commons';
import { Router } from '@angular/router';
import { Injectable } from '@angular/core';
import { catchError, tap, map } from 'rxjs/operators';
import { TranslateService } from '@ngx-translate/core';
import { NotificationService, NotificationType, AuthenticationService } from '@xdf/commons';
import { Router } from '@angular/router';
import { ConflictErrorDialogService } from '@xdf/gallery';
@Injectable()
export class CustomErrorHandlerInterceptor implements HttpInterceptor {
@Injectable()
export class CustomErrorHandlerInterceptor implements HttpInterceptor {
constructor(
private router: Router,
private translate: TranslateService,
......@@ -42,7 +42,7 @@ import { ConflictErrorDialogService } from '@xdf/gallery';
const messageDuplicate = this.translate.instant('message.error.duplicated');
this.notificationService.showMessage(messageDuplicate, this.translate.instant('title.error'), NotificationType.error);
break;
case 419:// validar cual es el código correcto
case 419: // validar cual es el código correcto
this.conflictErrorDialogService.loadComponent(
null,
'title.error.conflict',
......@@ -56,25 +56,25 @@ import { ConflictErrorDialogService } from '@xdf/gallery';
window.location.href = './';
});
} else {
let message = '';
let messageDefault = '';
if (error.error) {
if (error.error.params) {
const params = [];
error.error.params.forEach(element => {
params.push(this.translate.instant(element));
});
message = this.translate.instant(error.error.message, params);
messageDefault = this.translate.instant(error.error.message, params);
} else {
if (error.error.message) {
message = this.translate.instant(error.error.message);
messageDefault = this.translate.instant(error.error.message);
} else {
message = this.translate.instant(error.error);
messageDefault = this.translate.instant(error.error);
}
}
} else {
message = this.translate.instant(error.message);
messageDefault = this.translate.instant(error.message);
}
this.notificationService.showMessage(message, this.translate.instant('title.error'), NotificationType.error);
this.notificationService.showMessage(messageDefault, this.translate.instant('title.error'), NotificationType.error);
}
}
......@@ -82,5 +82,4 @@ import { ConflictErrorDialogService } from '@xdf/gallery';
})
);
}
}
\ No newline at end of file
}
......@@ -28,7 +28,7 @@ export class CustomProgramsFakeBackendInterceptor implements HttpInterceptor {
case url.match('.*' + basePath) && method === 'GET':
return getList();
case url.match('.*'+ basePathCotnrols + '.*') && method === 'GET':
case url.match('.*' + basePathCotnrols + '.*') && method === 'GET':
return getControls();
default:
// pass through any requests not handled above
......
......@@ -20,7 +20,7 @@ const routes: Routes = [
},
{
path: 'agent/detail/new',
//component: AgentDetailComponent,
// component: AgentDetailComponent,
component: AgentComponent,
resolve: {
countryData : CountryDataForWizardResolver
......@@ -36,7 +36,7 @@ const routes: Routes = [
},
{
path: 'agent/detail/edit/:code',
//component: AgentDetailComponent,
// component: AgentDetailComponent,
component: AgentComponent,
resolve: {
agentDetail: AgentDetailResolver,
......@@ -50,9 +50,9 @@ const routes: Routes = [
breadcrumb: 'Agentes',
backButton: true
}
},{
}, {
path: 'agent/detail/view/:code',
//component: AgentDetailComponent,
// component: AgentDetailComponent,
component: AgentComponent,
resolve: {
agentDetail: AgentDetailResolver,
......
......@@ -6,7 +6,15 @@ import {NgxTributeModule} from 'ngx-tribute';
import { MaterialFileInputModule } from 'ngx-material-file-input';
import { XdfGalleryModule } from '@xdf/gallery';
import { MatProgressSpinnerModule, MatDividerModule, MatSidenavModule, MatListModule, MatStepperModule, MatDialogModule, MatMenuModule, MatIconModule, MatSlideToggleModule, MatCheckboxModule, MatRippleModule, MatNativeDateModule, MatChipsModule, MatExpansionModule, MatTooltipModule, MatToolbarModule, MatTabsModule, MatTableModule, MatSortModule, MatSelectModule, MatRadioModule, MatPaginatorModule, MatInputModule, MatFormFieldModule, MatButtonToggleModule, MatButtonModule, MatCardModule, MatAutocompleteModule, MatSnackBarModule, MatProgressBarModule } from '@angular/material';
import { MatProgressSpinnerModule, MatDividerModule, MatSidenavModule, MatListModule } from '@angular/material';
import { MatStepperModule, MatDialogModule, MatMenuModule, MatIconModule } from '@angular/material';
import { MatSlideToggleModule, MatCheckboxModule, MatRippleModule, MatNativeDateModule } from '@angular/material';
import { MatChipsModule, MatExpansionModule, MatTooltipModule, MatToolbarModule } from '@angular/material';
import { MatTabsModule, MatTableModule, MatSortModule, MatSelectModule, MatRadioModule } from '@angular/material';
import { MatPaginatorModule, MatInputModule, MatFormFieldModule, MatButtonToggleModule } from '@angular/material';
import { MatButtonModule, MatCardModule, MatAutocompleteModule, MatSnackBarModule } from '@angular/material';
import { MatProgressBarModule } from '@angular/material';
import { SlickCarouselModule } from 'ngx-slick-carousel';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
......@@ -23,8 +31,6 @@ import { CaDeploymentChannelsModalComponent } from './view/components/ca-deploym
import { AgentStatusPipe } from './pipe/agent-status.pipe';
import { CaFileUploadModalComponent } from './view/components/ca-file-upload-modal/ca-file-upload-modal.component';
@NgModule({
entryComponents: [
CaDeploymentChannelsModalComponent,
......
......@@ -11,7 +11,7 @@ export class DynamicTranslatePipe implements PipeTransform {
}
transform(value: any, ...args: any[]): any {
let lang = this.translateService.currentLang ? this.translateService.currentLang : this.translateService.defaultLang;
const lang = this.translateService.currentLang ? this.translateService.currentLang : this.translateService.defaultLang;
let traductions;
......
......@@ -13,8 +13,8 @@ export class AgentDataForWizardResolver implements Resolve<any> {
state: RouterStateSnapshot
): Observable<any>|Promise<any>|any {
let code = route.paramMap.get('code');
const code = route.paramMap.get('code');
return this.service.getDataForWizard(parseInt(code));
return this.service.getDataForWizard(parseInt(code, 10));
}
}
......@@ -13,7 +13,7 @@ export class AgentDetailResolver implements Resolve<any> {
state: RouterStateSnapshot
): Observable<any>|Promise<any>|any {
let code = route.paramMap.get('code');
const code = route.paramMap.get('code');
return this.service.getResult(code);
}
......
......@@ -21,7 +21,7 @@ export class AgentService extends DynaDataService {
};
}
return this.httpClient.get(this.serviceURL + '/connection/data', {
params: params
params
});
}
......@@ -40,7 +40,7 @@ export class AgentService extends DynaDataService {
return this.httpClient.get(this.serviceURL + '/channels');
}
synchronize(id: number, user:string) {
synchronize(id: number, user: string) {
return this.httpClient.get(this.serviceURL + '/synchronize/' + id, {
params: {
user
......
import { Component, OnInit, ViewChild, ViewContainerRef, Input } from '@angular/core';
import { Component, OnInit, ViewChild, ViewContainerRef, Input, AfterViewInit } from '@angular/core';
import { MatPaginator, MatSort } from '@angular/material';
import { ColumnTemplate, DynaDataSource, ConfirmationDialogService, extractRSQL, FieldFilter } from '@xdf/gallery';
import { Pagination, SortField, NotificationType, NotificationService, AuthenticationService } from '@xdf/commons';
......@@ -135,7 +135,9 @@ const columnTemplateArray = [
const fieldFilters = [
new FieldFilter('agent_code', 'id', 'id', 'number', undefined),
new FieldFilter('agent_name', 'name', 'name', 'string', undefined),
new FieldFilter('agent_status', 'status', 'status', 'valpos', ({ 'DP': 'label.deployed', 'PS': 'label.sync-pending' }) as any),
new FieldFilter('agent_status', 'status', 'status', 'valpos', (
{ DP: 'label.deployed', PS: 'label.sync-pending' }
) as any),
];
@Component({
......@@ -143,7 +145,7 @@ const fieldFilters = [
templateUrl: './agent-list.component.html',
styleUrls: ['./agent-list.component.scss']
})
export class AgentListComponent implements OnInit {
export class AgentListComponent implements OnInit, AfterViewInit {
@ViewChild(MatPaginator, { static: false }) paginator: MatPaginator;
@ViewChild(MatSort, { static: false }) sort: MatSort;
......@@ -232,7 +234,7 @@ export class AgentListComponent implements OnInit {
this.pagination.currentPage = 0;
this.pagination.itemsPerPage = this.pagingSize;
this.pagination.filterExpression = "id != 0";
this.pagination.filterExpression = 'id != 0';
// Ordenación por defecto
if (this.sortColumn && this.sortDirection) {
......@@ -264,14 +266,14 @@ export class AgentListComponent implements OnInit {
for (let i = 0; i < tagsTemp.length; i++) {
if (tagsTemp[i].column !== 'id') {
tagsTemp[i].value = tagsTemp[i].value;
tagsTemp[i].value = tags[i].value;
}
}
this.pagination.filterExpression = extractRSQL(tagsTemp);
if (this.pagination.filterExpression == null || this.pagination.filterExpression == undefined) {
this.pagination.filterExpression = "id != 0";
if (this.pagination.filterExpression === null || this.pagination.filterExpression === undefined) {
this.pagination.filterExpression = 'id != 0';
}
this.dataSource.load(this.pagination);
......@@ -289,9 +291,10 @@ export class AgentListComponent implements OnInit {
if (result) {
this.agentService.delete(item.id).subscribe((rslt: any) => {
if (rslt.statusCode != 200) {
if (rslt.statusCode !== 200) {
this.notificationService.showMessage(
this.translateService.instant(rslt.message), this.translateService.instant('label.error.message.title'), NotificationType.error);
this.translateService.instant(rslt.message), this.translateService.instant('label.error.message.title'),
NotificationType.error);
} else {
this.dataSource.load(this.pagination);
}
......@@ -308,10 +311,10 @@ export class AgentListComponent implements OnInit {
}
synchronize(item) {
let user = (this.authenticationService.currentUserValue ? this.authenticationService.currentUserValue.username : 'admin');
const user = (this.authenticationService.currentUserValue ? this.authenticationService.currentUserValue.username : 'admin');
this.agentService.synchronize(item.id, user).pipe(first()).subscribe(() => {
this.notificationService.showMessage(this.translateService.instant("agent.synchronize.success"), undefined, NotificationType.success);
this.notificationService.showMessage(this.translateService.instant('agent.synchronize.success'), undefined, NotificationType.success);
this.onRefresh();
});
}
......
......@@ -15,7 +15,7 @@
{{'label.general-information.description' | translate}}
</div>
</ng-template>
<byte-ca-general-information [stepper]="stepper" (onNextPage)="updateDirtyStatus($event)"></byte-ca-general-information>
<byte-ca-general-information [stepper]="stepper" (nextPage)="updateDirtyStatus($event)"></byte-ca-general-information>
</mat-step>
<mat-step state="questions">
......@@ -25,7 +25,7 @@
{{'label.questions.description' | translate}}
</div>
</ng-template>
<byte-ca-frequent-questions [stepper]="stepper" (onNextPage)="updateDirtyStatus($event)"></byte-ca-frequent-questions>
<byte-ca-frequent-questions [stepper]="stepper" (nextPage)="updateDirtyStatus($event)"></byte-ca-frequent-questions>
</mat-step>
<mat-step state="deployment-channels">
......
import { Component, OnInit, ViewChild, Input, AfterContentChecked, AfterViewInit, ChangeDetectionStrategy, AfterContentInit, ViewContainerRef } from '@angular/core';
import { Component, OnInit, ViewChild, Input, AfterContentChecked, AfterViewInit } from '@angular/core';
import { ChangeDetectionStrategy, AfterContentInit, ViewContainerRef } from '@angular/core';
import { FormGroup, Validators, FormBuilder } from '@angular/forms';
import { CaGeneralInformationComponent } from '../components/ca-general-information/ca-general-information.component';
import { MAT_STEPPER_GLOBAL_OPTIONS } from '@angular/cdk/stepper';
import { STEPPER_GLOBAL_OPTIONS } from '@angular/cdk/stepper';
import { ActivatedRoute, Router } from '@angular/router';
import { NavigationService } from '@xdf/layouts';
import { IDirty } from '@xdf/gallery';
......@@ -14,7 +15,7 @@ import { CaDeploymentChannelsComponent } from '../components/ca-deployment-chann
templateUrl: './agent.component.html',
styleUrls: ['./agent.component.scss'],
providers: [{
provide: MAT_STEPPER_GLOBAL_OPTIONS, useValue: { displayDefaultIndicatorType: false }
provide: STEPPER_GLOBAL_OPTIONS, useValue: { displayDefaultIndicatorType: false }
}]
})
......@@ -38,18 +39,18 @@ export class AgentComponent implements OnInit, IDirty {
resourceAuth: any;
//dirty acumulado
generalDirty: boolean = false;
// dirty acumulado
generalDirty = false;
constructor(
private _vcRef: ViewContainerRef,
private _activatedRoute: ActivatedRoute,
private _backService: NavigationService,
private _router: Router
private vcRef: ViewContainerRef,
private activatedRoute: ActivatedRoute,
private backService: NavigationService,
private router: Router
) {
this._backService.backAnnounced$.subscribe(data => {
this._router.navigate(['/configuration/agent']);
this.backService.backAnnounced$.subscribe(data => {
this.router.navigate(['/configuration/agent']);
});
}
......@@ -60,21 +61,21 @@ export class AgentComponent implements OnInit, IDirty {
|| this.frequentQuestionsComponent.isDirty();
if (dirty) {
dirty = this.deploymentChannelsComponent.isDirty()
dirty = this.deploymentChannelsComponent.isDirty();
}
return dirty;
}
getRef(): ViewContainerRef {
return this._vcRef;
return this.vcRef;
}
ngOnInit() {
this.stepper.selectedIndex = 0;
const authList = this._activatedRoute.snapshot.paramMap['authorization'];
const authList = this.activatedRoute.snapshot.paramMap['authorization'];
this.resourceAuth = new Object();
......@@ -86,13 +87,13 @@ export class AgentComponent implements OnInit, IDirty {
console.log(this.resourceAuth);
this.isNew = this._activatedRoute.snapshot.data.mode === 'create';
this.isNew = this.activatedRoute.snapshot.data.mode === 'create';
if (this.isNew) {
this.agentDetail = {
};
} else {
this.agentDetail = this._activatedRoute.snapshot.data.agentDetail;
this.agentDetail = this.activatedRoute.snapshot.data.agentDetail;
}
......
......@@ -10,7 +10,7 @@ export class CaDeploymentChannelsModalComponent implements OnInit {
channels: Array<any>;
selectedChannel: any;
applicationSettings:any;
applicationSettings: any;
constructor(
public dialogRef: MatDialogRef<CaDeploymentChannelsModalComponent>,
......
......@@ -15,9 +15,11 @@ import { Form, FormControl, FormGroup, FormGroupDirective, NgForm } from '@angul
})
export class CaDeploymentChannelsComponent implements OnInit {
@Input() stepper: MatStepper;
@Input()
stepper: MatStepper;
@Input() changes: boolean = false;
@Input()
changes = false;
@ViewChild('fieldForm', {static: false})
fieldFormList: any;
......@@ -25,13 +27,13 @@ export class CaDeploymentChannelsComponent implements OnInit {
agentDetail: any;
channels: Array<any>;
deploymentChannels: Array<any> = new Array<any>();
dirty: boolean = true;
dirty = true;
step = -1;
viewMode: boolean = false;
isAvaliableChannels: boolean = false;
mode: string = 'new';
detailText: string = "Detail";
titleText: string = "Titulo"
viewMode = false;
isAvaliableChannels = false;
mode = 'new';
detailText = 'Detail';
titleText = 'Titulo';
constructor(
private activatedRoute: ActivatedRoute,
......@@ -70,8 +72,8 @@ export class CaDeploymentChannelsComponent implements OnInit {
buildList() {
if (this.channels && this.deploymentChannels) {
for (let deploymentChannel of this.deploymentChannels) {
for (let channel of this.channels) {
for (const deploymentChannel of this.deploymentChannels) {
for (const channel of this.channels) {
if (channel.id === deploymentChannel.channelId) {
......@@ -82,8 +84,8 @@ export class CaDeploymentChannelsComponent implements OnInit {
deploymentChannel.suggestDetail = channel.suggestDetail;
for (let parameter of deploymentChannel.parameters) {
for (let field of channel.parameters) {
for (const parameter of deploymentChannel.parameters) {
for (const field of channel.parameters) {
if (parameter.channelParamName === field.name) {
parameter.label = field.label;
......@@ -107,10 +109,10 @@ export class CaDeploymentChannelsComponent implements OnInit {
buildAvaliableChannels() {
this.isAvaliableChannels = false;
mainLoop: for (let channel of this.channels) {
mainLoop: for (const channel of this.channels) {
channel.disabled = false;
for (let deploymentChannel of this.deploymentChannels) {
for (const deploymentChannel of this.deploymentChannels) {
if (channel.id === deploymentChannel.channelId) {
channel.disabled = true;
continue mainLoop;
......@@ -123,7 +125,7 @@ export class CaDeploymentChannelsComponent implements OnInit {
}
addChannel() {
let dialog = this.matDialog.open(CaDeploymentChannelsModalComponent, {
const dialog = this.matDialog.open(CaDeploymentChannelsModalComponent, {
width: '500px',
data: {
message: '',
......@@ -133,7 +135,7 @@ export class CaDeploymentChannelsComponent implements OnInit {
dialog.afterClosed().subscribe(result => {
if (result) {
let selectedChannel = { ...result };
const selectedChannel = { ...result };
selectedChannel.channelId = selectedChannel.id;
selectedChannel.channelName = selectedChannel.name;
......@@ -163,7 +165,7 @@ export class CaDeploymentChannelsComponent implements OnInit {
}
save() {
let isValid: boolean = this.validate();
const isValid: boolean = this.validate();
if (!isValid) {
if (this.fieldFormList && this.fieldFormList.control) {
......@@ -172,7 +174,7 @@ export class CaDeploymentChannelsComponent implements OnInit {
return;
}
let agent: any = {};
const agent: any = {};
agent.id = this.agentDetail.id;
agent.name = this.agentDetail.name;
......@@ -186,8 +188,8 @@ export class CaDeploymentChannelsComponent implements OnInit {
agent.status = this.agentDetail.status;
agent.deploymentChannels = [];
for (let deploymentChannel of this.deploymentChannels) {
let deploymentChannelTmp: any = {};
for (const deploymentChannel of this.deploymentChannels) {
const deploymentChannelTmp: any = {};
deploymentChannelTmp.id = deploymentChannel.id;
deploymentChannelTmp.name = deploymentChannel.name;
......@@ -195,8 +197,8 @@ export class CaDeploymentChannelsComponent implements OnInit {
deploymentChannelTmp.channelId = deploymentChannel.channelId;
deploymentChannelTmp.parameters = [];
for (let parameter of deploymentChannel.parameters) {
let parameterTmp: any = {};
for (const parameter of deploymentChannel.parameters) {
const parameterTmp: any = {};
parameterTmp.id = parameter.id;
parameterTmp.value = parameter.value;
......@@ -238,22 +240,22 @@ export class CaDeploymentChannelsComponent implements OnInit {
validate(): boolean {
let valid = true;
mainLoop: for (let deploymentChannel of this.deploymentChannels) {
let deploymentChannelTmp: any = {};
mainLoop: for (const deploymentChannel of this.deploymentChannels) {
const deploymentChannelTmp: any = {};
// if (!deploymentChannel.name) {
// valid = false;
// break;
// }
for (let parameter of deploymentChannel.parameters) {
for (const parameter of deploymentChannel.parameters) {
parameter.error = false;
if (!parameter.value) {
valid = false;
break mainLoop;
}
if (parameter.regex) {
let regex = new RegExp(parameter.regex);
const regex = new RegExp(parameter.regex);
if (!regex.test(parameter.value)) {
parameter.error = true;
valid = false;
......
......@@ -39,19 +39,19 @@ export class CaFileUploadModalComponent implements OnInit {
dataSource = new MatTableDataSource([]);
displayedColumns: string[] = [];
applicationSettings:any;
applicationSettings: any;
constructor(
private formBuilder: FormBuilder,
private agentService: AgentService,
private _notificationService: NotificationService,
private _translateService: TranslateService,
private notificationService: NotificationService,
private translateService: TranslateService,
public dialogRef: MatDialogRef<CaFileUploadModalComponent>,
@Inject(MAT_DIALOG_DATA) public data: any
) {
this.formGroup = this.formBuilder.group({
description: new FormControl({ value: "", disabled: false }),
description: new FormControl({ value: '', disabled: false }),
file: new FormControl({ value: '', disabled: false }),
filename: new FormControl({ value: '', disabled: true })
});
......@@ -72,20 +72,20 @@ export class CaFileUploadModalComponent implements OnInit {
buildErrorDetail(status, detail) {
this.fileErrorDetail = undefined;
if ("CONTENT_ERROR" === status) {
if ('CONTENT_ERROR' === status) {
this.displayedColumns = ['line', 'type', 'value'];
if (detail) {
let fileErrorDetailTemp = [];
const fileErrorDetailTemp = [];
for (let line of Object.keys(detail)) {
let object = detail[line];
for (const line of Object.keys(detail)) {
const object = detail[line];
let type = Object.keys(object)[0];
const type = Object.keys(object)[0];
fileErrorDetailTemp.push({
line: line,
type: type,
line,
type,
value: object[type],
});
}
......@@ -97,18 +97,18 @@ export class CaFileUploadModalComponent implements OnInit {
}
} else if ("HEADER_ERROR" === status) {
} else if ('HEADER_ERROR' === status) {
this.displayedColumns = ['header', 'value'];
if (detail) {
let fileErrorDetailTemp = [];
const fileErrorDetailTemp = [];
for (let header of Object.keys(detail)) {
let value = detail[header];
for (const header of Object.keys(detail)) {
const value = detail[header];
fileErrorDetailTemp.push({
header: header,
value: value,
header,
value,
});
}
......@@ -131,17 +131,17 @@ export class CaFileUploadModalComponent implements OnInit {
if (event[i] instanceof File) {
const reader = new FileReader();
reader.onload = () => {
//this.formGroup.controls['imageAvatar'].setValue(reader.result as string);
// this.formGroup.controls['imageAvatar'].setValue(reader.result as string);
};
reader.readAsDataURL(event[i]);
let fileSelected = {
const fileSelected = {
data: event[i],
state: 'in',
inProgress: false,
progress: 0,
canRetry: false
}
};
this.validateFile(fileSelected);
}
......@@ -174,12 +174,12 @@ export class CaFileUploadModalComponent implements OnInit {
if (typeof (event) === 'object') {
this.fileErrorDetail = undefined;
this.enabledOK = false;
let info = event.body;
const info = event.body;
this.fileInfo = new FileUploadModel();
if (info) {
let status = info.fileValidationResult.status;
const status = info.fileValidationResult.status;
if ("OK" === status) {
if ('OK' === status) {
this.fileInfo.id = info.id;
this.fileInfo.description = this.formGroup.controls.description.value;
this.fileInfo.uuid = info.uuid;
......@@ -191,20 +191,21 @@ export class CaFileUploadModalComponent implements OnInit {
this.enabledOK = true;
this.fileErrorDetail = undefined;
} else if ("INCOMPATIBLE_EXTENSION" === status) {
} else if ('INCOMPATIBLE_EXTENSION' === status) {
this.formGroup.controls.file.setValue(null);
let message = "label.file.incompatible.extension";
const message = 'label.file.incompatible.extension';
this.enabledOK = false;
this.fileErrorDetail = undefined;
this._notificationService.showMessage(this._translateService.instant(message) + "[" + this.accept + "]", null, NotificationType.error);
this.notificationService.showMessage(this.translateService.instant(message)
+ '[' + this.accept + ']', null, NotificationType.error);
} else if ("CONTENT_ERROR" === status) {
} else if ('CONTENT_ERROR' === status) {
this.formGroup.controls.file.setValue(null);
this.enabledOK = false;
this.buildErrorDetail(status, info.fileValidationResult.recordsErrorMap);
} else if ("HEADER_ERROR" === status) {
} else if ('HEADER_ERROR' === status) {
this.formGroup.controls.file.setValue(null);
this.enabledOK = false;
......
import { Component, OnInit, Input, ViewContainerRef, ViewChild, Output, EventEmitter } from '@angular/core';
import { Component, OnInit, Input, ViewContainerRef, ViewChild, Output } from '@angular/core';
import { AfterViewInit, EventEmitter } from '@angular/core';
import { MatStepper, MatDialog, MatTableDataSource, MatSort } from '@angular/material';
import { ActivatedRoute, Router } from '@angular/router';
import { animate, trigger, state, transition, style } from '@angular/animations';
......@@ -19,16 +20,18 @@ import { CaFileUploadModalComponent, FileUploadModel } from '../ca-file-upload-m
])
]
})
export class CaFrequentQuestionsComponent implements OnInit {
export class CaFrequentQuestionsComponent implements OnInit, AfterViewInit {
@ViewChild(MatSort, { static: false }) sort: MatSort;
@Input() stepper: MatStepper;
@Input()
stepper: MatStepper;
@Output() onNextPage: EventEmitter<boolean> = new EventEmitter<boolean>();
@Output()
nextPage: EventEmitter<boolean> = new EventEmitter<boolean>();
public resourceAuth = new Object();
dirty: boolean = false;
dirty = false;
......@@ -38,29 +41,30 @@ export class CaFrequentQuestionsComponent implements OnInit {
dataSource = new MatTableDataSource<FileUploadModel>([]);
mapStatus = {
"LO": {
"class": "label label-primary",
"text": "label.status.loaded"
LO: {
class: 'label label-primary',
text: 'label.status.loaded'
},
"PS": {
"class": "label label-warning",
"text": "label.status.pending"
PS: {
class: 'label label-warning',
text: 'label.status.pending'
}
};
files = [];
viewMode: boolean;
constructor(protected route: ActivatedRoute,
constructor(
protected route: ActivatedRoute,
protected router: Router,
protected vcRef: ViewContainerRef,
protected authorizationService: AuthorizationService,
private translate: TranslateService,
private _activatedRoute: ActivatedRoute,
private activatedRoute: ActivatedRoute,
private matDialog: MatDialog
) {
this.viewMode = this._activatedRoute.snapshot.data.mode === 'view';
this.viewMode = this.activatedRoute.snapshot.data.mode === 'view';
}
......@@ -89,7 +93,7 @@ export class CaFrequentQuestionsComponent implements OnInit {
}
setDataForWizard(result: any) {
console.log(result)
console.log(result);
/*
this.protocols = result.connectionProtocolOptions;
this.generalProperties = result.generalProperties;
......@@ -112,15 +116,15 @@ export class CaFrequentQuestionsComponent implements OnInit {
}
addFile() {
let dialog = this.matDialog.open(CaFileUploadModalComponent, {
const dialog = this.matDialog.open(CaFileUploadModalComponent, {
width: '600px',
data: null
});
dialog.afterClosed().subscribe(result => {
if (result) {
let fileAdded = { ...result };
let listTemp = this.dataSource.data;
const fileAdded = { ...result };
const listTemp = this.dataSource.data;
listTemp.push(fileAdded);
this.dataSource.data = listTemp;
this.dirty = true;
......@@ -131,27 +135,25 @@ export class CaFrequentQuestionsComponent implements OnInit {
onEditRecord(item, index) {
item.editable = true;
let dialog = this.matDialog.open(CaFileUploadModalComponent, {
const dialog = this.matDialog.open(CaFileUploadModalComponent, {
width: '500px',
data: item
});
dialog.afterClosed().subscribe(result => {
if (result) {
let fileEdited = { ...result };
const fileEdited = { ...result };
let listTemp = this.dataSource.data;
const listTemp = this.dataSource.data;
listTemp[index] = fileEdited;
this.dataSource.data = listTemp;
}
});
}
saveQuestions(validateForm: boolean) {
let success = true;
const success = true;
this.agentDetail.frequentQuestions = this.dataSource.data;
......@@ -159,7 +161,7 @@ export class CaFrequentQuestionsComponent implements OnInit {
}
onDeleteRecord(item, index) {
let listTemp = this.dataSource.data;
const listTemp = this.dataSource.data;
listTemp.splice(index, 1);
this.dataSource.data = listTemp;
this.dirty = true;
......@@ -176,7 +178,7 @@ export class CaFrequentQuestionsComponent implements OnInit {
}
if (this.saveQuestions(true)) {
this.onNextPage.emit(this.isDirty());
this.nextPage.emit(this.isDirty());
this.stepper.next();
}
}
......
......@@ -25,17 +25,19 @@ export const FILE_TYPE = {
})
export class CaGeneralInformationComponent implements OnInit {
@Input() stepper: MatStepper;
@Input()
stepper: MatStepper;
@Output() onNextPage: EventEmitter<boolean> = new EventEmitter<boolean>();
@Output()
nextPage: EventEmitter<boolean> = new EventEmitter<boolean>();
agentDetail: any;
formGroup: FormGroup;
viewMode: boolean;
mode: string = 'new';
mode = 'new';
imageName = "imageAvatar";
imageName = 'imageAvatar';
urlBase = '';
countries = [];
......@@ -43,41 +45,41 @@ export class CaGeneralInformationComponent implements OnInit {
languages = [
{
"code": "ES",
"name": "Español"
code: 'ES',
name: 'Español'
}
];
types = [
{
"code": "FQ",
"name": "Agente de preguntas frecuentes"
code: 'FQ',
name: 'Agente de preguntas frecuentes'
}
];
acceptedImageTypes = ['image/png', 'image/jpeg', 'image/gif'];
acceptedTypes = "PNG, JPEG, GIF";
acceptedTypes = 'PNG, JPEG, GIF';
constructor(
private formBuilder: FormBuilder,
private _activatedRoute: ActivatedRoute,
private _notificationService: NotificationService,
private _translateService: TranslateService
private activatedRoute: ActivatedRoute,
private notificationService: NotificationService,
private translateService: TranslateService
) {
this.mode = this._activatedRoute.snapshot.data.mode;
this.mode = this.activatedRoute.snapshot.data.mode;
this.viewMode = this.mode === 'view';
this.countries = this._activatedRoute.snapshot.data.countryData;
this.countries = this.activatedRoute.snapshot.data.countryData;
this.formGroup = this.formBuilder.group({
name: new FormControl({ value: "", disabled: this.viewMode }),
description: new FormControl({ value: "", disabled: this.viewMode }),
version: new FormControl({ value: "", disabled: this.viewMode }),
imageAvatar: new FormControl({ value: "", disabled: this.viewMode }, { validators: [Validators.required] }),
country: new FormControl({ value: "", disabled: this.viewMode }),
timezone: new FormControl({ value: "", disabled: this.viewMode }),
language: new FormControl({ value: "", disabled: this.viewMode }),
type: new FormControl({ value: "", disabled: this.viewMode })
name: new FormControl({ value: '', disabled: this.viewMode }),
description: new FormControl({ value: '', disabled: this.viewMode }),
version: new FormControl({ value: '', disabled: this.viewMode }),
imageAvatar: new FormControl({ value: '', disabled: this.viewMode }, { validators: [Validators.required] }),
country: new FormControl({ value: '', disabled: this.viewMode }),
timezone: new FormControl({ value: '', disabled: this.viewMode }),
language: new FormControl({ value: '', disabled: this.viewMode }),
type: new FormControl({ value: '', disabled: this.viewMode })
});
}
......@@ -128,7 +130,7 @@ export class CaGeneralInformationComponent implements OnInit {
uploadFiles(event) {
for (const i in event) {
if (event[i] instanceof File) {
let eventTemp = event[i];
const eventTemp = event[i];
if (this.acceptedImageTypes.includes(eventTemp.type)) {
......@@ -138,15 +140,16 @@ export class CaGeneralInformationComponent implements OnInit {
};
reader.readAsDataURL(event[i]);
} else {
let message = "label.imageAvatar.incompatible.extension";
this._notificationService.showMessage(this._translateService.instant(message) + "[" + this.acceptedTypes + "]", null, NotificationType.error);
const message = 'label.imageAvatar.incompatible.extension';
this.notificationService.showMessage(this.translateService.instant(message) +
'[' + this.acceptedTypes + ']', null, NotificationType.error);
}
}
}
}
onCountryChange(obj, deleteTimeZone?: boolean) {
let selectedCountry = obj.value;
const selectedCountry = obj.value;
this.timezones = [];
if (deleteTimeZone) {
......@@ -154,7 +157,7 @@ export class CaGeneralInformationComponent implements OnInit {
}
if (selectedCountry) {
for (var index in this.countries) {
for (const index in this.countries) {
if (selectedCountry === this.countries[index].id) {
this.timezones = this.countries[index].timezones;
break;
......@@ -170,7 +173,7 @@ export class CaGeneralInformationComponent implements OnInit {
}
if (this.saveGeneralInformation(true)) {
this.onNextPage.emit(this.isDirty());
this.nextPage.emit(this.isDirty());
this.stepper.next();
}
}
......
......@@ -6,7 +6,7 @@ import { Injectable } from '@angular/core';
providedIn: 'root'
})
export class UploadService {
SERVER_URL: string = "./service/agent";
SERVER_URL = './service/agent';
constructor(private httpClient: HttpClient) { }
......
......@@ -19,7 +19,7 @@ import { LayoutModule } from '@angular/cdk/layout';
TranslateModule,
LayoutModule
],
entryComponents:[
entryComponents: [
],
exports: [
BytebotLayoutComponent
......
......@@ -8,7 +8,7 @@ import { detectBody } from '../app.helpers';
})
export class BytebotLayoutComponent implements OnInit {
constructor(//protected toogleService: ToogleService
constructor(// protected toogleService: ToogleService
) { }
ngOnInit() {
......@@ -25,8 +25,8 @@ export class BytebotLayoutComponent implements OnInit {
}
onToggle() {
console.log("test");
//this.toogleService.onToggle(true);
console.log('test');
// this.toogleService.onToggle(true);
}
}
......@@ -4,7 +4,8 @@ import { DashboardsRoutingModule } from './dashboards-routing.module';
import { TranslateModule } from '@ngx-translate/core';
import { ReactiveFormsModule, FormsModule } from '@angular/forms';
import { CommonModule } from '@angular/common';
import { MatFormFieldModule, MatSelectModule, MatTooltipModule, MatButtonModule, MatDatepickerModule, MatInputModule, MatPaginatorModule, MatSortModule, MatIconModule } from '@angular/material';
import { MatFormFieldModule, MatSelectModule, MatTooltipModule, MatButtonModule, MatDatepickerModule,
MatInputModule, MatPaginatorModule, MatSortModule, MatIconModule } from '@angular/material';
import { XdfSettingsModule } from '@xdf/settings';
import { XdfLayoutsModule } from '@xdf/layouts';
import { OperativeDashboardComponent } from './views/operative-dashboard/components/operative-dashboard/operative-dashboard.component';
......@@ -23,7 +24,7 @@ import { GaugeChartComponent } from './views/operative-dashboard/components/gaug
import { GaugeChartModule } from 'angular-gauge-chart';
import { InactivitySesionComponent } from './views/operative-dashboard/components/inactivity-sesion/inactivity-sesion.component';
import { HeatMapComponent } from './views/operative-dashboard/components/heat-map/heat-map.component';
import { OperativeDashboardFilterComponent } from './views/operative-dashboard/components/operative-dashboard-filter/operative-dashboard-filter.component'
import { OperativeDashboardFilterComponent } from './views/operative-dashboard/components/operative-dashboard-filter/operative-dashboard-filter.component';
import { NgxMatDateAdapter, NgxMatDatetimePickerModule, NgxMatNativeDateModule, NgxMatTimepickerModule } from '@angular-material-components/datetime-picker';
import { LocalizedDateModule } from '@xdf/commons';
import { StackedColumnChartComponent } from './views/customer-interaction-dashboard/componentes/stacked-column-chart/stacked-column-chart.component';
......@@ -39,7 +40,6 @@ import { TracingIntentByCustomerComponent } from './views/customer-interaction-d
import { MillisToDayHourMinuteSecond } from './pipes/millis-to-day-hour-minute-second.pipe';
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
export function highchartsModules() {
// apply Highcharts Modules to this array
return [ more, exporting, highmaps, sankey];
......
......@@ -9,24 +9,24 @@ export class MillisToDayHourMinuteSecond implements PipeTransform {
constructor(private translateService: TranslateService) {}
transform(value: any, ...args: any[]) {
let valueNumber: number;
let type = typeof value;
const type = typeof value;
if (type === 'number') {
valueNumber = value;
} else if (type === 'string') {
valueNumber = + value;
}
if (valueNumber > 0) {
let days = Math.trunc(valueNumber / 86400);
const days = Math.trunc(valueNumber / 86400);
valueNumber = valueNumber % 86400;
let hours = Math.trunc(valueNumber / 3600);
const hours = Math.trunc(valueNumber / 3600);
valueNumber = valueNumber % 3600;
let minutes = Math.trunc(valueNumber / 60);
const minutes = Math.trunc(valueNumber / 60);
valueNumber = valueNumber % 60;
let seconds = valueNumber;
return (days < 10 ? '0' : '') + days + this.translateService.instant("pipe.format.day")
+ ' ' + (hours < 10 ? '0' : '') + hours + this.translateService.instant("pipe.format.hour")
+ ' ' + (minutes < 10 ? '0' : '') + minutes + this.translateService.instant("pipe.format.minute")
+ ' ' + (seconds < 10 ? '0' : '') + seconds + this.translateService.instant("pipe.format.seconds");
const seconds = valueNumber;
return (days < 10 ? '0' : '') + days + this.translateService.instant('pipe.format.day')
+ ' ' + (hours < 10 ? '0' : '') + hours + this.translateService.instant('pipe.format.hour')
+ ' ' + (minutes < 10 ? '0' : '') + minutes + this.translateService.instant('pipe.format.minute')
+ ' ' + (seconds < 10 ? '0' : '') + seconds + this.translateService.instant('pipe.format.seconds');
}
return value;
}
......
......@@ -14,7 +14,7 @@ export class CustomerInteractionService {
return './dashboard/customer-interaction';
}
getSummary(startDate:Date, endDate:Date, channel:string) {
getSummary(startDate: Date, endDate: Date, channel: string) {
return this.http.post(this.serviceURL, {startDate, endDate, channel});
}
......
......@@ -14,7 +14,7 @@ export class OperationalConsultationService {
return './dashboard/operative';
}
getSummary(startDate:Date, endDate:Date, channel:string) {
getSummary(startDate: Date, endDate: Date, channel: string) {
return this.http.post(this.serviceURL, {startDate, endDate, channel});
}
......
......@@ -48,7 +48,7 @@ export class AvgIntentByCustomerComponent implements OnInit {
type: 'datetime',
tickInterval: 86400000,
labels: {
formatter: function() {
formatter() {
return Highcharts.dateFormat('%e - %b',
this.value);
}
......
......@@ -15,19 +15,19 @@ export class CustomerInteractionFilterComponent implements OnInit {
channels = [
{
value: "W",
label: "Whatsapp"
value: 'W',
label: 'Whatsapp'
},
{
value: "F",
label: "Facebook"
value: 'F',
label: 'Facebook'
}
];
endDateTime: Date;
startDateTime: Date;
selectedChannel: string;
isLoading: Boolean = false;
isLoading = false;
@Input()
header: string;
......@@ -36,10 +36,10 @@ export class CustomerInteractionFilterComponent implements OnInit {
headerDesc: string;
@Input()
icon: string = '<i class="fa fa-bar-chart-o"></i>';
icon = '<i class="fa fa-bar-chart-o"></i>';
@Output()
onFilter: EventEmitter<any> = new EventEmitter();
filtered: EventEmitter<any> = new EventEmitter();
constructor(
protected route: ActivatedRoute,
......@@ -63,8 +63,8 @@ export class CustomerInteractionFilterComponent implements OnInit {
}
search() {
const filters = {startDateTime: this.startDateTime, endDateTime: this.endDateTime, channel: this.selectedChannel}
this.onFilter.emit(filters);
const filters = {startDateTime: this.startDateTime, endDateTime: this.endDateTime, channel: this.selectedChannel};
this.filtered.emit(filters);
}
private getStartDate(endDate: Date): Date {
......@@ -75,7 +75,7 @@ export class CustomerInteractionFilterComponent implements OnInit {
event.preventDefault();
}
clickEvent (event: NgxMatDatetimePicker<any>) {
clickEvent(event: NgxMatDatetimePicker<any>) {
event.open();
}
......
<byte-customer-interaction-filter (onFilter)="filter($event)"></byte-customer-interaction-filter>
<byte-customer-interaction-filter (filtered)="filter($event)"></byte-customer-interaction-filter>
<ng-container *ngIf="isLoading">
<div class="spiner-example">
<div class="sk-spinner sk-spinner-circle">
......
......@@ -13,38 +13,22 @@ export class CustomerInteractionComponent implements OnInit {
links = ['Graph', 'Detail'];
activeLink = this.links[0];
latestDate = new Date();
existDateRange: Boolean = false;
isLoading: Boolean = false;
existDateRange = false;
isLoading = false;
startDate: Date;
endDate: Date;
data: any;
isDataLoaded: Boolean = false;
isDataLoaded = false;
background: ThemePalette = undefined;
constructor(
protected customerInteractionService: CustomerInteractionService,
protected notificationService: NotificationService
) { }
ngOnInit() {
}
toggleBackground() {
this.background = this.background ? undefined : 'primary';
}
addLink() {
this.links.push(`Link ${this.links.length + 1}`);
}
panelOptions = {
elevation: false,
title: {
primary: 'Mensajes por horario de actividad del cliente',
secondary: ''
}
}
};
tracingPanelOptions = {
elevation: false,
......@@ -52,7 +36,7 @@ export class CustomerInteractionComponent implements OnInit {
primary: 'dashboards.customer.interaction.tracing.intent',
secondary: ''
}
}
};
avgIntentOptions = {
elevation: false,
......@@ -60,7 +44,7 @@ export class CustomerInteractionComponent implements OnInit {
primary: 'dashboards.customer.interaction.avg.intent',
secondary: ''
}
}
};
goalPanelOptions = {
elevation: false,
......@@ -68,7 +52,7 @@ export class CustomerInteractionComponent implements OnInit {
primary: 'dashboards.customer.interaction.goals',
secondary: ''
}
}
};
intentCustomer = {
elevation: false,
......@@ -86,6 +70,22 @@ export class CustomerInteractionComponent implements OnInit {
}
};
constructor(
protected customerInteractionService: CustomerInteractionService,
protected notificationService: NotificationService
) { }
ngOnInit() {
}
toggleBackground() {
this.background = this.background ? undefined : 'primary';
}
addLink() {
this.links.push(`Link ${this.links.length + 1}`);
}
filter(filters) {
this.isDataLoaded = false;
this.isLoading = true;
......@@ -97,13 +97,13 @@ export class CustomerInteractionComponent implements OnInit {
this.isLoading = false;
this.isDataLoaded = this.isValidData(this.data);
if (!this.isDataLoaded) {
this.notificationService.showMessage("No se encontró información para el rango de fechas seleccionado", "", NotificationType.error);
this.notificationService.showMessage('No se encontró información para el rango de fechas seleccionado', '', NotificationType.error);
}
}, err => {
this.isLoading = false;
});
}
private isValidData(data:any): Boolean {
private isValidData(data: any): boolean {
if (data['sessionFlow'] && data['sessionFlow']['intent'] && data['sessionFlow']['sentence']) {
if (data['sessionFlow']['intent']['total'] > 0 || data['sessionFlow']['sentence']['total'] > 0) {
return true;
......
import { DataSource } from '@angular/cdk/table';
import { Component, Input, OnInit, ViewChild } from '@angular/core';
import { AfterViewInit, Component, Input, OnInit, ViewChild } from '@angular/core';
import { MatPaginator, MatSort } from '@angular/material';
import { Pagination, SortField } from '@xdf/commons';
import { DynaDataSource } from '@xdf/gallery';
......@@ -11,15 +11,15 @@ import { MessageByIntentService } from './services/message-by-intent.service';
templateUrl: './message-by-intent-table.component.html',
styleUrls: ['./message-by-intent-table.component.scss']
})
export class MessageByIntentTableComponent implements OnInit {
export class MessageByIntentTableComponent implements OnInit, AfterViewInit {
displayedColumns: string[] = ['sentence', 'identifier', 'count', 'customer'];
dataSource: DynaDataSource;
@ViewChild(MatPaginator, { static: false }) paginator: MatPaginator;
@ViewChild(MatSort, { static: false }) sort: MatSort;
sortColumn: string = "count";
sortDirection: string = "desc";
sortColumn = 'count';
sortDirection = 'desc';
statusQuickFilter: string;
pagingSize = 8;
......@@ -41,7 +41,7 @@ export class MessageByIntentTableComponent implements OnInit {
this.pagination.currentPage = 0;
this.pagination.itemsPerPage = this.pagingSize;
this.pagination.filterExpression = "startDate=" + this.minDate.getTime() + "&&endDate=" + this.maxDate.getTime();
this.pagination.filterExpression = 'startDate=' + this.minDate.getTime() + '&&endDate=' + this.maxDate.getTime();
// Ordenación por defecto
if (this.sortColumn && this.sortDirection) {
......@@ -80,7 +80,7 @@ export class MessageByIntentTableComponent implements OnInit {
.subscribe();
}
disabledPopper(value: number): Boolean {
disabledPopper(value: number): boolean {
return value <= 30;
}
......
export interface MessageByIntent{
export interface MessageByIntent {
sentence: string;
intent: string;
ocurrency: number;
......
......@@ -11,7 +11,7 @@ import { map } from 'rxjs/operators';
})
export class MessageByIntentService extends DynaDataService {
serviceURL = "./dashboard/customer-interaction/message-by-intent";
serviceURL = './dashboard/customer-interaction/message-by-intent';
constructor(private httpClient: HttpClient) {
super(httpClient);
......
......@@ -10,7 +10,7 @@ import { Chart } from 'angular-highcharts';
export class SankeyDiagramComponent implements OnInit {
chart: Chart;
startPoint:string = "Session start";
startPoint = 'Session start';
private percentDetail = {};
@Input()
......@@ -22,7 +22,7 @@ export class SankeyDiagramComponent implements OnInit {
if (!this.data) {
return;
}
let dataDiagram = this.generateData(this.data);
const dataDiagram = this.generateData(this.data);
if (!dataDiagram) {
return;
}
......@@ -61,11 +61,10 @@ export class SankeyDiagramComponent implements OnInit {
// dataLabels: {
// formatter: function () {
// console.log(this);
// return "";
// return '';
// }
// },
}] as Array<any>
});
}
......@@ -73,9 +72,9 @@ export class SankeyDiagramComponent implements OnInit {
if (!data['topList']) {
return undefined;
}
let dataForDiagram = [];
const dataForDiagram = [];
data['topList'].forEach(x => {
//PercentageInventary.getInstance().setPercent(x['identifier'], x['count']/data['total']*100);
// PercentageInventary.getInstance().setPercent(x['identifier'], x['count']/data['total']*100);
dataForDiagram.push([this.startPoint, x['identifier'], x['count']]);
});
return dataForDiagram;
......@@ -89,8 +88,8 @@ function update(key) {
export class PercentageInventary {
private percentages: any = {};
private static instance: PercentageInventary;
private percentages: any = {};
public static getInstance(): PercentageInventary {
if (!PercentageInventary.instance) {
......@@ -102,7 +101,7 @@ export class PercentageInventary {
getPercent(name: string) {
if (this.percentages[name]) {
return (this.percentages[name] as number).toFixed(2) + "%";
return (this.percentages[name] as number).toFixed(2) + '%';
}
return null;
}
......
......@@ -21,8 +21,8 @@ export class StackedColumnChartComponent implements OnInit {
if (!this.data) {
return;
}
let categories = this.generateData(this.data, 'goal');
let dataSeries = this.generateData(this.data, 'count');
const categories = this.generateData(this.data, 'goal');
const dataSeries = this.generateData(this.data, 'count');
this.chart = new Chart({
chart: {
type: 'column'
......@@ -37,7 +37,7 @@ export class StackedColumnChartComponent implements OnInit {
text: ''
},
xAxis: {
categories: categories
categories
},
credits: {
enabled: false
......@@ -82,7 +82,7 @@ export class StackedColumnChartComponent implements OnInit {
}
private generateData(data: Array<any>, field: string) {
let dataGenerated = [];
const dataGenerated = [];
data.forEach(x => {
dataGenerated.push(x[field]);
});
......
......@@ -25,7 +25,7 @@ export class TracingIntentByCustomerComponent implements OnInit {
ngOnInit() {
console.log(this.minDate);
console.log(this.maxDate);
let series: Array<any> = this.getGenerateData(this.data);
const series: Array<any> = this.getGenerateData(this.data);
this.chart = new Chart({
chart: {
type: 'line'
......@@ -54,9 +54,8 @@ export class TracingIntentByCustomerComponent implements OnInit {
min: this.getDate(this.minDate),
max: this.getDate(this.maxDate),
labels: {
formatter: function() {
return Highcharts.dateFormat('%e - %b',
this.value * 1000);
formatter() {
return Highcharts.dateFormat('%e - %b', this.value * 1000);
}
}
},
......@@ -66,7 +65,7 @@ export class TracingIntentByCustomerComponent implements OnInit {
},
},
tooltip: {
formatter: function() {
formatter() {
return '<b>' + this.series.name + '</b><br/>' +
Highcharts.dateFormat('%e - %b',
this.x * 1000) +
......@@ -80,19 +79,21 @@ export class TracingIntentByCustomerComponent implements OnInit {
}
}
},
series: series
series
});
}
private getGenerateData(data: any): Array<any> {
let series: Array<any> = [];
const series: Array<any> = [];
for (const intent in data) {
let serie = {};
if (data.hasOwnProperty(intent)) {
const serie = {};
serie['name'] = intent;
serie['data'] = data[intent];
series.push(serie);
console.log(serie);
}
}
return series;
}
......
......@@ -11,7 +11,7 @@ import { map } from 'rxjs/operators';
})
export class UnidentifiedSentenceService extends DynaDataService {
serviceURL = "./dashboard/operative/sentence-by-intent";
serviceURL = './dashboard/operative/sentence-by-intent';
constructor(private httpClient: HttpClient) {
super(httpClient);
......
import { Component, Input, OnInit, ViewChild } from '@angular/core';
import { AfterViewInit, Component, Input, OnInit, ViewChild } from '@angular/core';
import { MatPaginator, MatSort } from '@angular/material';
import { Pagination, SortField } from '@xdf/commons';
import { DynaDataSource } from '@xdf/gallery';
......@@ -10,15 +10,15 @@ import { UnidentifiedSentenceService } from './services/unidentified-sentences.s
templateUrl: './unidentified-sentences-table.component.html',
styleUrls: ['./unidentified-sentences-table.component.scss']
})
export class UnidentifiedSentencesTableComponent implements OnInit {
export class UnidentifiedSentencesTableComponent implements OnInit, AfterViewInit {
displayedColumns: string[] = ['identifier', 'count'];
dataSource: DynaDataSource;
@ViewChild(MatPaginator, { static: false }) paginator: MatPaginator;
@ViewChild(MatSort, { static: false }) sort: MatSort;
sortColumn: string = "count";
sortDirection: string = "desc";
sortColumn = 'count';
sortDirection = 'desc';
statusQuickFilter: string;
pagingSize = 8;
......@@ -40,7 +40,7 @@ export class UnidentifiedSentencesTableComponent implements OnInit {
this.pagination.currentPage = 0;
this.pagination.itemsPerPage = this.pagingSize;
this.pagination.filterExpression = "startDate=" + this.minDate.getTime() + "&&endDate=" + this.maxDate.getTime();
this.pagination.filterExpression = 'startDate=' + this.minDate.getTime() + '&&endDate=' + this.maxDate.getTime();
// Ordenación por defecto
if (this.sortColumn && this.sortDirection) {
......
......@@ -26,7 +26,6 @@ export class CustomerActivityWidgetComponent implements OnInit {
xAxis: {
allowDecimals: false,
labels: {
},
accessibility: {
rangeDescription: 'Range: 1940 to 2017.'
......@@ -37,7 +36,7 @@ export class CustomerActivityWidgetComponent implements OnInit {
text: 'Nuclear weapon states'
},
labels: {
formatter: function () {
formatter() {
return this.value / 1000 + 'k';
}
}
......
......@@ -19,7 +19,7 @@ export const DEFAULT_OPTIONS_GAUGE_CHART: GaugeChart = {
arcDelimiters: [16, 33],
rangeLabel: ['0', '6'],
needleStartValue: 1,
}
};
@Component({
selector: 'byte-gauge-chart',
......@@ -29,25 +29,25 @@ export const DEFAULT_OPTIONS_GAUGE_CHART: GaugeChart = {
export class GaugeChartComponent implements OnInit {
@Input()
name: string = "Gauge chart";
name = 'Gauge chart';
@Input()
value: any = 1.2;
@Input()
unit: string = "";
unit = '';
@Input()
options: GaugeChart;
@Input()
format: Boolean = false;
format = false;
@Input()
maxValue: number = 6;
maxValue = 6;
canvasWidth = 250
centralLabel = '25'
canvasWidth = 250;
centralLabel = '25';
bottomLabel = '';
constructor() { }
......@@ -60,18 +60,18 @@ export class GaugeChartComponent implements OnInit {
valueNumber = valueNumber / 1000;
}
let valueFormater:number = 0;
let valueFormater = 0;
if (valueNumber >= 86400) {
this.unit = "d";
this.unit = 'd';
valueFormater = valueNumber / 86400;
} else if (valueNumber >= 3600) {
this.unit = "h";
this.unit = 'h';
valueFormater = valueNumber / 3600;
} else if (valueNumber >= 60){
this.unit = "m";
} else if (valueNumber >= 60) {
this.unit = 'm';
valueFormater = valueNumber / 60;
} else {
this.unit = "s";
this.unit = 's';
valueFormater = valueNumber;
}
this.bottomLabel = valueFormater.toFixed(1) + ' ' + this.unit;
......
import { Component, Input, OnDestroy, OnInit } from '@angular/core';
//import { ToogleService } from '@xdf/layouts';
// import { ToogleService } from '@xdf/layouts';
import { Chart } from 'angular-highcharts';
import * as Highcharts from 'highcharts';
import { Subscription } from 'rxjs';
......@@ -23,8 +23,10 @@ export class HeatMapComponent implements OnInit, OnDestroy {
subscriptionToogle: Subscription;
chart: Chart;
constructor(
//protected toogleService: ToogleService
// protected toogleService: ToogleService
) {
}
......@@ -34,8 +36,6 @@ export class HeatMapComponent implements OnInit, OnDestroy {
}
}
chart: Chart;
ngOnInit() {
if (!this.maxDate || !this.minDate) {
return;
......@@ -48,7 +48,7 @@ export class HeatMapComponent implements OnInit, OnDestroy {
marginRight: 40,
type: 'heatmap',
events: {
load: function (event: any) {
load: (event: any) => {
event.target.reflow();
}
}
......@@ -91,8 +91,8 @@ export class HeatMapComponent implements OnInit, OnDestroy {
text: null
},
labels: {
formatter: function () {
//return 'H' + (this.value + 1) + ': ' + (this.value < 10 ? '0' : '') + this.value + ':00' ;
formatter() {
// return 'H' + (this.value + 1) + ': ' + (this.value < 10 ? '0' : '') + this.value + ':00' ;
return 'H' + (this.value + 1) + ': ' + (3 * this.value < 10 ? '0' : '') + 3 * this.value + ':00'
+ ' - ' + ((3 * this.value + 3) < 10 ? '0' : '') + (3 * this.value + 3) + ':00';
},
......@@ -132,7 +132,7 @@ export class HeatMapComponent implements OnInit, OnDestroy {
colsize: 24 * 36e5, // one day
tooltip: {
headerFormat: '{point.x:%e %b}',
//pointFormat: '{point.x:%e %b, %Y} {point.y}:00: <b>{point.value} ℃</b>'
// pointFormat: '{point.x:%e %b, %Y} {point.y}:00: <b>{point.value} ℃</b>'
pointFormat: '<b>{point.value} mensajes</b>'
},
turboThreshold: Number.MAX_VALUE, // #3404, remove after 4.0.5 release
......
......@@ -12,8 +12,8 @@ export class InactivitySesionComponent implements OnInit, AfterViewInit {
@Input() options = {
width: 200,
height: 60,
fill: "#dfecf9",
stroke: "#024990",
fill: '#dfecf9',
stroke: '#024990',
strokeWidth: 1
};
@Input() values = [1, 12, 3, 15, 5, -1, 10];
......@@ -36,7 +36,7 @@ export class InactivitySesionComponent implements OnInit, AfterViewInit {
}
}
@HostListener('window:resize',['$event'])
@HostListener('window:resize', ['$event'])
public onResize(event) {
const width = event.target.innerWidth;
this.updateWidth(width);
......@@ -45,12 +45,12 @@ export class InactivitySesionComponent implements OnInit, AfterViewInit {
private updateWidth(width: number) {
if (width >= 1600) {
this.options.width = 300
this.options.width = 300;
} else if (width >= 1350) {
this.options.width = 200
} else if (width >= 768){
this.options.width = 200;
} else if (width >= 768) {
this.options.width = 150;
} else if (width >= 576){
} else if (width >= 576) {
this.options.width = 200;
} else {
this.options.width = 300;
......
......@@ -14,19 +14,19 @@ export class OperativeDashboardFilterComponent implements OnInit {
channels = [
{
value: "W",
label: "Whatsapp"
value: 'W',
label: 'Whatsapp'
},
{
value: "F",
label: "Facebook"
value: 'F',
label: 'Facebook'
}
];
endDateTime: Date;
startDateTime: Date;
selectedChannel: string;
isLoading: Boolean = false;
isLoading = false;
@Input()
header: string;
......@@ -35,10 +35,10 @@ export class OperativeDashboardFilterComponent implements OnInit {
headerDesc: string;
@Input()
icon: string = '<i class="fa fa-bar-chart-o"></i>';
icon = '<i class="fa fa-bar-chart-o"></i>';
@Output()
onFilter: EventEmitter<any> = new EventEmitter();
filtered: EventEmitter<any> = new EventEmitter();
constructor(
protected route: ActivatedRoute,
......@@ -62,8 +62,8 @@ export class OperativeDashboardFilterComponent implements OnInit {
}
search() {
const filters = {startDateTime: this.startDateTime, endDateTime: this.endDateTime, channel: this.selectedChannel}
this.onFilter.emit(filters);
const filters = { startDateTime: this.startDateTime, endDateTime: this.endDateTime, channel: this.selectedChannel };
this.filtered.emit(filters);
}
private getStartDate(endDate: Date): Date {
......@@ -74,8 +74,7 @@ export class OperativeDashboardFilterComponent implements OnInit {
event.preventDefault();
}
clickEvent (event: NgxMatDatetimePicker<any>) {
clickEvent(event: NgxMatDatetimePicker<any>) {
event.open();
}
}
<byte-operative-dashboard-filter (onFilter)="filter($event)"></byte-operative-dashboard-filter>
<byte-operative-dashboard-filter (filtered)="filter($event)"></byte-operative-dashboard-filter>
<ng-container *ngIf="isLoading">
<div class="spiner-example">
<div class="sk-spinner sk-spinner-circle">
......
......@@ -14,12 +14,12 @@ import { PetyWidgetModel } from '../summary-peti-widget/summary-peti-widget.comp
export class OperativeDashboardComponent implements OnInit {
latestDate = new Date();
existDateRange: Boolean = false;
isLoading: Boolean = false;
existDateRange = false;
isLoading = false;
startDate: Date;
endDate: Date;
data: any;
isDataLoaded: Boolean = false;
isDataLoaded = false;
formatterNumber: PetiFormatter = new MessageCountFormatter();
panelOptions = {
......@@ -28,37 +28,37 @@ export class OperativeDashboardComponent implements OnInit {
primary: 'dashboards.operative.message.customer.activity',
secondary: ''
}
}
};
optionsInactivitySesion = {
width: 300,
height: 60,
fill: "#C8FEFF",
stroke: "#23c6c8",
fill: '#C8FEFF',
stroke: '#23c6c8',
strokeWidth: 1
};
totalSesionsOptions = {
width: 300,
height: 60,
fill: "#CFECFF",
stroke: "#1c84c6",
fill: '#CFECFF',
stroke: '#1c84c6',
strokeWidth: 1
};
totalReceivedOptions = {
width: 300,
height: 60,
fill: "#D2EEE9",
stroke: "#1ab394",
fill: '#D2EEE9',
stroke: '#1ab394',
strokeWidth: 1
};
totalSentOptions = {
width: 300,
height: 60,
fill: "#FFD9DD",
stroke: "#ed5565",
fill: '#FFD9DD',
stroke: '#ed5565',
strokeWidth: 1
};
......
......@@ -3,9 +3,9 @@ import { PetiFormatter } from './formatter';
export class MessageCountFormatter implements PetiFormatter {
format(value: number): string {
if (value < 1000) {
return "" + value;
return '' + value;
}
let newNumber: number = value/1000;
return newNumber.toFixed(1) + "K";
const newNumber: number = value / 1000;
return newNumber.toFixed(1) + 'K';
}
}
import { Component, HostListener, Input, OnInit, ViewChild } from '@angular/core';
import { AfterViewInit, Component, HostListener, Input, OnInit, ViewChild } from '@angular/core';
import { PeityComponent } from '@xdf/graph';
import { PetiFormatter } from './formatter/formatter';
declare var jQuery: any;
......@@ -16,20 +16,20 @@ export class PetyWidgetModel {
templateUrl: './summary-peti-widget.component.html',
styleUrls: ['./summary-peti-widget.component.scss']
})
export class SummaryPetiWidgetComponent implements OnInit {
export class SummaryPetiWidgetComponent implements OnInit, AfterViewInit {
@Input() options = {
width: 200,
height: 60,
fill: "#dfecf9",
stroke: "#024990",
fill: '#dfecf9',
stroke: '#024990',
strokeWidth: 1
};
@Input() values = [1, 12, 3, 15, 5, -1, 10];
@Input() header;
@Input() value: PetyWidgetModel;
@Input() tooltip: string;
@Input() formatter: PetiFormatter
@Input() formatter: PetiFormatter;
@ViewChild('peti', { static: false })
peti: PeityComponent;
......@@ -52,12 +52,11 @@ export class SummaryPetiWidgetComponent implements OnInit {
return this.formatter.format(this.value.value);
}
return this.value.value;
}
@HostListener('window:resize',['$event'])
@HostListener('window:resize', ['$event'])
public onResize(event) {
console.log("aea");
console.log('aea');
const width = event.target.innerWidth;
this.updateWidth(width);
this.peti.updateSize();
......@@ -65,12 +64,12 @@ export class SummaryPetiWidgetComponent implements OnInit {
private updateWidth(width: number) {
if (width >= 1600) {
this.options.width = 300
this.options.width = 300;
} else if (width >= 1350) {
this.options.width = 200
} else if (width >= 768){
this.options.width = 200;
} else if (width >= 768) {
this.options.width = 150;
} else if (width >= 576){
} else if (width >= 576) {
this.options.width = 200;
} else {
this.options.width = 300;
......
......@@ -15,7 +15,8 @@ const routes: Routes = [
}
},
{
path: 'user-role/detail/:mode', component: UserRoleFormComponent, canActivate: [AuthGuard, ResourceAuthGuard], canDeactivate: [DirtyGuard],
path: 'user-role/detail/:mode', component: UserRoleFormComponent, canActivate: [AuthGuard, ResourceAuthGuard],
canDeactivate: [DirtyGuard],
resolve: { record: RecordResolver, accessList: AccessDetailResolver },
data: {
program: 'user_role',
......
......@@ -19,7 +19,7 @@ import { XdfSettingsModule } from '@xdf/settings';
XdfSettingsModule,
SecurityRoutingModule
],
entryComponents:[
entryComponents: [
],
providers: [
{ provide: DirtyGuard, useClass: DirtyGuard }
......
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { AuthGuard } from '@xdf/security';
import { DirtyGuard, TemplateResolver, CrudGridComponent, EditableDataTableTemplateResolver, CrudDetailComponent, FormViewComponent, ListResolver, RecordResolver } from '@xdf/gallery';
import { DirtyGuard, TemplateResolver, CrudGridComponent, EditableDataTableTemplateResolver } from '@xdf/gallery';
import { CrudDetailComponent, FormViewComponent, ListResolver, RecordResolver } from '@xdf/gallery';
import { ResourceAuthGuard } from '@xdf/security';
import { ApplicationFormComponent, ValposFormComponent } from '@xdf/settings';
import { TabsLayoutComponent, TabsTemplateResolver } from '@xdf/layouts';
const routes: Routes = [
{
path: "system-settings", component: TabsLayoutComponent,
path: 'system-settings', component: TabsLayoutComponent,
resolve: { template: TabsTemplateResolver },
data: {
templateName: "system-settings",
templateName: 'system-settings',
},
children: [
{ path: 'information', component: FormViewComponent, canActivate: [AuthGuard, ResourceAuthGuard], canDeactivate: [DirtyGuard],
......@@ -76,7 +77,8 @@ const routes: Routes = [
}
},
{
path: 'application/detail/:mode', component: ApplicationFormComponent, canActivate: [AuthGuard, ResourceAuthGuard], canDeactivate: [DirtyGuard],
path: 'application/detail/:mode', component: ApplicationFormComponent,
canActivate: [AuthGuard, ResourceAuthGuard], canDeactivate: [DirtyGuard],
resolve: { record: RecordResolver },
data: {
program: 'application',
......
......@@ -4,23 +4,23 @@ import { Injectable } from '@angular/core';
providedIn: 'root'
})
export class SharedFilterService {
private _startDate:Date;
private _endDate:Date;
private myStartDate: Date;
private myEndDate: Date;
get startDate():Date {
return this._startDate;
get startDate(): Date {
return this.myStartDate;
}
get endDate():Date {
return this._endDate;
get endDate(): Date {
return this.myEndDate;
}
setStartDate(date: Date) {
this._startDate = date;
this.myStartDate = date;
}
setEndDate(date: Date) {
this._endDate = date;
this.myEndDate = date;
}
}
{
"extends": "tslint:recommended",
"rulesDirectory": [
"codelyzer"
],
"rules": {
"no-string-literal": false,
"array-type": false,
"arrow-parens": false,
"deprecation": {
"severity": "warning"
},
"import-blacklist": [
true,
"rxjs/Rx"
],
"interface-name": false,
"max-classes-per-file": false,
"max-line-length": [
false,
240
],
"member-access": false,
"member-ordering": [
true,
{
"order": [
"static-field",
"instance-field",
"static-method",
"instance-method"
]
}
],
"no-consecutive-blank-lines": false,
"no-console": [
true,
"debug",
"info",
"time",
"timeEnd",
"trace"
],
"no-empty": false,
"no-inferrable-types": [
true,
"ignore-params"
],
"no-non-null-assertion": true,
"no-redundant-jsdoc": true,
"no-switch-case-fall-through": true,
"no-var-requires": false,
"object-literal-key-quotes": [
true,
"as-needed"
],
"object-literal-sort-keys": false,
"ordered-imports": false,
"quotemark": [
true,
"single"
],
"trailing-comma": false,
"component-class-suffix": true,
"contextual-lifecycle": true,
"directive-class-suffix": true,
"no-conflicting-lifecycle": true,
"no-host-metadata-property": true,
"no-input-rename": true,
"no-inputs-metadata-property": true,
"no-output-native": true,
"no-output-on-prefix": true,
"no-output-rename": true,
"no-outputs-metadata-property": true,
"template-banana-in-box": true,
"template-no-negated-async": true,
"use-lifecycle-interface": true,
"use-pipe-transform-interface": true
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment