Fixnig file import in script, import and template&mapping. 62/105662/1
authorAhmedEldeeb50 <ahmed.eldeeb.ext@orange.com>
Wed, 8 Apr 2020 13:59:21 +0000 (15:59 +0200)
committerDan Timoney <dtimoney@att.com>
Thu, 9 Apr 2020 15:41:30 +0000 (15:41 +0000)
Fixing routes redirect

Issue-ID: CCSDK-2258

Signed-off-by: AhmedEldeeb50 <ahmed.eldeeb.ext@orange.com>
Change-Id: Ibe9f4516884044adcea2e8e16ee59c4e1775120f
(cherry picked from commit c78641087f481cb645096842a15efbb9feb77bfa)

cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/imports-tab/imports-tab.component.html
cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/scripts-tab/scripts-tab.component.html
cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-creation/templ-mapp-creation.component.html
cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-dashboard/package-list/package-list.component.html
cds-ui/designer-client/src/app/modules/feature-modules/packages/packages-dashboard/package-list/package-list.component.ts
cds-ui/designer-client/src/app/modules/shared-modules/header/header.component.html
cds-ui/designer-client/src/app/modules/shared-modules/header/header.component.ts

index 499efce..bf86c46 100644 (file)
@@ -5,7 +5,7 @@
             <a class="enter-link" href="#"><i class="icon-enter"></i></a>
         </div>
         <span class="import-container-span">Or you can also <a href="#" data-toggle="modal"
-                data-target="#importModal">Import File</a></span>
+                (click)="resetTheUploadedFiles()" data-target="#importModal">Import File</a></span>
 
     </div>
 
@@ -47,9 +47,9 @@
                 <div [id]="'id-'+mapIndex" class="collapse" [attr.aria-labelledby]="'head-'+mapIndex"
                     data-parent="#accordion">
                     <div class="card-body">
-                        <ace-editor [(text)]="file.value" (textChange)="textChanges($event,file.key)" [mode]="'json'" [autoUpdateContent]="true"
-                            [durationBeforeCallback]="1000" [theme]="'tomorrow_night_bright'" #editor
-                            style="height:300px;">
+                        <ace-editor [(text)]="file.value" (textChange)="textChanges($event,file.key)" [mode]="'json'"
+                            [autoUpdateContent]="true" [durationBeforeCallback]="1000" [theme]="'tomorrow_night_bright'"
+                            #editor style="height:300px;">
                         </ace-editor>
                     </div>
                 </div>
             </div>
         </div>
     </div>
-</div>
+</div>
\ No newline at end of file
index 525043a..5b4e7c8 100644 (file)
@@ -5,7 +5,7 @@
             <a class="enter-link" href="#"><i class="icon-enter"></i></a>
         </div>
         <span class="import-container-span">Or you can also <a data-target="#scriptsModal" data-toggle="modal"
-                href="#">Import File</a></span>
+                (click)="resetTheUploadedFiles()" href="#">Import File</a></span>
 
     </div>
 
index 8a43b01..86e713b 100644 (file)
                 </button>
             </div>
             <div class="modal-body">
-                <ngx-file-drop [accept]="allowedExt" dropZoneLabel="Drop files here" (onFileDrop)="dropped($event)"
+                <ngx-file-drop [multiple]="false" [accept]="allowedExt" dropZoneLabel="Drop files here" (onFileDrop)="dropped($event)"
                     (onFileOver)="fileOver($event)" (onFileLeave)="fileLeave($event)">
                     <ng-template ngx-file-drop-content-tmp let-openFileSelector="openFileSelector">
                         <div class="folder-upload">
index 9322ee7..f33615d 100644 (file)
@@ -92,7 +92,8 @@
                                 </button>
                             </div>
                             <div class="col">
-                                <button type="button" class="btn btn-card-config">Configuration</button>
+                                <button type="button" (click)="view(bluePrint.id)"
+                                    class="btn btn-card-config">Configuration</button>
                             </div>
                         </div>
                     </div>
index 0498012..b7bc05f 100644 (file)
@@ -1,6 +1,7 @@
-import {Component, OnInit} from '@angular/core';
-import {BlueprintModel} from '../../model/BluePrint.model';
-import {PackagesStore} from '../../packages.store';
+import { Component, OnInit } from '@angular/core';
+import { BlueprintModel } from '../../model/BluePrint.model';
+import { PackagesStore } from '../../packages.store';
+import { Router } from '@angular/router';
 
 @Component({
     selector: 'app-packages-list',
@@ -12,7 +13,7 @@ export class PackageListComponent implements OnInit {
     viewedPackages: BlueprintModel[] = [];
 
 
-    constructor(private packagesStore: PackagesStore) {
+    constructor(private packagesStore: PackagesStore, private router: Router) {
         console.log('PackageListComponent');
         this.packagesStore.state$.subscribe(state => {
             console.log(state);
@@ -26,6 +27,9 @@ export class PackageListComponent implements OnInit {
         this.packagesStore.getAll();
     }
 
+    view(id) {
+        this.router.navigate(['/packages/package', id]);
+    }
     testDispatch(bluePrint: BlueprintModel) {
         console.log(bluePrint.id);
     }
index 502e098..b6dadf8 100644 (file)
@@ -5,14 +5,14 @@
     <div class="overflow-container">
       <ul class="menu-dropdown">
         <li class="active">
-          <a routerLink="/packages">Packages</a>
+          <a (click)="redirect()" routerLink="/packages">Packages</a>
           <span class="icon">
             <!-- <i class="fa fa-dashboard"></i> -->
             <i class="icon-package"></i>
           </span>
         </li>
         <li class="menu-hasdropdown">
-          <a >Data Dictionary</a>
+          <a>Data Dictionary</a>
           <span class="icon">
             <i class="icon-dictionary"></i>
           </span>
@@ -34,7 +34,7 @@
             </li>
           </ul>
         </li> -->
-        <!-- <li>
+          <!-- <li>
             <a href="#">Favourites</a>
             <span class="icon">
               <i class="fa fa-heart"></i>
@@ -69,4 +69,4 @@
     </ul>
 
   </nav>
-</div>
+</div>
\ No newline at end of file
index 3ee4d0f..db87f8f 100644 (file)
@@ -1,4 +1,5 @@
 import { Component, OnInit } from '@angular/core';
+import { Router } from '@angular/router';
 
 @Component({
   selector: 'app-header',
@@ -7,9 +8,13 @@ import { Component, OnInit } from '@angular/core';
 })
 export class HeaderComponent implements OnInit {
 
-  constructor() { }
+  constructor(private router: Router) { }
 
   ngOnInit() {
   }
 
+  redirect() {
+    this.router.navigate(['/packages']);
+  }
+
 }