Skip to content
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

Merged
merged 2 commits into from
Oct 3, 2023

Conversation

jelly
Copy link
Member

@jelly jelly commented Sep 27, 2023

No description provided.

@jelly jelly marked this pull request as ready for review September 27, 2023 11:19
Copy link
Member

@subhoghoshX subhoghoshX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great effort. Thanks :)

pkg/systemd/reporting.jsx Show resolved Hide resolved
pkg/systemd/reporting.jsx Outdated Show resolved Hide resolved
Don't mix this.props and properties directly de-constructed such as
`active_profile`.
Comment on lines +80 to +81
setProblemState(ProblemState.UNREPORTABLE);
console.error(cockpit.format("Getting properties for problem $0 failed: $1", problem.path, exception));
Copy link
Contributor

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);
Copy link
Contributor

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");
Copy link
Contributor

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))
Copy link
Contributor

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);
Copy link
Contributor

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

Comment on lines +190 to +191
const on_get_properties_rejected = exception => {
setProblemState(ProblemState.UNREPORTABLE);
Copy link
Contributor

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));
Copy link
Contributor

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)));
Copy link
Contributor

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

Comment on lines +337 to +340
const newMessage = cockpit.format("reportd task could not be created: $0", (exception.problem || exception.message));
setMessage(newMessage);
setProblemState(ProblemState.REPORTABLE);
console.error(newMessage);
Copy link
Contributor

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))));
Copy link
Contributor

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

Copy link
Member

@subhoghoshX subhoghoshX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect!!

Copy link
Member

@martinpitt martinpitt left a 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!

@martinpitt martinpitt merged commit fd698c1 into cockpit-project:main Oct 3, 2023
97 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants