|
1 | 1 | <div dsSection #sectionRef="sectionRef" [attr.id]="'section_' + sectionData.id" |
2 | 2 | [ngClass]="{ 'section-focus' : sectionRef.isSectionActive() }" [mandatory]="sectionData.mandatory" |
3 | 3 | [submissionId]="submissionId" [sectionType]="sectionData.sectionType" [sectionId]="sectionData.id"> |
4 | | - <!-- DATASHARE - note: reverted to upstream accordion behavior (all sections open by default) for CI compatibility --> |
5 | | - <!-- DataShare's signal-based one-section-at-a-time behavior should be implemented in the datashare theme override instead --> |
| 4 | + <!-- DATASHARE - start --> |
| 5 | + <!-- Use the signal-based method to determine if the section is open and recording panel changes--> |
6 | 6 | <ngb-accordion #acc="ngbAccordion" *ngIf="(sectionRef.isEnabled() | async)" |
7 | | - (panelChange)="sectionRef.sectionChange($event)" activeIds="{{ sectionData.id }}" [destroyOnHide]="false"> |
| 7 | + (panelChange)="onPanelChange($event)" [activeIds]="datashareSubmissionFormSectionContainerService.openPanelId() === sectionData.id ? sectionData.id : ''" [destroyOnHide]="false" |
| 8 | + [class]="isSectionOpen() ? 'ds-open' : 'ds-closed'"> |
| 9 | + <!-- DATASHARE - end --> |
8 | 10 | <ngb-panel id="{{ sectionData.id }}" [type]="sectionRef.isInfo() ? 'info' : ''"> |
9 | 11 | <ng-template ngbPanelTitle> |
10 | 12 | <span [ngClass]="{ 'text-white' : sectionRef.isInfo()}" class="float-left section-title" tabindex="0">{{ |
|
26 | 28 | <i *ngIf="sectionRef.isInfo()" class="fas fa-info-circle mr-3 text-white" |
27 | 29 | title="{{'submission.sections.status.info.title' | translate}}" role="img" |
28 | 30 | [attr.aria-label]="'submission.sections.status.info.aria' | translate"></i> |
| 31 | + <!-- DATASHARE - start --> |
| 32 | + <!-- Replaced sectionRef.isOpen() with isSectionOpen() to use the new signal-based method --> |
29 | 33 | <a class="close" tabindex="0" role="button" |
30 | | - [attr.aria-label]="(sectionRef.isOpen() ? 'submission.sections.toggle.aria.close' : 'submission.sections.toggle.aria.open') | translate: {sectionHeader: ('submission.sections.'+sectionData.header | translate)}" |
31 | | - [title]="(sectionRef.isOpen() ? 'submission.sections.toggle.close' : 'submission.sections.toggle.open') | translate"> |
32 | | - <span *ngIf="sectionRef.isOpen()" [ngClass]="{ 'text-white' : sectionRef.isInfo()}" |
| 34 | + [attr.aria-label]="(isSectionOpen() ? 'submission.sections.toggle.aria.close' : 'submission.sections.toggle.aria.open') | translate: {sectionHeader: ('submission.sections.'+sectionData.header | translate)}" |
| 35 | + [title]="(isSectionOpen() ? 'submission.sections.toggle.close' : 'submission.sections.toggle.open') | translate"> |
| 36 | + <span *ngIf="isSectionOpen()" [ngClass]="{ 'text-white' : sectionRef.isInfo()}" |
33 | 37 | class="fas fa-chevron-up fa-fw"></span> |
34 | | - <span *ngIf="!sectionRef.isOpen()" class="fas fa-chevron-down fa-fw"></span> |
| 38 | + <span *ngIf="!isSectionOpen()" class="fas fa-chevron-down fa-fw"></span> |
35 | 39 | </a> |
| 40 | + <!-- DATASHARE - end --> |
36 | 41 | <a href="javascript:void(0);" class="close mr-3" *ngIf="!sectionRef.isMandatory()" |
37 | 42 | (click)="removeSection($event)" |
38 | 43 | [attr.aria-label]="'submission.sections.remove' | translate: {sectionHeader: ('submission.sections.'+sectionData.header | translate)}"> |
39 | 44 | <i class="fas fa-trash-o" aria-hidden="true"></i> |
40 | 45 | </a> |
41 | 46 | </div> |
42 | 47 | </ng-template> |
43 | | - <ng-template ngbPanelContent> |
| 48 | + <!-- DATASHARE - start --> |
| 49 | + <ng-template ngbPanelContent *ngIf="datashareSubmissionFormSectionContainerService.openPanelId() === sectionData.id || ''"> |
| 50 | + <!-- DATASHARE - end --> |
44 | 51 | <div id="sectionGenericError_{{sectionData.id}}" *ngIf="sectionRef.hasGenericErrors()"> |
45 | 52 | <ds-alert *ngFor="let error of sectionRef.getErrors(); let i = index" [content]="error" [dismissible]="true" |
46 | 53 | [type]="AlertTypeEnum.Error" (close)="sectionRef.removeError(i)"></ds-alert> |
|
0 commit comments