Skip to content

Commit

Permalink
Fixed issue with refresh-delay-factor, updated text color for regex, …
Browse files Browse the repository at this point in the history
…added notification on filter save error
  • Loading branch information
rmathis committed Feb 22, 2019
1 parent 5c4465b commit 483adc5
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 11 deletions.
2 changes: 2 additions & 0 deletions backend/src/main/resources/i18n/messages_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,8 @@ message.database-constraint=There was a database constraint problem processing t
message.user-request-received-title=User request received
message.user-request-received-body=Your request has been received and is being reviewed. You will be notified with access status.

message.filter-fail=A server error occured, and the filter failed to save.

tooltip.entity-id=Entity ID
tooltip.service-provider-name=Service Provider Name (Dashboard Display Only)
tooltip.force-authn=Disallows use (or reuse) of authentication results and login flows that don\u0027t provide a real-time proof of user presence in the login process
Expand Down
1 change: 1 addition & 0 deletions ui/src/app/metadata/domain/model/metadata-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ export interface MetadataProvider extends MetadataBase {
xmlId: string;
sortKey: number;
metadataFilters: MetadataFilter[];
reloadableMetadataResolverAttributes?: any;
}
12 changes: 11 additions & 1 deletion ui/src/app/metadata/domain/service/provider.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,17 @@ export class MetadataProviderService {
}

find(id: string): Observable<MetadataProvider> {
return this.http.get<MetadataProvider>(`${this.base}${this.endpoint}/${id}`);
return this.http.get<MetadataProvider>(`${this.base}${this.endpoint}/${id}`).pipe(map(
provider => {
/*if (provider.reloadableMetadataResolverAttributes) {
if (provider.reloadableMetadataResolverAttributes.refreshDelayFactor) {
provider.reloadableMetadataResolverAttributes.refreshDelayFactor =
provider.reloadableMetadataResolverAttributes.refreshDelayFactor.toString();
}
}*/
return provider;
}
));
}

update(provider: MetadataProvider): Observable<MetadataProvider> {
Expand Down
23 changes: 22 additions & 1 deletion ui/src/app/metadata/filter/effect/collection.effect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ import { EntityAttributesFilterEntity } from '../../domain/entity/filter/entity-
import { MetadataFilterService } from '../../domain/service/filter.service';
import { SelectProviderRequest } from '../../provider/action/collection.action';
import { UpdateFilterChanges, ClearFilter } from '../action/filter.action';
import { AddNotification } from '../../../notification/action/notification.action';
import { NotificationType, Notification } from '../../../notification/model/notification';
import { I18nService } from '../../../i18n/service/i18n.service';
import * as fromI18n from '../../../i18n/reducer';

/* istanbul ignore next */
@Injectable()
Expand Down Expand Up @@ -118,6 +122,22 @@ export class FilterCollectionEffects {
map(() => new ClearFilter())
);

@Effect()
addFilterFailNotification$ = this.actions$.pipe(
ofType<AddFilterFail>(FilterCollectionActionTypes.ADD_FILTER_FAIL),
map(action => action.payload.error),
withLatestFrom(this.store.select(fromI18n.getMessages)),
map(([error, messages]) => {
return new AddNotification(
new Notification(
NotificationType.Danger,
`${error.errorCode}: ${this.i18nService.translate(error.errorMessage || 'message.filter-fail', null, messages)}`,
8000
)
);
})
);

@Effect()
updateFilter$ = this.actions$.pipe(
ofType<UpdateFilterRequest>(FilterCollectionActionTypes.UPDATE_FILTER_REQUEST),
Expand Down Expand Up @@ -253,6 +273,7 @@ export class FilterCollectionEffects {
private actions$: Actions,
private router: Router,
private filterService: MetadataFilterService,
private store: Store<fromFilter.State>
private store: Store<fromFilter.State>,
private i18nService: I18nService
) { }
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
</ng-container>
<ng-container *ngSwitchCase="'REGEX'">
<input id="targetInput" class="form-control" type="text" [formControl]="script" name="script" />
<small id="regex-help" class="text-danger">
<small id="regex-help" class="form-text text-secondary">
<translate-i18n key="message.required-for-regex">Required for Regex</translate-i18n>
&nbsp;
</small>
Expand Down
38 changes: 30 additions & 8 deletions ui/src/assets/schema/provider/file-system.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"properties": {
"name": {
"title": "label.metadata-provider-name",
"title": "label.service-provider-name-dashboard-display-only",
"description": "tooltip.metadata-provider-name",
"type": "string",
"widget": {
Expand Down Expand Up @@ -55,6 +55,29 @@
"type": "boolean",
"default": false
},
"doInitialization": {
"title": "label.do-resolver-initialization",
"description": "tooltip.do-resolver-initialization",
"type": "boolean",
"widget": {
"id": "boolean-radio"
},
"oneOf": [
{
"enum": [
true
],
"description": "value.true"
},
{
"enum": [
false
],
"description": "value.false"
}
],
"default": false
},
"reloadableMetadataResolverAttributes": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -105,17 +128,16 @@
"refreshDelayFactor": {
"title": "label.refresh-delay-factor",
"description": "tooltip.refresh-delay-factor",
"type": "number",
"type": "string",
"widget": {
"id": "number",
"step": 0.01
"id": "string",
"help": "message.real-number"
},
"placeholder": "label.real-number",
"minimum": 0,
"maximum": 1,
"default": null
"default": "",
"pattern": "^(?:([0]*(\\.[0-9]+)?|[0]*\\.[0-9]*[1-9][0-9]*)|)$"
}
}
}
}
}
}

0 comments on commit 483adc5

Please sign in to comment.