-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
fix(@angular/cli): support default options for multiselect list x-prompt #28842
Conversation
choices: definition.items?.map((item) => | ||
typeof item == 'string' | ||
? { | ||
name: item, | ||
value: item, | ||
} | ||
: { | ||
...item, |
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.
Include options that are in line with the new API: https://github.com/SBoudrias/Inquirer.js/tree/main/packages/checkbox#choice-object
@@ -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, |
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.
default
property is still valid for select
package, used for prompt with type list
which does not support multiselect: https://github.com/pawelfras/angular-cli/blob/62d5c330c0457a3d753359b8f520bc912ed2c3e2/packages/angular/cli/src/command-builder/schematics-command-module.ts#L197
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.
Thank you for the contribution
The changes were merged into the following branches: main, 18.2.x, 19.0.x |
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
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
PR Checklist
Please check to confirm your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
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?
Other information