-
Notifications
You must be signed in to change notification settings - Fork 92
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
feat(unix-cmd): User Experience improvements #2662
Conversation
Signed-off-by: Likhitha Nimma <[email protected]>
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## next #2662 +/- ##
=======================================
Coverage 93.36% 93.37%
=======================================
Files 109 109
Lines 10193 10192 -1
Branches 2150 2146 -4
=======================================
Hits 9517 9517
+ Misses 675 674 -1
Partials 1 1 ☔ View full report in Codecov by Sentry. |
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.
Thanks @likhithanimma1! Left a couple comments regarding variable naming and input box logic.
if (obj.argValue) { | ||
sshProfile.profile[p] = obj.argValue; | ||
} else { | ||
const options: vscode.InputBoxOptions = { | ||
prompt: `Enter the ${p} of the ssh profile`, | ||
value: "", | ||
ignoreFocusOut: true, | ||
password: true, | ||
}; | ||
const response = await Gui.showInputBox(options); | ||
if (!response) { | ||
Gui.showMessage(localize("issueUnixCommand.enter.command", `No command entered.`)); | ||
return; | ||
} | ||
sshProfile.profile[p] = response; |
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.
I'm not sure how common this would be, but if I do not have a specific property specified and the profile property expects a type other than string
, this may cause undefined behavior. To avoid this possibility, the validateInput
option in InputBoxOptions
can be used to ensure the property is set with a proper value.
Since this is unlikely to surface in this scenario, this isn't a requested change, but I wanted to mention this for future reference.
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.
Thanks @likhithanimma1 for working on these polish items. I left a couple comments mainly on localization. I was also wondering a couple things:
- this doesn't seem to support using the base profile stored credentials with ssh profile even when they share host and ru values.
- when prompted for ssh credentials are we planning to write them to file/store securely? When I tested I was prompted but after checked config and no updates under ssh profile.
return; | ||
if (cwd == "") { | ||
cwd = await vscode.window.showInputBox({ | ||
prompt: "Enter the path of the directory in order to execute the command", |
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.
this text should be localized
sshProfile.profile[p] = obj.argValue; | ||
} else { | ||
const options: vscode.InputBoxOptions = { | ||
prompt: `Enter the ${p} of the ssh profile`, |
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.
This should also be localized
Hey @JillieBeanSim !
|
@likhithanimma1 we will need this to behave similarly as if using the team configuration file with cli commands for ssh. |
Signed-off-by: Likhitha Nimma <[email protected]>
Signed-off-by: Likhitha Nimma <[email protected]>
Signed-off-by: likhithanimma1 <[email protected]>
Signed-off-by: Billie Simmons <[email protected]>
Signed-off-by: Billie Simmons <[email protected]>
Signed-off-by: Billie Simmons <[email protected]>
Signed-off-by: Billie Simmons <[email protected]>
Signed-off-by: Billie Simmons <[email protected]>
Signed-off-by: Billie Simmons <[email protected]>
Signed-off-by: likhithanimma1 <[email protected]>
Signed-off-by: likhithanimma1 <[email protected]>
Signed-off-by: likhithanimma1 <[email protected]>
Signed-off-by: likhithanimma1 <[email protected]>
Signed-off-by: likhithanimma1 <[email protected]>
Signed-off-by: likhithanimma1 <[email protected]>
Signed-off-by: likhithanimma1 <[email protected]>
updates for unix cmd ux
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.
This looks pretty good, thanks @likhithanimma1!
Will re-review after merge conflicts have been resolved. A few questions:
- What is the expected behavior when the ssh profile does not have user or password? I'm seeing that nothing happens when I click "Issue Unix Command". But when my ssh profile has credentials, then it works as expected.
- For the prompt shown in the terminal output, it is currently formatted like this:
> ibmuser @ lpar1.ssh : ~ ls
Personally I think the spaces in between symbols look kind of weird. Would it make sense to use a format similar to most Linux terminals?
[email protected]:~$ ls
OR[[email protected] ~]$ ls
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.
Can this empty file be removed?
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.
If the ssh profile doesn't have the user or password it will prompt you to enter the credentials and the corresponding profile in the config file will be updated with credentials
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.
Changes LGTM, had a question about the use of the profType
variable in promptCredentials
👍 will approve once conflicts are resolved
let profType = ""; | ||
if (typeof profile !== "string") { | ||
profType = profile.type; | ||
} | ||
const userInputBoxOptions: vscode.InputBoxOptions = { | ||
placeHolder: vscode.l10n.t(`User Name`), | ||
prompt: vscode.l10n.t(`Enter the user name for the connection. Leave blank to not store.`), | ||
prompt: vscode.l10n.t(`Enter the user name for the {0} connection.`, profType), | ||
}; | ||
const passwordInputBoxOptions: vscode.InputBoxOptions = { | ||
placeHolder: vscode.l10n.t(`Password`), | ||
prompt: vscode.l10n.t(`Enter the password for the connection. Leave blank to not store.`), | ||
prompt: vscode.l10n.t(`Enter the password for the {0} connection.`, profType), |
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.
If profile
is of type string
, profType
will be an empty string and the prompt will say "Enter the password for the connection" (with two spaces between "the" and "connection"). Is this intended behavior?
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.
No, that would not be the intended behaviour. Just missed that case. Addressed the scenario and changed the prompt.
Signed-off-by: likhithanimma1 <[email protected]>
Signed-off-by: likhithanimma1 <[email protected]>
Quality Gate failedFailed conditions |
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.
Tested and LGTM - thanks @likhithanimma1!
I like that the quick pick keeps track of your recent commands, this is really convenient if you have to run the same command frequently 😋
I filed #2728 as a possible future enhancement to allow adding/removing from this quick pick.
Proposed changes
Fixes #2643
Enhanced Unix user experience, addressing feedback and improving usability.
Release Notes
Milestone:
Changelog:
Types of changes
What types of changes does your code introduce to Zowe Explorer?
Put an
x
in the boxes that applyChecklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This checklist will be used as reference for both the contributor and the revieweryarn workspace vscode-extension-for-zowe vscode:prepublish
has been executedFurther comments