Fixed Rdp-data-table data loading issue 43/103243/5
authorSudarshan Kumar <sudarshan.kumar@att.com>
Fri, 6 Mar 2020 10:00:05 +0000 (15:30 +0530)
committerSudarshan Kumar <sudarshan.kumar@att.com>
Mon, 9 Mar 2020 09:10:36 +0000 (09:10 +0000)
Fixed rdp-data-table data loading issue and also fixed firefox issue for
welcome page.inculuded missing imports and providers

Issue-ID: PORTAL-836
Change-Id: I0ca770536a1fb9e7056bc4dc890ad677bcd8d4e9
Signed-off-by: Sudarshan Kumar <sudarshan.kumar@att.com>
15 files changed:
ecomp-sdk/epsdk-app-os/ngapp/src/app/pages/pages-routing.module.ts
ecomp-sdk/epsdk-app-os/ngappsrc/portalsdk-tag-lib-0.0.1.tgz
ecomp-sdk/epsdk-app-os/ngappsrc/src/app/pages/pages-routing.module.ts
ecomp-sdk/epsdk-app-os/ngappsrc/src/app/pages/pages.module.ts
ecomp-sdk/epsdk-app-os/ngappsrc/src/app/pages/welcome-dashboard/note/note.component.ts
ecomp-sdk/epsdk-app-os/ngappsrc/src/app/pages/welcome-dashboard/welcome-dashboard.component.ts
ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/layout/layout.module.ts
ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/ext/profile/search/search.component.html
ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/ext/profile/search/search.component.ts
ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/ext/profile/self/self.component.html
ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/shared/services/user/user.service.ts
ecomp-sdk/portalsdk-tag-lib-test-app/package-lock.json
ecomp-sdk/portalsdk-tag-lib-test-app/portalsdk-tag-lib-0.0.1.tgz
ecomp-sdk/portalsdk-tag-library/projects/portalsdk-tag-lib/src/lib/rdp/rdp-data-table/rdp-data-table.component.html
ecomp-sdk/portalsdk-tag-library/projects/portalsdk-tag-lib/src/lib/rdp/rdp-data-table/rdp-data-table.component.ts

