OfficeDev / generator-office

Yeoman generator for building Microsoft Office related projects.
https://www.npmjs.com/package/generator-office
MIT License
815 stars 207 forks source link

[FIX] Fix the hang arrow key in script type selection when the UsageDataPrompt is no needed to show #804

Closed sigmarising closed 6 months ago

sigmarising commented 6 months ago

[FIX] Fix the hang arrow key in script type selection when the UsageDataPrompt is no needed to show


  1. Do these changes impact User Experience? (e.g., how the user interacts with Yo Office and/or the files and folders the user sees in the project that Yo Office creates)

    • [x] Yes
    • [ ] No

    When promptForUsageData is needed, the prompt show and user can select as expected. But when the promptForUsageData is no needed to show, the user's arrow key will be hang in script type selection step. After some investigation, this issue should be related to Inquirer.js (Inquirer.js is used by Yeoman) v8's when option api. This PR move the condition judge out from prompt() and fix the arrow key hang issue. This will make the ux more fluently.

  2. Do these changes impact documentation? (e.g., a tutorial on https://learn.microsoft.com/en-us/office/dev/add-ins/overview/office-add-ins)

    • [ ] Yes
    • [x] No
  3. Validation/testing performed:

    Manual testing: npm run build && npm link, then yo office works well. Delete office-addin-usage-data.json in user's folder, yo office works well.

  4. Platforms tested:

    • [x] Windows
    • [ ] Mac
sigmarising commented 6 months ago

@microsoft-github-policy-service agree company="Microsoft"

millerds commented 6 months ago

/azurepipelines run

azure-pipelines[bot] commented 6 months ago
Azure Pipelines successfully started running 1 pipeline(s).