feat(nx-dev): display deprecated schema options last (#14518)

This commit is contained in:
Benjamin Cabanes 2023-01-20 10:47:06 -05:00 committed by GitHub
parent f8854d7089
commit 7193b85d2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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<JSX.Element>();