Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/issue 12033 url label #12959

Merged
merged 37 commits into from
Feb 13, 2019
Merged
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
39bc785
merge from upstream
Oct 30, 2018
e15b05f
Merge branch 'master' of github.com:WordPress/gutenberg
Oct 31, 2018
f9856ed
Merge branch 'master' of github.com:WordPress/gutenberg
Oct 31, 2018
0395ac4
Merge branch 'master' of github.com:WordPress/gutenberg
Nov 5, 2018
9eca9bf
Merge branch 'master' of github.com:WordPress/gutenberg
Nov 7, 2018
2297665
Merge branch 'master' of github.com:WordPress/gutenberg
Nov 8, 2018
246370f
Merge branch 'master' of github.com:WordPress/gutenberg
Nov 12, 2018
dfd129a
Merge branch 'master' of github.com:WordPress/gutenberg
Nov 12, 2018
e730af9
Merge branch 'master' of github.com:WordPress/gutenberg
Nov 13, 2018
277ff12
Merge branch 'master' of github.com:WordPress/gutenberg
Nov 13, 2018
b0ec06c
Merge branch 'master' of github.com:WordPress/gutenberg
Nov 13, 2018
8792af3
Merge branch 'master' of github.com:WordPress/gutenberg
Nov 16, 2018
de9d101
Merge branch 'master' of github.com:WordPress/gutenberg
Nov 19, 2018
cc87beb
local save
Nov 28, 2018
d7d5a8d
Merge branch 'master' of github.com:WordPress/gutenberg
Nov 28, 2018
cc4e6ca
Merge branch 'master' of github.com:WordPress/gutenberg
Nov 30, 2018
b9e444f
Merge branch 'master' of github.com:WordPress/gutenberg
Nov 30, 2018
2cf001e
darked focus state outline for block lists
Nov 30, 2018
3dc2f01
Merge branch 'master' of github.com:WordPress/gutenberg
Nov 30, 2018
94b2f52
Merge branch 'fix/issue-12254-make-selected-block-outline-darker'
Nov 30, 2018
09400da
Merge branch 'master' of github.com:WordPress/gutenberg
Dec 3, 2018
9446bc2
Merge branch 'master' of github.com:WordPress/gutenberg
Dec 3, 2018
bf8a16d
Merge branch 'master' of github.com:WordPress/gutenberg
Dec 5, 2018
21b3b3e
Merge branch 'master' of github.com:WordPress/gutenberg
Dec 7, 2018
260375e
Merge branch 'master' of github.com:WordPress/gutenberg
Dec 17, 2018
8aef5e5
sasve
Dec 17, 2018
8fa3ad7
Merge branch 'master' of github.com:WordPress/gutenberg
Dec 17, 2018
4834328
updated permalink labelling
Dec 17, 2018
daa937a
Merge branch 'master' of github.com:WordPress/gutenberg
Dec 20, 2018
fadb6cb
reverted package lock
Dec 20, 2018
cd8481f
updated label and added helper link
Dec 21, 2018
5226cd4
Merge branch 'master' of github.com:WordPress/gutenberg
Dec 21, 2018
0ef7a22
Merge branch 'master' of github.com:WordPress/gutenberg
Jan 28, 2019
5219d36
Merge branch 'master' into fix/issue-12033-URL-label
Jan 28, 2019
6049de6
post link text update
Jan 28, 2019
69e495e
Merge branch 'master' of github.com:WordPress/gutenberg into fix/issu…
Jan 29, 2019
b123408
Update index.js
timwright12 Feb 8, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 37 additions & 29 deletions packages/edit-post/src/components/sidebar/post-link/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,38 +53,46 @@ function PostLink( {
onToggle={ onTogglePanel }
>
{ isEditable && (
<TextControl
label={ __( 'URL' ) }
value={ forceEmptyField ? '' : currentSlug }
onChange={ ( newValue ) => {
editPermalink( newValue );
// When we delete the field the permalink gets
// reverted to the original value.
// The forceEmptyField logic allows the user to have
// the field temporarily empty while typing.
if ( ! newValue ) {
if ( ! forceEmptyField ) {
<div className="editor-post-link">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like the className editor-post-link doesn't have any associated styles. It can probably be removed unless there's a good reason for it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this div really necessary or should we just replace it with <Fragment />

<TextControl
label={ __( 'URL Slug' ) }
value={ forceEmptyField ? '' : currentSlug }
onChange={ ( newValue ) => {
editPermalink( newValue );
// When we delete the field the permalink gets
// reverted to the original value.
// The forceEmptyField logic allows the user to have
// the field temporarily empty while typing.
if ( ! newValue ) {
if ( ! forceEmptyField ) {
setState( {
forceEmptyField: true,
} );
}
return;
}
if ( forceEmptyField ) {
setState( {
forceEmptyField: false,
} );
}
} }
onBlur={ ( event ) => {
editPermalink( cleanForSlug( event.target.value ) );
if ( forceEmptyField ) {
setState( {
forceEmptyField: true,
forceEmptyField: false,
} );
}
return;
}
if ( forceEmptyField ) {
setState( {
forceEmptyField: false,
} );
}
} }
onBlur={ ( event ) => {
editPermalink( cleanForSlug( event.target.value ) );
if ( forceEmptyField ) {
setState( {
forceEmptyField: false,
} );
}
} }
/>
} }
/>
<p>
{ __( 'The last part of the URL. ' ) }
<ExternalLink href="https://codex.wordpress.org/Posts_Add_New_Screen">
{ __( 'Read about permalinks' ) }
</ExternalLink>
</p>
</div>
) }
<p className="edit-post-post-link__preview-label">
{ __( 'Preview' ) }
Expand Down