Skip to content

Commit 276ebd0

Browse files
committed
Compliance with UX Guidelines
1 parent fd889aa commit 276ebd0

File tree

5 files changed

+41
-35
lines changed

5 files changed

+41
-35
lines changed

src/Helper/actionHelper.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@ import * as vscode from 'vscode';
22
import * as fs from 'fs';
33
import * as path from 'path';
44

5-
export class ItemQuickPick {
5+
export class ItemQuickPick implements vscode.QuickPickItem {
66
constructor(
77
public label:string,
88
public description: string,
9-
public value: any
10-
) {
11-
}
9+
public value: any,
10+
public detail?: string
11+
) {
12+
13+
}
1214
}

src/TreeDataDevicesProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ export class TreeDataDevicesProvider implements vscode.TreeDataProvider<BaseTree
188188
//event unsubscription
189189
device.Client.OnChangedStateUnsubscribe(handler);
190190
//
191-
result=new IotResult(StatusResult.Ok,`Device added successfully. Device: ${device.label}`);
191+
result=new IotResult(StatusResult.Ok,`Device added successfully 🎉! Device: ${device.label}`);
192192
//return new device
193193
result.returnObject=device;
194194
return Promise.resolve(result);

src/actionsDevice/addDevice.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,23 @@ import { IContexUI } from '../ui/IContexUI';
1414
export async function addDevice(treeData: TreeDataDevicesProvider,treeView:vscode.TreeView<BaseTreeItem>,contextUI:IContexUI): Promise<void> {
1515

1616
let hostName = await vscode.window.showInputBox({
17-
prompt: 'prompt',
18-
title: 'Add Device (1/5). Enter the host of the developer board',
19-
value:'192.168.50.75',
17+
prompt: 'Enter the hostname of the developer board',
18+
title: 'Add Device (1/5)',
19+
value:'192.168.50.75'
2020
});
2121
if(!hostName) return;
2222
hostName=IoTHelper.StringTrim(hostName);
2323
let portAnswer = await vscode.window.showInputBox({
24-
prompt: 'prompt',
25-
title: 'Add Device (2/5). Enter a number port ssh',
24+
prompt: 'Enter a number port ssh',
25+
title: 'Add Device (2/5)',
2626
value:'22'
2727
});
2828
if(!portAnswer) return;
2929
portAnswer=IoTHelper.StringTrim(portAnswer);
3030
const port=+portAnswer;
3131
let userName = await vscode.window.showInputBox({
32-
prompt: 'prompt',
33-
title: 'Add Device (3/5). Enter username with sudo rights (usually root)',
32+
prompt: 'Enter username with sudo rights (usually root)',
33+
title: 'Add Device (3/5)',
3434
value:'root'
3535
});
3636
if(!userName) return;
@@ -47,11 +47,11 @@ export async function addDevice(treeData: TreeDataDevicesProvider,treeView:vscod
4747
item = new ItemQuickPick("root","Select if you have problems accessing /dev/* and /sys/* devices","root");
4848
itemAccounts.push(item);
4949
const SELECTED_ITEM = await vscode.window.showQuickPick(
50-
itemAccounts,{title: 'Add Device (5/5). Select an account to debugging .NET applications:',});
50+
itemAccounts,{title: 'Add Device (5/5)',placeHolder:`Select an account to debugging .NET applications`});
5151
if(!SELECTED_ITEM) return;
5252
const accountNameDebug=SELECTED_ITEM.value;
5353
//Info
54-
vscode.window.showInformationMessage('It may take 2 to 7 minutes to initialize and configure the device.');
54+
vscode.window.showInformationMessage('It may take 2 to 7 minutes to initialize and configure the device.');
5555
//Main process
5656
contextUI.Output("Action: adding a device");
5757
//Adding a device is the main process

src/actionsLaunch/addLaunch.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,14 @@ export async function addLaunch(treeData:TreeDataLaunchsProvider,devices:Array<I
3636
}
3737
//Select Device
3838
let itemDevices:Array<ItemQuickPick>=[];
39-
devices.forEach((device) => {
40-
const item = new ItemQuickPick(<string>device.label,
41-
`${device.Information.BoardName} ${device.Information.Architecture}`,device);
39+
devices.forEach((device) => {
40+
const label=`${device.label}`;
41+
const description=`${device.Information.Architecture}`;
42+
const detail=`$(circuit-board) ${device.Information.BoardName} $(terminal-linux) ${device.Information.OsDescription} ${device.Information.OsKernel} $(account) ${device.Account.UserName}`;
43+
const item = new ItemQuickPick(label,description,device,detail);
4244
itemDevices.push(item);
4345
});
44-
let SELECTED_ITEM = await vscode.window.showQuickPick(itemDevices,{title: 'Choose a device (1/4):',});
46+
let SELECTED_ITEM = await vscode.window.showQuickPick(itemDevices,{title: 'Choose a device (1/4)',placeHolder:`Developer board`});
4547
if(!SELECTED_ITEM) return;
4648
const selectDevice= <IotDevice>SELECTED_ITEM.value;
4749
//Select template
@@ -59,11 +61,11 @@ export async function addLaunch(treeData:TreeDataLaunchsProvider,devices:Array<I
5961
//Choice of two options
6062
let items:Array<ItemQuickPick>=[];
6163
let item = new ItemQuickPick("1. Select template (recommended): "+<string>selectTemplate.Attributes.Label,
62-
`${selectTemplate.Attributes.Detail}. Language: ${selectTemplate.Attributes.Language}`,selectTemplate);
64+
`Language: ${selectTemplate.Attributes.Language}`,selectTemplate,`Detail: ${selectTemplate.Attributes.Detail}`);
6365
items.push(item);
6466
item = new ItemQuickPick("2. Choose another template from the collection","",undefined);
6567
items.push(item);
66-
SELECTED_ITEM = await vscode.window.showQuickPick(items,{title: 'Select an action (2/4):',});
68+
SELECTED_ITEM = await vscode.window.showQuickPick(items,{title: 'Select an action (2/4)'});
6769
if(!SELECTED_ITEM) return;
6870
selectTemplate=SELECTED_ITEM.value;
6971
}
@@ -78,10 +80,10 @@ export async function addLaunch(treeData:TreeDataLaunchsProvider,devices:Array<I
7880
let itemTemplates:Array<ItemQuickPick>=[];
7981
listTemplates.forEach((template) => {
8082
const item = new ItemQuickPick(<string>template.Attributes.Label,
81-
`${template.Attributes.Detail}. Language: ${template.Attributes.Language}`,template);
83+
`Language: ${template.Attributes.Language}`,template,`${template.Attributes.Detail}`);
8284
itemTemplates.push(item);
8385
});
84-
SELECTED_ITEM = await vscode.window.showQuickPick(itemTemplates,{title: 'Choose a template (3/4):',});
86+
SELECTED_ITEM = await vscode.window.showQuickPick(itemTemplates,{title: 'Choose a template (3/4)',placeHolder:`Template`});
8587
if(!SELECTED_ITEM) return;
8688
selectTemplate= <IotTemplate>SELECTED_ITEM.value;
8789
}
@@ -102,7 +104,7 @@ export async function addLaunch(treeData:TreeDataLaunchsProvider,devices:Array<I
102104
const item = new ItemQuickPick(label,description,fileName);
103105
itemProjects.push(item);
104106
});
105-
SELECTED_ITEM = await vscode.window.showQuickPick(itemProjects,{title: 'Choose a project (4/4):'});
107+
SELECTED_ITEM = await vscode.window.showQuickPick(itemProjects,{title: 'Choose a project (4/4)',placeHolder:`Project`});
106108
if(!SELECTED_ITEM) return;
107109
selectProject=SELECTED_ITEM.value;
108110
//Preparing values

