Skip to content

Commit

Permalink
StackVersion → Stack
Browse files Browse the repository at this point in the history
  • Loading branch information
fiskus committed Oct 22, 2024
1 parent ce077f9 commit 78af107
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
12 changes: 5 additions & 7 deletions catalog/app/components/Footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import * as GQL from 'utils/GraphQL'
import * as NamedRoutes from 'utils/NamedRoutes'
import copyToClipboard from 'utils/clipboard'

import STACK_VERSION_QUERY from 'utils/StackVersion.generated'
import STACK_QUERY from 'utils/Stack.generated'

Check warning on line 17 in catalog/app/components/Footer/Footer.tsx

View check run for this annotation

Codecov / codecov/patch/informational

catalog/app/components/Footer/Footer.tsx#L17

Added line #L17 was not covered by tests

import bg from './bg.png'
import iconFacebook from './icon-facebook.svg'
Expand All @@ -37,23 +37,21 @@ const useVersionStyles = M.makeStyles((t) => ({

function Version() {
// eslint-disable-next-line @typescript-eslint/naming-convention
const {
stack: { version },
} = GQL.useQueryS(STACK_VERSION_QUERY)
const { stack } = GQL.useQueryS(STACK_QUERY)

Check warning on line 40 in catalog/app/components/Footer/Footer.tsx

View check run for this annotation

Codecov / codecov/patch/informational

catalog/app/components/Footer/Footer.tsx#L40

Added line #L40 was not covered by tests
const classes = useVersionStyles()
const { push } = Notifications.use()
const handleCopy = React.useCallback(() => {
copyToClipboard(version || '')
copyToClipboard(stack.version || '')
push('Web catalog container hash has been copied to clipboard')
}, [push, version])
}, [push, stack.version])
return (
<M.Typography
className={classes.revision}
onClick={handleCopy}
title="Copy product revision hash to clipboard"
variant="caption"
>
Version: {version}
Version: {stack.version}
</M.Typography>
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
import type { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'
import * as Types from '../model/graphql/types.generated'

export type utils_StackVersionQueryVariables = Types.Exact<{ [key: string]: never }>
export type utils_StackQueryVariables = Types.Exact<{ [key: string]: never }>

export type utils_StackVersionQuery = { readonly __typename: 'Query' } & {
export type utils_StackQuery = { readonly __typename: 'Query' } & {
readonly stack: { readonly __typename: 'Stack' } & Pick<Types.Stack, 'version'>
}

export const utils_StackVersionDocument = {
export const utils_StackDocument = {

Check warning on line 11 in catalog/app/utils/Stack.generated.ts

View check run for this annotation

Codecov / codecov/patch/informational

catalog/app/utils/Stack.generated.ts#L11

Added line #L11 was not covered by tests
kind: 'Document',
definitions: [
{
kind: 'OperationDefinition',
operation: 'query',
name: { kind: 'Name', value: 'utils_StackVersion' },
name: { kind: 'Name', value: 'utils_Stack' },
selectionSet: {
kind: 'SelectionSet',
selections: [
Expand All @@ -30,6 +30,6 @@ export const utils_StackVersionDocument = {
},
},
],
} as unknown as DocumentNode<utils_StackVersionQuery, utils_StackVersionQueryVariables>
} as unknown as DocumentNode<utils_StackQuery, utils_StackQueryVariables>

export { utils_StackVersionDocument as default }
export { utils_StackDocument as default }

Check warning on line 35 in catalog/app/utils/Stack.generated.ts

View check run for this annotation

Codecov / codecov/patch/informational

catalog/app/utils/Stack.generated.ts#L35

Added line #L35 was not covered by tests
File renamed without changes.

0 comments on commit 78af107

Please sign in to comment.