Skip to content

Commit f77ce86

Browse files
[DURACOM-304] remove control flow
1 parent bc06839 commit f77ce86

2 files changed

Lines changed: 14 additions & 13 deletions

File tree

src/app/shared/form/builder/ds-dynamic-form-ui/models/list/dynamic-list.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { getFirstSucceededRemoteDataPayload } from '../../../../../../core/share
1717
import { PaginatedList } from '../../../../../../core/data/paginated-list.model';
1818
import { VocabularyEntry } from '../../../../../../core/submission/vocabularies/models/vocabulary-entry.model';
1919
import { PageInfo } from '../../../../../../core/shared/page-info.model';
20-
import { EMPTY, expand, reduce } from "rxjs";
20+
import { BehaviorSubject, EMPTY, expand, map, reduce, tap } from "rxjs";
2121

2222
export interface ListItem {
2323
id: string;

src/app/submission/sections/cc-license/submission-section-cc-licenses.component.html

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@if (submissionCcLicenses) {
1+
<ng-container *ngIf="selectedCcLicense">
22
<div class="mb-4 ccLicense-select">
33
<div ngbDropdown>
44
<input id="cc-license-dropdown"
@@ -18,22 +18,23 @@
1818
[infiniteScrollUpDistance]="1.5"
1919
[fromRoot]="true"
2020
[scrollWindow]="false">
21-
22-
@if(submissionCcLicenses?.length === 0) {
21+
<ng-container *ngIf="submissionCcLicenses?.length === 0; else licensesList">
2322
<button class="dropdown-item disabled">
2423
{{ 'submission.sections.ccLicense.none' | translate }}
2524
</button>
26-
} @else {
27-
@for(license of submissionCcLicenses; track license.id) {
28-
<button class="dropdown-item" (click)="selectCcLicense(license)">
29-
{{ license.name }}
30-
</button>
31-
}
32-
}
25+
</ng-container>
3326
</div>
27+
</div>
3428
</div>
35-
</div>
36-
}
29+
</ng-container>
30+
31+
<ng-template #licensesList>
32+
<ng-container *ngFor="let license of submissionCcLicenses">
33+
<button class="dropdown-item" (click)="selectCcLicense(license)">
34+
{{ license.name }}
35+
</button>
36+
</ng-container>
37+
</ng-template>
3738

3839
<ng-container *ngIf="getSelectedCcLicense()">
3940

0 commit comments

Comments
 (0)