mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-28 05:14:12 +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)
11 lines
248 B
Handlebars
11 lines
248 B
Handlebars
<input
|
|
type="url"
|
|
class="gh-input"
|
|
placeholder="https://www.facebook.com/username"
|
|
value={{this.value}}
|
|
{{on "input" this.setScratchValue}}
|
|
{{on "blur" this.setFacebookUrl}}
|
|
data-test-facebook-input
|
|
...attributes
|
|
/>
|