Skip to content

Commit

Permalink
Remove colons from control labels (#65205)
Browse files Browse the repository at this point in the history
* Remove colons from control labels in docs

* Remove label colon from Archives block

* Remove label colon in Latest Posts block

* Fix label in Legacy Widget block

* Shorten to "Legacy widget" and update test

Co-authored-by: mirka <[email protected]>
Co-authored-by: tyxla <[email protected]>
Co-authored-by: DaniGuardiola <[email protected]>
Co-authored-by: jasmussen <[email protected]>
  • Loading branch information
5 people authored Sep 11, 2024
1 parent f1aa523 commit a15a93d
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion docs/reference-guides/block-api/block-context.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export default function Edit( props ) {
return (
<div>
<TextControl
label={ __( 'Record ID:' ) }
label={ __( 'Record ID' ) }
value={ recordId }
onChange={ ( val ) =>
setAttributes( { recordId: Number( val ) } )
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/archives/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export default function ArchivesEdit( { attributes, setAttributes } ) {
<SelectControl
__next40pxDefaultSize
__nextHasNoMarginBottom
label={ __( 'Group by:' ) }
label={ __( 'Group by' ) }
options={ [
{ label: __( 'Year' ), value: 'yearly' },
{ label: __( 'Month' ), value: 'monthly' },
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/latest-posts/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ export default function LatestPostsEdit( { attributes, setAttributes } ) {
{ displayPostContent && (
<RadioControl
className="wp-block-latest-posts__post-content-radio"
label={ __( 'Show:' ) }
label={ __( 'Show' ) }
selected={ displayPostContentRadio }
options={ [
{ label: __( 'Excerpt' ), value: 'excerpt' },
Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/select-control/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ Render a user interface to select multiple users from a list.
```jsx
<SelectControl
multiple
label={ __( 'Select some users:' ) }
label={ __( 'User' ) }
value={ this.state.users } // e.g: value = [ 'a', 'c' ]
onChange={ ( users ) => {
this.setState( { users } );
Expand All @@ -126,7 +126,7 @@ const [ item, setItem ] = useState( '' );
// ...

<SelectControl
label={ __( 'Select an item:' ) }
label={ __( 'My dinosaur' ) }
value={ item } // e.g: value = 'a'
onChange={ ( selection ) => { setItem( selection ) } }
__nextHasNoMarginBottom
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default function WidgetTypeSelector( { selectedId, onSelect } ) {
<SelectControl
__next40pxDefaultSize
__nextHasNoMarginBottom
label={ __( 'Select a legacy widget to display:' ) }
label={ __( 'Legacy widget' ) }
value={ selectedId ?? '' }
options={ [
{ value: '', label: __( 'Select widget' ) },
Expand Down
4 changes: 1 addition & 3 deletions test/e2e/specs/widgets/customizing-widgets.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -358,9 +358,7 @@ test.describe( 'Widgets Customizer', () => {
const legacyWidgetBlock =
await widgetsCustomizerPage.addBlock( 'Legacy Widget' );
await page
.locator(
'role=combobox[name="Select a legacy widget to display:"i]'
)
.locator( 'role=combobox[name="Legacy widget"i]' )
.selectOption( 'test_widget' );

await expect(
Expand Down

0 comments on commit a15a93d

Please sign in to comment.