Commit graph

12 commits

Author SHA1 Message Date
Michael Kohl
8f5cfa2c0f
Drop profile columns from user (#10707)
* Prepare to drop profile columns from user

* Update code and factory

* Also remove unused constant

* Move validation from user to profile

* Remove Profiles::ExtractData service object

* Add more comments

* Simplify sameAs attribute generation

* Obey me machine, I am your master

* Fix condition order in guard clause

* Temporarily disable callback

* Fix specs

* Reduce usage of Profile#refresh_attributes!

* Remove leftover comment

* Handle social media links differently

* More spec fixes

* Fix specs for admin profile fields controller

* Fix specs after merge

* Fix remaining specs

* Update user show request spec

* Add comment for follow_hiring_tag

* Only save profile when user is valid

* Fix seeds.rb for profile fields

* Switch from before_save to after_save

* Undo unrelated formattin change

* Update spec/fixtures/files/profile_fields.csv

Co-authored-by: Molly Struve <mollylbs@gmail.com>

* Remove data update script and spec

* Fix spec

* Fix typo in comment

* Fix typo in comment

* Move article resave logic to service object

* Move profile field creation to before(:suite)

* Refactor error handling in Profiles::Update

* Fix Profiles::Update specs and refactor

* Temporarily disable spec

* Add ProfileValidator

* Clean up

* Move DB ready check into app/lib

* Refresh attributes after importing from CSV

* Fix specs

* Remove unused file

* A girl has no name. A profile neither.

* Fix specs

* Add responds_to? check

* Spec fix

* Add name to user fields in profile settings page

Co-authored-by: Molly Struve <mollylbs@gmail.com>
2020-12-03 08:14:38 +07:00
Michael Kohl
a2b55f889c
Remove Twitch integration (#10732)
* Remove Twitch integration

* Ignore columns
2020-10-08 12:44:10 +00:00
Mac Siri
9ebd742712
[deploy] Reintroduce sticky_nav changes (ab81f36 & 7f92855) (#10263)
* Revert "[deploy] Revert removal of unneeded eager load (if needed) (#10179)"

This reverts commit 11c7b148da.

* Revert "[deploy] Revert "Migrate ProfileImage to Images::Profile (#10055)" (#10149)"

This reverts commit 5657067e55.
2020-09-09 15:33:13 -04:00
Molly Struve
5657067e55
[deploy] Revert "Migrate ProfileImage to Images::Profile (#10055)" (#10149)
This reverts commit ab81f36a38.
2020-09-01 18:28:58 -05:00
Mac Siri
ab81f36a38
[deploy] Migrate ProfileImage to Images::Profile (#10055) 2020-09-01 17:16:03 -04:00
rhymes
f5d35c6506
Rubocop: Enable and fix Style/StringConcatenation (#9844) 2020-08-18 14:50:15 +02:00
Molly Struve
b40af82b66
Flaky Spec Fix:Remove let_it_be Test Prof Helper (#9556)
* Flaky Spec Fix:Remove let_it_be Test Prof Helper

* Spec cleanup and fixes
2020-07-29 11:31:01 +02:00
Julianna Tetreault
97c46cfbf8
Refactor User-Specific JSON-LD in the Stories::Controller (#7731)
* Refactor user_same_as_json_ld method to be more readable

* Refactor user JSON-LD to be less verbose in Stories::Controller
  * Removes set_user_same_as_json_ld method
  * Removes set_user_profile_json_ld method
  * Adds user_works_for and user_disambiguating_description
  * Adds inline logic to the data structure
  * Simplifies user_same_as method

* Add documentation around specific data properties

* Add .reject to user_json_ld to remove key, value if value blank
  * Checks for blank values and rejects key,value if blank
  * Accounts for JSON-LD preference for no key,value if blank

* Add reject and compact to worksFor in Stories::Controller
  * Ensures any nil/empty values for worksFor are removed
  * Cleans up existing code within Stories::Controller

* Add test for values that eval to true when .blank? is called
  * Adds test to check that empty key/values are not included
  * Adds test to check that nil key/values are not included
  * Refactors variables to be inline in user_show_spec
  * Refactors existing code in user_show_spec

* Add reject for blank values to user_same_as in Stories::Contrroller
  * Adds a check for email_public to email

* Fix typo within comment in Stories::Controller

* Add ternary operation to email in Stories::Controller
2020-05-20 14:40:34 -06:00
rhymes
b5ebf8f3dc
Routine rubocop fixes (#7743)
* Rubocop auto fixes

* Fix Capybara/VisibilityMatcher

* Regenerate todo
2020-05-08 19:38:06 +02:00
Julianna Tetreault
d7b3b770e7
Refactor JSON-LD Within user_show_spec to Improve Testing (#7672)
* Refactor user_show_spec to check for exact JSON-LD data to improve testing
  * Extracts data out into factory objects to shorten # of lines in test
  * Extracts JSON-LD into a parsed object for more precise testing
  * Shortens test to be within the 15 line rubocop limit
  * Resolves rubocop multi-line errors

* Refactor user.update_columns to be a single method

* Add :with_all_info trait to users factory
  * Adds trait that holds all necessary info for user JSON-LD
  * Removes user.update_columns method from the user_show_spec
  * Adds the :with_all_info trait to the user in the spec

* Wrap test in rubocop:disable to resolve ExampleLength errors
  * Removes let blocks that once held extracted code
  * Adds code back to the data structure as inline code
  * Resolves even more rubocop errors... hopefully
2020-05-04 15:10:51 -06:00
Ben Halpern
2c6a4b4ecf
[deploy] Make adjustments in ld+json logic (#7307)
* Make adjustments in ld+json logic

* Add github url
2020-04-15 15:50:48 -04:00
Julianna Tetreault
fd9fdebc0b
[deploy] Migrate from Schema.org to JSON-LD (#6956)
* Add JSON-LD in place of schema.org in _video_player.html.erb

* Remove unnecessary tags around JSON-LD to clean up templates

* Fix indenatation and remove extra elements from show.html.erb and _profile_header.html.erb

* Remove empty line from articles/show.html.erb

* Clean up JSON-LD commas across erb templates

* Revert articleBody changes, adjust nesting, and remove extra quote

* Add application/ld+json to allowed_types in .erb-lint.yml

This addition makes it so that the no verify flag is no longer required

* Add additional data for Articles, Users, and Orgs to better SEO

* Add additional data to JSON-LD structures
*Add sameAs data to articles/show.html.erb
*Add sameAs data to users/show.html.erb
*Make adjustments to VideoObject data in _video_player
*Make adjustments to Org in _profile_header
*Add removed erb back to all erb templates

* Refactor code to fix syntax Google syntax errors
* Add missing double quotes to values
* Remove unnecessary meta tags from _video_player.html.erb
* Add additional key-value pairs to data structures
* General code clean up

* Clean up existing data structures
  *Remove useless meta tag and replace with a tag
  *Small refactor to users/show.html.erb data

* Extract user json-ld out of users/show.html.erb
  *Move json-ld logic to stories_controller
  *Use user_json_ld variable in place of entire data structure
  *Set user_json_ld as a before_action in the controller

* Add specs around JSON-LD data in templates
  *Add request spec for users/show.html.erb
  *Add request spec for articles/show.html.erb
  *Add request spec for _video_player.html.erb
  *Add request spec for _profile_header.html.erb
  *WIP: Fix pending specs for all templates

* Remove useless meta tags from users/show and _profile_header.html.erb

* Add additional test coverage to users/show.html.erb
  *Add additional tests to user_show_spec
  *Ensure that all tests pass
  *Small refactor to users/show.html.erb JSON data structure

* Add additional test coverage around JSON-LD data
  *Add more robust tests to template specs
  *Remove unnecessary comments from specs
  *Uncomment pending specs

* Adjust modified date to be more readable in article specs

* Refactor spec to be more readable and update GitHub username test

* Remove meta erb from articles/show.html.erb

* Remove meta data from _video_player.html.erb

* Clean up useless codeand whitespace for final review

* Extract users/show data structure from template into StoriesController
  * Remove JSON-LD object from users/show.html.erb
  * Place JSON-LD for users/show.html.erb in StoriesController
  * Store user_json_ld in set_json_ld method in StoriesController
  * Call user_json_ld variable in script tag in users/show
  * Clean up trailing commas and refactor articles/show.html.erb
  * Remove redundant user/profile_header_spec.rb

* Remove unnecessary code from _profile_header and articles/show
  * Remove Organization from articles/show.html.erb
  * Remove unnecessary comments from _profile_header.html.erb

* Extract user_json_ld into separate methods to fix Code Climate failures

* Rename user_profile_details and user_same_as methods to be more explicit

* Refactored user_json_ld methods to use symbols instead of strings
  * Use symbols to fetch keys from a hash instead of strings
  * Changed user_url in data structure

* Removal of erb tags and general clean up

* Revert schema changes

* Remove unnecessary quotation marks
2020-04-15 15:03:05 -04:00