Skip to content

Commit

Permalink
Fixed radio widget
Browse files Browse the repository at this point in the history
  • Loading branch information
rmathis committed Jun 28, 2021
1 parent 00f1779 commit 211b30b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ui/src/app/form/component/widgets/RadioWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const RadioWidget = ({
const itemDisabled =
Array.isArray(enumDisabled) &&
enumDisabled.indexOf(option.value) !== -1;
const checked = option.value.toString() === value.toString();
const checked = option?.value?.toString() === value?.toString();

const radio = (
<Form.Check
Expand Down
6 changes: 5 additions & 1 deletion ui/src/app/metadata/editor/MetadataEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import API_BASE_PATH from '../../App.constant';
import { MetadataObjectContext } from '../hoc/MetadataSelector';
import { FilterableProviders } from '../domain/provider';
import { checkChanges } from '../hooks/utility';
import { createNotificationAction, NotificationTypes, useNotificationDispatcher } from '../../notifications/hoc/Notifications';

export function MetadataEditor ({ current }) {

Expand All @@ -27,6 +28,8 @@ export function MetadataEditor ({ current }) {

const { update, loading } = useMetadataUpdater(`${ API_BASE_PATH }${getMetadataPath(type)}`, current);

const notificationDispatch = useNotificationDispatcher();

const { data } = useMetadataEntities(type, {}, []);
const history = useHistory();
const definition = React.useContext(MetadataDefinitionContext);
Expand All @@ -47,7 +50,8 @@ export function MetadataEditor ({ current }) {
gotoDetail({ refresh: true });
})
.catch(err => {
window.location.reload();
// window.location.reload();
notificationDispatch(createNotificationAction(`${err.errorCode} - ${translator(err.errorMessage)}`, NotificationTypes.ERROR))
});
};

Expand Down

0 comments on commit 211b30b

Please sign in to comment.