Skip to content

Commit

Permalink
Fixed invalid duration setting
Browse files Browse the repository at this point in the history
  • Loading branch information
rmathis committed Aug 30, 2022
1 parent 40f3e13 commit 9091027
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions backend/src/main/resources/i18n/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,7 @@ message.delete-role-title=Delete Role?

message.delete-role-body=You are requesting to delete a role. If you complete this process the role will be removed. This cannot be undone. Do you wish to continue?
message.duration=Requires a valid ISO 8601 duration (ex. PT2D)
message.invalid-duration=Invalid duration for this field.

message.delete-user-title=Delete User?
message.delete-user-body=You are requesting to delete a user. If you complete this process the user will be removed. This cannot be undone. Do you wish to continue?
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { metadataFilterProcessor } from '../utility/providerFilterProcessor';
import { MetadataFilterTypes } from '../../filter';
import { has } from 'lodash';

export const BaseProviderDefinition = {
schemaPreprocessor: metadataFilterProcessor,
Expand All @@ -18,6 +19,18 @@ export const BaseProviderDefinition = {
errors.xmlId.addError('message.id-unique');
}

if (has(formData, 'reloadableMetadataResolverAttributes.minRefreshDelay')) {
if (formData.reloadableMetadataResolverAttributes.minRefreshDelay === 'PT0S') {
errors.reloadableMetadataResolverAttributes.minRefreshDelay.addError('message.invalid-duration');
}
}

if (has(formData, 'reloadableMetadataResolverAttributes.maxRefreshDelay')) {
if (formData.reloadableMetadataResolverAttributes.maxRefreshDelay === 'PT0S') {
errors.reloadableMetadataResolverAttributes.maxRefreshDelay.addError('message.invalid-duration');
}
}

return errors;
}
},
Expand Down

0 comments on commit 9091027

Please sign in to comment.