Commit graph

11 commits

Author SHA1 Message Date
Julianna Tetreault
426d3191e8
Add a Broadcast Show View (#8769) [deploy]
* Add #show to the Broadcasts::Controller and to routes.rb
  - Adds a show method to the Broadcasts Controller
  - Adds a show route to routes.rb

* Add a show view for Broadcasts
  - Adds show.html.erb to /internal/broadcasts
  - Repurposes code from index.html.erb for show view
  - Repurposes code from edit.html.erb for show view

* Rewrite /internal/broadcasts index to use a table
  - Formats /internal/broadcasts with a table
  - Removes on-hover functionality from show.html.erb

* Refactor Broadcast resources in routes.rb

* Redirect to #show on create and update for Broadcasts

* Add the Destroy Broadcast button to the Broadcast show view

* Remove style preventing Broadcast preview

* Add Broadcast styling back and add display: block to stylesheet

* Add display: flex to .broadcast-wrapper in layout.scss

* Remove superfluous slashes from opening tags
2020-06-18 15:51:45 -06:00
Vaidehi Joshi
d37e54a6a0
Refactor BroadcastsController (#8416) [deploy]
* Refactor BroadcastsController

* Prefer find to find_by when searching with just id
2020-06-11 12:01:54 -07:00
Vaidehi Joshi
defab11a4d
Provide default crayon styles when creating banners (#8361) [deploy]
* Provide default crayon styles when creating banners

* Import crayons styles into /internal pages.
* Allow admins to use crayons banner styles when creating broadcasts.
* Preview banner styles with crayons.

* Use constant and helper for broadcast banner styles

* Add VALID_BANNER_STYLES frozen constant to Broadcast class.
* Add banner_style helper for determining banner style class.
2020-06-09 11:26:14 -07:00
Julianna Tetreault
d2d46c5f47
Allow Admins to Delete Broadcasts (#8258) [deploy]
* Add #destroy to Broadcasts::Controller and destroy route to routes.rb
  * Adds destroy method w/ corresponding flash messages to controller
  * Adds destroy route to Broadcast routes in routes.rb

* Add destroy button to internal/broadcasts edit view
  * Adds destroy action to broadcasts/edit.html.erb
  * Adds deletion confirmation to broadcasts/edit.html.erb

* Add tests around deleting broadcasts in broadcasts_spec.rb

* Adjust #destroy in Broadcasts::Controller to be a conditional

* Add an exclamation point to #destroyin Broadcasts::Controller
2020-06-03 15:15:27 -06:00
Vaidehi Joshi
a4be185720
Leverage announcement broadcasts (#8150) [deploy]
* Differentiate between welcome + announcement broadcasts

* Allow admins to filter between these two types in the `/internal/broadcasts` UI.
* Ensure that the index endpoint fetches the correct Broadcast models.

* Only allow one Announcement broadcast to be created at a time

* Also add some `announcement` and `welcome` scopes on the `Broadcast` class.
* Add flash[:success] messages in BroadcastsController.

* Add some tests for Announcement broadcast validations

* Remove unused active_announcement_params method

* Order Broadcasts by title, optimization improvements

* Fix missing closing tags in broadcast specs
2020-05-29 11:38:41 -07:00
Vaidehi Joshi
3bc0f49861
Only send notifications that belong to an active broadcast (#6319) [deploy]
* Use active in place of sent on internal broadcast routes

* Add and use active scope on broadcasts

* Update seeds + specs to use active broadcasts

* Add note about active broadcasts to /internal/broadcasts page
2020-02-27 08:02:45 -08:00
Vaidehi Joshi
e84dec1db6
Allow broadcasts to be created from internal/broadcast (#5908) [deploy]
Also raise errors when necessary in all broadcast endpoints.
Clean up tests and add specs for POST /internal/broadcast
2020-02-04 15:57:17 -08:00
Mac Siri
d976eb7ab6 Create InternalPolicy (#4380)
* Ensure verify_authorized in internal

* Create internal_policy

* Replace ArticlePolicy usage with InternalPolicy

* Replace BufferUpdate&CommentPolicy with InternalPolicy

* Remove verbose authorize_admin

* Forgot to remove coresponding specs

* Create specs for InternalPolicy

* Expand policy access on internal's broadcast

* Refactor

* Create shared spec

* Create request specs

* Add additional test cases
2019-10-17 14:21:43 -04:00
Edem Attikese
0ad8cd9eab Edem/improvements/pundit coverage (#498)
* added organization policy + spec

* user specs for is_org_admin?

* added authroize to organization controller

* admin policy + specs

* deleted enforce admin due to pundit policy redundancy

* applied admin policy to entire admin namespace

* refactoring analytics controller WIP - wanna test codeship

* Add protection against reactions to unpublished articles (#473)

* Add chat channel policy and spec (#474)

* Add comment policy and specs (#475)

* Fix edge case with apostrophes

* Add comment policy and specs

* Add login for deleting comment spec

* Change test to raise pundit error instead of 404

* Clean up comment destroy request specs

* Remove redundant raise

* Whitelist columns on to_json call (#477)

* Add pundit policy for several controllers (#476)

* Add pundit policy for several controllers

* Adjust video spec

* Fix tag request specs

* Add proper twilio tokens request specs

* Remove puts statements

* Add a couple basic request specs (#478)

* Add a few tests and fix user tag color bug (#482)

* Refactor handle_tag_index in stories_controller (#481)

* Modify valid_request_origin? (#483)

* Add misc specs and remove banned attribute from user model (#484)

*  Fix missing Cloudinary tags and misc specs (#486)

* removing current_user_is_admin? to use .is_admin? method

* added missing org policy routes

* Add comment for all public controllers

* Fix edge case for test

* Authorize mod controller and add specs

* Refactor methods via inheritance and use only super_admin role

* Create policy method for analytics via article_policy and refactor

* Capitalize all buttons in dashboard page

* Fix org tests and remove old admin test

* Use only happy path for analytics

* Fix tests to use Pundit error

* Update org_policy spec
2018-06-28 09:38:20 -04:00
Ben Halpern
9381a17cf2
Move readinglist trigger JS (#67)
* Remove verify_auth_token skips

* Move readinglist trigger JS

* Remove unneeded logs and add check for referer in cromulent
2018-03-09 21:44:07 -08:00
Mac Siri
301c6080e3 Initial commit 2018-02-28 16:11:08 -05:00