Skip to content

Commit

Permalink
Issue 5778 - UI - Remove error message if .dsrc is missing
Browse files Browse the repository at this point in the history
Description:  Having a .dsrc file is not required, so the UI should not report
an error if it's not present

relates: #5778

Reviewed by: spichugi & progier(Thanks!)
  • Loading branch information
mreynolds389 committed May 25, 2023
1 parent 28adbec commit 22c174a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
10 changes: 8 additions & 2 deletions src/cockpit/389-console/src/lib/monitor/monitorModals.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,10 @@ class ReportCredentialsModal extends React.Component {
key="save"
variant="primary"
onClick={newEntry ? addConfig : editConfig}
isDisabled={hostname === "" || binddn === "" || bindpw === ""}
isDisabled={
hostname === "" || binddn === "" ||
(bindpw === "" && !pwInputInterractive)
}
>
Save
</Button>,
Expand Down Expand Up @@ -549,7 +552,10 @@ class ReportConnectionModal extends React.Component {
key="save"
variant="primary"
onClick={addConn}
isDisabled={name ==="" || hostname === "" || port === "" || binddn === "" || bindpw === ""}
isDisabled={
name ==="" || hostname === "" || port === "" ||
binddn === "" || (bindpw === "" && !pwInputInterractive)
}
>
Save
</Button>,
Expand Down
9 changes: 4 additions & 5 deletions src/cockpit/389-console/src/lib/monitor/replMonitor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,7 @@ export class ReplMonitor extends React.Component {
})
.fail(err => {
const errMsg = JSON.parse(err);
this.props.addNotification(
"error",
`Failed to get .dsrc information: ${errMsg.desc}`
);
console.log(`loadDSRC: Could not load .dsrc file: ${errMsg.desc}`);
this.setState({
loadingDSRC: false,
});
Expand All @@ -262,7 +259,9 @@ export class ReplMonitor extends React.Component {
credsBindpw: "",
pwInputInterractive: true
}
]
],
credRows: [...this.props.credRows],
aliasRows: [...this.props.aliasRows],
}));
if ('replAgmts' in this.props.data) {
for (const agmt of this.props.data.replAgmts) {
Expand Down
12 changes: 5 additions & 7 deletions src/cockpit/389-console/src/monitor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -713,8 +713,8 @@ export class Monitor extends React.Component {
glues: config.items,

},
replInitLoaded: true,
replLoading: false,
replInitLoaded: true
});
})
.fail(() => {
Expand Down Expand Up @@ -756,16 +756,13 @@ export class Monitor extends React.Component {
this.setState({
credRows,
aliasRows,
replLoading: false,
replInitLoaded: true
});
})
.fail(err => {
// No dsrc file, thats ok
const errMsg = JSON.parse(err);
this.props.addNotification(
"error",
`Failed to get .dsrc information: ${errMsg.desc}`
);
console.log(`loadDSRC: Could not load .dsrc file: ${errMsg.desc}`);
this.setState({
replLoading: false,
});
Expand Down Expand Up @@ -862,6 +859,7 @@ export class Monitor extends React.Component {
.spawn(cmd, { superuser: true, err: "message" })
.done(content => {
const config = JSON.parse(content);
this.loadDSRC();
this.setState({
[treeViewItem.suffix]: {
...this.state[treeViewItem.suffix],
Expand All @@ -883,7 +881,7 @@ export class Monitor extends React.Component {
// Notification of failure (could only be server down)
this.setState({
replLoading: false,
});
}, this.loadDSRC);
});
} else {
// We should enable it here because ReplMonitor never will be mounted
Expand Down

0 comments on commit 22c174a

Please sign in to comment.