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

Improvements to twitter & facebook handling #6848

Merged
merged 4 commits into from
May 17, 2016

Commits on May 17, 2016

  1. Add helpers for facebook & twitter urls

    refs TryGhost#6534
    
    - this PR assumes that we are now saving usernames only in the database for twitter & facebook
    - adds a new social links utility which can generate twitter & facebook urls from the username
    - adds a {{twitter_url}} and {{facebook_url}} helper which uses these
    - adds a full suite of tests for the helpers & utils
    ErisDS committed May 17, 2016
    Configuration menu
    Copy the full SHA
    e96b60b View commit details
    Browse the repository at this point in the history
  2. Update structured data for fb & twitter usernames

    refs TryGhost#6534
    
    - twitter & facebook fields are changing to store usernames only
    - use the new social url util to generate urls where necessary
    - update tests
    ErisDS committed May 17, 2016
    Configuration menu
    Copy the full SHA
    29c9e8b View commit details
    Browse the repository at this point in the history
  3. Fixes error in validation

    closes TryGhost#6826
    
    - refactors the validation of facebook and twitter input field in `general.js` and `user.js` controller
    	- Example validations for facebook:
    		- `facebook.com/username` will be corrected to the full URL
    		- `user` will show error `Your Page name is not a valid Facebook Page name' for `general.js` and `Your Username is not a valid Facebook Username` for `user.js` as the username in facebook has to be at least 5 characters long
    		- `twitter.com/username` will be autocorrected to the valid facebook URL incl. the `username`
    	- Example validations for twitter:
    		- `twitter.com/user_` will be corrected to the full URL
                    - `user:99` will show error `Your Username is not a valid Twitter Username`
                    - `facebook.com/username` will be autocorrected to the valid twitter URL incl. the `username`
    - updates both acceptance tests
    - adds further validation for facebook pages in general settings and user. Submitting a url which incl. `/page/` or `/pages/` will now accept any username followed incl. further `/`.
    - adds a custom transform `facebook-url-user` which will extract the username (if it's a facebook page, incl. `pages/`) to store only this in the backend
    - uses the `twitter-url-user` transform now also for user
    aileen authored and ErisDS committed May 17, 2016
    Configuration menu
    Copy the full SHA
    6dbf610 View commit details
    Browse the repository at this point in the history
  4. Fix unwanted clearing of social inputs on blur with no edits

    no issue
    - updates the logic to expect `null` scratch values as the scratch values won't be set until the input value has changed
    - adds tests for initial value display and regression tests for the cleared input bug
    kevinansfield committed May 17, 2016
    Configuration menu
    Copy the full SHA
    2640f77 View commit details
    Browse the repository at this point in the history