Skip to content

Commit

Permalink
Merge pull request #500 from storyblok/develop
Browse files Browse the repository at this point in the history
Release DS updates
  • Loading branch information
lisilinhart authored Jan 19, 2024
2 parents b3a9199 + 563c579 commit b409ffc
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 27 deletions.
17 changes: 17 additions & 0 deletions src/components/EditorHeader/__tests__/HeaderTitle.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,21 @@ describe('Test if Header title renderer correctly', () => {

expect(wrapper.findComponent(SbButton).exists()).toBe(true)
})

it('Test to check if the default slot renders correctly', () => {
const defaultSlotText = 'Just a text'
const wrapper = mount(SbHeaderTitle, {
props: {
headerTitle: 'Awesome cms',
headerSubtitle: 'Its true',
},
slots: {
default: `<span data-testid="default-slot-text"> ${defaultSlotText} </span>`,
},
})

expect(wrapper.find('[data-testid="default-slot-text"]').text()).toBe(
defaultSlotText,
)
})
})
1 change: 1 addition & 0 deletions src/components/EditorHeader/components/HeaderTitle.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<p>{{ headerTitle }}</p>
<p class="sb-editor-header__subtitle">{{ headerSubtitle }}</p>
</div>
<slot />
</div>
</template>

Expand Down
4 changes: 4 additions & 0 deletions src/components/FormItem/form-item.scss
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,7 @@
.sb-form-item__required {
color: $red;
}

.sb-form-item__body{
padding-bottom: $s-2;
}
29 changes: 3 additions & 26 deletions src/components/Select/components/SelectInner.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
/>
</div>

<div v-if="isAvatarVisible && showAvatar" class="sb-select-inner__avatar">
<div v-if="isAvatarVisible" class="sb-select-inner__avatar">
<SbAvatar
:src="avatarData.src"
size="small"
Expand Down Expand Up @@ -240,10 +240,6 @@ export default {
'remove-item-value',
],
data: () => ({
showAvatar: false,
}),
computed: {
dataTestid() {
return this.$attrs['data-testid'] || 'sb-select-inner'
Expand Down Expand Up @@ -318,8 +314,7 @@ export default {
this.hasValue &&
!this.multiple &&
!this.searchInputText.length &&
!this.isAvatarVisible &&
!this.showAvatar
!this.isAvatarVisible
)
},
Expand Down Expand Up @@ -421,7 +416,7 @@ export default {
tagsCountTooltip() {
return {
label: this.tagLabels
?.map((item) => item.label)
?.map((item) => item[this.itemLabel])
.slice(1)
.join(', '),
position: 'top',
Expand All @@ -430,16 +425,6 @@ export default {
},
watch: {
searchInputText(val) {
if (
this.avatarData &&
val === this.avatarData?.label &&
this.isAvatarVisible
) {
this.showAvatar = true
}
},
modelValue(val, oldVal) {
const isSameValue = JSON.stringify(val) === JSON.stringify(oldVal)
if (this.isSearchTextVisible && !isSameValue) {
Expand All @@ -448,14 +433,6 @@ export default {
}
return
}
if (this.isAvatarVisible) {
this.showAvatar = true
}
},
isAvatarVisible(val) {
this.showAvatar = val
},
},
Expand Down
1 change: 1 addition & 0 deletions src/components/Sidebar/sidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@
list-style: none;

svg {
min-height: $s-5;
min-width: $s-5;
}

Expand Down
5 changes: 5 additions & 0 deletions src/components/TextField/SbTextField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
</SbTooltip>
<SbIcon
v-if="hasIconRight"
v-tooltip="iconRightDescription"
:name="iconRight"
class="sb-textfield__icon sb-textfield__icon--right"
:color="iconColor"
Expand Down Expand Up @@ -179,6 +180,10 @@ export default {
type: String,
default: '',
},
iconRightDescription: {
type: String,
default: '',
},
},
emits: [
Expand Down
7 changes: 6 additions & 1 deletion src/lib/internal-icons.js
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,12 @@ const sidebarIcons = {
'sidebar-ideas': {
viewBox: '0 0 24 24',
path: `
<path fill="#fff" d="M10 7a2 2 0 0 1 2-2h7a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-7a2 2 0 0 1-2-2V7Z"/><path fill="#fff" fill-rule="evenodd" d="M6 6a2 2 0 0 0-2 2h4a2 2 0 0 0-2-2Zm2 4H4v5.394a2 2 0 0 0 .336 1.11l.832 1.248a1 1 0 0 0 1.664 0l.832-1.248A2 2 0 0 0 8 15.394V10Z" clip-rule="evenodd" opacity=".57"/><rect width="7" height="2" x="12" y="8" fill="#9DA1AC" rx="1"/><rect width="5" height="2" x="12" y="12" fill="#9DA1AC" rx="1"/>
<g fill="none" fill-rule="evenodd">
<path fill="currentColor" d="M10 7a2 2 0 0 1 2-2h7a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-7a2 2 0 0 1-2-2V7Z"/>
<path fill="currentColor" fill-rule="evenodd" d="M6 6a2 2 0 0 0-2 2h4a2 2 0 0 0-2-2Zm2 4H4v5.394a2 2 0 0 0 .336 1.11l.832 1.248a1 1 0 0 0 1.664 0l.832-1.248A2 2 0 0 0 8 15.394V10Z" clip-rule="evenodd" opacity=".57"/>
<rect width="7" height="2" x="12" y="8" fill="#9DA1AC" rx="1"/>
<rect width="5" height="2" x="12" y="12" fill="#9DA1AC" rx="1"/>
</g>
`,
},
'sidebar-quickstart': {
Expand Down

0 comments on commit b409ffc

Please sign in to comment.