Commit graph

1147 commits

Author SHA1 Message Date
Brunno Souza
00b9d0ea12
Refactoring ChatChannel - distributing into services (#9253) 2020-08-07 10:41:34 +02:00
Julianna Tetreault
5daf162629
[deploy] Update "/internal/badges" route to "/internal/badge_achievements" (#9643)
* Update /internal/badges route to be /internal/badges/award
  -Updates the route
  -Redirects the old route, /internal/badges, to the new route

* Updates the redirect in #award_badges to correct route
  -Updates #award_badges in Internal::Badges::Controller
   to account for the new route, /internal/badges/award

* Adjust route to be /internal/badges/award in admin_awards_badges_spec.rb

* Adjust URL to be /internal/badges/award in badges_spec.rb

* Replace /internal/badges/award with /internal/badge_achievements to follow convention
  -Updates the old route in routes.rb
  -Updates the old route in #award_badges in Internal::Badges::Controller
  -Updates the old route in admin_awards_badges_spec.rb
  -Updates the old route in badges_spec.rb
2020-08-06 09:58:19 -04:00
Ridhwana
fc86c30790
Profile Admin UI Setup Screen (v1) (#9610)
* Add ProfileField model

* Fix schema.rb

* Add service objects for base and link fields

* feat: show an index of profile fields and allow them to be edited

* Fix schema.rb

* Add service objects for base and link fields

* Add link fields to seeds

* Make placeholder a keyword argument

* Add work fields

* Add explanation column to profile fields

* Add coding fields

* Switch from inheritance to mixin

* Add email checkbox to base fields

* Add branding fields

* Add spec for ProfileFields::FieldDefinition

* chore: moved the migration file

* feat: add a create and destroy route

* feat: render a partial form

* fix: oops form instead of f

* Move migration back into correct location

* Rename column from explanation to description

* Rename attribute in mixin

* chore: update classed for buttons

* chore: rename from explanation to description

* chore: explanation to description

* chore: new profie field

* fix: only one submit button per form

* fix: update the form

* fix: remove files that got merged mistakenly

* chore: finally, some specs...

Co-authored-by: Michael Kohl <citizen428@dev.to>
2020-08-06 09:26:17 +02:00
Vaidehi Joshi
df990afadc
Conditionally remove no-cache from Fastly headers (#9631) [deploy]
* Rename FastlyHeaders to CachingHeaders, conditionally experiment with removing no-cache

We suspect that it is safe to remove `no-cache` entirely from the Cache-Control headers that are sent
along to Fastly, but there is no great way to confirm this hypothesis. We're testing this by experimenting
on one single article. We will conditionally default to the same headers that we send to Nginx, and send
those headers to Fastly (by removing `no-cache` and adding in `max-age`, which should be ignored since Fastly
also has Surrogate-Control headers added to it, which include a `max-age`, which Fastly should prioritize
over any other `max-age`.

Once we've confirmed that this doesn't cause issues on the Fastly side, we can remove this check and use
the same Cache-Control headers for both Fastly and Nginx.

* Add check for request.env[REQUEST_PATH].present?
2020-08-05 12:34:12 -07:00
Josh Puetz
427ea0b35a
Correct some lingering /admin paths (#9630) [deploy] 2020-08-04 13:16:17 -05:00
Molly Struve
94251c2f30
[deploy] Bug Fix:Redirect to Direct User Channel for Org Listings (#9616) 2020-08-04 10:37:15 -05:00
Josh Puetz
cda18d0aa4
[deploy] Move Admin interface paths (#9576)
* Move administrate to /resource_admin

* Test fixes

* Update docs
2020-08-03 08:49:23 -04:00
Ben Halpern
5e6a651a4f
[deploy] Award badges asynchronously in internal (#9582)
* Award badges asynchronously in internal

* Spec fixes

Co-authored-by: mstruve <mollylbs@gmail.com>
2020-07-31 19:09:51 -04:00
Michael Kohl
1a6c6acd45
[deploy] Activate Devise::Lockable (#9535) 2020-07-30 10:28:51 -04:00
Alberto Pérez de Rada Fiol
115adbb1bd
[deploy] Add index and show pages for series (#9201)
* Add index and show pages for series

* Address code review

* Use `id` instead of `slug` to get collections

* Extract `collection_link` into the application helper

* Only count published articles

* Get rid of the `collection_link_class` method

* Add tests

* Fix test

* Use `**kwargs` instead of `options = {}`
2020-07-29 10:01:52 -04:00
rhymes
5a2cae4fbb
Rubocop: enable and fix new Rails cops (#9537)
* Enable new Rails/* cops and use autocorrect on them

* Fixed Rails/PluckInWhere leftovers

* Fix Rails/DefaultScope

* Enable and fix Rails/PluckId

* Fix manual mistake with forcing autocorrection on Rails/PluckId

* Apply PR feedback to remove Rails/PluckId inline disables

* Apply PR feedback to get rid of Rails/PluckInWhere inline
2020-07-29 11:14:19 +02:00
Andy Zhao
a589529269
[deploy] Allow org admins to delete their organizations (#9357)
* Add destroy organization backend

* Add view for deleting org

* Add new line to end of file

* Refactor and move destroyable? to model

* Use a nice card to distinguish the message

* Prevent organizations from being deleted if they have credits

* Fix codeclimate issues

* Remove let_it_be_changeable for flakiness
2020-07-28 12:00:15 -04:00
Molly Struve
386c3e9fa7
[deploy] Optimization/Bug Fix:Only Send Mentioned User Notifications, not all for every message (#9493) 2020-07-27 11:16:41 -05:00
rhymes
0b4ad49cf8
Rubocop: Enable and fix Style/OptionHash (#9430)
* Enable and fix Style/OptionHash

* Add 10 seconds default timeout to DB statements
2020-07-25 10:41:21 +02:00
Jacob Herrington
b26919e79b
[deploy] Fix archived readinglist reactions affecting count (#9044)
* Fix archived readinglist reactions affecting count

The reading list count badge on the home page currently takes all
readinglist reactions into account, but we shouldn't be including those
that are marked "archived."

Secondarily this fixes a bug that affects only admin users: all
reactions created by admins were given the status "confirmed"
instead of the expected "valid" status.
2020-07-24 14:18:35 -05:00
Michael Kohl
96b0d7fa09
Make credit pricing configurable (#9326)
* Add credit prices to SiteConfig

* Add credit prices to /internal/config

* Fix spec and transform values on update
2020-07-24 12:03:13 -04:00
Molly Struve
cd22f395d3
[deploy] Optimization:Create message JSON once when Notifying Users (#9492) 2020-07-24 10:56:05 -05:00
Michael Kohl
8425c847c3
Update CODEOWNERS and team names in TODO comments (#9460)
* Update CODEOWNERS

* Update teams in TODO comments

* Remove mentions of team cool
2020-07-24 12:17:20 +07:00
Fernando Valverde
a9441add3d
[deploy] Redirect override (#9469) 2020-07-23 10:28:28 -04:00
Andy Zhao
9bdef4d4ae
[deploy] Update /ban for Connect (#9459)
* Rough MVP of /ban v2

* Make snackbar dismissable

* Make unban work

* Clean up response for happy and sad paths

* Fix tests

* Fix policy spec
2020-07-23 09:49:54 -04:00
Fernando Valverde
7eb27328bb
[deploy] Changes expiration of invitation links to 80h (#9449) 2020-07-22 12:22:32 -04:00
Molly Struve
91c6541f57
Bug Fix:Validate User Password Length is Between 8-100 characters (#9447) 2020-07-22 11:40:23 -04:00
Andy Zhao
32c413f182
[deploy] Default to adding users as members to a chat channel and not mods (#9446) 2020-07-22 10:51:44 -04:00
rhymes
88f0a0e58a
Rubocop: re-activate Style/RegexpLiteral and fix violations (#9418)
* Rubocop: re-activate Style/RegexpLiteral and fix violations

* Add 10 seconds default timeout to DB statements
2020-07-22 16:28:27 +02:00
Veggier
126367fa4a
Ability for admins to remove user from internal chat channels (#9235)
* change ui

* admins can remove users from internal chat channels

* rename destroy to remove_user

* change syntax

* add a single user

* remove a single user --debug

* remove a single user --debug

* remove a single user

* remove a single user

* remove a single user

* remove a single user

* add test for remove single user from internal chat_channel

* test

* sytax change

* add delete user for channel test

* add more test case for the remove user from chat channel

* change to single test case
2020-07-22 09:43:38 -04:00
narender2031
0cfc593150
[deploy] 🚀 Feature: Chat channel request manager (#9305)
* Feature 🚀 : Ability to delete messages in chat channels

- Sending message ID to frontend
- Deleting Message
- Use pusher to delete message realtime

* Minor Bug 🐞: Show message action only for current user

- User can delete or edit their own messages

* Test cases added

* Bug 🐞: Update message id for receiver

Message id was not sent to receiver by pusher

* Refactoring🛠: Message controller refactoring

* Test Cases📝 : Specs for Delete message added

* Feature 🚀 : Ability to edit messages

* Test Cases📝 : Specs for Edit message added

* Merge conflict resolved

* request manager info API

* 👨🏼‍🎨 Design added for requestCenter

* integrate request manager with API

* remove unused argument

* fix request manager card UI

* fix request card UI

* add request manager button

* handle no invitaion UI

* fix badge UI

* add request specs

* add jest specs

* remove the presenter

* fix code climate issues

* fix queries

* fix runbocop issues

* fix PR suggestions

* remove empty lines

Co-authored-by: Sarthak Sharma <7lovesharma7@gmail.com>
2020-07-22 09:12:09 -04:00
Michael Kohl
2fe4a36271
[deploy] Add audit logs for credit card actions (#9416)
* Add AuditLog entries for credit card actions

* Update docs

* Update category and slug

* Update audit log example in docs
2020-07-22 08:23:42 +07:00
Ben Halpern
1b22cdd1c9
[deploy] Change from presence to private pusher channels (#9401) 2020-07-20 12:59:26 -04:00
rhymes
6cd64c4071
Rubocop: enable and fix Style/Send and Style/Next (#9366)
* Enable and fix Style/Send

* Enable and fix Style/Next

* Fix private cookies send

* Fix merging indentation issues
2020-07-20 16:28:00 +02:00
Michael Kohl
a4dadfb728
Standardize ActiveRecord order clauses (#9395)
* Change simple order clauses

* Change nested order clauses
2020-07-20 10:00:51 -04:00
Michael Kohl
8dd4a85fba
Introduce domain model for campaigns (#9300)
* Introduce domain model for campaigns

* Move main_tag method to decorator

* Add options argument to decorator method

* Change more code to use Campaign domain model

* active? -> show_in_sidebar? and fix spec

* Switch back to leading dots after merge
2020-07-20 09:04:53 -04:00
Ridhwana
4359d5b09a
[deploy] Site Config: Get Started Section and Show Required Fields (#9289)
* chore: spike

* fix: update doesnt get to symbol

* spelling

* chore: some suggestions

* chore: change name

* chore: content tag and safe join

* chore: keep this open for now

* chore: code climate

* more code climate stuff

* chore: remove commas

* fix: tests

* feat: update the descriptions and placeholders

* chore: update all the variables

* chore: update lines

* feat: update ""

* chore: length line

* feat: content_tag

* chore: disable rubocop:disable Rails/OutputSafety

* feat: collapse the get started section if everything is filled out

* chore: comment

* some cleanup

* codeclimate :(
2020-07-20 08:20:15 -04:00
Sarthak Sharma
3addb64326
[deploy] 🚀 Feature: Chat channel membership manager component (#8945)
* Feature 🚀 : Ability to delete messages in chat channels

- Sending message ID to frontend
- Deleting Message
- Use pusher to delete message realtime

* Minor Bug 🐞: Show message action only for current user

- User can delete or edit their own messages

* Test cases added

* Bug 🐞: Update message id for receiver

Message id was not sent to receiver by pusher

* Refactoring🛠: Message controller refactoring

* Test Cases📝 : Specs for Delete message added

* Feature 🚀 : Ability to edit messages

* Test Cases📝 : Specs for Edit message added

* Merge conflict resolved

* fix video content issue

* add UI for membership management

* add api to update memberahip role

* add methods for manage membership

* Add integration test cases

* add emoji for admin

* Open member profile in sidecar only

* 🐞 Problem with direct channel sidecar

* 🐞 Few other UI enhancements

* fix mod typo

* add limit upto 4 for display active memberships

* fix UI issues

* fix action ui for membership

* fix sidebar redirection issue

* fix svg buttons

* add test cases

* fixed broken spec

* fix PR suggestions

* remove not used code

* fix typo

* fix PR suggestion

* fix typos

* add invitation url expiry

* fix specs

* fix PR suggestions

* removed unused gem

* remove presenter format

* handle invitation link expiry with redis

* fix PR suggestions

* user can view non-discoverable channel invitation link

* fix typos

* remove commented code

* add spacing

* PR suggestions

* remove class from button

* replace componentDidMount with commen function

* remove action button for single membership

* add chat message on update role

* add spece between lines

Co-authored-by: Narender Singh <narender2031@gmail.com>
Co-authored-by: Fernando Valverde <fdov88@gmail.com>
2020-07-20 08:08:31 -04:00
Molly Struve
62d43a1ce7
[deploy] Refactor: Remove Block Model and All Related Code (#9370) 2020-07-17 15:32:39 -05:00
benhalpern
b564592a4e Fix test typo 2020-07-17 13:38:47 -04:00
rhymes
696c712883
Rubocop: routine fixes (#9345)
* rubocop -A

* Fix Style/HashLikeCase

* regenerated todo file
2020-07-16 18:18:13 +02:00
narender2031
2a5f5053b7
[deploy] Fix non channel details visible (#9252)
* Feature 🚀 : Ability to delete messages in chat channels

- Sending message ID to frontend
- Deleting Message
- Use pusher to delete message realtime

* Minor Bug 🐞: Show message action only for current user

- User can delete or edit their own messages

* Test cases added

* Bug 🐞: Update message id for receiver

Message id was not sent to receiver by pusher

* Refactoring🛠: Message controller refactoring

* Test Cases📝 : Specs for Delete message added

* Feature 🚀 : Ability to edit messages

* Test Cases📝 : Specs for Edit message added

* Merge conflict resolved

* fix pending invitation issue

* non active member blocked to open channel details

* add specs for bug fix

Co-authored-by: Sarthak Sharma <7lovesharma7@gmail.com>
2020-07-16 09:28:28 -06:00
benhalpern
b611a9847a Enable public or private forem config 2020-07-16 09:58:00 -04:00
rhymes
f1ec04a0c9
Rubocop: move dot in multi-line calls to leading position (#9262) 2020-07-16 15:51:11 +02:00
Alex
204fb51f14
[deploy] Remove path redirects (#9350)
* Remove path_redirect menu item

* Remove path_redirects_controller

* Remove path_redirect routes

* Remove PathRedirect model

* Remove internal views

* Remove path_redirects from seed file

* Remove PathRedirect factory

* Remove specs

* Migration to drop table and update schema
2020-07-16 09:35:42 -04:00
benhalpern
98242dc68b Initial work 2020-07-16 06:59:20 -04:00
Arit Amana
a78ccf2310
[deploy] [ModCenter] Fix "FlagUser" Modal functionality (#8995)
* Make FlagUserModal show up on click

* Explain extra div

* Make sure "Vomit All" reaction fires accurately

* Make test-file comment clearer

* Fix bug when 2 articles are open and the FlagUser modal does not open for the first article

* Still working it out ...

* Tests broken; need help

* Get rid of debugging alerts

* Fixed broken tests for <SingleArticle />

* Write tests for ModerationArticles component

* Complete tests for ModerationArticles component

* Employ safer Preact testing techniques

* Query all articles using "data-testid"

* Revert changes

* Got it working with portals for non-iframe implementation.

* wip tests

* Got mod tools flag user modal wprking on article page again.

* Added some documentation the code.

* Now confirm is disabled until you select an item in the flag user modal.

* Revert "wip tests"

This reverts commit fb7a0825039fd377cad04d9dedad9d1146b03978.

* test prep

* Fixed broken test.

* Refactored to use useRef hook.

* Rename a variable

* remove unnecessary comments

Co-authored-by: Nick Taylor <nick@dev.to>
2020-07-15 13:54:52 -04:00
Ben Halpern
da6a6739e5
[deploy] Invite users to join and create password (#9294)
* Initial invitation work

* Add more invitation code

* Add proper registration page

* Fix up tests

* Fix failings

* Fix spec

* Add self-serve auth config

* Add registered condition

* Change profile image call and registered_at test

* Change comment

* Fix copy test

* Stub emojipedia

* Linting

* Add registered at to factory

* Ensure registered for user tag

* Update app/views/internal/invitations/index.html.erb

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

* Update app/controllers/internal/invitations_controller.rb

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

* Slight changes

* Update recover password flow

* Update app/views/internal/invitations/index.html.erb

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

* Update app/controllers/internal/invitations_controller.rb

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

* Update db/schema.rb

Co-authored-by: Michael Kohl <citizen428@dev.to>
2020-07-15 11:37:19 -04:00
Ben Halpern
70a060b71c
[deploy] Make sidebar sponsor headline configurable (#9251)
* Make sidebar sponsor headline configurable

* Fix spec

* Fix spec typo
2020-07-14 20:18:59 -04:00
rhymes
1166370818
Rubocop: activate Layout/ClassStructure (#9304) 2020-07-14 18:28:18 +02:00
rhymes
3ab9b91575
Routine Rubocop fixes (#9302)
* rubocop -A

* rubocop --auto-gen-config

* Fix sorting in Bundler/OrderedGems to consider punctuation
2020-07-14 17:24:03 +02:00
Brunno Souza
b5de27f1a6
Refactoring comments_controller#create reducing lines (#9162) 2020-07-10 17:24:36 +02:00
rhymes
3722355e8c
Rubocop: fix Metrics/CyclomaticComplexity and disable Metrics/AbcSize (#9221)
* Fix Metrics/CyclomaticComplexity

* Disable Metrics/AbcSize

* Refactored Articles::Builder a bit
2020-07-10 15:26:05 +02:00
Molly Struve
fad259b1c8
[deploy] Bug Fix: Remove Rails Validation for Follow Uniqueness, Guard against dup Follow Jobs (#9222) 2020-07-09 09:50:06 -05:00
rhymes
ffc96db209
Rubocop: fix additional violations in todo file (#9218) 2020-07-09 10:25:44 -04:00