Skip to content

Commit

Permalink
Add descriptions to several components
Browse files Browse the repository at this point in the history
Signed-off-by: Volker Theile <[email protected]>
  • Loading branch information
votdev committed Aug 12, 2024
1 parent 729ef76 commit 8284df3
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 2 deletions.
2 changes: 2 additions & 0 deletions pkg/harvester/edit/kubevirt.io.virtualmachine/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,7 @@ export default {
:mode="mode"
:read-allowed="false"
:value-can-be-empty="true"
:description="t(`harvester.virtualMachine.labels.description`)"
@input="value.setLabels($event)"
/>
</Tab>
Expand All @@ -767,6 +768,7 @@ export default {
:display-side-by-side="false"
:show-annotations="false"
:show-label-title="false"
:label-description="t(`harvester.virtualMachine.instanceLabels.description`)"
>
<template #labels="{toggler}">
<KeyValue
Expand Down
4 changes: 4 additions & 0 deletions pkg/harvester/l10n/en-us.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,10 @@ harvester:
inNamespaces: "Workloads in these namespaces"
namespaces:
label: Namespaces
labels:
description: Foo bar baz
instanceLabels:
description: These labels are automatically synchronized to the Virtual Machine Instance.

volume:
label: Volumes
Expand Down
9 changes: 9 additions & 0 deletions shell/components/form/KeyValue.vue
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,10 @@ export default {
default: false,
type: Boolean
},
description: {
default: '',
type: String,
},
},
data() {
const rows = this.getRows(this.value);
Expand Down Expand Up @@ -565,6 +569,11 @@ export default {
</h3>
</slot>
</div>
<div v-if="description">
<p class="mt-10 mb-10">
{{ description }}
</p>
</div>
<div
class="kv-container"
:style="containerStyle"
Expand Down
16 changes: 14 additions & 2 deletions shell/components/form/Labels.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,16 @@ export default {
type: Boolean,
default: true,
},
showLabelDescription: {
type: Boolean,
default: true,
},
labelDescription: {
type: String,
default: '',
},
},
data() {
Expand Down Expand Up @@ -89,8 +99,10 @@ export default {
:on-label="t('labels.labels.show')"
/>
</div>
<p class="mt-10 mb-10">
<t k="labels.labels.description" />
<p v-if="showLabelDescription"

Check warning on line 102 in shell/components/form/Labels.vue

View workflow job for this annotation

GitHub Actions / lint

Expected a linebreak before this attribute
class="mt-10 mb-10">

Check failure on line 103 in shell/components/form/Labels.vue

View workflow job for this annotation

GitHub Actions / lint

Expected 1 line break before closing bracket, but no line breaks found
<span v-if="labelDescription">{{ labelDescription }}</span>
<t v-if="!labelDescription" k="labels.labels.description" />

Check failure on line 105 in shell/components/form/Labels.vue

View workflow job for this annotation

GitHub Actions / lint

'k' should be on a new line
</p>
<div :class="columnsClass">
<slot
Expand Down

0 comments on commit 8284df3

Please sign in to comment.