diff options
author | ShaabanEltanany <shaaban.eltanany.ext@orange.com> | 2020-04-08 18:54:43 +0200 |
---|---|---|
committer | Dan Timoney <dtimoney@att.com> | 2020-04-09 12:45:02 +0000 |
commit | 357fb897b019d5da84100f4ed62d145e031a7762 (patch) | |
tree | 491a30dcf046de9b4421017d7c07379e16106328 /cds-ui/designer-client | |
parent | 0466d6807e71c7c443f60e340445927194c0ee39 (diff) |
Fixing All Accordion panels is only open and not closed
Issue-ID: CCSDK-2219
Signed-off-by: ShaabanEltanany <shaaban.eltanany.ext@orange.com>
Change-Id: Ic2b22206f6cf9193723a9d441768a48ae9f865da
(cherry picked from commit 053de4277d61ee49dbcfe47a6c2fee4c97544712)
Diffstat (limited to 'cds-ui/designer-client')
4 files changed, 31 insertions, 9 deletions
diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/imports-tab/imports-tab.component.html b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/imports-tab/imports-tab.component.html index d80ed16b2..499efcee7 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/imports-tab/imports-tab.component.html +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/imports-tab/imports-tab.component.html @@ -36,9 +36,9 @@ <div class="card"> <div class="card-header" [id]="'head-'+mapIndex"> <h5 class="mb-0 d-flex justify-content-between"> - <button class="btn btn-link collapsed" data-toggle="collapse" - [attr.data-target]="'#id-'+mapIndex" aria-expanded="false" - [attr.aria-controls]="'id-'+mapIndex"> + <button class="btn btn-link " data-toggle="collapse" + aria-expanded="false" + (click)="changeDivShow(mapIndex)" > <i class="icon-file-code"></i> {{file.key}} </button> <a class="accordion-delete" (click)="removeFile(mapIndex)"><i class="icon-delete"></i></a> @@ -54,6 +54,7 @@ </div> </div> </div> + <!-- <div class="card"> <div class="card-header" id="headingThree"> @@ -77,6 +78,7 @@ </div> </div> --> + </div> </div> diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/imports-tab/imports-tab.component.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/imports-tab/imports-tab.component.ts index dc0cf7f3b..3b9d38c1a 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/imports-tab/imports-tab.component.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/imports-tab/imports-tab.component.ts @@ -1,7 +1,7 @@ -import { Component, OnInit } from '@angular/core'; -import { FileSystemFileEntry, NgxFileDropEntry } from 'ngx-file-drop'; -import { PackageCreationStore } from '../package-creation.store'; -import { PackageCreationUtils } from '../package-creation.utils'; +import {Component, OnInit} from '@angular/core'; +import {FileSystemFileEntry, NgxFileDropEntry} from 'ngx-file-drop'; +import {PackageCreationStore} from '../package-creation.store'; +import {PackageCreationUtils} from '../package-creation.utils'; @Component({ @@ -19,6 +19,7 @@ export class ImportsTabComponent implements OnInit { constructor(private packageCreationStore: PackageCreationStore, private packageCreationUtils: PackageCreationUtils) { } + ngOnInit(): void { this.packageCreationStore.state$.subscribe(cbaPackage => { if (cbaPackage.definitions && cbaPackage.definitions.imports && cbaPackage.definitions.imports.size > 0) { @@ -76,4 +77,14 @@ export class ImportsTabComponent implements OnInit { textChanges(code: any, key: string) { this.packageCreationStore.addDefinition(key, code); } + + changeDivShow(mapIndex: number) { + const divElement = document.getElementById('id-' + mapIndex) as HTMLElement; + if (divElement.getAttribute('class').includes('show')) { + divElement.setAttribute('class', 'collapse'); + } else { + divElement.setAttribute('class', 'collapse show'); + } + console.log(divElement.getAttribute('class')); + } } diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/scripts-tab/scripts-tab.component.html b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/scripts-tab/scripts-tab.component.html index 5dd68ed72..525043a51 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/scripts-tab/scripts-tab.component.html +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/scripts-tab/scripts-tab.component.html @@ -20,7 +20,7 @@ <div class="card"> <div [id]="'head-script-'+mapIndex" class="card-header"> <h5 class="mb-0 d-flex justify-content-between"> - <button [attr.aria-controls]="'id-script-'+mapIndex" [attr.data-target]="'#id-script-'+mapIndex" + <button (click)="changeDivShow(mapIndex)" aria-expanded="false" class="btn btn-link collapsed" data-toggle="collapse"> <i class="icon-file-code"></i> {{file.key}} </button> @@ -92,4 +92,4 @@ </div> </div> </div> -</div>
\ No newline at end of file +</div> diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/scripts-tab/scripts-tab.component.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/scripts-tab/scripts-tab.component.ts index 5387489a2..efe28e9a4 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/scripts-tab/scripts-tab.component.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/scripts-tab/scripts-tab.component.ts @@ -98,4 +98,13 @@ export class ScriptsTabComponent implements OnInit { textChanges(code: any, key: string) { this.packageCreationStore.addScripts(key, code); } + + changeDivShow(mapIndex: number) { + const divElement = document.getElementById('id-script-' + mapIndex) as HTMLElement; + if (divElement.getAttribute('class').includes('show')) { + divElement.setAttribute('class', 'collapse'); + } else { + divElement.setAttribute('class', 'collapse show'); + } + } } |