src/actionsTemplates/createProject.ts

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,14 @@ export async function createProject(config:IotConfiguration,devices:Array<IotDev
3131
}
3232
//Select Device
3333
let itemDevices:Array<ItemQuickPick>=[];
34-
devices.forEach((device) => {
35-
const item = new ItemQuickPick(<string>device.label,
36-
`${device.Information.BoardName} ${device.Information.Architecture}`,device);
34+
devices.forEach((device) => {
35+
const label=`${device.label}`;
36+
const description=`${device.Information.Architecture}`;
37+
const detail=`$(circuit-board) ${device.Information.BoardName} $(terminal-linux) ${device.Information.OsDescription} ${device.Information.OsKernel} $(account) ${device.Account.UserName}`;
38+
const item = new ItemQuickPick(label,description,device,detail);
3739
itemDevices.push(item);
3840
});
39-
let SELECTED_ITEM = await vscode.window.showQuickPick(itemDevices,{title: 'Choose a device (1/5):',});
41+
let SELECTED_ITEM = await vscode.window.showQuickPick(itemDevices,{title: 'Choose a device (1/4)',placeHolder:`Developer board`});
4042
if(!SELECTED_ITEM) return;
4143
const selectDevice= <IotDevice>SELECTED_ITEM.value;
4244
//Select template
@@ -49,16 +51,16 @@ export async function createProject(config:IotConfiguration,devices:Array<IotDev
4951
let itemTemplates:Array<ItemQuickPick>=[];
5052
listTemplates.forEach((template) => {
5153
const item = new ItemQuickPick(<string>template.Attributes.Label,
52-
`${template.Attributes.Detail}. Language: ${template.Attributes.Language}`,template);
54+
`Language: ${template.Attributes.Language}`,template,`${template.Attributes.Detail}`);
5355
itemTemplates.push(item);
5456
});
55-
SELECTED_ITEM = await vscode.window.showQuickPick(itemTemplates,{title: 'Choose a template (2/5):',});
57+
SELECTED_ITEM = await vscode.window.showQuickPick(itemTemplates,{title: 'Choose a template (2/5)',placeHolder:`Template`});
5658
if(!SELECTED_ITEM) return;
5759
const selectTemplate= <IotTemplate>SELECTED_ITEM.value;
5860
//Select name project
5961
let nameProject = await vscode.window.showInputBox({
60-
prompt: 'prompt',
61-
title: 'Application name (3/5). Enter the name of your application',
62+
prompt: 'Enter the name of your application',
63+
title: 'Application name (3/5)',
6264
value: selectTemplate.Attributes.ProjName
6365
});
6466
if(!nameProject) return;
@@ -76,7 +78,7 @@ export async function createProject(config:IotConfiguration,devices:Array<IotDev
7678
canSelectFolders: true,
7779
canSelectMany: false,
7880
title: "Select a folder for the project (4/5)",
79-
openLabel: 'Select',
81+
openLabel: 'Select folder',
8082
};
8183
let folder:string;
8284
if(config.ExtMode==vscode.ExtensionMode.Production){
@@ -90,8 +92,8 @@ export async function createProject(config:IotConfiguration,devices:Array<IotDev
9092
//Project path confirmation
9193
folder=`${folder}\\${nameProject}`;
9294
let selectFolder = await vscode.window.showInputBox({
93-
prompt: 'prompt',
94-
title: 'Project path (5/5). Confirm project location',
95+
prompt: 'Confirm project location',
96+
title: 'Project path (5/5)',
9597
value: folder
9698
});
9799
if(!selectFolder) return;
@@ -115,7 +117,7 @@ export async function createProject(config:IotConfiguration,devices:Array<IotDev
115117
const item = new ItemQuickPick(value[1],"",value[0]);
116118
itemTarget.push(item);
117119
});
118-
SELECTED_ITEM = await vscode.window.showQuickPick(itemTarget,{title: 'Choose a .NET framework:',});
120+
SELECTED_ITEM = await vscode.window.showQuickPick(itemTarget,{title: 'Choose a .NET framework',placeHolder:`.NET framework`});
119121
if(!SELECTED_ITEM) return;
120122
//
121123
values.set("%{project.dotnet.targetframework}",<string>SELECTED_ITEM.value);

0 commit comments

Comments
 (0)