Skip to content

Commit

Permalink
[SDPAP-7863]added fix to have one publication author (#1317)
Browse files Browse the repository at this point in the history
* added fix to have one publication author

* fixed lint

* updated storybook

* updated array values

* added conditional for array values

* Reverted back to array to avoid issues on names with commas

* Updated publication story

* update default to empty array
  • Loading branch information
yeniatencio authored Sep 14, 2023
1 parent 72ab723 commit 803a43c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ export default {
},
publishingInfo () {
if (this.publication.type === 'node--publication') {
const authorsName = this.publication.field_publication_authors ? this.publication.field_publication_authors : ''
const author = authorsName && authorsName.length > 0 ? authorsName.map((authors) => authors.name) : []
const authorsName = this.publication.field_publication_authors ?? []
const author = Array.isArray(authorsName) ? authorsName.map((author) => author.name) : [authorsName.name]
const date = this.publication.field_publication_date
const copyright = this.publication.field_license_type ? this.publication.field_license_type.description : ''
return (author || date || copyright) ? { author, date, copyright } : null
Expand Down
4 changes: 2 additions & 2 deletions packages/ripple-nuxt-tide/modules/publication/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ export default {
computed: {
publishingInfo () {
if (this.page.type === 'node--publication') {
const authorsName = this.page.field_publication_authors ? this.page.field_publication_authors : ''
const author = authorsName && authorsName.length > 0 ? authorsName.map((authors) => authors.name) : []
const authorsName = this.page.field_publication_authors ?? []
const author = Array.isArray(authorsName) ? authorsName.map((author) => author.name) : [authorsName.name]
const date = this.page.field_publication_date
const copyright = this.page.field_license_type ? this.page.field_license_type.description : ''
return (author || date || copyright) ? { author, date, copyright } : null
Expand Down

0 comments on commit 803a43c

Please sign in to comment.