Skip to content

Commit

Permalink
Project group name is now mandatory, Canceling when entering group na…
Browse files Browse the repository at this point in the history
…me fixed // v1.5.1
  • Loading branch information
Kruemelkatze committed Oct 24, 2019
1 parent fdd474c commit d48248f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Change Log
All notable changes to the "dashboard" extension will be documented in this file. It follows the [Keep a Changelog](http://keepachangelog.com/) recommendations.

## [1.5.1] 2019-10-24
### Changed
- Project group name is now mandatory, as the group name is always displayed. So enforcing a name makes sense.

### Fixed
- Escape/Unfocus on entering group name now cancels the add/edit action instead of having an unnamed group.

## [1.5] 2019-10-22
### Added
- Support for [Remote Development Projects](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.vscode-remote-extensionpack).
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "vscode-dashboard",
"displayName": "Dashboard",
"description": "Organize your workspaces in a speed-dial manner.",
"version": "1.5.0",
"version": "1.5.1",
"publisher": "kruemelkatze",
"icon": "media/extension_icon.png",
"engines": {
Expand Down
16 changes: 12 additions & 4 deletions src/dashboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,15 @@ export function activate(context: vscode.ExtensionContext) {
value: group.groupName || undefined,
valueSelection: group.groupName ? [0, group.groupName.length] : undefined,
placeHolder: 'Project Group Name',
ignoreFocusOut: true
ignoreFocusOut: true,
validateInput: (val: string) => val ? '' : 'A Group Name must be provided.',
});

if (groupName == null) {
//throw new Error(USER_CANCELED);
return
}

group.groupName = groupName;
await updateProjectGroup(context, projectGroupId, group);

Expand Down Expand Up @@ -372,14 +378,16 @@ export function activate(context: vscode.ExtensionContext) {

projectGroupId = selectedProjectGroupPick.id;
if (projectGroupId === 'Add') {
// If there is no default group, allow name to be empty
let validateInput = projectGroups.length === 0 ? undefined : (val: string) => val ? '' : 'A Group Name must be provided.';
let newGroupName = await vscode.window.showInputBox({
placeHolder: 'New Project Group Name',
ignoreFocusOut: true,
validateInput,
validateInput: (val: string) => val ? '' : 'A Group Name must be provided.',
});

if (newGroupName == null) {
throw new Error(USER_CANCELED);
}

projectGroupId = (await addProjectGroup(context, newGroupName)).id;
}

Expand Down

0 comments on commit d48248f

Please sign in to comment.