Hide EPerson search section in the edit mode

This commit is contained in:
Luca Giamminonni
2020-08-21 18:01:35 +02:00
parent 708b5495c7
commit 547ade276c
2 changed files with 83 additions and 78 deletions

View File

@@ -7,7 +7,8 @@
<ds-eperson-form *ngIf="isEPersonFormShown" (submitForm)="forceUpdateEPeople()" <ds-eperson-form *ngIf="isEPersonFormShown" (submitForm)="forceUpdateEPeople()"
(cancelForm)="isEPersonFormShown = false"></ds-eperson-form> (cancelForm)="isEPersonFormShown = false"></ds-eperson-form>
<div *ngIf="!isEPersonFormShown" class="button-row top d-flex pb-2"> <div *ngIf="!isEPersonFormShown">
<div class="button-row top d-flex pb-2">
<button class="mr-auto btn btn-success addEPerson-button" <button class="mr-auto btn btn-success addEPerson-button"
(click)="isEPersonFormShown = true"> (click)="isEPersonFormShown = true">
<i class="fas fa-plus"></i> <i class="fas fa-plus"></i>
@@ -87,7 +88,7 @@
<div *ngIf="(ePeople | async)?.payload?.totalElements == 0" class="alert alert-info w-100 mb-2" role="alert"> <div *ngIf="(ePeople | async)?.payload?.totalElements == 0" class="alert alert-info w-100 mb-2" role="alert">
{{labelPrefix + 'no-items' | translate}} {{labelPrefix + 'no-items' | translate}}
</div> </div>
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -175,7 +175,7 @@ describe('EPeopleRegistryComponent', () => {
it('editEPerson form is toggled', () => { it('editEPerson form is toggled', () => {
const ePeopleIds = fixture.debugElement.queryAll(By.css('#epeople tr td:first-child')); const ePeopleIds = fixture.debugElement.queryAll(By.css('#epeople tr td:first-child'));
ePersonDataServiceStub.getActiveEPerson().subscribe((activeEPerson: EPerson) => { ePersonDataServiceStub.getActiveEPerson().subscribe((activeEPerson: EPerson) => {
if (activeEPerson === ePeopleIds[0].nativeElement.textContent) { if (ePeopleIds[0] && activeEPerson === ePeopleIds[0].nativeElement.textContent) {
expect(component.isEPersonFormShown).toEqual(false); expect(component.isEPersonFormShown).toEqual(false);
} else { } else {
expect(component.isEPersonFormShown).toEqual(true); expect(component.isEPersonFormShown).toEqual(true);
@@ -183,6 +183,10 @@ describe('EPeopleRegistryComponent', () => {
}) })
}); });
it('EPerson search section is hidden', () => {
expect(fixture.debugElement.query(By.css('#search'))).toBeNull();
});
}); });
}); });