-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Catch and display load errors for WorkloadsOverview #4393
Conversation
- Move the select filter to the top level since that is where the subscribe call is Signed-off-by: Sebastian Malton <sebastian@malton.name>
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.
Signed-off-by: Sebastian Malton <sebastian@malton.name>
@jim-docker Good catch, thanks. I also fixed the same issue on the |
type RegisteredWorkloadsOverviewDetail = Required<WorkloadsOverviewDetailRegistration>; | ||
|
||
export class WorkloadsOverviewDetailRegistry extends BaseRegistry<WorkloadsOverviewDetailRegistration, RegisteredWorkloadsOverviewDetail> { | ||
getItems() { | ||
const items = super.getItems(); | ||
return orderBy(super.getItems(), "priority", "desc"); | ||
} | ||
|
||
protected getRegisteredItem(item: WorkloadsOverviewDetailRegistration): RegisteredWorkloadsOverviewDetail { | ||
const { priority = 50, ...rest } = item; | ||
|
||
return items.sort((a, b) => (b.priority ?? 50) - (a.priority ?? 50)); | ||
return { priority, ...rest }; |
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 looks unrelated to the issue, did you test that it still works?
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.
Yes I did. With the kube-resource-map extension installed (and the default overview doesn't have priority
defined) the order is the exact same as before.
namespaces: clusterContext.contextNamespaces, | ||
onLoadFailure: error => this.loadErrors.push(String(error)), | ||
}), | ||
reaction(() => clusterContext.contextNamespaces.slice(), () => { |
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.
Why can't it just be () => clusterContext.contextNamespaces
?
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.
Because then it only tracks assignments to the clusterContext.contextNamespaces
field itself, and not internal changes.
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.
Ah, right. You have to "dot" into it. Ugh.
subscribe call is
Signed-off-by: Sebastian Malton sebastian@malton.name
fixes #4344