Skip to content

Commit

Permalink
Fix Config-Server UI (#1636)
Browse files Browse the repository at this point in the history
* fix mapping-editor

* fix buttons

* fix methodConfigurationEditor
  • Loading branch information
EddeCCC authored Dec 22, 2023
1 parent b792206 commit 986a6bb
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const ConvertDialog = ({ name, visible, onHide, text, onSuccess }) => {
const proceedButton = React.createRef();

useEffect(() => {
if (proceedButton && proceedButton.current) {
if (proceedButton?.current?.element) {
proceedButton.current.element.focus();
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,6 @@ const MethodConfigurationEditor = ({ yamlConfiguration }) => {
};
});
setScopes(currentScopes);

// expand all rows by default
const initialExpandedRows = _.reduce(
currentScopes,
(result, { typeKey }) => {
result[typeKey] = true;
return result;
},
{}
);
setExpandedRows(initialExpandedRows);
}, [configuration]);

/**
Expand Down Expand Up @@ -337,7 +326,7 @@ const MethodConfigurationEditor = ({ yamlConfiguration }) => {
dataKey="typeKey"
sortField="typeKey"
sortOrder={1}
groupField="typeKey"
groupRowsBy="typeKey"
expandableRowGroups={true}
expandedRows={expandedRows}
onRowToggle={(e) => setExpandedRows(e.data)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ class ConfigurationView extends React.Component {
<DownloadDialogue
visible={this.state.isConfigurationDialogShown}
onHide={this.hideConfigurationDialog}
onCancel={this.hideConfigurationDialog}
loading={this.props.loading}
contentValue={fileContentWithoutFirstLine}
contentType={'config'}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ class FileTree extends React.Component {
event.originalEvent.stopPropagation();
return;
}
event.originalEvent.persist();
if (event.originalEvent) {
event.originalEvent.persist();
}
this.setState({ contextMenuModel: this.getContextMenuModel(newSelection) });
this.contextMenuRef.current.show(event.originalEvent || event);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class KeyValueEditor extends React.Component {
editor = (columnProps) => {
return (
<InputText
value={columnProps.rowData[columnProps.field]}
defaultValue={columnProps.rowData[columnProps.field]}
onChange={(e) => this.valueChanged(columnProps.rowIndex, columnProps.field, e.target.value)}
/>
);
Expand Down

0 comments on commit 986a6bb

Please sign in to comment.