App onboarding fixes 88/110688/1
authorSudarshan Kumar <sudarshan.kumar@att.com>
Wed, 29 Jul 2020 11:16:31 +0000 (16:46 +0530)
committerSudarshan Kumar <sudarshan.kumar@att.com>
Wed, 29 Jul 2020 11:16:41 +0000 (16:46 +0530)
App onboarding fixes - PORTAL-968,969,970,971

Issue-ID: PORTAL-969
Change-Id: I4046d37aaff0b5df7605e694cabca148d64a74ea
Signed-off-by: Sudarshan Kumar <sudarshan.kumar@att.com>
portal-FE-common/src/app/pages/web-analytics/web-analytics.component.scss
portal-FE-os/src/app/pages/application-onboarding/application-details-dialog/application-details-dialog.component.html
portal-FE-os/src/app/pages/application-onboarding/application-details-dialog/application-details-dialog.component.ts
portal-FE-os/src/app/pages/application-onboarding/application-onboarding.component.html
portal-FE-os/src/app/pages/application-onboarding/application-onboarding.component.ts

index c72d11e..7e68e1a 100644 (file)
     padding-bottom: 15px;
     padding-right: 40px;
     font-weight: bold;
+    white-space: nowrap;
+}
+
+td.mat-cell, td.mat-footer-cell, th.mat-header-cell {
+   padding-right: 45px;
 }
 
 .ion-md-trash{
index 6d0c544..f68d879 100644 (file)
                                                                <span style="flex: 9">Upload
                                                                        Image</span>
                                                                <app-information-tooltip style="flex: 1;"
-                                                                       [textMessage]="'Image file must be smaller than 1MB'">
+                                                                       [textMessage]="'Image file(.png or.jpg or.jpeg with dimension 200X200 pixel) must be smaller than 1MB.'">
                                                                </app-information-tooltip>
                                                        </div>
-                                                       <input type="file" id="input-app-image-upload"
+                                                       <input #inputAppImageUpload type="file" id="input-app-image-upload"
                                                                class="input-file-field input-app-image-upload-ht" accept="image/*"
                                                                [(ngModel)]="applicationObj.originalImage" name="appImage"
                                                                image-upload="applicationObj.originalImage" image-upload-resize-max-height="300"
                                                <div class="property" *ngIf="!(applicationObj.applicationType == '3')">
                                                        <div class="property-label preview">
                                                                <span class="left-label">Preview</span>
-                                                               <span class="remove" (click)="removeImage()">Remove</span>
+                                                               <span *ngIf="(applicationObj.imageLink && applicationObj.imageLink.indexOf('default_app_image.gif') == -1
+                                                               ||applicationObj.thumbnail && applicationObj.thumbnail.indexOf('default_app_image.gif') == -1
+                                                               ||emptyImgForPreview && emptyImgForPreview.indexOf('default_app_image.gif') == -1)" 
+                                                               class="remove" (click)="removeImage()">Remove</span>
                                                        </div>
                                                        <img id="image-app-preview" class="image-preview"
                                                                src="{{applicationObj.imageLink || applicationObj.thumbnail || emptyImgForPreview}}" />
index 1b15f80..852e970 100644 (file)
@@ -75,6 +75,7 @@ export class ApplicationDetailsDialogComponent implements OnInit {
   @Input() action: any;
   @Output() passEntry: EventEmitter<any> = new EventEmitter();
   @ViewChild('applicationName') applicationNameElement: ElementRef;
+  @ViewChild('inputAppImageUpload') inputAppImageUpload: ElementRef;
 
   newAppModel = {
     'id': null,
@@ -200,6 +201,7 @@ export class ApplicationDetailsDialogComponent implements OnInit {
         this.applicationObj.imageUrl = null;
         this.applicationObj.imageLink = null;
         this.emptyImgForPreview = '../../../assets/images/default_app_image.gif';
+        this.inputAppImageUpload.nativeElement.value = "";
       }
     }, (resut) => {
       return;
index 19f5d8a..4772247 100644 (file)
@@ -51,6 +51,7 @@
             </button>
           
             <div class="apps-table">
+                <span class="ecomp-spinner" *ngIf="showEcompSpinner"></span>
                 <!-- Applications Table goes here-->
                 <table mat-table [dataSource]="dataSource" matSort>
                     <!-- Thumbnail Column -->
index 5903d65..83cbfa0 100644 (file)
@@ -66,6 +66,7 @@ export class ApplicationOnboardingComponent implements OnInit {
   dataSource = new MatTableDataSource(this.appsList);
   @ViewChild(MatSort) sort: MatSort;
   @ViewChild(MatPaginator) paginator: MatPaginator;
+  showEcompSpinner:boolean = false;
 
   constructor(public applicationsService: ApplicationsService, public ngbModal: NgbModal) { }
 
@@ -77,11 +78,13 @@ export class ApplicationOnboardingComponent implements OnInit {
 
   getOnboardingApps(){
     //console.log("getOnboardingApps called");
+    this.showEcompSpinner = true;
     this.applicationsService.getOnboardingApps()
       .subscribe(_data => {
           this.result = _data;
           if (this.result == null || this.result == 'undefined') {
               console.log('WidgetOnboardingService::getOnboardingWidgets Failed: Result or result.data is null');
+              this.showEcompSpinner = false;
           }else {
             this.appsList = _data;
             for (var i = 0; i < this.appsList.length; i++) {
@@ -94,11 +97,14 @@ export class ApplicationOnboardingComponent implements OnInit {
               }                                        
             }
             this.populateTableData(this.appsList);
+            this.showEcompSpinner = false;
           }
       }, error =>{
         console.log(error);
+        this.showEcompSpinner = false;
         this.openConfirmationModal('Error', error.message);
     });
+    this.showEcompSpinner = false;
   }
 
   applyFilter(filterValue: string) {
@@ -143,13 +149,16 @@ export class ApplicationOnboardingComponent implements OnInit {
           console.log('ApplicationOnboardingCtrl::deleteApplication: No apllication or ID... cannot delete');
           return;
         }
+        this.showEcompSpinner = true;
         this.appsList.splice(this.appsList.indexOf(application), 1);
         this.applicationsService.deleteOnboardingApp(application.id)
           .subscribe( data => {
             this.result = data;
             this.getOnboardingApps();
+            this.showEcompSpinner = false;
           }, error => {
             console.log(error);
+            this.showEcompSpinner = false;
             if(error && error.status == 405){
               this.openConfirmationModal('', 'Application : ' + application.appName+ ' can not be deleted as it is associsted with one of the Microservices.');
             }else{