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

shell: Make it all reacty #21012

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

mvollmer
Copy link
Member

No description provided.

pkg/newshell/base_index.js Fixed Show fixed Hide fixed
pkg/newshell/base_index.js Fixed Show fixed Hide fixed
pkg/newshell/hosts_dialog.jsx Fixed Show fixed Hide fixed
pkg/newshell/hosts_dialog.jsx Fixed Show fixed Hide fixed
pkg/newshell/shell.jsx Fixed Show fixed Hide fixed
pkg/shell/shell.jsx Fixed Show fixed Hide fixed
@garrett
Copy link
Member

garrett commented Sep 16, 2024

The host switcher mockups are so old, they used PF3 and had the dashboard:

unified-sidebar-host-switcher-few-isolated
unified-sidebar-host-switcher-many-isolated

(And the dashboard was where we edited machines prior.)

For PF4, if we're doing a 1:1 port, we should consider doing popovers and having a modal show up when you add or edit without dismissing the popover. (It will look different from these mockups for sure.)

@mvollmer mvollmer added the no-test For doc/workflow changes, or experiments which don't need a full CI run, label Sep 17, 2024
pkg/shell/shell.jsx Fixed Show fixed Hide fixed
@mvollmer mvollmer force-pushed the shell-never-go-full-react branch 3 times, most recently from f845f71 to 08db4e9 Compare September 18, 2024 12:56
@@ -71,6 +71,8 @@ class TestPages(testlib.MachineCase):
m = self.machine
b = self.browser

m.upload(["/home/mvo/work/cockpit/dist/shell"], "/usr/share/cockpit")
Copy link
Member

Choose a reason for hiding this comment

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

^_^

@mvollmer mvollmer force-pushed the shell-never-go-full-react branch 2 times, most recently from fd4891c to 566ddbc Compare September 19, 2024 11:33
pkg/shell/shell.jsx Fixed Show fixed Hide fixed
hosts_sel.appendChild(this.el);
}

componentWillUnmount() {
const hosts_sel = document.getElementById("nav-hosts");
Copy link
Member

Choose a reason for hiding this comment

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

Seems like an easy split off PR?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, but it's only necessary here because '#nav-hosts' doesn't exist yet (in this PR only) when the file is loaded. Also, I hope we can get rid of this DOM manipulation completely in this PR. Eventually.

@@ -307,7 +306,6 @@ export class CockpitHosts extends React.Component {
item_render={render}
sorting={(a, b) => true}
filtering={this.filterHosts}
current={label}
Copy link
Member

Choose a reason for hiding this comment

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

So it seems CockpitNav does not use current at all, can we then split this removal off?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, that was a mistake unfortunately. It uses current to notice when navigation has happened, and then resets the search field.

This might be a good example of hard to understand magic that we want to get rid of. There might be a signal on the ShellState that announces navigation, or we might have a navigation_counter, or something more obvious.

@mvollmer mvollmer force-pushed the shell-never-go-full-react branch 2 times, most recently from b5f4113 to 39ba1c5 Compare September 20, 2024 08:24
pkg/shell/shell.jsx Fixed Show fixed Hide fixed
pkg/shell/shell.jsx Fixed Show fixed Hide fixed
pkg/shell/state.jsx Fixed Show fixed Hide fixed
pkg/shell/state.jsx Fixed Show fixed Hide fixed
import React from 'react';
import { createRoot } from "react-dom/client";

import { WithDialogs, useDialogs } from "dialogs.jsx";

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused import useDialogs.
pkg/shell/state.jsx Fixed Show fixed Hide fixed
let's git rid of our state objects (but keep pushState and
replaceState in the right places).
console.log("passed state", JSON.stringify(state));

state = null;
if (!state)

Check warning

Code scanning / CodeQL

Useless conditional Warning

This negation always evaluates to true.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-test For doc/workflow changes, or experiments which don't need a full CI run,
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants