Commit 0d2bf86b authored by Sebastian Chicoma's avatar Sebastian Chicoma

Correcciones en la grilla principal

parent 6a5f7263
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { BaseLayoutComponent, NotFoundComponent } from '@xdf/layouts';
import { BaseLayoutComponent, NotFoundComponent, CustomLayoutComponent } from '@xdf/layouts';
import { AuthGuard, LoginComponent } from '@xdf/security';
import { HomeComponent } from './views/home/home.component';
......@@ -10,7 +10,7 @@ const routes: Routes = [
// Main redirect
{ path: '', redirectTo: 'home', pathMatch: 'full', canActivate: [AuthGuard] },
{
path: '', component: BaseLayoutComponent,
path: '', component: CustomLayoutComponent,
children: [
{ path: 'home', component: HomeComponent, data: { breadcrumb: 'Home' } },
{
......
......@@ -19,6 +19,7 @@ import { CaGeneralInformationComponent } from './view/components/ca-general-info
import { CaDeploymentChannelsComponent } from './view/components/ca-deployment-channels/ca-deployment-channels.component';
import { AgentListComponent } from './view/agent-list/agent-list.component';
import { CaDeploymentChannelsModalComponent } from './view/components/ca-deployment-channels-modal/ca-deployment-channels-modal.component';
import { AgentStatusPipe } from './pipe/agent-status.pipe';
@NgModule({
......@@ -34,7 +35,8 @@ import { CaDeploymentChannelsModalComponent } from './view/components/ca-deploym
DynamicTranslatePipe,
CaGeneralInformationComponent,
CaDeploymentChannelsComponent,
CaDeploymentChannelsModalComponent
CaDeploymentChannelsModalComponent,
AgentStatusPipe
],
imports: [
FormsModule,
......
import { AgentStatusPipe } from './agent-status.pipe';
describe('AgentStatusPipe', () => {
it('create an instance', () => {
const pipe = new AgentStatusPipe();
expect(pipe).toBeTruthy();
});
});
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'agentStatus'
})
export class AgentStatusPipe implements PipeTransform {
transform(value: any, ...args: any[]): any {
if (value) {
switch (value) {
case 'AC':
return 'label.active';
case 'IN':
return 'label.inactive';
}
}
return value;
}
}
......@@ -3,7 +3,7 @@
<div class="col-lg-12">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>{{'label.external.systems' | translate}}</h5>
<h5>{{'label.agent' | translate}}</h5>
</div>
<div class="ibox-content">
......@@ -48,8 +48,16 @@
[style.width]="template.width ? template.width : ''"
[ngClass]="{'td-view': !this.resourceAuth['view']}" (click)="view(item)">
<span *ngIf="template['name'] !== 'avatar'">{{ item[template['name']] }}</span>
<img *ngIf="template['name'] === 'avatar'" [src]="item[template['name']]" alt="Avatar" class="avatar">
<div *ngIf="template['name'] !== 'avatar'">
<span class="label" [ngClass]="{'label-success': item[template['name']] === 'AC', 'label-default': item[template['name']] === 'IN'}"
*ngIf="template['name'] === 'status'">{{ item[template['name']] | agentStatus | translate }}</span>
<span
*ngIf="template['name'] !== 'status'">{{ item[template['name']] }}</span>
</div>
<img *ngIf="template['name'] === 'avatar'" [src]="item[template['name']]"
alt="Avatar" class="avatar">
</td>
</ng-container>
......
......@@ -14,7 +14,7 @@ const columnTemplateArray = [
{
name: 'avatar',
sortable: true,
title: 'etl_avatar',
title: 'agent_avatar',
visible: true,
filtable: true,
style: { width: 'auto' },
......@@ -31,7 +31,7 @@ const columnTemplateArray = [
{
name: 'id',
sortable: true,
title: 'etl_code',
title: 'agent_code',
visible: true,
filtable: true,
style: { width: 'auto' },
......@@ -48,7 +48,7 @@ const columnTemplateArray = [
{
name: 'name',
sortable: true,
title: 'etl_name',
title: 'agent_name',
visible: true,
filtable: true,
style: { width: 'auto' },
......@@ -65,7 +65,7 @@ const columnTemplateArray = [
{
name: 'version',
sortable: true,
title: 'etl_version',
title: 'agent_version',
visible: true,
filtable: true,
style: { width: 'auto' },
......@@ -82,7 +82,7 @@ const columnTemplateArray = [
{
name: 'status',
sortable: true,
title: 'etl_status',
title: 'agent_status',
visible: true,
filtable: true,
style: { width: 'auto' },
......@@ -97,9 +97,9 @@ const columnTemplateArray = [
colStyle: null
},
{
name: 'country',
name: 'countryName',
sortable: true,
title: 'etl_country',
title: 'agent_country',
visible: true,
filtable: true,
style: { width: 'auto' },
......@@ -116,7 +116,7 @@ const columnTemplateArray = [
{
name: 'timezone',
sortable: true,
title: 'etl_timezone',
title: 'agent_timezone',
visible: true,
filtable: true,
style: { width: 'auto' },
......@@ -134,9 +134,8 @@ const columnTemplateArray = [
const fieldFilters = [
new FieldFilter('etl_code', 'id', 'id', 'number', undefined),
new FieldFilter('etl_abbreviation', 'abbreviation', 'abbreviation', 'string', undefined),
new FieldFilter('etl_name', 'name', 'name', 'string', undefined),
new FieldFilter('agent_code', 'id', 'id', 'number', undefined),
new FieldFilter('agent_name', 'name', 'name', 'string', undefined),
];
@Component({
......
......@@ -3,13 +3,14 @@
"home.comments": "Este proyecto presenta una aplicación web típica. Puede usarlo como un marco de referencia para el desarrollo de sus aplicaciones web.",
"btn.previous": "Atrás",
"btn.accept": "Aceptar",
"etl_avatar": "Avatar",
"etl_code": "ID",
"etl_name": "Nombre",
"etl_version": "Versión",
"etl_status": "Estado",
"etl_country": "País",
"etl_timezone": "Zona horaria",
"label.agent": "Agentes",
"agent_avatar": "Avatar",
"agent_code": "ID",
"agent_name": "Nombre",
"agent_version": "Versión",
"agent_status": "Estado",
"agent_country": "País",
"agent_timezone": "Zona horaria",
"label.deployment-channels.title": "Canales de despliegue",
"label.deployment-channels.description": "Configure los canales de mensajería por los cuáles interactuará el agente",
"label.channels": "Canales configurados",
......
......@@ -12,9 +12,5 @@
"menu.settings.valpos": "Valores posibles",
"menu.business.config": "Configuración",
"menu.ticket.manager": "Gestor de tickets",
"menu.piloto": "Configuración piloto",
"entidades.piloto": "Entidades",
"estados.piloto": "Estados",
"motivos.piloto": "Motivos",
"categoria.motivo.piloto": "Categorías de motivos"
"menu.parent.agent": "Agentes"
}
\ No newline at end of file
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