-
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
shell: More types than ever #21426
shell: More types than ever #21426
Conversation
This is still another approach, just rename everything (almost) and get it relaxed green. |
@mvollmer unblocked! |
7fb1850
to
f9267bb
Compare
A CockpitNav component wants the "filtering" function to put a keyword on each item, but the item can be anything otherwise. CockpitHosts uses it with Machine objects, and PageNav with ManifestItems.
f9267bb
to
c29bed6
Compare
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.
Thanks! Nothing too serious, but I think it needs one more cleanup round.
It can return null and the host parameter is optional.
c29bed6
to
f2bcc1e
Compare
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.
Thanks! 😎
useEvent(keys as unknown as cockpit.EventSource<cockpit.EventMap>, "changed"); | ||
|
||
if (!keys) | ||
return null; |
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.
setUnlockKey(key.name); | ||
/* Key needs to be unloaded, do that directly */ | ||
} else if (!enable && key.loaded) { | ||
keys.unload(key).catch(ex => setDialogError(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.
onClose={() => dialogResult.resolve()} | ||
title={_("SSH keys")} | ||
id="credentials-modal" | ||
footer={<Button variant='secondary' onClick={() => dialogResult.resolve()}>{_("Close")}</Button>} |
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.
footer={<Button variant='secondary' onClick={() => dialogResult.resolve()}>{_("Close")}</Button>} | ||
> | ||
<Stack hasGutter> | ||
{dialogError && <ModalError dialogError={dialogError} />} |
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.
{ title: _("Toggle") }, | ||
] } | ||
rows={ Object.keys(keys.items).map((currentKeyId, index) => { | ||
const currentKey = keys.items[currentKeyId] || { name: 'test' }; |
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.
onTroubleshoot = () => {}, | ||
onReconnect = () => {}, |
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.
@@ -202,8 +235,8 @@ export class CockpitHosts extends React.Component { | |||
</Tooltip> | |||
</>} | |||
/>; | |||
const label = current_machine.label || ""; | |||
const user = current_machine.user || this.state.current_user; | |||
const label = current_machine?.label || ""; |
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.
arg.then(function(...args) { console.log(...args) }, | ||
function(...args) { console.error(...args) }); |
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.
if (typeof arg.stream == "function") | ||
arg.stream(function() { console.log.apply(console, arguments) }); | ||
arg.stream(function(...args) { console.log(...args) }); |
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.
No description provided.