提交 10c74e38 编写于 作者: F Fatih Acet

Token remove UI.

上级 3431305d
......@@ -7,7 +7,7 @@
- Added new methods to get info from Git and GitLab.
- Implemented MR link on status bar.
- Implemented pipeline status on status bar.
- Implemented UI flow to ask and store GitLab Personal Access Token.
- Added Personal Access Token flow providing menu options to save and delete GitLab PAT.
### Changed
- Removed `gitlab.userId` necessity.
......
......@@ -19,7 +19,11 @@
"commands": [
{
"command": "gl.setToken",
"title": "Set GitLab Personal Access Token"
"title": "GitLab: Set GitLab Personal Access Token"
},
{
"command": "gl.removeToken",
"title": "GitLab: Remove your GitLab Personal Access Token"
},
{
"command": "gl.showIssuesAssigedToMe",
......
......@@ -17,6 +17,7 @@ const registerCommands = () => {
'gl.showIssuesAssigedToMe': openLinks.showIssues,
'gl.showMergeRequestsAssigedToMe': openLinks.showMergeRequests,
'gl.setToken': tokenInput.showInput.bind(null, context),
'gl.removeToken': tokenInput.removeToken.bind(null, context),
}
Object.keys(commands).forEach((cmd) => {
......
const vscode = require('vscode');
const extension = require('./extension');
// TODO: Provide user an option to delete PAT
async function showInput(context) {
const token = await vscode.window.showInputBox({
ignoreFocusOut: true,
......@@ -15,4 +14,10 @@ async function showInput(context) {
}
}
const removeToken = (context) => {
context.globalState.update('glToken', null);
extension.deactivate();
};
exports.showInput = showInput;
exports.removeToken = removeToken;
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册