Skip to content

Commit 3d6e3c4

Browse files
ui: add optional parameter for separator label in RegionSubmenu (#3592)
* add parameter for separator label * make text one word * change default text to items instead of selections Co-authored-by: Justin M. Keyes <[email protected]> --------- Co-authored-by: Justin M. Keyes <[email protected]>
1 parent cccc238 commit 3d6e3c4

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

src/cloudWatchLogs/commands/searchLogGroup.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,8 @@ export function createRegionSubmenu() {
241241
return new RegionSubmenu(
242242
getLogGroupsFromRegion,
243243
{ title: localize('AWS.cwl.searchLogGroup.logGroupPromptTitle', 'Select Log Group') },
244-
{ title: localize('AWS.cwl.searchLogGroup.regionPromptTitle', 'Select Region for Log Group') }
244+
{ title: localize('AWS.cwl.searchLogGroup.regionPromptTitle', 'Select Region for Log Group') },
245+
"Log Groups"
245246
)
246247
}
247248

src/ec2/prompter.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export function createEC2ConnectPrompter(): RegionSubmenu<string> {
3030
return new RegionSubmenu(
3131
async region => (await getInstanceIdsFromRegion(region)).map(asQuickpickItem).promise(),
3232
{ title: 'Select EC2 Instance Id' },
33-
{ title: 'Select Region for EC2 Instance' }
33+
{ title: 'Select Region for EC2 Instance' },
34+
"Instances"
3435
)
3536
}

src/shared/ui/common/regionSubmenu.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export class RegionSubmenu<T> extends Prompter<RegionSubmenuResponse<T>> {
2727
private readonly itemsProvider: (region: string) => ItemLoadTypes<T>,
2828
private readonly dataOptions?: ExtendedQuickPickOptions<T>,
2929
private readonly regionOptions?: ExtendedQuickPickOptions<T>,
30+
private readonly separatorLabel: string = "Items",
3031
private currentRegion = globals.regionProvider.guessDefaultRegion()
3132
) {
3233
super()
@@ -50,7 +51,7 @@ export class RegionSubmenu<T> extends Prompter<RegionSubmenuResponse<T>> {
5051
description: `current region: ${this.currentRegion}`,
5152
},
5253
{
53-
label: 'Selections',
54+
label: this.separatorLabel,
5455
kind: vscode.QuickPickItemKind.Separator,
5556
data: undefined,
5657
},

0 commit comments

Comments
 (0)