62589: Review 03-10-2019 Changes and fixes

This commit is contained in:
Kristof De Langhe
2019-10-08 13:06:31 +02:00
parent 8652c4bce8
commit 5b776b605a
17 changed files with 118 additions and 117 deletions

View File

@@ -7,7 +7,7 @@
[collectionSize]="collectionsRD?.payload?.totalElements"
[hidePagerWhenSinglePage]="true"
[hideGear]="true">
<div class="table-responsive">
<div class="table-responsive mt-2">
<table id="collection-select" class="table table-striped table-hover">
<thead>
<tr>
@@ -24,11 +24,18 @@
</table>
</div>
</ds-pagination>
<div *ngIf="collectionsRD?.payload?.totalElements === 0 || collectionsRD?.payload?.page?.length === 0" class="alert alert-info w-100" role="alert">
{{'collection.select.empty' | translate}}
</div>
<ds-error *ngIf="collectionsRD?.hasFailed" message="{{'error.collections' | translate}}"></ds-error>
<ds-loading *ngIf="!collectionsRD || collectionsRD?.isLoading" message="{{'loading.collections' | translate}}"></ds-loading>
<div>
<div *ngVar="(selectedIds$ | async) as selectedIds">
<button class="btn btn-outline-secondary collection-cancel float-left" (click)="onCancel()">{{cancelButton | translate}}</button>
<button *ngIf="dangerConfirm" class="btn btn-danger collection-confirm float-right" (click)="confirmSelected()">{{confirmButton | translate}}</button>
<button *ngIf="!dangerConfirm" class="btn btn-primary collection-confirm float-right" (click)="confirmSelected()">{{confirmButton | translate}}</button>
<button class="btn collection-confirm float-right"
[ngClass]="{'btn-danger': dangerConfirm, 'btn-primary': !dangerConfirm}"
[disabled]="selectedIds?.length === 0"
(click)="confirmSelected()">
{{confirmButton | translate}}
</button>
</div>
</ng-container>

View File

@@ -16,7 +16,7 @@ import { CollectionSelectComponent } from './collection-select.component';
import { Collection } from '../../../core/shared/collection.model';
import { of } from 'rxjs/internal/observable/of';
describe('ItemSelectComponent', () => {
describe('CollectionSelectComponent', () => {
let comp: CollectionSelectComponent;
let fixture: ComponentFixture<CollectionSelectComponent>;
let objectSelectService: ObjectSelectService;
@@ -43,7 +43,7 @@ describe('ItemSelectComponent', () => {
imports: [TranslateModule.forRoot(), SharedModule, RouterTestingModule.withRoutes([])],
declarations: [],
providers: [
{ provide: ObjectSelectService, useValue: new ObjectSelectServiceStub() },
{ provide: ObjectSelectService, useValue: new ObjectSelectServiceStub([mockCollectionList[1].id]) },
{ provide: HostWindowService, useValue: new HostWindowServiceStub(0) }
],
schemas: [NO_ERRORS_SCHEMA]