Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: show Looker release version providing API specification #1233

Merged
merged 1 commit into from
Jan 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion packages/api-explorer/src/scenes/HomeScene/HomeScene.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import type { ApiModel } from '@looker/sdk-codegen'
import type { FC } from 'react'
import React from 'react'
import { useParams } from 'react-router-dom'
import { Space, Span, Tooltip } from '@looker/components'
import { ApixSection, DocMarkdown, DocTitle } from '../../components'

interface DocHomeProps {
Expand All @@ -39,10 +40,18 @@ interface DocHomeParams {

export const HomeScene: FC<DocHomeProps> = ({ api }) => {
const { specKey } = useParams<DocHomeParams>()
const lookerVersion = 'x-looker-release-version'

return (
<ApixSection>
<DocTitle>{api.spec.info.title}</DocTitle>
<Space>
<DocTitle>{api.spec.info.title}</DocTitle>
{api.spec.info[lookerVersion] && (
<Tooltip content="Looker version providing this specification">
<Span fontSize="small">{api.spec.info[lookerVersion]}</Span>
</Tooltip>
)}
</Space>
{api.spec.info.description && (
<DocMarkdown source={api.spec.info.description} specKey={specKey} />
)}
Expand Down