File tree Expand file tree Collapse file tree 7 files changed +34
-8
lines changed Expand file tree Collapse file tree 7 files changed +34
-8
lines changed Original file line number Diff line number Diff line change 20062006 },
20072007 {
20082008 "command" : " aws.docdb.createCluster" ,
2009- "when" : " view == aws.explorer && viewItem == awsDocDBNode"
2009+ "when" : " view == aws.explorer && viewItem == awsDocDBNode" ,
2010+ "group" : " 0@1"
20102011 },
20112012 {
20122013 "command" : " aws.docdb.startCluster" ,
20732074 "when" : " viewItem =~ /^awsDocDB-/" ,
20742075 "group" : " 0@1"
20752076 },
2077+ {
2078+ "command" : " aws.docdb.openHelp" ,
2079+ "when" : " viewItem == awsDocDBNode"
2080+ },
20762081 {
20772082 "command" : " aws.docdb.copyEndpoint" ,
20782083 "when" : " viewItem =~ /^awsDocDB-/" ,
37483753 }
37493754 }
37503755 },
3756+ {
3757+ "command" : " aws.docdb.openHelp" ,
3758+ "title" : " %AWS.command.docdb.openHelp%" ,
3759+ "category" : " %AWS.title%" ,
3760+ "enablement" : " (isCloud9 || !aws.isWebExtHost)" ,
3761+ "cloud9" : {
3762+ "cn" : {
3763+ "category" : " %AWS.title.cn%"
3764+ }
3765+ }
3766+ },
37513767 {
37523768 "command" : " aws.docdb.copyEndpoint" ,
37533769 "title" : " %AWS.command.docdb.copyEndpoint%" ,
Original file line number Diff line number Diff line change 212212 "AWS.command.docdb.stopCluster" : " Stop Cluster" ,
213213 "AWS.command.docdb.tags" : " Tags..." ,
214214 "AWS.command.docdb.open" : " Open in Browser" ,
215+ "AWS.command.docdb.openHelp" : " Open Getting Started Guide" ,
215216 "AWS.command.docdb.copyEndpoint" : " Copy Endpoint" ,
216217 "AWS.command.docdb.addRegion" : " Add region..." ,
217218 "AWS.command.resources.copyIdentifier" : " Copy Identifier" ,
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ import { modifyInstance } from './commands/modifyInstance'
2121import { rebootInstance } from './commands/rebootInstance'
2222import { renameInstance } from './commands/renameInstance'
2323import { addTag , listTags , removeTag } from './commands/tagCommands'
24+ import { env , Uri } from 'vscode'
2425
2526/**
2627 * Activates DocumentDB components.
@@ -88,6 +89,11 @@ export async function activate(ctx: ExtContext): Promise<void> {
8889 await node ?. openInBrowser ( )
8990 } ) ,
9091
92+ Commands . register ( 'aws.docdb.openHelp' , async ( node ?: DBResourceNode ) => {
93+ const url = Uri . parse ( 'https://docs.aws.amazon.com/documentdb/latest/developerguide/get-started-guide.html' )
94+ await env . openExternal ( url )
95+ } ) ,
96+
9197 Commands . register ( 'aws.docdb.copyEndpoint' , async ( node ?: DBResourceNode ) => {
9298 await node ?. copyEndpoint ( )
9399 } )
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ import { DBInstanceNode } from './dbInstanceNode'
1717import { PlaceholderNode } from '../../shared/treeview/nodes/placeholderNode'
1818import { DBInstance , DocumentDBClient } from '../../shared/clients/docdbClient'
1919import { DocDBContext } from './docdbContext'
20+ import { toTitleCase } from '../../shared'
2021
2122export type DBClusterRole = 'global' | 'regional' | 'primary' | 'secondary'
2223
@@ -83,10 +84,11 @@ export class DBClusterNode extends DBResourceNode {
8384 }
8485
8586 public getDescription ( ) : string | boolean {
87+ const role = toTitleCase ( this . clusterRole )
8688 if ( ! this . isAvailable ) {
87- return `${ this . clusterRole } cluster • ${ this . status } `
89+ return `${ role } cluster • ${ toTitleCase ( this . status ?? ' ' ) } `
8890 }
89- return `${ this . clusterRole } cluster`
91+ return `${ role } cluster`
9092 }
9193
9294 public async createInstance ( request : CreateDBInstanceMessage ) : Promise < DBInstance | undefined > {
Original file line number Diff line number Diff line change @@ -44,9 +44,9 @@ export class DBElasticClusterNode extends DBResourceNode {
4444
4545 public getDescription ( ) : string | boolean {
4646 if ( ! this . isAvailable ) {
47- return `elastic cluster • ${ this . status } `
47+ return `Elastic cluster • ${ this . status } `
4848 }
49- return 'elastic cluster'
49+ return 'Elastic cluster'
5050 }
5151
5252 public async deleteCluster ( finalSnapshotId : string | undefined ) : Promise < DBElasticCluster | undefined > {
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ export class DBGlobalClusterNode extends DBResourceNode {
4343 this . name = cluster . GlobalClusterIdentifier ?? ''
4444 this . contextValue = this . getContext ( )
4545 this . iconPath = new vscode . ThemeIcon ( 'globe' ) //TODO: determine icon for global cluster
46- this . description = 'global cluster'
46+ this . description = 'Global cluster'
4747 this . tooltip = `${ this . name } \nEngine: ${ this . cluster . EngineVersion } \nStatus: ${ this . cluster . Status } (read-only)`
4848 }
4949
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import { DBResourceNode } from './dbResourceNode'
1111import { DBClusterNode } from './dbClusterNode'
1212import { ModifyDBInstanceMessage } from '@aws-sdk/client-docdb'
1313import { copyToClipboard } from '../../shared/utilities/messages'
14+ import { toTitleCase } from '../../shared'
1415
1516/**
1617 * An AWS Explorer node representing a DocumentDB instance.
@@ -31,9 +32,9 @@ export class DBInstanceNode extends DBResourceNode {
3132 }
3233
3334 private makeDescription ( ) : string {
34- const type = this . instance . IsClusterWriter ? 'primary ' : 'replica '
35+ const type = this . instance . IsClusterWriter ? 'Primary ' : 'Replica '
3536 if ( this . getContext ( ) !== DocDBContext . InstanceAvailable ) {
36- return `${ this . status } ${ type } instance`
37+ return `${ toTitleCase ( this . status ?? ' ' ) } ${ type } instance`
3738 }
3839 return `${ type } instance • ${ this . instance . DBInstanceClass } `
3940 }
You can’t perform that action at this time.
0 commit comments