From 4e5a9d4eae99cae05615ea36c8bc78e1e5f43a97 Mon Sep 17 00:00:00 2001 From: Charles Lyding <19598772+clydin@users.noreply.github.com> Date: Tue, 20 Oct 2020 18:51:44 -0400 Subject: [PATCH] fix(@angular-devkit/core): allow prompt providers to access property types This allows prompt providers to adjust their logic based on the type of property requested. (cherry picked from commit 83c91204ed8dd2345d47a8f398b3799532003ac7) --- etc/api/angular_devkit/core/src/_golden-api.d.ts | 1 + packages/angular_devkit/core/src/json/schema/interface.ts | 1 + packages/angular_devkit/core/src/json/schema/registry.ts | 1 + 3 files changed, 3 insertions(+) diff --git a/etc/api/angular_devkit/core/src/_golden-api.d.ts b/etc/api/angular_devkit/core/src/_golden-api.d.ts index 93168b67c547..0572bee4faef 100644 --- a/etc/api/angular_devkit/core/src/_golden-api.d.ts +++ b/etc/api/angular_devkit/core/src/_golden-api.d.ts @@ -715,6 +715,7 @@ export interface PromptDefinition { }>; message: string; multiselect?: boolean; + propertyTypes: Set; raw?: string | JsonObject; type: string; validator?: (value: JsonValue) => boolean | string | Promise; diff --git a/packages/angular_devkit/core/src/json/schema/interface.ts b/packages/angular_devkit/core/src/json/schema/interface.ts index c62f08237d36..2e4375511a03 100644 --- a/packages/angular_devkit/core/src/json/schema/interface.ts +++ b/packages/angular_devkit/core/src/json/schema/interface.ts @@ -105,6 +105,7 @@ export interface PromptDefinition { raw?: string | JsonObject; multiselect?: boolean; + propertyTypes: Set; } export type PromptProvider = (definitions: Array) diff --git a/packages/angular_devkit/core/src/json/schema/registry.ts b/packages/angular_devkit/core/src/json/schema/registry.ts index a2f8df45077a..50c5ed4bbb3c 100644 --- a/packages/angular_devkit/core/src/json/schema/registry.ts +++ b/packages/angular_devkit/core/src/json/schema/registry.ts @@ -590,6 +590,7 @@ export class CoreSchemaRegistry implements SchemaRegistry { raw: schema, items, multiselect, + propertyTypes, default: typeof (parentSchema as JsonObject).default == 'object' && (parentSchema as JsonObject).default !== null &&