From 94897fd13a324837a96e4b2d4bd703d2d53d83ac Mon Sep 17 00:00:00 2001 From: Ben <3447705+bcabanes@users.noreply.github.com> Date: Fri, 20 Jan 2023 09:42:24 -0500 Subject: [PATCH] feat(nx-dev): display deprecated schema options last --- .../src/lib/schema-viewer.tsx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/nx-dev/feature-package-schema-viewer/src/lib/schema-viewer.tsx b/nx-dev/feature-package-schema-viewer/src/lib/schema-viewer.tsx index 1e551ab3bcba44..bc25286f33c73c 100644 --- a/nx-dev/feature-package-schema-viewer/src/lib/schema-viewer.tsx +++ b/nx-dev/feature-package-schema-viewer/src/lib/schema-viewer.tsx @@ -58,25 +58,28 @@ function getViewModel( } function extractPropertiesByImportance(properties: PropertyModel[]): { - required: PropertyModel[]; + deprecated: PropertyModel[]; important: PropertyModel[]; internal: PropertyModel[]; + required: PropertyModel[]; rest: PropertyModel[]; } { const result: { - required: PropertyModel[]; + deprecated: PropertyModel[]; important: PropertyModel[]; internal: PropertyModel[]; + required: PropertyModel[]; rest: PropertyModel[]; } = { - required: [], + deprecated: [], important: [], internal: [], + required: [], rest: [], }; for (const property of properties) { - if (property.isRequired) { - result.required.push(property); + if (isPropertyDeprecated(property.initialSchema)) { + result.deprecated.push(property); continue; } if ( @@ -158,6 +161,7 @@ export function SchemaViewer({ ...categorizedProperties.important, ...categorizedProperties.rest, ...categorizedProperties.internal, + ...categorizedProperties.deprecated, ]); const additionalProperties = new Array();