diff --git a/backend/package.json b/backend/package.json index 1ca4e56c..a80074e8 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "yeoman-ui", - "version": "1.0.4", + "version": "1.0.5", "displayName": "Application Wizard", "publisher": "SAPSE", "author": { @@ -43,7 +43,7 @@ }, { "command": "yeomanUI.toggleOutput", - "title": "Toggle Output", + "title": "Show Output", "icon": { "light": "./resources/images/icons/console_light.svg", "dark": "./resources/images/icons/console_dark.svg" diff --git a/backend/src/extension.ts b/backend/src/extension.ts index da26bd7a..0f9350e8 100644 --- a/backend/src/extension.ts +++ b/backend/src/extension.ts @@ -16,11 +16,14 @@ import { IChildLogger } from "@vscode-logging/logger"; import Environment = require('yeoman-environment'); const YEOMAN_UI = "Yeoman UI"; +let defaultNpmPaths: string[]; export function activate(context: vscode.ExtensionContext) { try { // improves performance - Environment.createEnv(); + // TODO: replace or remove this API + // it is very slow, takes more than 2 seconds + defaultNpmPaths = Environment.createEnv().getNpmPaths(); createExtensionLoggerAndSubscribeToLogSettingsChanges(context); } catch (error) { console.error("Extension activation failed due to Logger configuration failure:", error.message); @@ -126,7 +129,7 @@ export class YeomanUIPanel { vscodeYouiEvents, outputChannel, this.logger, - {genFilter: this.genFilter, messages: this.messages}, + {genFilter: this.genFilter, messages: this.messages, defaultNpmPaths}, _.get(vscode, "workspace.workspaceFolders[0].uri.fsPath")); this.yeomanui.registerCustomQuestionEventHandler("file-browser", "getFilePath", this.showOpenFileDialog.bind(this)); this.yeomanui.registerCustomQuestionEventHandler("folder-browser", "getPath", this.showOpenFolderDialog.bind(this)); diff --git a/backend/src/yeomanui.ts b/backend/src/yeomanui.ts index 38e2a7be..1e3fedf9 100644 --- a/backend/src/yeomanui.ts +++ b/backend/src/yeomanui.ts @@ -123,9 +123,8 @@ export class YeomanUI { const resPath = path.join(...parts.slice(0, index + 1), YeomanUI.NODE_MODULES); return YeomanUI.isWin32 ? resPath : path.join(path.sep, resPath); }); - // TODO: replace or remove this API - // it is very slow, takes more than 2 seconds - const defaultPaths = env.getNpmPaths(); + + const defaultPaths = _.get(this.uiOptions, "defaultNpmPaths", env.getNpmPaths()); return _.uniq(userPaths.concat(defaultPaths)); } diff --git a/frontend/package.json b/frontend/package.json index ef05cf1d..be80abde 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -16,7 +16,7 @@ }, "dependencies": { "@mdi/font": "^5.1.45", - "@sap-devx/inquirer-gui": "0.1.11", + "@sap-devx/inquirer-gui": "0.1.12", "@sap-devx/inquirer-gui-file-browser-plugin": "0.0.5", "@sap-devx/inquirer-gui-folder-browser-plugin": "0.0.3", "@sap-devx/inquirer-gui-login-plugin": "0.0.4", diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 7f823f5c..21162203 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -6,10 +6,10 @@ :height="64" :width="64" :color="isLoadingColor" - background-color="transparent" + background-color="transparent" loader="spinner" > - +
{ - let showBusy = true; - setTimeout(() => { - if (showBusy) { - that.showBusyIndicator = true; - } - }, 1000); + if (this.currentPrompt) { + this.currentPrompt.status = EVALUATING; + } - try { - const response = await that.rpc.invoke("evaluateMethod", [ - args, - question.name, - prop - ]); - showBusy = false; - that.showBusyIndicator = false; - - return response; - } catch(e) { - showBusy = false; - that.showBusyIndicator = false; - throw(e); - } - }; + try { + return await that.rpc.invoke("evaluateMethod", [ + args, + question.name, + prop + ]); + } catch(e) { + that.showBusyIndicator = false; + throw(e); + }}; } } } + + if (this.currentPrompt) { + this.currentPrompt.status = undefined; + } }, async showPrompt(questions, name) { @@ -309,7 +312,8 @@ export default { name: promptName, description: promptDescription, answers: {}, - active: true + active: true, + status: _.get(this.currentPrompt, "status") }); return prompt; },