Skip to content

Commit 4fbbb9d

Browse files
crisbetommalerba
authored andcommitted
feat(ng-add): add preview URLs for theme choices (#13723)
Adds URLs that people can use to preview a theme, before selecting it, when going through the ng-add prompts. Formatting is aligned with https://github.com/angular/angular-cli/blob/907ce5c94c774147c4b52870b3522aed4e087c76/packages/schematics/angular/ng-new/schema.json#L121 Fixes #13708. **A couple of notes:** * Blocked until angular/material.angular.io#549 is merged and released. * Marking this as `patch`, even though it's a `feat`, since it's basically just message changes.
1 parent 04716b1 commit 4fbbb9d

File tree

2 files changed

+19
-10
lines changed

2 files changed

+19
-10
lines changed

src/lib/schematics/ng-add/schema.json

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,37 @@
66
"properties": {
77
"project": {
88
"type": "string",
9-
"description": "The name of the project.",
9+
"description": "Name of the project.",
1010
"$default": {
1111
"$source": "projectName"
1212
}
1313
},
1414
"theme": {
15-
"enum": ["indigo-pink", "deeppurple-amber", "pink-bluegrey", "purple-green", "custom"],
16-
"default": "indigo-pink",
1715
"description": "The theme to apply",
18-
"x-prompt": "Enter a prebuilt theme name, or \"custom\" for a custom theme:"
16+
"type": "string",
17+
"default": "indigo-pink",
18+
"x-prompt": {
19+
"message": "Choose a prebuilt theme name, or \"custom\" for a custom theme:",
20+
"type": "list",
21+
"items": [
22+
{ "value": "indigo-pink", "label": "Indigo/Pink [ Preview: https://material.angular.io?theme=indigo-pink ]" },
23+
{ "value": "deeppurple-amber", "label": "Deep Purple/Amber [ Preview: https://material.angular.io?theme=deeppurple-amber ]" },
24+
{ "value": "pink-bluegrey", "label": "Pink/Blue Grey [ Preview: https://material.angular.io?theme=pink-bluegrey ]" },
25+
{ "value": "purple-green", "label": "Purple/Green [ Preview: https://material.angular.io?theme=purple-green ]" },
26+
{ "value": "custom", "label": "Custom" }
27+
]
28+
}
1929
},
2030
"gestures": {
2131
"type": "boolean",
2232
"default": true,
23-
"description": "Whether gesture support should be set up or not.",
33+
"description": "Whether gesture support should be set up.",
2434
"x-prompt": "Set up HammerJS for gesture recognition?"
2535
},
2636
"animations": {
2737
"type": "boolean",
2838
"default": true,
29-
"description": "Whether Angular browser animations should be set up or not.",
39+
"description": "Whether Angular browser animations should be set up.",
3040
"x-prompt": "Set up browser animations for Angular Material?"
3141
}
3242
},

src/lib/schematics/ng-add/schema.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,13 @@
77
*/
88

99
export interface Schema {
10-
11-
/** Name of the project to target. */
10+
/** Name of the project. */
1211
project: string;
1312

14-
/** Whether gesture support should be set up or not. */
13+
/** Whether gesture support should be set up. */
1514
gestures: boolean;
1615

17-
/** Whether Angular browser animations should be set up or not. */
16+
/** Whether Angular browser animations should be set up. */
1817
animations: boolean;
1918

2019
/** Name of pre-built theme to install. */

0 commit comments

Comments
 (0)