Commit graph

1984 commits

Author SHA1 Message Date
Michael Kohl
d284e597cd
[deploy] Add Profiles::Update service object (#9912)
* Add Profiles::Update service object

* Refactor

* Rename Profile.fields to Profile.attributes

* Keep sync from user -> profile

* And and update comments

* Rename Profile.refresh_store_accessors!

* Make forwarding getters in user dynamic

* Add more explanation

* Fix typo

* Update service object

* Fix return value

* Fix specs

* Travis, let's be friends again?

* Remove Travis change

* Add require_dependency in Profile

* Refactor

* More refactoring

* Avoid double sync

* Fix specs

* Fix mapped attributes sync
2020-09-03 09:19:25 -04:00
Michael Kohl
adbdbb9789
Add ProfileFieldGroupsController to API (#10124) 2020-09-03 10:12:53 +07:00
Arit Amana
b79766f697
[deploy] [Admin Tooling] Allow admins unpublish articles from the Mod Actions Panel (#10038) 2020-09-02 16:08:08 -05:00
Molly Struve
83d44401f5
[deploy] Index Reaction created_at Timestamp (#10142) 2020-09-02 12:56:33 -05:00
Molly Struve
34593b7ec3
[deploy] Optimization:Select Article Columns for Digest Email, Limit 6, Use User Attributes (#10147) 2020-09-02 11:31:43 -05:00
Fernando Valverde
ada2d0c728
[deploy] Extracts DisplayAds from Administrate into admin (#10153)
* Extracts DisplayAds from Administrate into admin

* Suggested changes
2020-09-02 09:28:22 -06:00
Ridhwana
3474ffda6d
Profile Admin updates (#10133)
* feat: cater for when there are no profile fields in a group

* feat: add a modal to create a new group

* feat: add a controller and route for the group

* refactor: add group modal

* feat: edit a group

* chore: remove an instance var

* chore: toggle the section using a toggle button

* feat: add the edit button

* chore: update the messaging

* chore: update the class name

* feat: delete the group

* chore: add some css

* chore: use group_name

* chore: rename the file and add the group select to the file

* feat: render the correct partial and add the profile_field_group_id

* feat: add a profile field

* feat: amend the styles on the card header

* feat: add a cursor pointer

* feat: get the form to redirect after an update

* chore:  remove style

* feat: order by created at so that each time we save the order doesn't change

* fix: change the form

* chore: format the options

* feat: show ungrouped fields at the bottom

* feat: add the profile fields length

* chore: remove unused action

* test: add some specs for profile group workflow

* fix: oops

* refactor: grouped profile fields

* refactor: amend the styles

* chore: rename methods

* chore: update headings

* chore: remove changes from my linter

* refactor: suggestions by Michael - upgrade ternary

* refactor: order by name and label
2020-09-02 12:32:25 +02:00
Michael Kohl
f023c6174f
[deploy] Add data update script for profile fields (#10119) 2020-09-02 09:54:04 +07:00
Molly Struve
b60c6c687c
Flaky Spec Fix:(Attempt)Ensure Article Suggester Count is Consistent (#10146) 2020-09-01 20:27:46 -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
23cee97d0a
Fix Flaky Runkit system spec (#10148) 2020-09-01 19:22:12 -04:00
Mac Siri
ab81f36a38
[deploy] Migrate ProfileImage to Images::Profile (#10055) 2020-09-01 17:16:03 -04:00
Molly Struve
79b00d4960
[deploy] Optimization:Throttle Noisy Honeycomb Events More (#10143) 2020-09-01 15:21:07 -05:00
Diogo Osório
a5e7b1cf60
Rely on error types to determine when a repo should be removed on the RepoSyncWorker (#10131)
* Registers the Github AcocuntSuspended & RepositoryUnavailable errors

Adds the above-mentioned errors to the list of known errors raised by
Octokit as to make possible for the rest of the application to
specifically trap those.

* Makes the RepoSyncWorker error handling rely on types

The current implementation attempted to parse the error message to
determine if the error reported by Github's API can/should be handled,
this commit changes the implementation so that the exception type is
used instead.
2020-09-01 15:01:23 -04:00
Andy Zhao
0b849341e0
Remove ghostify from app (#10139)
* Remove ghostify from app

* Remove unused ghostify specs
2020-09-01 13:39:39 -04:00
Ben Halpern
7b5bc89b7c
Allow admins to set brand color (#10097)
* Allow admins to set brand color

* Remove extra line

* Fix linting

* Update app/controllers/admin/configs_controller.rb

Co-authored-by: Michael Kohl <citizen428@dev.to>

* Move wcag compare to own class

* Remove unnecessary spacing

Co-authored-by: Michael Kohl <citizen428@dev.to>
2020-09-01 11:16:31 +02:00
Molly Struve
31acf735cb
Comment out Flaky Reaction Search Sort Spec (#10118) 2020-08-31 19:16:45 -04:00
Lisa Sy
54c071856e
[deploy] Update top-header for logged-out user (#9874)
* Create first start at desktop top header updates

* Update mobile styling of top header

* Stylize sign in widget card

* Update nav menu and top bar

* Changes based on user being logged-in or not

* Uses user_signed_in? on top nav bar

* Fix lingering old cloudinary helper method

* Trigger CI

* Fixes specs

* Adds redirect_using_referer_spec, fixes other specs & cleanup

* Adds nav-menu.scss to layouts/_styles.html.erb for inline & small edit in referer check

* Remove logged-out styles to make it more uniform with logged in

* Remove nav-menu.scss file

* cleanup markup and JS a little

* Fixes FB auth specs to new login links

* Makes sure unauthenticated /new redirects back to editor

* CI fix Sing in with -> Continue with

* Update db/schema.rb

* Update db/schema.rb

* Update db/schema.rb

Co-authored-by: Fernando Valverde <fdov88@gmail.com>
Co-authored-by: ludwiczakpawel <ludwiczakpawel@gmail.com>
Co-authored-by: Ben Halpern <bendhalpern@gmail.com>
2020-08-31 18:12:22 -04:00
Ben Halpern
7ba7d9fc46
Add logic for asking for FOREM_OWNER_SECRET to be present on first user sign up if set by system (#10108)
* Add logic for requiring FOREM_OWNER_SECRET to be present

* Fix test logic
2020-08-31 16:41:30 -04:00
Molly Struve
667f3c9edf
[deploy] Refactor:Email Digest Sending Logic (#10107) 2020-08-31 14:28:55 -05:00
Diogo Osório
4b8a725681
Fixes brakeman open redirect warnings at pages_controller (#10095)
When redirecting to the welcome, challenge and checkin articles,
breakman was complaining about a potential open redirect vulnerability
due to the fact that the redirect URL comes from a string stored in the
database.

This commit silences breakman by explicitly parsing the database article
path (via `URI.parse`) and explicitly stating that only the `path`
portion of the URI is to be used (== in an unlikely event of an absolute
URI pops up from the db record, the user-agent will still be instructed
to be redirected to a page under the app's domain).
2020-08-31 13:39:04 -04:00
Lisa Sy
5ff2ad7437
Update main authentication view to improve visual design (#9856) [deploy]
* Update mobile version of /new registration view

* Optimize styles for desktop view

* Fix typo

* Fix typo

* Add twemojis in footer area

* Update messaging to fulfill all intents

* cache

* cache

* hr-label fix on mobile

* hr-label fix on mobile

* crayons for checkbox

* crayons for checkbox

* remove old styles

* move signin to appropriate folder

* Remove schema changes

* Fix registraction specs and hide password hint for no SSO enabled

* Disable email hint for password reset page

* Fix specs

* Revert "Disable email hint for password reset page"

This reverts commit b33a6dda4c13534541294281f83f7ad5a4864c0d.

* Transfer User.registered.estimated_count to the controller

* Fix import path

Co-authored-by: ludwiczakpawel <ludwiczakpawel@gmail.com>
Co-authored-by: rhymes <rhymes@hey.com>
2020-08-31 09:55:27 -07:00
Ben Halpern
dba151915b
[deploy] Allow initial user to sign up and configure app (#10073)
* Allow initial user to sign up and configure app

* Fix added value unneeded

* Make siteconfig public in tests

* Remove deprecated method and adjust seed default

* Add new controllers not to redirect for public

* Modify tests

* Edit test defaults

* Fix linting

* Add starter mode to seed file
2020-08-31 12:54:22 -04:00
Molly Struve
0b8df875da
[deploy] Bug Fix:Destroy GithubRepos with Suspended or Blocked Access (#10103) 2020-08-31 11:32:15 -05:00
ludwiczakpawel
8ec4044f3e
[deploy] Adding Crayons to Admin (#10015)
* layout

* user

* config

* header

* badges, badge_achievements, layout

* broadcasts

* chat channels

* comments.. not much really

* Events

* growth

* listings

* mod actions

* mods

* orgs

* pages

* permissions

* podcasts

* reactions

* profile fields

* reports

* response templates

* tools

* users

* Secrets

* webhooks

* welcome threads

* .

* internal

* css fix

* .

* main element elsewhere

* scope

* bring back some of the old styling

* .

* .

* .

* notice

* Revert schema.db

* add alert

* little fixes

* profile fields

* Update schema.rb

* closing span

* another span

* Fixed broken admin specs.

Co-authored-by: Nick Taylor <nick@dev.to>
2020-08-31 10:29:06 -04:00
rhymes
1a147a3176
[deploy] Add missing foreign keys to models related to users (#10018)
* Add missing foreign keys to models related to users

* Fix specs

* Change FK for page_views and rating_votes to nullify

* Improve rating vote validation and fix Users::Delete specs

* Revert "Spec Fix:Nullify Rating Votes when Deleting Users (#10071)"

This reverts commit 12dfe4ab3b.
2020-08-31 15:39:57 +02:00
dependabot-preview[bot]
914f274b2f
Bump shoulda-matchers from 4.3.0 to 4.4.1 (#10077) 2020-08-31 09:31:08 -04:00
Rafi
84012d400d
Deleting hidden comment notification using after_update (#9823)
* Deleting comment notification using after_update

* Using conditional callback to delete notification

* Adding tests for notification deletion
2020-08-31 11:01:25 +02:00
Michael Kohl
cfe288d8cc
[deploy] Start ignoring group column for profile fields (#10045)
* Start ignoring group column for profile fields

* Fix specs

Co-authored-by: mstruve <mollylbs@gmail.com>
2020-08-31 10:16:37 +07:00
Molly Struve
4bf5b858f9
[deploy] Bug Fix:Run Individual Digest Workers inline for DEV (#10070) 2020-08-29 09:25:54 -05:00
Molly Struve
12dfe4ab3b
Spec Fix:Nullify Rating Votes when Deleting Users (#10071) 2020-08-29 09:00:33 -05:00
Molly Struve
4ab5bf5255
[deploy] Feature:Add Ability to Run RssReader via Sidekiq Cron, Prevent for DEV (#10066) 2020-08-28 14:57:22 -05:00
Molly Struve
8a44eb9421
[deploy] Refactor:Cleanup Naming and Optimize Email Digest Code (#10054) 2020-08-28 13:36:11 -05:00
rhymes
ba8b3dd443
[deploy] Add missing dependent clauses to User and cleanup relations (#10011)
* Add dependent: :destroy relation to user.notes

* Add cleanup script for orphaned notes

* Reorder relations and reorganize specs in User

* Update specs as notes are not needed after a user is deleted

* Tweets can just be nullified

* Add other cleanup scripts

* Tell the specs we keep tweets

* Fix comments

* Keep page_views and rating_votes when a user is deleted

* Fix specs
2020-08-28 20:19:24 +02:00
Molly Struve
4786cbddfc
[deploy] Optimization:Dont Send Multiple Digest Emails in a Day (#10042) 2020-08-28 12:25:32 -05:00
rhymes
c9e401758a
[deploy] Add dependent clauses to Article and fix Comment validation (#9990)
* Add dependent clauses to Article model

* Comment should be valid without a commentable

* Add cleanup scripts

* Cache the comments ids before destroying the article

* Add dependent clause to Article.user_subscriptions as well

* Fix specs
2020-08-28 18:24:28 +02:00
Ben Halpern
239629c1de
[deploy] Grant admin permissions through the UI (part 1) (#9656)
* Grant permissions through the UI

* Update app/services/moderator/manage_activity_and_roles.rb

Co-authored-by: Michael Kohl <citizen428@dev.to>

* Make roles into constants

* Swap internal and admin

* Improve UI, remove hack

* Fix link

* Remove unused internal file

* Modify registrations controller

* A bit of progress

* More work

* a bit pf progress on confirmation emails

* Get basic functionality in place

* Remove comments

* First basic test

* Add tests

* Fix code styles

* Remove sessions spec

* Remove sessions spec

* Remove extra markup

* Fix base role

* Add Resource Admin Config

* Fix indentation issue

Co-authored-by: Michael Kohl <citizen428@dev.to>
2020-08-28 11:57:06 -04:00
Ben Halpern
0dd04ea45a
Create initial "register by email and password" beta/MVP in prep for "setup mode" (#10039)
* Modify registrations controller

* A bit of progress

* More work

* a bit pf progress on confirmation emails

* Get basic functionality in place

* Remove comments

* First basic test

* Add tests

* Fix code styles

* Remove sessions spec

* Remove sessions spec

* Remove extra markup
2020-08-28 09:46:56 -04:00
Molly Struve
cd1db855b6
[deploy] Optimization:Break Send User Digest Emails in Single Jobs (#10043) 2020-08-28 06:37:27 -05:00
Michael Kohl
161ed7d55e
[deploy] Introduce ProfileFieldGroup model (#10007)
* Introduce ProfileFieldGroup model

* Make profile_fields_groups name column unique

* Fix some specs

* feat: allow the page to work again

* Add guard clause to data update script

* Remove unused file

* Fix specs

* Add foreign key

Co-authored-by: Ridhwana <ridhwana.khan16@gmail.com>
2020-08-28 10:51:33 +07:00
Molly Struve
a7928838f4
[deploy] Optimization:Break Github Repo Updates into Individual Sidekiq Jobs (#10040) 2020-08-27 16:01:36 -05:00
rhymes
56f1f2d777
[deploy] Set UserSubscription sourceable columns to nullable (#10033)
* Set UserSubscription sourceable columns to nullable

* Fix spec
2020-08-27 16:25:48 +02:00
Jacob Herrington
5496ac5b83
Make confirmation text a required field (#10014)
* Make confirmation text a required field

* Use strong params to check if confirmation param is present

* Require config confirmation text to match pattern
2020-08-26 19:59:41 -04:00
Nick Taylor
6f86573dbf
Removed the autoprefixer-rails deprecated gem (#10017)
Co-authored-by: Mac Siri <krairit.siri@gmail.com>
2020-08-26 17:38:24 -04:00
Jacob Herrington
2c645c9ace
Allow greater flexibility for footer mascot image (#10004)
* Allow greater flexibility for footer mascot image

This change allows admins to set a footer mascot image of any dimension
and manage the forced dimensions in their site config options.

* Update site config copy based on PR feedback
2020-08-26 12:33:52 -04:00
Josh Puetz
d47d02f090
[deploy] Log in with Facebook (#9922)
* First draft of facebook auth

* Add Facebook welcome broadcast to seeds, data script

* Tests!

* Documentation

* Update docs with pictures

* User siteconfig/app config

* Adjust dropdown menu width to avoid wrap for Facebook button

* Add Facebook auth keys to SiteConfig properly

* Remove unnecessary VCR cassette

* Add omniauth facebook gem to vendor cache

* Use uid instead of email for nickname randomization

* Test fix, test for missing email in Facebook

* Update docs/backend/auth-facebook.md

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

* Typo fix!

* Don't default facebook auth settings to ApplicationConfig

Co-authored-by: Molly Struve <mollylbs@gmail.com>
2020-08-26 12:04:20 -04:00
Ben Halpern
bd6a996bce
[deploy] Remove AWS SDK and private endpoints completely (#9978)
* Initial work to remove aws_sdk

* More work

* Add tests

* Typos and cleanup

* Fixed typo and misc

* Fix test typos

* Update spec

* Remove functioncaller code

* Add comment to bump tests :)

* Fix spaminess calc
2020-08-26 10:30:31 -04:00
Mac Siri
bed641f6aa
Refactor optimizer_spec (#10002) 2020-08-26 09:52:22 -04:00
Jacob Herrington
bd78ba4c2c
[deploy] Add missing configs controller params for rate limiting (#10003) 2020-08-26 07:00:50 -05:00
Mac Siri
b5be5990e4
[deploy] Expand Images::Optimizer to support imgproxy (#9909)
* Create _comment.html.erb spec

* Add imgproxy.rb

* Setup imgproxy MVP

* Expand Images::Optimizer to support imgproxy

* Enable imgproxy in dashboards/show WIP

* Create view spec

* Fix typo

* Also check for Imgproxy.config.endpoint

* Use ApplicationConfig instead of ENV

* Update Images::Optimizer#call
2020-08-25 16:00:40 -04:00