Project

General

Profile

« Previous | Next » 

Revision 57922

[Monitor Dashboard | Trunk]: Change Topic, Category, Subcategory options be like Indicator's

View differences:

indicators.component.ts
35 35
   * Editable indicator
36 36
   */
37 37
  public indicator: Indicator;
38
  public index: number;
38
  public index: number = -1;
39 39
  /**
40 40
   * Displayed chart and numbers base on Top filters
41 41
   */
......
55 55
  public grid: boolean = true;
56 56
  private subscriptions: any[] = [];
57 57
  private urlSubscriptions: any[] = [];
58
  @ViewChild('editIndicatorModal') editIndicatorModal: AlertModal;
59
  @ViewChild('deleteIndicatorModal') deleteIndicatorModal: AlertModal;
58
  @ViewChild('editModal') editModal: AlertModal;
59
  @ViewChild('deleteModal') deleteModal: AlertModal;
60 60
  
61 61
  constructor(private layoutService: LayoutService,
62 62
              private stakeholderService: StakeholderService,
......
320 320
      }
321 321
    });
322 322
    this.index = (id) ? this.charts.findIndex(value => value._id === id) : -1;
323
    console.log(this.index);
323 324
    if (this.index !== -1) {
324 325
      this.indicator = HelperFunctions.copy(this.charts[this.index]);
325 326
      this.indicatorFb = this.fb.group({
......
348 349
      });
349 350
      this.addIndicatorPath();
350 351
    }
351
    this.editIndicatorModal.cancelButtonText = 'Cancel';
352
    this.editIndicatorModal.okButtonLeft = false;
353
    this.editIndicatorModal.alertMessage = false;
352
    this.editModal.cancelButtonText = 'Cancel';
353
    this.editModal.okButtonLeft = false;
354
    this.editModal.alertMessage = false;
354 355
    if (this.index === -1) {
355
      this.editIndicatorModal.alertTitle = 'Create a new chart Indicator';
356
      this.editIndicatorModal.okButtonText = 'Save';
356
      this.editModal.alertTitle = 'Create a new chart indicator';
357
      this.editModal.okButtonText = 'Save';
357 358
    } else {
358
      this.editIndicatorModal.okButtonText = 'Save Changes';
359
      this.editModal.alertTitle = 'Edit chart indicator\'s information';
360
      this.editModal.okButtonText = 'Save Changes';
359 361
    }
360
    this.editIndicatorModal.open();
362
    this.editModal.open();
361 363
  }
362 364
  
363 365
  saveIndicator() {
......
428 430
    } else {
429 431
      this.indicator = this.numbers.find(value => value._id == id);
430 432
    }
431
    this.deleteIndicatorModal.alertTitle = 'Delete ' + this.indicator.name;
432
    this.deleteIndicatorModal.cancelButtonText = 'No';
433
    this.deleteIndicatorModal.okButtonText = 'Yes';
434
    this.deleteIndicatorModal.message = 'This indicator will permanently be deleted. Are you sure you want to proceed?';
435
    this.deleteIndicatorModal.open();
433
    this.deleteModal.alertTitle = 'Delete indicator';
434
    this.deleteModal.cancelButtonText = 'No';
435
    this.deleteModal.okButtonText = 'Yes';
436
    this.deleteModal.open();
436 437
  }
437 438
  
438 439
  deleteIndicator() {

Also available in: Unified diff