Skip to content

Commit

Permalink
Made description dynamic on related resources
Browse files Browse the repository at this point in the history
Signed-off-by: greta <gretadoci@gmail.com>
  • Loading branch information
GretaD committed Nov 1, 2023
1 parent eeace13 commit 887bf74
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions src/components/NcRelatedResourcesPanel/NcRelatedResourcesPanel.vue
Expand Up @@ -28,7 +28,7 @@ Use this component to display the related resources of a given item.
```
<template>
<NcRelatedResourcesPanel provider-id="talk"
header="Related resources for talk"
header="Related resources for talk"
:item-id="conversationId" />
</template>

Expand All @@ -48,7 +48,7 @@ export default {
<div v-if="appEnabled && isVisible" class="related-resources">
<div class="related-resources__header">
<h5>{{ header }}</h5>
<p>{{ description }}</p>
<p>{{ subline }}</p>
</div>

<NcResource v-for="resource in resources"
Expand Down Expand Up @@ -120,6 +120,17 @@ export default {
type: String,
default: t('Related resources'),
},
description: {
type: String,
default: t('Anything shared with the same group of people will show up here'),
},
/**
* If this element is used on a primary element set to true for primary styling.
*/
primary: {
type: Boolean,
default: false,
},
},
emits: [
Expand All @@ -143,12 +154,11 @@ export default {
}
return this.error ?? this.resources.length > 0
},
description() {
subline() {
if (this.error) {
return t('Error getting related resources. Please contact your system administrator if you have any questions.')
}
return t('Anything shared with the same group of people will show up here')
return this.description
},
hasResourceInfo() {
Expand Down

0 comments on commit 887bf74

Please sign in to comment.