From ce9bc0c6ad58e4117d26a204ffc56bbcdb7fe916 Mon Sep 17 00:00:00 2001
From: rsanchez <rsanchez@curisit.net>
Date: Tue, 14 Mar 2017 19:41:20 +0000
Subject: [PATCH] #3527 fix - Changes on pack list and routes
---
securis/src/main/webapp/src/app/pack.list.component.ts | 24 +++++++++++++-----------
1 files changed, 13 insertions(+), 11 deletions(-)
diff --git a/securis/src/main/webapp/src/app/pack.list.component.ts b/securis/src/main/webapp/src/app/pack.list.component.ts
index 0af18bb..7df79ab 100644
--- a/securis/src/main/webapp/src/app/pack.list.component.ts
+++ b/securis/src/main/webapp/src/app/pack.list.component.ts
@@ -1,11 +1,13 @@
import { Router } from '@angular/router';
-import { MdDialog } from '@angular/material';
+import { MdDialog, MdDialogConfig } from '@angular/material';
import { TdDataTableService, TdDataTableSortingOrder, ITdDataTableSortChangeEvent, ITdDataTableColumn } from '@covalent/core';
import { IPageChangeEvent } from '@covalent/core';
import { Component, AfterViewInit } from '@angular/core';
import { TdMediaService } from '@covalent/core';
import { PacksService } from './resources/packs';
import { PackFormComponent } from './forms/pack.form.component';
+import { LocaleService } from './common/i18n';
+
var pack_example = {
id: 7,
@@ -36,6 +38,11 @@
renew_valid_period: 0,
}
+const DIALOG_OPTIONS : MdDialogConfig = {
+ height: '80%', // can be px or %
+ width: '45%', // can be px or %
+}
+
@Component({
selector: 'pack-list',
templateUrl: 'src/app/pack.list.component.html'
@@ -58,7 +65,7 @@
fromRow: number = 1;
currentPage: number = 1;
pageSize: number = 10;
- sortBy: string = 'application_name';
+ sortBy: string = 'code';
sortOrder: TdDataTableSortingOrder = TdDataTableSortingOrder.Descending;
filteredItems = this.data.length;
pack_menu_options : any[] = [{
@@ -81,6 +88,7 @@
private media: TdMediaService,
private router: Router,
private dialog: MdDialog,
+ private $L: LocaleService,
private packForm: PackFormComponent,
private packs: PacksService) {
this.packs.get().subscribe(
@@ -97,10 +105,7 @@
}
createPack() : void {
- var ref = this.dialog.open(PackFormComponent, {
- height: '50%', // can be px or %
- width: '40%', // can be px or %
- });
+ var ref = this.dialog.open(PackFormComponent, DIALOG_OPTIONS);
ref.componentInstance.isNew = true;
ref.afterClosed().subscribe(result => {
console.log(result);
@@ -113,10 +118,7 @@
}
editPack(pack: any) : void {
- var ref = this.dialog.open(PackFormComponent, {
- height: '70%', // can be px or %
- width: '40%', // can be px or %
- });
+ var ref = this.dialog.open(PackFormComponent, DIALOG_OPTIONS);
ref.componentInstance.isNew = false;
ref.componentInstance.data = pack;
ref.afterClosed().subscribe(result => {
@@ -127,7 +129,7 @@
sort(sortEvent: ITdDataTableSortChangeEvent): void {
- this.sortBy = sortEvent.name;
+ this.sortBy = sortEvent.name === 'used_licenses' ? 'num_available' : sortEvent.name;
this.sortOrder = sortEvent.order;
this.filter();
}
--
Gitblit v1.3.2