Files
zitadel/docs/src/theme/DocSidebarItems/index.js
T
88493dd2a0 docs: strikethrough deprecated APIs (#9740)
# Which Problems Are Solved

The docs overview pages and navs don't visually distinguish between
deprecated and GA APIs.
This makes it hard to find the right methods for the job already.
As we are implementing the resource API and continously deprecate
obsolete APIs, this only gets worse.

# How the Problems Are Solved

The UI items in docs overview pages are striked through and pushed to
the bottom of the list.
This applies to side navs as well as card lists.

For example, [see management user
methods](https://docs-git-strikethrough-deprecated-apis-zitadel.vercel.app/docs/apis/resources/mgmt/users):

![image](https://github.com/user-attachments/assets/a12ccd92-3a70-4854-8ebf-b771ff151083)

A method is considered deprecated if it has this option set in the
protos rpc definition:

```protobuf
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
    deprecated: true;
}
```

# Additional Changes

None

# Additional Context

- Relates to #9680

---------

Co-authored-by: David Skewis <[email protected]>
2025-04-14 11:37:47 +00:00

15 lines
587 B
JavaScript

import React from 'react';
import DocSidebarItems from '@theme-original/DocSidebarItems';
import toCustomDeprecatedItemsProps from '../../utils/deprecated-items.js';
// The DocSidebarItems component is used in generated side navs for API services.
// We wrap the original to push deprecated items to the bottom and give them a CSS class.
// This lets us easily style them differently in docs/src/css/custom.css.
export default function DocSidebarItemsWrapper(props) {
return (
<>
<DocSidebarItems {...toCustomDeprecatedItemsProps(props)} />
</>
);
}