Skip to content

Commit

Permalink
Resolved merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
rmathis committed Dec 4, 2019
2 parents 3a33e02 + 9a074d6 commit f7f715a
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<section class="section" aria-label="Add a new metadata source - how are you adding the metadata information?" tabindex="0">
<section class="section" aria-label="Add a new metadata provider." tabindex="0">
<div class="section-header bg-info p-2 text-white">
<div class="row justify-content-between">
<div class="col-md-12">
Expand Down
1 change: 1 addition & 0 deletions ui/src/app/metadata/provider/effect/collection.effect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ export class CollectionEffects {
map(action => action.payload),
withLatestFrom(this.store.select(fromI18n.getMessages)),
map(([error, messages]) => {
console.log(error);
let message = `${error.errorCode}: ${this.i18nService.translate(error.errorMessage, null, messages)}`;
message = error.cause ? `${message} - ${error.cause}` : message;
return new AddNotification(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Component, Input, Output, EventEmitter, OnInit } from '@angular/core';
import { Notification } from '../model/notification';
import { LiveAnnouncer } from '@angular/cdk/a11y';

@Component({
selector: 'notification-item',
Expand All @@ -10,11 +11,15 @@ export class NotificationItemComponent implements OnInit {
@Input() notification: Notification;
@Output() clear: EventEmitter<Notification> = new EventEmitter<Notification>();
readonly timerCallback = () => this.clear.emit(this.notification);
constructor() {}
constructor(
private announce: LiveAnnouncer
) {}

ngOnInit(): void {
if (this.notification.timeout > 0) {
setTimeout(this.timerCallback, this.notification.timeout);
}

this.announce.announce(`Error: ${this.notification.body}`);
}
} /* istanbul ignore next */
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
class="component-control"
limit="10"
[formControl]="search"
[matches]="ids$ | async"
[matches]="ids"
(keydown.enter)="onSelectValue(search.value)">
</auto-complete>
<small [class.text-danger]="search.invalid && search.touched" translate="message.entity-id-min-unique">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ export class FilterTargetComponent extends ObjectWidget implements OnDestroy, Af
) {
super();
this.ids$ = this.store.select(fromFilters.getEntityCollection);
this.ids$.subscribe(ids => this.ids = ids);
this.ids$.subscribe(ids => {
this.ids = [...ids];
});

this.search
.valueChanges
Expand Down
4 changes: 3 additions & 1 deletion ui/src/app/shared/autocomplete/autocomplete.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@
[attr.aria-label]="this.input.value"
[innerHTML]="option | highlight:this.input.value">
</button>
<p class="dropdown-item dropdown-item-noresults" *ngIf="matches && matches.length === 0 && !processing">
<p class="dropdown-item dropdown-item-noresults"
role="option"
*ngIf="matches && matches.length === 0 && !processing">
{{ noneFoundText }}
</p>
</div>
12 changes: 9 additions & 3 deletions ui/src/app/shared/autocomplete/autocomplete.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,15 @@ export class AutoCompleteComponent implements OnInit, OnDestroy, OnChanges, Afte

ngOnChanges(changes: SimpleChanges): void {
if (changes.matches && this.matches) {
const count = this.matches.length;
this.live.announce(count === 0 ? 'No results available' : `${count} result${count === 1 ? '' : 's'} available`);
this.announceResults();
}
}

announceResults(): void {
const count = this.matches.length;
this.live.announce(count === 0 ? 'No results available' : `${count} result${count === 1 ? '' : 's'} available`);
}

writeValue(value: any): void {
this.input.setValue(value);
}
Expand Down Expand Up @@ -229,6 +233,8 @@ export class AutoCompleteComponent implements OnInit, OnDestroy, OnChanges, Afte
selected: searchForOptions ? ((autoselect && optionsAvailable) ? 0 : -1) : null
});
this.propagateChange(query);

setTimeout(() => this.announceResults(), 250);
}

handleInputFocus(): void {
Expand Down Expand Up @@ -370,4 +376,4 @@ export class AutoCompleteComponent implements OnInit, OnDestroy, OnChanges, Afte
...this.state.currentState
};
}
} /* istanbul ignore next */
}

0 comments on commit f7f715a

Please sign in to comment.