-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
systemd: more functional component porting of trivial components #19403
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great effort. Thanks :)
Don't mix this.props and properties directly de-constructed such as `active_profile`.
c578ad2
to
b39d5ff
Compare
setProblemState(ProblemState.UNREPORTABLE); | ||
console.error(cockpit.format("Getting properties for problem $0 failed: $1", problem.path, exception)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These 2 added lines are not executed by any test. Details
}) | ||
.then((properties) => { | ||
if (!properties) { | ||
return; | ||
} | ||
|
||
if (!properties[0].CanBeReported.v) { | ||
this.setState({ problemState: ProblemState.UNREPORTABLE }); | ||
setProblemState(ProblemState.UNREPORTABLE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This added line is not executed by any test. Details
|
||
_onReportButtonClick(event) { | ||
this.setState({ problemState: ProblemState.UNREPORTABLE }); | ||
const onCancelButtonClick = _event => process.close("canceled"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This added line is not executed by any test. Details
{ | ||
err: "out", | ||
superuser: "true", | ||
}) | ||
.stream((data) => this.setState({ message: data, })) | ||
.then(() => this.setState({ problemState: ProblemState.REPORTED, })) | ||
.stream((data) => setMessage(data)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This added line is not executed by any test. Details
.catch(exception => { | ||
this.setState({ problemState: ProblemState.REPORTABLE, }); | ||
setProblemState(ProblemState.REPORTABLE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This added line is not executed by any test. Details
const on_get_properties_rejected = exception => { | ||
setProblemState(ProblemState.UNREPORTABLE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These 2 added lines are not executed by any test. Details
problemState: ProblemState.REPORTABLE, | ||
reportLinks: [], | ||
task: null, | ||
console.error(cockpit.format("Getting properties for problem $0 failed: $1", problem.path, exception)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This added line is not executed by any test. Details
@@ -307,184 +319,124 @@ class BusWorkflowRow extends React.Component { | |||
return; | |||
} | |||
|
|||
console.error(cockpit.format("reportd task for workflow $0 did not finish: $1", this.props.workflow[0], (ex.problem || ex.message))); | |||
this.setState({ message: _("Reporting failed") }); | |||
console.error(cockpit.format("reportd task for workflow $0 did not finish: $1", workflow[0], (ex.problem || ex.message))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This added line is not executed by any test. Details
const newMessage = cockpit.format("reportd task could not be created: $0", (exception.problem || exception.message)); | ||
setMessage(newMessage); | ||
setProblemState(ProblemState.REPORTABLE); | ||
console.error(newMessage); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These 4 added lines are not executed by any test. Details
const getWorkflows = client => { | ||
client.call("/org/freedesktop/reportd/Service", "org.freedesktop.reportd.Service", "GetWorkflows", [problem.path]) | ||
.then((args, _options) => setWorkflows(args[0]), | ||
exception => console.error(cockpit.format("Failed to get workflows for problem $0: $1", problem.path, (exception.problem || exception.message)))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This added line is not executed by any test. Details
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"don't use this.props in a functional component " is a weird description for "port ProfilesMenuDialogBody to functional component", but changes look good. Thanks!
No description provided.