Merge pull request #668 from jmc265/adding-image-description

Adding image description to sidebar
This commit is contained in:
Viktor Strate Kløvedal
2022-03-28 18:51:48 +02:00
committed by GitHub
15 changed files with 86 additions and 0 deletions

View File

@@ -68,6 +68,7 @@ export const SHARE_ALBUM_QUERY = gql`
}
exif {
id
description
camera
maker
lens

View File

@@ -49,6 +49,7 @@ export const SHARE_TOKEN_QUERY = gql`
}
exif {
id
description
camera
maker
lens

View File

@@ -106,6 +106,10 @@ export interface SharePageToken_shareToken_media_exif_coordinates {
export interface SharePageToken_shareToken_media_exif {
__typename: 'MediaEXIF'
id: string
/**
* The description of the image
*/
description: string | null
/**
* The model name of the camera
*/

View File

@@ -120,6 +120,10 @@ export interface shareAlbumQuery_album_media_exif_coordinates {
export interface shareAlbumQuery_album_media_exif {
__typename: 'MediaEXIF'
id: string
/**
* The description of the image
*/
description: string | null
/**
* The model name of the camera
*/

View File

@@ -65,6 +65,7 @@ export const SIDEBAR_MEDIA_QUERY = gql`
}
exif {
id
description
camera
maker
lens

View File

@@ -12,6 +12,7 @@ describe('ExifDetails', () => {
type: MediaType.Photo,
exif: {
id: '0',
description: null,
camera: null,
maker: null,
lens: null,
@@ -30,6 +31,7 @@ describe('ExifDetails', () => {
render(<ExifDetails media={media} />)
expect(screen.queryByText('Description')).not.toBeInTheDocument()
expect(screen.queryByText('Camera')).not.toBeInTheDocument()
expect(screen.queryByText('Maker')).not.toBeInTheDocument()
expect(screen.queryByText('Lens')).not.toBeInTheDocument()
@@ -50,6 +52,7 @@ describe('ExifDetails', () => {
type: MediaType.Photo,
exif: {
id: '1666',
description: "Media description",
camera: 'Canon EOS R',
maker: 'Canon',
lens: 'TAMRON SP 24-70mm F/2.8',
@@ -72,6 +75,8 @@ describe('ExifDetails', () => {
render(<ExifDetails media={media} />)
expect(screen.getByText('Description')).toBeInTheDocument()
expect(screen.getByText('Camera')).toBeInTheDocument()
expect(screen.getByText('Canon EOS R')).toBeInTheDocument()

View File

@@ -120,6 +120,7 @@ const ExifDetails = ({ media }: ExifDetailsProps) => {
}
const exifNameLookup = (t: TranslationFn): { [key: string]: string } => ({
description: t('sidebar.media.exif.description', 'Description'),
camera: t('sidebar.media.exif.name.camera', 'Camera'),
maker: t('sidebar.media.exif.name.maker', 'Maker'),
lens: t('sidebar.media.exif.name.lens', 'Lens'),

View File

@@ -85,6 +85,10 @@ export interface sidebarMediaQuery_media_exif_coordinates {
export interface sidebarMediaQuery_media_exif {
__typename: 'MediaEXIF'
id: string
/**
* The description of the image
*/
description: string | null
/**
* The model name of the camera
*/