[DURACOM-304] remove control flow

This commit is contained in:
FrancescoMolinaro
2025-01-30 12:14:07 +01:00
parent bc06839926
commit f77ce869f8
2 changed files with 14 additions and 13 deletions

View File

@@ -17,7 +17,7 @@ import { getFirstSucceededRemoteDataPayload } from '../../../../../../core/share
import { PaginatedList } from '../../../../../../core/data/paginated-list.model';
import { VocabularyEntry } from '../../../../../../core/submission/vocabularies/models/vocabulary-entry.model';
import { PageInfo } from '../../../../../../core/shared/page-info.model';
import { EMPTY, expand, reduce } from "rxjs";
import { BehaviorSubject, EMPTY, expand, map, reduce, tap } from "rxjs";
export interface ListItem {
id: string;

View File

@@ -1,4 +1,4 @@
@if (submissionCcLicenses) {
<ng-container *ngIf="selectedCcLicense">
<div class="mb-4 ccLicense-select">
<div ngbDropdown>
<input id="cc-license-dropdown"
@@ -18,22 +18,23 @@
[infiniteScrollUpDistance]="1.5"
[fromRoot]="true"
[scrollWindow]="false">
@if(submissionCcLicenses?.length === 0) {
<ng-container *ngIf="submissionCcLicenses?.length === 0; else licensesList">
<button class="dropdown-item disabled">
{{ 'submission.sections.ccLicense.none' | translate }}
</button>
} @else {
@for(license of submissionCcLicenses; track license.id) {
<button class="dropdown-item" (click)="selectCcLicense(license)">
{{ license.name }}
</button>
}
}
</ng-container>
</div>
</div>
</div>
</div>
}
</ng-container>
<ng-template #licensesList>
<ng-container *ngFor="let license of submissionCcLicenses">
<button class="dropdown-item" (click)="selectCcLicense(license)">
{{ license.name }}
</button>
</ng-container>
</ng-template>
<ng-container *ngIf="getSelectedCcLicense()">