Skip to content

Commit

Permalink
Merged develop into feature/shibui-2341
Browse files Browse the repository at this point in the history
  • Loading branch information
chasegawa committed Aug 31, 2022
2 parents d7bed88 + f389624 commit 02e6572
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 6 deletions.
3 changes: 2 additions & 1 deletion backend/src/main/resources/i18n/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,8 @@ label.role=Role
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.duration=Requires a valid ISO 8601 duration (ex. PT4H)
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
2 changes: 0 additions & 2 deletions ui/src/app/metadata/Filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ export function Filter() {

const { path, url } = useRouteMatch();

console.log(path, url)

return (
<Switch>
<Route path={`${path}/list`} render={() =>
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
8 changes: 8 additions & 0 deletions ui/src/app/metadata/editor/MetadataFilterEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ export function MetadataFilterEditor({children, onNavigate, block}) {
const schema = React.useContext(MetadataSchemaContext);
const current = React.useContext(MetadataFilterContext);

React.useEffect(() => {
const step = definition.steps.find(step => step.id === section);
if (!step) {
onNavigate(definition.steps[0].id);
}
}, [section, current, onNavigate, definition]);

const { state, dispatch } = React.useContext(MetadataFormContext);
const { metadata, errors } = state;

Expand All @@ -38,6 +45,7 @@ export function MetadataFilterEditor({children, onNavigate, block}) {

const warnings = definition.warnings && definition.warnings(metadata);


return (
<div className="">
<div className="row">
Expand Down
6 changes: 5 additions & 1 deletion ui/src/app/metadata/hooks/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ export function useUiSchema(definition, schema, current, locked = true) {

const ui = React.useMemo(() => definition ? { ...definition.uiSchema } : {}, [definition]);
const schemaKeys = React.useMemo(() => schema ? Object.keys(schema.properties) : [], [schema]);
const step = React.useMemo(() => definition ? definition.steps.find(step => step.id === current) : {fields: []}, [definition, current]);
let step = React.useMemo(() => definition ? definition.steps.find(step => step.id === current) : {fields: []}, [definition, current]);

if (!step) {
step = definition.steps[0];
}

const filled = React.useMemo(() => fillInRootProperties(schemaKeys, ui), [schemaKeys, ui]);
const mapped = React.useMemo(() => Object.keys(filled).reduce((sch, key) => {
Expand Down
4 changes: 2 additions & 2 deletions ui/src/app/metadata/wizard/MetadataFilterTypeSelector.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Translate from '../../i18n/components/translate';
import { InfoIcon } from '../../form/component/InfoIcon';
import { useTranslator } from '../../i18n/hooks';

export function MetadataFilterTypeSelector({ types = [], children, actions}) {
export function MetadataFilterTypeSelector({ types = [], children}) {

const translator = useTranslator();

Expand All @@ -29,7 +29,7 @@ export function MetadataFilterTypeSelector({ types = [], children, actions}) {
React.useEffect(() => {
setBase({
'@type': type
})
});
}, [type])

return (
Expand Down

0 comments on commit 02e6572

Please sign in to comment.