-
Notifications
You must be signed in to change notification settings - Fork 532
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
Refactor element-specific behavior out of ListModel #8212
base: dev-mail
Are you sure you want to change the base?
Conversation
370a923
to
0526659
Compare
0526659
to
931b436
Compare
0b4b27d
to
e86dad5
Compare
931b436
to
0136a8e
Compare
src/common/misc/ListModel.ts
Outdated
@@ -25,23 +22,37 @@ import { ListFetchResult, PageSize } from "../gui/base/ListUtils.js" | |||
import { isOfflineError } from "../api/common/utils/ErrorUtils.js" | |||
import { ListAutoSelectBehavior } from "./DeviceConfig.js" | |||
|
|||
export type ListModelConfig<ListElementType> = { | |||
export type ListModelConfig<ElementType, IdType> = { |
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.
ElementType
is also an existing type, might be confusing to shadow it
src/common/misc/ListModel.ts
Outdated
return settledThen(this.loading, what) | ||
} | ||
|
||
addToLoadedEntities(entity: ElementType) { |
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.
should maybe not refer to entities
in the names since we have specific meaning for it
Good job! I hope this is enough |
3707808
to
33bd027
Compare
33bd027
to
50f8d71
Compare
We do not want ListModel to specifically only work on ListElement types, or even element types in general. As such, we generalize it to a list of some kind of elements with some kind of ID, even if these are not types that would be stored remotely as part of the model. Also renames entity/element to item for the ListModel. Closes #8222 Co-authored-by: hrb-hub <[email protected]>
50f8d71
to
ce112b7
Compare
No description provided.