Skip to content

Commit bab77d9

Browse files
committed
fix to coderabbit's qa
1 parent 3a72022 commit bab77d9

8 files changed

Lines changed: 18 additions & 14 deletions

File tree

src/components/sortable-picker/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ const LabeledItemIndicator = props => {
207207
}
208208
} }
209209
isPressed={ isOpen }
210-
data-item-key={ item.key }
210+
data-item-key={ item.key || item.slug || item.name }
211211
>
212212
<HStack justify="flex-start">
213213
<ItemPreview item={ item } />

src/lazy-components/modal-tour/tours/advanced-hover-states.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,14 +164,17 @@ export const advancedHoverStates = {
164164
position: 'left',
165165
glowTarget: '.stk-control:has([data-attribute="textColor1"]) .stk-label-unit-toggle__wrapper button[data-value="parent-hover"]',
166166
nextEventTarget: '.stk-control:has([data-attribute="textColor1"]) .stk-label-unit-toggle__wrapper button:not(.is-active)[data-value="parent-hover"]',
167+
modalDelay: 150,
167168
preStep: () => {
168169
setTimeout( () => {
169170
const targetElTop = document.querySelector( '.stk-control:has([data-attribute="textColor1"])' )?.getBoundingClientRect()?.top
170171
const editorSidebar = document.querySelector( '.editor-sidebar.ugb--has-panel-tabs' )
171-
editorSidebar.scrollTo( {
172-
top: targetElTop - editorSidebar.getBoundingClientRect().top - 100,
173-
behavior: 'smooth',
174-
} )
172+
if ( editorSidebar && typeof targetElTop === 'number' ) {
173+
editorSidebar.scrollTo( {
174+
top: targetElTop - editorSidebar.getBoundingClientRect().top - 100,
175+
behavior: 'smooth',
176+
} )
177+
}
175178

176179
document.querySelector( '.stk-control:has([data-attribute="textColor1"]) .stk-label-unit-toggle__wrapper:not(.is-open) button' )?.click()
177180
}, 100 )

src/lazy-components/modal-tour/tours/block-backgrounds.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ export const blockBackgrounds = {
119119
dispatch( 'core/block-editor' ).selectBlock( columnsBlock.clientId )
120120
}
121121

122-
waitForElement( '.edit-post-sidebar__panel-tab.ugb-tab--style:not(.is-active)' ).then( () => {
122+
waitForElement( '.edit-post-sidebar__panel-tab.ugb-tab--style' ).then( () => {
123123
// Click the tab
124124
document.querySelector( '.edit-post-sidebar__panel-tab.ugb-tab--style:not(.is-active)' )?.click()
125125
} )

src/lazy-components/modal-tour/tours/global-color-schemes.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,10 @@ export const globalColorSchemes = {
204204
const columnsBlock = allBlocks.find( block => block.name === 'stackable/columns' )
205205
if ( columnsBlock ) {
206206
dispatch( 'core/block-editor' ).selectBlock( columnsBlock.clientId )
207-
await waitForElement( '.edit-post-sidebar__panel-tab.ugb-tab--style:not(.is-active)' )
207+
await waitForElement( '.edit-post-sidebar__panel-tab.ugb-tab--style' )
208208
document.querySelector( '.edit-post-sidebar__panel-tab.ugb-tab--style:not(.is-active)' )?.click()
209209

210-
await waitForElement( '.ugb-block-background-panel:not(.is-opened) button' )
210+
await waitForElement( '.ugb-block-background-panel button' )
211211
document.querySelector( '.ugb-block-background-panel:not(.is-opened) button' )?.click()
212212
}
213213
}

src/lazy-components/modal-tour/tours/hover-states.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const hoverStates = {
2222
// Select the inner columns block for the tour
2323
dispatch( 'core/block-editor' ).selectBlock( blockObject.clientId )
2424

25-
waitForElement( '.edit-post-sidebar__panel-tab.ugb-tab--style:not(.is-active)' ).then( () => {
25+
waitForElement( '.edit-post-sidebar__panel-tab.ugb-tab--style' ).then( () => {
2626
document.querySelector( '.edit-post-sidebar__panel-tab.ugb-tab--style:not(.is-active)' )?.click()
2727
setTimeout( () => {
2828
document.querySelector( '.ugb-panel--image:not(.is-opened)' )?.click()
@@ -114,7 +114,7 @@ export const hoverStates = {
114114
},
115115
postStep: () => {
116116
document.querySelector( '.stk-control:has([data-attribute="imageZoom"]) .stk-label-unit-toggle__wrapper:not(.is-open) button' )?.click()
117-
waitForElement( '.stk-control:has([data-attribute="imageZoom"]) .stk-label-unit-toggle__wrapper button:not(.is-active)[data-value="normal"]' ).then( () => {
117+
waitForElement( '.stk-control:has([data-attribute="imageZoom"]) .stk-label-unit-toggle__wrapper button[data-value="normal"]' ).then( () => {
118118
document.querySelector( '.stk-control:has([data-attribute="imageZoom"]) .stk-label-unit-toggle__wrapper button:not(.is-active)[data-value="normal"]' )?.click()
119119
} )
120120
},

src/lazy-components/modal-tour/tours/responsive-controls.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,11 @@ export const responsiveControls = {
9292
if ( columnsBlock ) {
9393
dispatch( 'core/block-editor' ).selectBlock( columnsBlock.clientId )
9494
}
95-
await waitForElement( '.edit-post-sidebar__panel-tab.ugb-tab--layout:not(.is-active)' )
95+
await waitForElement( '.edit-post-sidebar__panel-tab.ugb-tab--layout' )
9696
// Open Layout tab if it's not open
9797
document.querySelector( '.edit-post-sidebar__panel-tab.ugb-tab--layout:not(.is-active)' )?.click()
9898

99-
await waitForElement( '.ugb-panel--layout:not(.is-opened)' )
99+
await waitForElement( '.ugb-panel--layout' )
100100
document.querySelector( '.ugb-panel--layout:not(.is-opened)' )?.click()
101101
},
102102
postStep: () => {
@@ -173,7 +173,7 @@ export const responsiveControls = {
173173
postStep: async () => {
174174
document.querySelector( '.ugb-sort-control .stk-control-responsive-toggle:not(.is-open) button' )?.click()
175175

176-
await waitForElement( '.ugb-sort-control .stk-control-responsive-toggle button:not(.is-active)[data-value="desktop"]' )
176+
await waitForElement( '.ugb-sort-control .stk-control-responsive-toggle button[data-value="desktop"]' )
177177
document.querySelector( '.ugb-sort-control .stk-control-responsive-toggle button:not(.is-active)[data-value="desktop"]' )?.click()
178178
},
179179
},

src/welcome/admin.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ body[class*="page_stk-"] {
207207
justify-content: flex-end;
208208
}
209209

210-
:not(.s-quick-buttons-arrow) svg {
210+
svg {
211211
height: 24px;
212212
width: 24px;
213213
}

src/welcome/getting-started.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,7 @@ body.settings_page_stackable-getting-started .s-body-container > .s-getting-star
271271
right: 69px;
272272
svg {
273273
width: 64px;
274+
height: auto;
274275
transform: scaleX(-1);
275276
}
276277
span {

0 commit comments

Comments
 (0)