Skip to content

Commit

Permalink
Fix optional text handling in LibraryEditField
Browse files Browse the repository at this point in the history
It is one of the more common client-side errors in Sentry (https://sentry.galaxyproject.org/share/issue/7cfa153372ab426485b0ea2d7cde8b49/), and this brings it in
line with the API definition where both text and and synposis are
nullable.
  • Loading branch information
mvdbeek committed Sep 14, 2024
1 parent 00f6482 commit 9afea55
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions client/src/components/Libraries/LibraryEditField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<b-form-textarea class="form-control" :value="text" rows="3" no-resize @change="updateValue" />
</div>
<!-- shrink long text -->
<div v-else-if="text.length > maxDescriptionLength && !isExpanded">
<div v-else-if="text && text.length > maxDescriptionLength && !isExpanded">
<!-- eslint-disable vue/no-v-html -->
<span
class="shrinked-description"
Expand All @@ -20,10 +20,10 @@
<!-- Regular -->
<div v-else>
<!-- eslint-disable-next-line vue/no-v-html -->
<div v-html="linkify(sanitize(text))"></div>
<div v-html="linkify(sanitize(text ?? ''))"></div>
<!-- hide toggle expand if text is too short -->
<a
v-if="text.length > maxDescriptionLength"
v-if="text && text.length > maxDescriptionLength"
class="more-text-btn"
href="javascript:void(0)"
@click="toggleDescriptionExpand"
Expand All @@ -47,6 +47,7 @@ export default {
props: {
text: {
type: String,
required: false,
},
changedValue: {
type: String,
Expand Down

0 comments on commit 9afea55

Please sign in to comment.