[CST-5270] fixed accordion issue and changed it to collapsable

This commit is contained in:
Rezart Vata
2022-05-18 16:44:20 +02:00
parent 8498504b93
commit a03557fcad
7 changed files with 122 additions and 151 deletions

View File

@@ -27,8 +27,6 @@ import { debounce, debounceTime, timeInterval } from 'rxjs/operators';
@renderSectionFor(SectionsType.SherpaPolicies)
export class SubmissionSectionSherpaPoliciesComponent extends SectionModelComponent {
@ViewChildren('acc', { emitDistinctChangesOnly: true }) acc: QueryList<any>;
/**
* The accesses section data
* @type {WorkspaceitemSectionAccessesObject}
@@ -47,6 +45,11 @@ export class SubmissionSectionSherpaPoliciesComponent extends SectionModelCompon
*/
protected subs: Subscription[] = [];
/**
* A boolean representing if div should start collapsed
*/
public isCollapsed = false;
/**
* Initialize instance variables
*
@@ -74,17 +77,6 @@ export class SubmissionSectionSherpaPoliciesComponent extends SectionModelCompon
.forEach((subscription) => subscription.unsubscribe());
}
/**
* Expand all primary accordions
*/
ngAfterViewInit() {
if (this.acc) {
this.acc.forEach(accordion => {
accordion.expandAll();
});
}
}
/**
* Initialize all instance variables and retrieve collection default access conditions
@@ -98,18 +90,6 @@ export class SubmissionSectionSherpaPoliciesComponent extends SectionModelCompon
this.sherpaPoliciesData$.next(sherpaPolicies);
})
);
this.subs.push(
this.sherpaPoliciesData$.pipe(
debounceTime(500)
).subscribe((sherpaPolicies: WorkspaceitemSectionSherpaPoliciesObject) => {
if (this.acc) {
this.acc.forEach(accordion => {
accordion.expandAll();
});
}
})
);
}
/**