mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-25 19:48:50 +03:00
c77c150745
refs https://github.com/TryGhost/Ghost/issues/14101 Twitter/facebook URL validation doesn't follow our typical validation and was duplicated across multiple screens making the controllers unnecessarily complex. - extracted url input fields and their validation into separate components - uses tracked scratch values so that the input field values can reset to the saved value on save - twitter/facebook URL inputs are different to our other inputs because invalid values won't prevent saving, instead they are reset to their previous value on save - added `this.validate()` call after a successful save in `settings` service so the service and underlying model validations are both in sync (fixes validation error sticking around after saving with invalid twitter/facebook values that have been reset)
10 lines
240 B
Handlebars
10 lines
240 B
Handlebars
<input
|
|
type="url"
|
|
class="gh-input"
|
|
placeholder="https://twitter.com/username"
|
|
value={{this.value}}
|
|
{{on "input" this.setScratchValue}}
|
|
{{on "blur" this.setTwitterUrl}}
|
|
data-test-twitter-input
|
|
...attributes
|
|
/> |