-
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
base: main
Are you sure you want to change the base?
shell: More types than ever #21426
Conversation
mvollmer
commented
Dec 12, 2024
•
edited by martinpitt
Loading
edited by martinpitt
- shell: Even more types #21425
A manifest is now just a JsonObject, and users are expected to type-cast it (or parts) of it to more concrete types, like the new ShellManifest and ManifestParentSection.
The cockpit.spawn function takes only two arguments (unlike cockpit.script). Location.reload() doesn't take any arguments, the "force_reload" argument is a Firefox extension.
A CockpitNav component wants the "filtering" function to put a keyword on each item, but the the item can be anything otherwise. CockpitHosts uses it with Machine objects, and PageNav with ManifestItems.
It doesn't happen anymore, yay!
This is still another approach, just rename everything (almost) and get it relaxed green. |
if (col && typeof col == "object") { | ||
const props = col as ListingTableRowColumnProps; | ||
if (props.sortKey) | ||
return props.sortKey; | ||
if (typeof props.title == "string") | ||
return props.title; |
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 6 added lines are not executed by any test.
if (typeof props.title == "string") | ||
return props.title; | ||
} | ||
return ""; |
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.
{typeof cell == 'object' ? cell.title : cell} | ||
<Th key={key || `row_${rowKey}_cell_${colKey}`} dataLabel={dataLabel} | ||
{...cellProps as ThProps}> | ||
{typeof cell == 'object' ? cell_as_props.title : cell} |
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.
@@ -215,7 +116,7 @@ const PublicKey = ({ currentKey }) => { | |||
|
|||
const KeyPassword = ({ currentKey, change, setDialogError }) => { | |||
const [confirmPassword, setConfirmPassword] = useState(''); | |||
const [inProgress, setInProgress] = useState(undefined); | |||
const [inProgress, setInProgress] = useState<boolean | undefined>(undefined); |
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.
@@ -245,8 +146,7 @@ | |||
const changePasswordBtn = ( | |||
<Button variant="primary" | |||
id={(currentKey.name || currentKey.comment) + "-change-password"} | |||
isDisabled={inProgress} | |||
isLoading={inProgress} | |||
{... inProgress !== undefined ? { isDisabled: inProgress, isLoading: inProgress } : {} } |
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.
.filter(key => !searchInput || manifest.locales[key].toLowerCase().includes(searchInput.toString().toLowerCase())); | ||
const locales = manifest.locales || {}; | ||
const filteredLocales = Object.keys(locales) | ||
.filter(key => !searchInput || locales[key].toLowerCase().includes(searchInput.toString().toLowerCase())); |
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.
{cockpit.format(_("$0 documentation"), this.state.osRelease.NAME)} | ||
</DropdownItem>); | ||
|
||
const shell_manifest = (cockpit.manifests.shell || {}) as ShellManifest; |
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.
// global documentation for cockpit as a whole | ||
(cockpit.manifests.shell?.docs ?? []).forEach(doc => { | ||
(shell_manifest.docs ?? []).forEach(doc => { |
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.
@mvollmer unblocked! |