Commit graph

1291 commits

Author SHA1 Message Date
ludwiczakpawel
184e56f216
Buttons Group (#6946)
* crayons-btn-group + crayons-btn--icon-alone

* typos

* better padding on outlined buttons

* make ooutlined button border a variable

* hey, pawel - how about not being an idiot??
2020-03-30 15:19:58 +02:00
Ben Halpern
d0a5c93684
[deploy] Fix fragment caching bug for SEO tag pagination. (#6917)
* Fix pagination caching and adjust logic

* Adjust range logic
2020-03-27 13:23:54 -04:00
Anna Buianova
ad26176828
Removed unused pages code (#6908) 2020-03-27 13:22:40 -04:00
Ben Halpern
e35d55c422
Add pagination to tag pages for better SEO crawling (#6771) [deploy]
* Add pagination to tag pages for better SEO crawling

* Modify system specs

* Add some tests

* Finalize tests

* Fix things up

* Add url helpers
2020-03-27 10:34:42 -04:00
Jacob Herrington
38d56542eb
[deploy] Moderator and admin actions log (#6797)
* Add audit logging for negative reactions

This change saves requests that create negative reactions to the audit
log. We need to be monitoring admin and moderator actions throughout the
app to increase visiblity on how our tools are being used and identify
abuse.

Additionally, this will help east concerns about giving elevated users
more powerful tools.

* Add a basic UI for moderator audit logs

* Log experience level ratings

* Log tag adjustments

* UI tweaks for moderator actions log

* Add logging to internal reactions controller

* Add logging for admin actions on users and articles

* Add searching to the moderator actions table

* Move audit instrumentation out of concern

We are able to use a PORO here instead of using a Rails concern. Moving
this also makes syntax to audit something quite a bit more explicit and
obvious to future developers

* Change moderator logs pagination page length

* Move auditing to after action filters

* Add moderator actions to the internal navbar

* Add request spec for internal moderator actions

* Use request params to populate AuditLog slug
2020-03-26 16:59:24 -05:00
Ben Halpern
320c92c759
Further restrict config read permissions (#6880) [deploy] 2020-03-26 17:37:39 -04:00
Vaidehi Joshi
0cac312f32
Use dynamic community name rather than hardcoding "DEV" (#6893) 2020-03-26 15:38:49 -04:00
Andy Zhao
1a989bef07
[deploy] Add response templates to user settings (#6823)
* Add response templates controller, routes, and view

* Add response templates settings page

* Remove dead code

* Use proper variable oops

* Use proper indentation

* Use before action for checking current_user

* Remove index action temporarily

* Use url helpers for redirects

* Use form_with over form_tag and form_for

* Persist previous content if edit fails

* Use exists for performance

* Remove index spec and add CRUD specs

* Memoize @response_template

* Use workaround for sad paths b/c render doesn't work

* Refactor and extract permitted_attributes into var

* Use present over exists to preload into memory

* Use last over first

* Lint for codeclimate

* Use two redirects for happy and sad create path

* Remove proper index route oops

* Codeclimate comma sigh
2020-03-26 14:48:00 -04:00
Vaidehi Joshi
c12cea9b02
Allow users to opt-out of welcome notifications (#6852) [deploy]
* Update some test descriptions in notifications_spec

The descriptions of these tests didn't actually match the test's assertions!

* Add welcome_notifications column to users table

Also ensures that welcome_notifications cannot be set to `nil`.

* Show an opt-out message for Welcome broadcast notifications

* Add opt-out link to notifications + welcome notification box to settings

* Allow welcome notification subscription to be updated

* Add tests for unsubscribed to welcome notification users

Also refactor generator specs a bit.

* Fix up paths, copy, tests

Use rails path helpers instead of hardcoding paths. Improve copy in a few locations.
2020-03-26 11:26:19 -07:00
ludwiczakpawel
209c01037a
Crayons'ifizing Header (#6780) [deploy]
* add tons of colors

* add tons of colors

* moving cheese around and prepping for new theming system

* documenting

* .

* moving theme code to own files

* replacing some variables

* whitespaces

* replacing another batch of variables

* get rid of another variable

* replace loading animation variable with one-fits-all-sizes

* get rid of theme-anchor-color

* remove code colors variables

* another batch of variables replaced

* mostly bringing in variables for haxor theme

* remove invert-image variable for chat

* remove another inver-image variable

* forgot to remove reaction-background variable

* remove border variable

* series

* .

* remove another variable

* remove another variable..

* another batch of variables

* and more...

* header updates

* i forgot to commits things in my PR....

* fix border

* .

* simplifyuing placeholder

* responsiveness

* responsive

* search fix

* fixing prefix-less classes

* increase clickable area

* small style updates for pink theme

* tests

* Fix test

* responsive dropdown

* tiny fixes

* generator rewritten

* dropdown reworked a little

* adjustments

* fix pwa

Co-authored-by: rhymes <rhymesete@gmail.com>
2020-03-26 12:21:53 -04:00
rhymes
cfb64a1c68
Add URL module and article_url, user_url helpers (#6833)
* Add AppURL with .article and .user

* Use URL.url and URL.user

* Add article_url and user_url helpers
2020-03-25 13:54:45 -04:00
Molly Struve
94c7bd3a95
return default aspect ratio of 1 if gif id is not present and refactor (#6837) [deploy] 2020-03-25 11:21:47 -05:00
Molly Struve
7724500bc5
notify honeybadger of js error when it occurs selecting a theme template (#6832) [deploy] 2020-03-25 09:28:42 -05:00
Jacob Herrington
c673b2bb6d
Internal: Add a table for negative reactions (#6751) [deploy]
* Add a table for moderator reactions

This is a simplified version of a feature that should be fleshed out
in the near future.

Despite the fact that this project is taking a new direction, I think
this table could be useful in the meantime.

* Add specs for internal mod actions view

* Rename mod actions to negative reactions
2020-03-24 16:08:24 -04:00
Ben Halpern
ba18f8e481
Include crayons style tag on pages that load direct from css (#6816) 2020-03-24 13:17:54 -04:00
ludwiczakpawel
2671a799b4
[deploy] Responsiveness & Crayons.css (#6814) 2020-03-24 12:56:09 -04:00
Molly Struve
93e1a19a4d
only show link to original commentable if it exists (#6810) [deploy] 2020-03-24 10:13:41 -05:00
Ben Halpern
513cf8081a
Add base imports before other inline styles (#6809) [deploy]
* Add base imports before other inline styles

* Remove base reset
2020-03-24 10:46:31 -04:00
ludwiczakpawel
61b913e5e8
Replacing theme variables (#6682)
* add tons of colors

* add tons of colors

* moving cheese around and prepping for new theming system

* documenting

* .

* moving theme code to own files

* replacing some variables

* whitespaces

* replacing another batch of variables

* get rid of another variable

* replace loading animation variable with one-fits-all-sizes

* get rid of theme-anchor-color

* remove code colors variables

* another batch of variables replaced

* mostly bringing in variables for haxor theme

* remove invert-image variable for chat

* remove another inver-image variable

* forgot to remove reaction-background variable

* remove border variable

* series

* .

* remove another variable

* remove another variable..

* another batch of variables

* and more...

* drop comments

* Update approval file for tweet

Co-authored-by: rhymes <rhymesete@gmail.com>
Co-authored-by: benhalpern <bendhalpern@gmail.com>
2020-03-24 15:05:35 +01:00
Andy Zhao
57d9d72c10
Update call to action box text styling (#6795)
* Use constant for type_of_user

* Add comment for clarity

* Remove legacy inline styles

* Move comment above the render
2020-03-24 10:49:37 +01:00
Alex
bc8c126497
Validate file uploads client-side (#6737)
* JavaScript MVP

- First round of linting
- Use for testing

* Add some default UI error handling

* Add file validation to updating profile image

* Add type validation and fix size bug

* Refactor and add file validation to article cover

* Add file validation to body images

* Add accept field to profile image form

* Add parseInt to maxFileSizeMb

* Add accept and max-file-size-mb to article images

* Change parseInt to Number

* Add file validations to podcast form

* Add accept image to podcasts

* Add file validation and accept field to org form

* Use appendChild for error message

* Add file validation to comment form

* Add JS Docs comments

* Remove redundant format check

* Add documentation to override default values

* Update documention (spelling, formatting, etc.)

* Update max-file-size-mb to 25

* Bump default max file size for images to 25

* Change appendChild to append

* Refactor remove error message

* Refactor JS, remove console logs, update error msg

* Remove video from permitted file types

* Update error messaging

* Update docs for funciton params...oops 🙈

* Fix file size check logic

- Allow for 0 maxFileSizeMb
- Use JSON.parse() for permittedFileTypes to get an Array

* Add specs

* Change blackbox to black box

* Remove wait_for_javascript

* Remove comments from spec
2020-03-24 09:21:49 +01:00
Molly Struve
3187514ad6
handle a missing commentable in new reply email (#6792) [deploy] 2020-03-23 16:40:51 -05:00
Jibran Kalia
a91cb9f8f4
Create primary_sticker_image_url in SiteConfig (#6746) [deploy]
* Create primary_sticker_image_url in SiteConfig

* Adding test for updating primary_sticker_image_url

* typo

Co-authored-by: Ben Halpern <bendhalpern@gmail.com>
2020-03-23 14:55:18 -04:00
rhymes
ff739bb8f8
Fix collection order with cross posted articles (#6768) [deploy] 2020-03-23 16:05:32 +01:00
Ben Halpern
030e491cf4
Add logo_png SiteConfig for manifest etc. use (#6760) [deploy]
* Add logo_png SiteConfig for manifest etc. use

* Touch ups
2020-03-23 14:31:41 +01:00
rhymes
bd1d54a2cc
UX: fix API description color in dark themes (#6770) [deploy]
* Add title to UX theme

* Add a visible color in all themes
2020-03-23 10:04:14 +01:00
Ben Halpern
ea6d988128
Loosen noindex rules slightly (#6769) [deploy] 2020-03-22 10:59:41 -04:00
Ben Halpern
d66d051280
Fix style bugs on article-show and article-new (#6762) [deploy] 2020-03-21 19:17:21 -04:00
Jacob Herrington
aa50e2b87b
Add a link to view pages (#6753) 2020-03-21 11:14:04 -04:00
Molly Struve
c62a60abdc
Remove Unused JS file and Algolia References (#6750) [deploy] 2020-03-20 16:33:15 -05:00
Andy Zhao
494ad153ab
Add response templates for internal usage (#6676)
* Add internal response template controller

* Add response template policy and spec

* Add response template views for internal

* Add missing html oops, and some padding

* Use arrays instead of %w because spaces

* Link to user in index list

* Add actual HTML oops

* Allow success flash to be displayed

* Add tag moderator trait

* Remove unnecessary .all

* Use constant to avoid duplication

* Use URL helpers over manual string URLs

* Use appropriate renders and URLs

* Follow conventional CRUD and use form_with

* Add internal request spec for response_templates

* Add missing view file oops

* Use table view for index and bootstrap styles

* Redirect to index after create

* Use clearer messaging for labels

* Validate email types to use only plain text and html
2020-03-20 11:32:55 -04:00
Fernando Valverde
14c13cb33b
Adds Podcast Episode metadata as JSON to avoid scraping the HTML (#6727) [deploy]
* Adds Podcast Episode metadata as JSON to avoid scraping the HTML

* Uses app_url helper instead of app_protocol_and_domain string interpolation for podcastImageUrl

* Adds podcast_episode#mobile_player_metadata, cleans eslint/codeclimate mess I made & adds tests

* Removes an extra line to fix codeclimate

* Removes unnecessary return
2020-03-20 10:28:24 -04:00
Douglas Lutz
e15fe6da38
Lower the minimum number of page views (#6728) 2020-03-20 10:26:59 -04:00
Ben Halpern
68dedc8a47
Update lastmod for generated sitemap (#6738) [deploy] 2020-03-19 18:59:36 -04:00
Ben Halpern
bff4050c35
Add dynamic monthly sitemaps (#6704) [deploy]
* Initial sitemap work

* More sitemap progress

* Remove files

* Finalize monthly sitemap

* Update spec/models/organization_spec.rb

Co-Authored-By: Vaidehi Joshi <vaidehi.sj@gmail.com>

* Clean up approach

* Change tests

* Fix test not sure what problem was

Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>
2020-03-19 17:20:23 -04:00
ludwiczakpawel
cad93674ff
New colors (#6650)
* add tons of colors

* add tons of colors

* moving cheese around and prepping for new theming system

* documenting

* .

* moving theme code to own files

* whitespaces
2020-03-19 15:34:09 -04:00
Mac Siri
693f27d000
Resolve infinite loop in User#edit #6732 [deploy] 2020-03-19 15:16:32 -04:00
Jacob Herrington
1a42b2b4b1
Use Rails URL helpers where possible (#6711) [deploy] 2020-03-19 10:24:44 -04:00
Michael Kohl
12931ea25a
Introduce app_url helper (#6715)
* Introduce app_url helper

* Add examples to documentation
2020-03-19 15:03:26 +01:00
Jacob Herrington
2b442ca8b6
Internal bug fixes and misc JS/CSS cleanup (#6684)
* Remove unused CSS rules

* Use bootstrap utility class over custom css

* Fix grapical bug with buffer tags

* Fix internal UI highlighting and misc fixes

This commit is a little bit too big.

It fixes a bug with the internal UI that was breaking the highlighting
feature (indicates status of articles and when an AJAX request has been
made).

It also does some reformatting in the internal listings UI. This should
make it a bit easier on anyone writing buffer updates in the listings
UI. I was able to reapply some stimulus I wrote previously for this,
super easy!

There are also a couple of CSS classes I renamed to match Bootstrap's
naming conventions.

* Remove <br> tag

* Update article_controller Stimulus test
2020-03-18 16:05:33 -05:00
Ben Halpern
379aa4d1ec
Allow communities to dictate authentication providers (#6639) [deploy]
* Allow communities to dictate authentication providers

* Include proper file

* Reset siteconfig value

Co-authored-by: rhymes <rhymesete@gmail.com>
2020-03-18 16:41:39 -04:00
Jacob Herrington
4630413acd
Add internal sidebar navigation (#6686)
The navbar in internal is a bit too much for a horizontal nav.

Because we aren't using breadcrumbs, it also indicates to users where
they are, so it needs to be visible and not collapsed.

Making this a sidebar fixes both of those problems. In this state, it is
definitely a barebones implmentation, but it is also an improvement over
the hornizontal nav.

Co-authored-by: MichaelaHunter <michaela1234@gmail.com>

Co-authored-by: MichaelaHunter <michaela1234@gmail.com>
2020-03-18 08:26:27 -04:00
Jacob Herrington
243e9b5524
Add a form to email users from internal (#6668)
Co-authored-by: MichaelaHunter <michaela1234@gmail.com>

Co-authored-by: MichaelaHunter <michaela1234@gmail.com>
2020-03-17 11:19:42 -04:00
Nick Taylor
ccf7e6e5bf
Upgrade to webpacker/webpack 4 and Babel 7 (#6664)
Upgraded to webpacker 4/webpack 4 and Babel 7
2020-03-17 08:20:36 -04:00
Michael Kohl
8f768a0cbc
Allow KaTeX to render inline (#6670) [deploy] 2020-03-17 10:42:41 +01:00
Jacob Herrington
19b91129d8
Denote previously reported and suspended users in vomit reactions (#6619) [deploy]
* Break feedback_messages view into partials

* Standardize capitalization

* Add visual cues for banned and vommitted users

* Use helper methods to construct urls

* Rename vomitted? to vomitted_on?

vomitted_on? is a slightly more clear method name. This change takes
Rhymes' suggestion to use the AR method exists? over where(...).exists?
2020-03-16 18:22:00 -04:00
Ben Halpern
de27e7ed34
Allow community admins to alter site description (#6662) [deploy]
* Allow community admins to alter site description

* Fix typo
2020-03-16 15:34:49 -04:00
Mac Siri
d0c1467ab0
Extract Onboarding into its own controller (#6620)
* Extract onboarding into it's own controller

* Pluralize controller

* Create Onboarding spec
2020-03-16 15:49:28 +01:00
Ben Halpern
58e524acdc
Allow admins to define core sidebar tags in config (#6641) [deploy] 2020-03-16 08:54:32 -04:00
Ben Halpern
079ec96d99
Fix a couple margins (#6637) [deploy] 2020-03-14 20:35:14 -04:00