Skip to content

fix(@angular/cli): support default options for multiselect list x-prompt #28842

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

Conversation

pawelfras
Copy link
Contributor

@pawelfras pawelfras commented Nov 12, 2024

PR Checklist

Please check to confirm your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

Issue Number: #28843

What is the new behavior?

This PR provides support for default options for multiselect list x-prompt after switching to @inquirer/prompts library.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

choices: definition.items?.map((item) =>
typeof item == 'string'
? {
name: item,
value: item,
}
: {
...item,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -204,14 +204,15 @@ export abstract class SchematicsCommandModule

return definition.validator(Object.values(values).map(({ value }) => value));
},
default: definition.default,
default: definition.multiselect ? undefined : definition.default,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@clydin clydin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the contribution

@clydin clydin added target: patch This PR is targeted for the next patch release action: merge The PR is ready for merge by the caretaker labels Nov 13, 2024
@jkrems jkrems merged commit af14769 into angular:main Nov 13, 2024
35 checks passed
@jkrems
Copy link
Contributor

jkrems commented Nov 13, 2024

The changes were merged into the following branches: main, 18.2.x, 19.0.x

pawelfras added a commit to SAP/spartacus that referenced this pull request Dec 10, 2024
Nx migration:
- "@angular-eslint/eslint-plugin" bumped to 18.4.2,
- "@angular-eslint/eslint-plugin-template" bumped to 18.4.2,
- "@angular-eslint/template-parser" bumped to 18.4.2,
- "@nx/angular" bumped to 20.1.3
- "@nx/devkit" bumped to 20.1.3
- "@nx/eslint-plugin" bumped to 20.1.3
- "@nx/jest" bumped to 20.1.3
- "@nx/workspace" bumped to 20.1.3
- "@types/jest" bumped to 29.5.14
- "jest" bumped to 29.7.0
- "jest-preset-angular" bumped to 14.1.1
- "nx" bumped to 20.1.3,
- "useInferencePlugins": false added to nx.json
  for more, see: https://nx.dev/concepts/inferred-tasks#existing-nx-workspaces
- "useLegacyCache": true added to nx.json
  for more, see: https://nx.dev/nx-api/devkit/documents/Workspace#uselegacycach
- /.nx/workspace-data added to .gitignore and .prettierignore
Angular migration:
- "@angular/.." libraries bumped from 17.0.5 to 18.2.9
- "@angular-devkit/.." libraries bumped from 17.0.5 to 18.2.9
- "@angular-eslint/.." libraries bumped from 17.1.0 to 18.4.2
- "@typescript-eslint/" libraries bumped from 6.13.1 to 7.2.0
- "@schematics/angular" bumped from 17.0.5 to 18.2.9
- "@ng-select/ng-select" bumped from 12.0.4 to 13.9.0
- "ngx-infinite-scroll" bumped from 17.0.0 to 18.0.0
- "zone.js" bumped from 0.14.2 to 0.14.10
- "@angular-builders/custom-webpack" bumped from 15.0.0 to 18.0.0
- "ng-packagr" bumped from 17.0.2 to 18.2.1
- replaced deprecated HTTP related modules with provider functions
- fixed issues after replacement in some tests (redundant code) (?)
- adjusted 'form-errors.component.ts' to new 'AbstractControl' shape
- set 'MessageService' as optional in form.component.ts and remove it from FormModule providers' array
- replaced boolean | UrlTree return type with GuardResult for canActivate guard functions and related code with
NgRx:
- "@ngrx/effects" bumped from 17.0.1 to 18.1.0
- "@ngrx/router-store" bumped from 17.0.1 to 18.1.0
- "@ngrx/store" bumped from 17.0.1 to 18.1.0
- "@ngrx/store-devtools" bumped from 17.0.1 to 18.1.0
- "@ngrx/operators" introduced
- TypedAction removed in favour of Action
Build issues:
- replaced Observable<boolean | UrlTree> with combined Observable<GuardResult> from @angular/router
  for more, see: feat(router): Add ability to return UrlTree with NavigationBehaviorOptions from guards angular/angular#45023
- add node to "types" in all tsconfig.schematics.json to support node API
- remove redundant dist and assets property from nested ng-package.json in CDP, OPF and OMF
for more, see: https://github.com/ng-packagr/ng-packagr/pull/2754/files
- Unit tests:
- add support for RedirectCommand type in guard tests
- adjust order-return-requrest-list.component.spec.ts to look for input[aria-controls="order-return-table"] instead of div[aria-controls="order-return-table"] due to changes in ng-select
  for more, see: fix(wcag): adds role 'combobox' to input ng-select/ng-select#2428
- remove recommended property from eslint rules
- add fix-jsdom-environment.ts containing fix for missing support of structuredClone in jest-environment-jsdom
  for more, see: [Bug]: structuredClone is not defined jsdom/jsdom#3363 (comment)
- convertAnnotatedSourceToFailureCase is now imported from @angular-eslint/test-utils(new dependency) instead from @angular-eslint/utils
- include TS files in tsconfig.spec.json
- replace/remove redundant RouterTestingModule
- update snapshots in schematics tests
Linting:
- added new @stylistic/eslint-plugin-ts due to moving some there som config from @typescript-eslint/eslint-plugin:
  - quotes
  - member-delimiter-style
  - semi
  - type-annotation-spacing`
  for more, see e.g.: https://typescript-eslint.io/rules/member-delimiter-style/
- removed redundant rules from legacy-ng-cli-compat files
Schematics:
- fixed type in file-utils_spec.ts
- update dependencies.json
- adjusted schema.json to work with new Angular
  for more, see: fix(@angular/cli): support default options for multiselect list x-prompt angular/angular-cli#28842
- Linter for styles:
- fixed issues caught after bumping minor version of "stylelint" packages (when upgrading package-lock.json)
- added "integration-libs" to the linter scope
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Dec 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker area: @angular/cli target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants