-
Notifications
You must be signed in to change notification settings - Fork 8
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
fix: update key for column resizing preferences #239
base: main
Are you sure you want to change the base?
Conversation
this is a temporary measure to ensure column width preferences are persisted with a key that can be used to retrieve them. This is only needed until issue#238 is addressed
🦋 Changeset detectedLatest commit: a127ffc The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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.
Looks good to me - will want a changeset tho!
@@ -307,7 +307,7 @@ export class TableMeta { | |||
let tablePrefs = this.table.preferences; | |||
|
|||
for (let column of visibleColumnMetas) { | |||
let existing = tablePrefs.storage.forPlugin('ColumnResizing'); | |||
let existing = tablePrefs.storage.forPlugin(ColumnResizing.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.
Based on #238 (comment), it sounds like maybe we shouldn't be doing this?
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.
If anything just the class should be passed, not a string, nor a property on the string.
It would be the responsibility of forPlugin
to see a plugin, and grab the key off of it
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.
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.
Well, I'm wondering now based on what @NullVoxPopuli says if this won't even be a temporary fix?
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.
@NullVoxPopuli do you mean something like:
forPlugin(klass: PluginClass<any>) {
let instance = Reflect.construct(klass);
let existing = this.plugins.get(instance.name);
if (!existing) {
existing = new TrackedPluginPrefs();
this.plugins.set(instance.name, existing);
}
return existing;
}
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.
yup, the class-references are primary public API 🎉
This is a temporary measure to ensure column width preferences are persisted with a key that can be used to retrieve them.
This is only needed until issue#238 is addressed