index eff5a3d..3439f8c 100644 (file)
@@ -29,7 +29,7 @@ const routes: Routes = [
   { path: 'reports/:reportMode/:reportId', component: HeaderTabsWrapperComponent},
   { path: 'run/:reportId', component: RunReportComponent},
   { path: 'run/:reportId/:queryParameters', component: RunReportFormFieldsComponent},
-  { path: 'welcome/welcome', component :WelcomeDashboardComponent}
+  { path: 'welcome', component :WelcomeDashboardComponent}
 ];
 
 @NgModule({
index dccad51..3b1c200 100644 (file)
Binary files a/ecomp-sdk/epsdk-app-os/ngappsrc/portalsdk-tag-lib-0.0.1.tgz and b/ecomp-sdk/epsdk-app-os/ngappsrc/portalsdk-tag-lib-0.0.1.tgz differ
index eff5a3d..3439f8c 100644 (file)
@@ -29,7 +29,7 @@ const routes: Routes = [
   { path: 'reports/:reportMode/:reportId', component: HeaderTabsWrapperComponent},
   { path: 'run/:reportId', component: RunReportComponent},
   { path: 'run/:reportId/:queryParameters', component: RunReportFormFieldsComponent},
-  { path: 'welcome/welcome', component :WelcomeDashboardComponent}
+  { path: 'welcome', component :WelcomeDashboardComponent}
 ];
 
 @NgModule({
index 47b86c2..041988a 100644 (file)
@@ -61,6 +61,7 @@ import { BarChartComponent } from './welcome-dashboard/bar-chart/bar-chart.compo
 import { PieChartComponent } from './welcome-dashboard/pie-chart/pie-chart.component';
 import { NoteComponent } from './welcome-dashboard/note/note.component';
 import { GridsterModule } from 'angular-gridster2';
+import { RdpModule } from 'portalsdk-tag-lib';
 
 
 
@@ -138,7 +139,8 @@ import { GridsterModule } from 'angular-gridster2';
     MatPaginatorModule,
     MatSortModule,
     MatIconModule,
-    GridsterModule
+    GridsterModule,
+         RdpModule
   ],
   entryComponents: [InformationModalComponent, ConfirmationModalComponent, NewRoleComponent, NewRoleFunctionComponent, NewMenuComponent],
   providers: []
index 9b35bb0..d8935f7 100644 (file)
@@ -53,12 +53,15 @@ export class NoteComponent {
   @Output() focusout = new EventEmitter();
   constructor(private el:ElementRef) {
    const {webkitSpeechRecognition} : IWindow = <IWindow>window;
-    this.recognition = new webkitSpeechRecognition();
-    this.recognition.onresult = (event)=> {
-      this.el.nativeElement.querySelector(".content").innerText += event.results[0][0].transcript
-      console.log(event.results[0][0].transcript) 
-      document.getElementById('toolbar').focus();
-    };
+
+    // Commented below code as it works only for chrome browser.
+
+    // this.recognition = new webkitSpeechRecognition();
+    // this.recognition.onresult = (event)=> {
+    //   this.el.nativeElement.querySelector(".content").innerText += event.results[0][0].transcript
+    //   console.log(event.results[0][0].transcript) 
+    //   document.getElementById('toolbar').focus();
+    // };
   }
   
   onDismiss(event){
index 99118e3..47e83e9 100644 (file)
@@ -250,14 +250,15 @@ export class WelcomeDashboardComponent {
     this.initilizeData();
 
     this.notes = JSON.parse(localStorage.getItem('notes')) || [{ id: 0,content:'' }];
-
-    const {webkitSpeechRecognition} : IWindow = <IWindow>window;
-    this.recognition = new webkitSpeechRecognition();
-    this.recognition.onresult = (event)=> {
-      console.log(this.el.nativeElement.querySelectorAll(".content")[0]);
-      this.el.nativeElement.querySelectorAll(".content")[0].innerText = event.results[0][0].transcript
+    
+    // Commented below code as it works only for chrome browser.
+    // const {webkitSpeechRecognition} : IWindow = <IWindow>window;
+    // this.recognition = new webkitSpeechRecognition();
+    // this.recognition.onresult = (event)=> {
+    //   console.log(this.el.nativeElement.querySelectorAll(".content")[0]);
+    //   this.el.nativeElement.querySelectorAll(".content")[0].innerText = event.results[0][0].transcript
       
-    };
+    // };
   }
 
   updateAllNotes() {
index 4f13607..a6bc03f 100644 (file)
@@ -44,14 +44,18 @@ import { LayoutRoutingModule } from './layout-routing.module';
 import { LayoutComponent } from './layout.component';
 import { SidebarComponent } from './components/sidebar/sidebar.component';
 import { HeaderComponent } from './components/header/header.component';
+import { MatDialogModule } from '@angular/material/dialog';
+import { CookieService } from 'ngx-cookie-service';
 
 @NgModule({
     imports: [
         CommonModule,
         LayoutRoutingModule,
         TranslateModule,
-        NgbDropdownModule
+        NgbDropdownModule,
+        MatDialogModule
     ],
-    declarations: [LayoutComponent, SidebarComponent, HeaderComponent]
+    declarations: [LayoutComponent, SidebarComponent, HeaderComponent],
+    providers:[CookieService]
 })
 export class LayoutModule {}
index 1b3b37b..1629ac2 100644 (file)
         <td mat-cell *matCellDef="let rowData" > {{rowData.email}} </td>
       </ng-container>
 
-      <ng-container matColumnDef="OrgUserId">
+      <ng-container matColumnDef="orgUserId">
         <th mat-header-cell *matHeaderCellDef  id="heading4"> {{userHeaders[4]}} </th>
         <td mat-cell *matCellDef="let rowData" > {{rowData.orgUserId}} </td>
       </ng-container>
 
-      <ng-container matColumnDef="Manager OrgUserId">
+      <ng-container matColumnDef="orgManagerUserId">
         <th mat-header-cell *matHeaderCellDef  id="heading4"> {{userHeaders[5]}} </th>
         <td mat-cell *matCellDef="let rowData" > {{rowData.orgManagerUserId}} </td>
       </ng-container>
index 7bebd04..a02158b 100644 (file)
@@ -56,7 +56,7 @@ export class SearchComponent implements OnInit {
   response: any;
   result: any;
   profileList:any;
-  userHeaders = ["User ID","Last Name","First Name","Email","ORG ID","Manager ORG ID","Edit","Active?"];
+  userHeaders = ["User ID","Last Name","First Name","Email","orgUserId","orgManagerUserId","Edit","Active?"];
   constructor(public profileservice:ProfileService, public ngbModal: NgbModal) { }
   dataSource: MatTableDataSource<[]>;
     
index 846dae5..ff319de 100644 (file)
                                </div>
                        </div>
                        <div class="form-row">
-                               <label for="textinputID-3a">Organization User ID</label>&nbsp;<a style="cursor: hand;" target="_new"
-                                       href="http://webphone.att.com/cgi-bin/webphones.pl?id={{profile.orgUserId}}">wephone</a>
-
+                               <label for="textinputID-3a">Organization User ID</label>
                                <input [(ngModel)]="profile.orgUserId" type="text" name="orgUserId" class="form-control" id="orgUserId"
                                        style="width: 100%;" disabled="true">
                        </div>
                        <div class="form-row">
                                <label for="textinputID-3a">Organization Manager ID</label>
-                               &nbsp;<a style="cursor: hand;" target="_new"
-                                       href="http://webphone.att.com/cgi-bin/webphones.pl?id={{profile.orgManagerUserId}}">wephone</a>
-
                                <input [(ngModel)]="profile.orgManagerUserId" type="text" name="orgManagerUserId" class="form-control"
                                        id="orgManagerUserId" style="
                                                width: 59%;" disabled="true">
index 4c4a01c..44d9e5e 100644 (file)
@@ -20,7 +20,7 @@ data;
 observable;
 
 getFunctionalMenuStaticDetailSession2(){    
-  return this.http.get(environment.getFunctionalMenuStaticDetail,{ withCredentials: true })
+  return this.http.get(environment.getTopMenu,{ withCredentials: true })
    .subscribe((results: Object) => {
    this.user =  new User(results);
    });  
@@ -30,7 +30,7 @@ getFunctionalMenuStaticDetailSession2(){
 
 public getFunctionalMenuStaticDetailSession(): Observable<User> {
   return this.http
-  .get(environment.getFunctionalMenuStaticDetail,{ withCredentials: true })
+  .get(environment.getTopMenu,{ withCredentials: true })
   .map(response => {
   return new User(response);
   })
@@ -43,7 +43,7 @@ getFunctionalMenuStaticDetailSession1() {
   } else if (this.observable) { 
     return this.observable; 
   } else { 
-    this.observable = this.http.get(environment.getFunctionalMenuStaticDetail, { 
+    this.observable = this.http.get(environment.getTopMenu, { 
       withCredentials: true,
       observe: 'response'
     }) 
index 780e658..60daa99 100644 (file)
     },
     "portalsdk-tag-lib": {
       "version": "file:portalsdk-tag-lib-0.0.1.tgz",
-      "integrity": "sha512-iqr81BSaZSC+ids5jIxDwvspC/yEKMX2PlTMoFAy0mvI/tcAeKUvSKgsFadqPRHBPbTbtXFDDpn22ZxgTtyc9Q==",
+      "integrity": "sha512-V4X0GIkX63rPFDQjgVbj53GVoyahtyeQX2m3owcJYmYBCvB/e36ncX5/wluFpiR8mp4eD+b+HDSBBVkq7bYqsg==",
       "requires": {
         "tslib": "^1.9.0"
       }
index 0bf7890..3b1c200 100644 (file)
Binary files a/ecomp-sdk/portalsdk-tag-lib-test-app/portalsdk-tag-lib-0.0.1.tgz and b/ecomp-sdk/portalsdk-tag-lib-test-app/portalsdk-tag-lib-0.0.1.tgz differ
index 4f98abd..e5d08e5 100644 (file)
@@ -51,8 +51,8 @@
       <tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
     </table>
   <!-- </rdp-scroll-container> -->
-  <div *ngIf="isPaginationRequired">
+  <div [hidden]="!isPaginationRequired">
     <mat-paginator [length]="totalRowsCount" #paginator [pageSizeOptions]="[5, 10, 25, 100]" [pageSize]="pageSize"
-    (page)="pageEvent = $event; onPaginationChange($event)"></mat-paginator>
+    ></mat-paginator>
   </div>
 </div>
\ No newline at end of file
index b833c6f..954d094 100644 (file)
@@ -59,7 +59,14 @@ export class RdpDataTableComponent<T> implements OnChanges, AfterViewInit, OnIni
   @Input() settings: any;
   
   @ViewChild(MatSort) sort: MatSort;
-  @ViewChild(MatPaginator) paginator: MatPaginator;
+  //@ViewChild(MatPaginator) paginator: MatPaginator;
+  private paginator: MatPaginator;
+  
+  @ViewChild(MatPaginator) set matPaginator(mp: MatPaginator) {
+    this.paginator = mp;
+    this.setData(this.data);
+  }
+
   @ViewChild(MatTable) table: MatTable<T>;
   @ViewChild('input') input: ElementRef;
   
@@ -74,7 +81,7 @@ export class RdpDataTableComponent<T> implements OnChanges, AfterViewInit, OnIni
   isEditMode: boolean;
   isSearchEnabled: boolean;
   isServerSidePaginationEnabled: boolean  = false;
-  showAddButton: boolean = true;
+  showAddButton: boolean = false;
   result : any;
   totalRowsCount: any;
   showSpinner: boolean;
@@ -88,7 +95,7 @@ export class RdpDataTableComponent<T> implements OnChanges, AfterViewInit, OnIni
   }
 
   ngAfterViewInit() {
-    if(this.isServerSidePaginationEnabled){
+    if(this.settings && this.settings.isServerSidePaginationEnabled && this.data){
     
       this.sort.sortChange.subscribe(() => this.paginator.pageIndex = 0);
     
@@ -108,12 +115,16 @@ export class RdpDataTableComponent<T> implements OnChanges, AfterViewInit, OnIni
           tap(() => this.loadData(this.paginator.pageIndex, this.paginator.pageSize))
       ).subscribe();  
     }
-
-    this.dataSource.paginator = this.paginator;
-    this.dataSource.sort = this.sort;
+    if(this.data) {
+      this.dataSource.paginator = this.paginator;
+      this.dataSource.sort = this.sort;
+    }
   }
 
   ngOnChanges() {
+     if(this.data) {
+       this.setData(this.data);
+     }
      if (this.settings) {
       console.log("Table setting Objects >>>>", this.settings);
 
@@ -134,6 +145,8 @@ export class RdpDataTableComponent<T> implements OnChanges, AfterViewInit, OnIni
 
       if (this.settings.isReadOnly) {
         this.showAddButton = false;
+      }else{
+        this.showAddButton = true;
       }
 
       if (this.settings.isTableSearchEnabled) {
@@ -159,7 +172,7 @@ export class RdpDataTableComponent<T> implements OnChanges, AfterViewInit, OnIni
   }
 
   setData(data) {
-    if(this.settings.isServerSidePaginationEnabled){
+    if(this.settings && this.settings.isServerSidePaginationEnabled){
       console.log("Server side pagination is enabled");
       this.dataSource = new RDPDataSource();
       this.dataSource.loadData(this.settings.applicationService,'', this.sort.active, this.sort.direction, 0, this.settings.paginationsSize);
@@ -170,6 +183,8 @@ export class RdpDataTableComponent<T> implements OnChanges, AfterViewInit, OnIni
       console.log("Server side pagination is not enabled");
       if (Array.isArray(data)) {
         this.dataSource.data = data;
+        this.dataSource.paginator = this.paginator;
+        this.dataSource.sort = this.sort;
         this.totalRowsCount = data.length;
       }
     }