From 5505e42484efac0273627795583179d58f81a1ee Mon Sep 17 00:00:00 2001 From: Sudarshan Kumar Date: Fri, 31 Jan 2020 17:10:17 +0530 Subject: Added RDP Library added RDP Library Issue-ID: PORTAL-826 Change-Id: If00af4c55b568bb4e41c789b6b18749d8bc96858 Signed-off-by: Sudarshan Kumar --- .../rdp-data-table-edit.component.html | 92 ++++++++++++++++++++++ .../rdp-data-table-edit.component.scss | 0 .../rdp-data-table-edit.component.spec.ts | 25 ++++++ .../rdp-data-table-edit.component.ts | 46 +++++++++++ 4 files changed, 163 insertions(+) create mode 100644 ecomp-sdk/portalsdk-tag-library/projects/portalsdk-tag-lib/src/lib/rdp/rdp-data-table/rdp-data-table-edit/rdp-data-table-edit.component.html create mode 100644 ecomp-sdk/portalsdk-tag-library/projects/portalsdk-tag-lib/src/lib/rdp/rdp-data-table/rdp-data-table-edit/rdp-data-table-edit.component.scss create mode 100644 ecomp-sdk/portalsdk-tag-library/projects/portalsdk-tag-lib/src/lib/rdp/rdp-data-table/rdp-data-table-edit/rdp-data-table-edit.component.spec.ts create mode 100644 ecomp-sdk/portalsdk-tag-library/projects/portalsdk-tag-lib/src/lib/rdp/rdp-data-table/rdp-data-table-edit/rdp-data-table-edit.component.ts (limited to 'ecomp-sdk/portalsdk-tag-library/projects/portalsdk-tag-lib/src/lib/rdp/rdp-data-table/rdp-data-table-edit') diff --git a/ecomp-sdk/portalsdk-tag-library/projects/portalsdk-tag-lib/src/lib/rdp/rdp-data-table/rdp-data-table-edit/rdp-data-table-edit.component.html b/ecomp-sdk/portalsdk-tag-library/projects/portalsdk-tag-lib/src/lib/rdp/rdp-data-table/rdp-data-table-edit/rdp-data-table-edit.component.html new file mode 100644 index 00000000..8a967121 --- /dev/null +++ b/ecomp-sdk/portalsdk-tag-library/projects/portalsdk-tag-lib/src/lib/rdp/rdp-data-table/rdp-data-table-edit/rdp-data-table-edit.component.html @@ -0,0 +1,92 @@ + + +
+ + + + + +
\ No newline at end of file diff --git a/ecomp-sdk/portalsdk-tag-library/projects/portalsdk-tag-lib/src/lib/rdp/rdp-data-table/rdp-data-table-edit/rdp-data-table-edit.component.scss b/ecomp-sdk/portalsdk-tag-library/projects/portalsdk-tag-lib/src/lib/rdp/rdp-data-table/rdp-data-table-edit/rdp-data-table-edit.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/ecomp-sdk/portalsdk-tag-library/projects/portalsdk-tag-lib/src/lib/rdp/rdp-data-table/rdp-data-table-edit/rdp-data-table-edit.component.spec.ts b/ecomp-sdk/portalsdk-tag-library/projects/portalsdk-tag-lib/src/lib/rdp/rdp-data-table/rdp-data-table-edit/rdp-data-table-edit.component.spec.ts new file mode 100644 index 00000000..755e33d9 --- /dev/null +++ b/ecomp-sdk/portalsdk-tag-library/projects/portalsdk-tag-lib/src/lib/rdp/rdp-data-table/rdp-data-table-edit/rdp-data-table-edit.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { RdpDataTableEditComponent } from './rdp-data-table-edit.component'; + +describe('RdpDataTableEditComponent', () => { + let component: RdpDataTableEditComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ RdpDataTableEditComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(RdpDataTableEditComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ecomp-sdk/portalsdk-tag-library/projects/portalsdk-tag-lib/src/lib/rdp/rdp-data-table/rdp-data-table-edit/rdp-data-table-edit.component.ts b/ecomp-sdk/portalsdk-tag-library/projects/portalsdk-tag-lib/src/lib/rdp/rdp-data-table/rdp-data-table-edit/rdp-data-table-edit.component.ts new file mode 100644 index 00000000..ede8aa25 --- /dev/null +++ b/ecomp-sdk/portalsdk-tag-library/projects/portalsdk-tag-lib/src/lib/rdp/rdp-data-table/rdp-data-table-edit/rdp-data-table-edit.component.ts @@ -0,0 +1,46 @@ +import { Component, OnInit, Input, EventEmitter, Output } from '@angular/core'; +import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; +import { RdpDataTableService } from '../../shared/rdp-data-table.service'; + +@Component({ + selector: 'rdp-rdp-data-table-edit', + templateUrl: './rdp-data-table-edit.component.html', + styleUrls: ['./rdp-data-table-edit.component.scss'] +}) +export class RdpDataTableEditComponent implements OnInit { + + @Input() settings: any; + @Input() rowdata: any; + @Input() isEditMode: boolean; + @Output() passEntry: EventEmitter = new EventEmitter(); + modalPopupTitle: string; + selectedRowData: any; + public columnsInfoList = []; + + constructor(public activeModal: NgbActiveModal, public rdpDataTableService: RdpDataTableService) { } + + ngOnInit() { + this.modalPopupTitle = "Edit"; + if (this.rowdata) { + this.selectedRowData = JSON.stringify(this.rowdata); + } + if (this.settings) { + if (this.settings.modalPopupTitle) { + this.modalPopupTitle = this.settings.modalPopupTitle; + } + for (var index in this.settings.columns) { + this.columnsInfoList.push(this.settings.columns[index]); + } + } + } + + saveChanges() { + this.passEntry.emit(this.rowdata); + this.activeModal.close(); + } + + columnDataChanged($event, columnTitle) { + this.rowdata[columnTitle] = $event; + } + +} -- cgit 1.2.3-korg