-
Notifications
You must be signed in to change notification settings - Fork 67
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
serviceconnector: Add database subtypes #1581
Conversation
@@ -43,7 +47,19 @@ export class TargetServiceListStep extends AzureWizardPromptStep<ICreateLinkerCo | |||
case TargetServiceTypeName.Storage: | |||
promptSteps.push(new StorageAccountListStep(storageAccountCreateOptions)); | |||
break; | |||
case TargetServiceTypeName.CosmosDB: | |||
case TargetServiceTypeName.Cassandra: |
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.
It might make more sense for the switch case to check the group. That shouldn't change anything for Storage (since all of the groups are also TargetServiceTypeName.Storage
).
But it'd make this a lot cleaner since all are part of TargetServiceTypeName.CosmosDB
and are all using the same promptStep as far as I can tell.
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.
Very true I will do that!
{ label: vscode.l10n.t('NoSQL'), data: { name: "sql", type: TargetServiceTypeName.NoSQL, id: '/databases' }, group: TargetServiceTypeName.CosmosDB }, | ||
{ label: vscode.l10n.t('Table'), data: { name: "table", type: TargetServiceTypeName.Table, id: '/databases' }, group: TargetServiceTypeName.CosmosDB }, | ||
{ label: vscode.l10n.t('Key Vault'), data: { name: "keyVault", type: TargetServiceTypeName.KeyVault, id: '/keyVault' }, group: TargetServiceTypeName.KeyVault }, | ||
{ label: vscode.l10n.t('Blob'), data: { name: "storageBlob", type: TargetServiceTypeName.Storage, id: '/blobServices/default', group: TargetServiceTypeName.Storage }, group: TargetServiceTypeName.Storage }, |
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.
Heh, this is a little bit goofy. It definitely works, but the repeat code hurts my eyes 😭
Could I suggest that rather than duplicating the group property in data
, that you instead save the result of the quickPick item instead of just the data
?
Something like this
const result = await context.ui.showQuickPick(picks, { placeHolder, enableGrouping: true };
context.targetServiceType = result.data;
switch (result.group) {
...
…ganmott/addDatabaseSubTypes
Add in database subtypes and filter the database accounts based on the chosen type. Here is how the new list looks: