Skip to content

Commit

Permalink
fix: APPS-2675 fix BlockStaffDetail.vue image type (#508)
Browse files Browse the repository at this point in the history
fix: image type

Co-authored-by: Jess Divers <[email protected]>
  • Loading branch information
farosFreed and Jess Divers authored May 11, 2024
1 parent 5b23c3e commit 779e58d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
12 changes: 4 additions & 8 deletions src/lib-components/BlockStaffDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import IconWithLink from '@/lib-components/IconWithLink.vue'
// PROPS & DATA
const props = defineProps({
image: {
type: Array as PropType<MediaItemType[]>,
default: () => [],
type: Object as PropType<MediaItemType>,
default: () => {},
},
to: {
type: String,
Expand Down Expand Up @@ -92,10 +92,6 @@ const props = defineProps({
}
})
const parsedImage = computed(() => {
return props.image.length ? props.image[0].src : {}
})
const parsedPronouns = computed(() => {
return `Pronouns: ${props.pronouns}`
})
Expand Down Expand Up @@ -152,8 +148,8 @@ const mergeSortTopics = computed(() => {
<div class="section-staff-bio">
<div :class="image ? 'body-contact' : 'body-contact no-image'">
<ResponsiveImage
v-if="props.image.length"
:media="parsedImage"
v-if="image"
:media="image"
:aspect-ratio="100"
class="image"
/>
Expand Down
10 changes: 5 additions & 5 deletions src/stories/BlockStaffDetail.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const mockDefault = {
slug: 'test-subject-librarian',
uri: 'about/staff/test-subject-librarian',
title: 'TEST - Subject Librarian',
image: [{ src: API.image_people }],
image: API.image_people,
to: 'test-subject-librarian',
nameFirst: 'TEST - Subject',
nameLast: 'Librarian',
Expand Down Expand Up @@ -82,7 +82,7 @@ const mockAlternativeName = {
slug: 'test-phyllis-blackshear',
uri: 'about/staff/test-phyllis-blackshear',
title: 'Test Alternative Name Phyllis Blackshear',
image: [{ src: API.image_people }],
image: API.image_people,
to: 'test-phyllis-blackshear',
nameFirst: 'test_Phyllis',
nameLast: 'Blackshear',
Expand Down Expand Up @@ -155,7 +155,7 @@ const mockNoImageOneLocation = {
slug: 'sylvia-page',
uri: 'about/staff/sylvia-page',
title: 'Test NO IMAGE Penelope Pitstop',
image: [],
// image: {},
to: 'sylvia-page',
nameFirst: 'Test NO IMAGE Penelope',
nameLast: 'Pitstop',
Expand Down Expand Up @@ -234,7 +234,7 @@ const mockNoImageOrBio = {
slug: 'sylvia-page',
uri: 'about/staff/sylvia-page',
title: 'Test NO IMAGE Penelope Pitstop',
image: [],
image: {},
to: 'sylvia-page',
nameFirst: 'Test NO IMAGE Penelope',
nameLast: 'Pitstop',
Expand Down Expand Up @@ -377,7 +377,7 @@ export function NoImageOrBio() {
}
}

export function AskMeAboutAndAcademicDeaprtments() {
export function AskMeAboutAndAcademicDepartments() {
return {
data() {
return {
Expand Down

2 comments on commit 779e58d

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.