Skip to content
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

Add column settings render query to plugins #2500

Closed

Conversation

ada-x64
Copy link
Contributor

@ada-x64 ada-x64 commented Jan 16, 2024

Based on #2459 due to column settings sidebar refactors.

This PR introduces plugin.can_render_column_styles() in order to remove hardcoded string matching in the viewer.

    /**
     * Given a column's grouping (determined by indexing it in `plugin.config_column_names`)
     * and its view type, determines whether or not to render column styles in the settings sidebar.
     */
    can_render_column_styles(
        view_type: perspective.Type,
        group: string
    ): boolean;

(from rust/perspective-viewer/src/ts/plugin.ts)

I believe these two parameters are all the possible requirements to determine whether or not a plugin can render column styles. If not, we can always update the API. We need this information to determine whether or not to show the edit button in the settings panel's column selector and on update to determine whether or not to keep the column settings open for that particular column, e.g. if aggregating and the view type changes to something the plugin cannot style.

A future PR will take the same parameters and produce data about which style controls a particular column can have. This will replace #2469, so you can consider this a Part 1 for those changes.

@ada-x64
Copy link
Contributor Author

ada-x64 commented Jan 18, 2024

Updated this to fix a bug where switching between datagrid date and datetime columns with the style tab open was not rerendering.

@ada-x64 ada-x64 force-pushed the chores/add-render-query-to-plugins branch from 35a09e7 to 8c0547e Compare January 19, 2024 15:16
@ada-x64 ada-x64 force-pushed the chores/add-render-query-to-plugins branch from 8c0547e to 108d60f Compare January 25, 2024 15:29
@ada-x64 ada-x64 force-pushed the chores/add-render-query-to-plugins branch 2 times, most recently from 4a0656e to 7a4f4bf Compare February 16, 2024 17:13
@ada-x64 ada-x64 force-pushed the chores/add-render-query-to-plugins branch from 7a4f4bf to b853bac Compare February 26, 2024 15:15
@ada-x64 ada-x64 force-pushed the chores/add-render-query-to-plugins branch from b853bac to 33cb79a Compare February 28, 2024 17:07
@texodus
Copy link
Member

texodus commented Mar 11, 2024

Thanks for the PR!

Superseded by #2563

@texodus texodus closed this Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants