` is a date-based version in the format YYYY-MM-DD.
*/
function truncatePackerOperationPath(path: string) {
return path.replace(
@@ -39,4 +58,8 @@ function PathTruncationAside({ path }: { path: string }) {
)
}
-export { PathTruncationAside, truncatePackerOperationPath }
+export {
+ PathTruncationAside,
+ truncatePackerOperationPath,
+ truncateVaultSecretsOperationPath,
+}
diff --git a/src/views/api-docs-view/index.tsx b/src/views/api-docs-view/index.tsx
index 4f4e2077c0..6f885ed6d4 100644
--- a/src/views/api-docs-view/index.tsx
+++ b/src/views/api-docs-view/index.tsx
@@ -36,12 +36,12 @@ function ApiDocsView({
/**
* We always render the API docs name in a heading-styled element.
*
- * When `serviceData` is provided, we'll render the service name
+ * When `serviceData.name` is provided, we'll render the service name
* in an `h1` element, as the `serviceName` is a more meaningful page title.
* In such cases, our page heading needs to be a `p` element to avoid
* having multiple `h1` elements on the page.
*/
- const pageHeadingTag = serviceData ? 'p' : 'h1'
+ const pageHeadingTag = serviceData?.name ? 'p' : 'h1'
/**
* We only show the version switcher if we have at least 2 options.
@@ -73,8 +73,10 @@ function ApiDocsView({
}
/>
{serviceData ? (
- <>
- {serviceData.name}
+
+ {serviceData.name ? (
+
{serviceData.name}
+ ) : null}
{serviceData.operations.map((operation: OperationObjectType) => {
return (
)
})}
- >
+
) : (
Select a service from the sidebar.
)}