Skip to content

Allow toolbar buttons visibility to be configured via settings #1598

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 47 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,41 @@
"description": "Override the default scale of the result table that is used by the `Preview SQL Query` command.",
"default": 1
},
"dbt.enableBuildModel": {
"type": "boolean",
"description": "Enable the 'Build dbt Model' button in SQL files",
"default": true
},
"dbt.enableExecuteSql": {
"type": "boolean",
"description": "Enable the 'Execute SQL' button in SQL files",
"default": true
},
"dbt.enableSqlQuickPick": {
"type": "boolean",
"description": "Enable the 'SQL Actions' button in SQL files",
"default": true
},
"dbt.enableRunModel": {
"type": "boolean",
"description": "Enable the 'Run dbt Model' button in SQL files",
"default": true
},
"dbt.enableTestModel": {
"type": "boolean",
"description": "Enable the 'Test dbt Model' button in SQL files",
"default": true
},
"dbt.enableSqlPreview": {
"type": "boolean",
"description": "Enable the 'Compiled dbt Preview' button in SQL files",
"default": true
},
"dbt.enableConvertToModel": {
"type": "boolean",
"description": "Enable the 'Convert to dbt model' button in SQL files",
"default": true
},
"dbt.fileNameTemplateGenerateModel": {
"type": "string",
"enum": [
Expand Down Expand Up @@ -871,32 +906,32 @@
"editor/title": [
{
"command": "dbtPowerUser.executeSQL",
"when": "resourceLangId =~ /^sql$|^jinja-sql$/",
"when": "resourceLangId =~ /^sql$|^jinja-sql$/ && config.dbt.enableExecuteSql",
"group": "navigation@1"
},
{
"command": "dbtPowerUser.runCurrentModel",
"when": "resourceLangId =~ /^sql$|^jinja-sql$/",
"when": "resourceLangId =~ /^sql$|^jinja-sql$/ && config.dbt.enableRunModel",
"group": "navigation@3"
},
{
"command": "dbtPowerUser.testCurrentModel",
"when": "resourceLangId =~ /^sql$|^jinja-sql$/",
"when": "resourceLangId =~ /^sql$|^jinja-sql$/ && config.dbt.enableTestModel",
"group": "navigation@4"
},
{
"command": "dbtPowerUser.sqlPreview",
"when": "resourceLangId =~ /^sql$|^jinja-sql$/",
"when": "resourceLangId =~ /^sql$|^jinja-sql$/ && config.dbt.enableSqlPreview",
"group": "navigation@5"
},
{
"command": "dbtPowerUser.sqlQuickPick",
"when": "resourceLangId =~ /^sql$|^jinja-sql$/",
"when": "resourceLangId =~ /^sql$|^jinja-sql$/ && config.dbt.enableSqlQuickPick",
"group": "navigation@1"
},
{
"command": "dbtPowerUser.sqlToModel",
"when": "resourceLangId =~ /^sql$|^jinja-sql$/",
"when": "resourceLangId =~ /^sql$|^jinja-sql$/ && config.dbt.enableConvertToModel",
"group": "navigation@6"
}
],
Expand Down Expand Up @@ -960,32 +995,32 @@
"editor/title/run": [
{
"command": "dbtPowerUser.buildCurrentProject",
"when": "resourceLangId =~ /^sql$|^jinja-sql$/",
"when": "resourceLangId =~ /^sql$|^jinja-sql$/ && config.dbt.enableBuildModel",
"group": "inline"
},
{
"command": "dbtPowerUser.buildCurrentModel",
"when": "resourceLangId =~ /^sql$|^jinja-sql$/",
"when": "resourceLangId =~ /^sql$|^jinja-sql$/ && config.dbt.enableBuildModel",
"group": "inline"
},
{
"command": "dbtPowerUser.buildChildrenModels",
"when": "resourceLangId =~ /^sql$|^jinja-sql$/",
"when": "resourceLangId =~ /^sql$|^jinja-sql$/ && config.dbt.enableBuildModel",
"group": "inline"
},
{
"command": "dbtPowerUser.buildParentModels",
"when": "resourceLangId =~ /^sql$|^jinja-sql$/",
"when": "resourceLangId =~ /^sql$|^jinja-sql$/ && config.dbt.enableBuildModel",
"group": "inline"
},
{
"command": "dbtPowerUser.buildChildrenParentModels",
"when": "resourceLangId =~ /^sql$|^jinja-sql$/",
"when": "resourceLangId =~ /^sql$|^jinja-sql$/ && config.dbt.enableBuildModel",
"group": "inline"
},
{
"command": "dbtPowerUser.runCurrentModel",
"when": "resourceLangId =~ /^sql$|^jinja-sql$/",
"when": "resourceLangId =~ /^sql$|^jinja-sql$/ && config.dbt.enableBuildModel",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be enableRunModel? @matthieucan

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That one is trickier than the others: all the actions within the single button "Build project" are behind a single flag.
This allows to display/hide the entire group (the button with the down arrow), rather than sub-items in this group. Only hiding a subset of the sub-items within this button would not hide the button itself, therefore it would be less useful IMO.

Does that make sense?

"group": "inline"
}
],
Expand Down