* db
* Add an iframe to host mod actions menu
This iframe is probably the fastest way to get a working mod actions
menu without rewriting existing code. We may eventually re-write this,
but based on Ben's recommendation we are going to go with an iframe
because it gets us a working feature quickly and it seems to be serving
us well in other parts of the application.
* Add the mod actions menu button to articles
When the user is "trusted" they will see a small badge on the lower
right-hand side of the screen. Clicking the icon reveals the mod actions
menu.
* Add header to actions panel (#7395)
* Update iframe border
* Add 'Moderate Post' header and button
* Use inline SVG over <img src='svg'>
* Use Crayons variables for units
* Use flexbox to center chevron
* Add accidentally deleted positioning
* Add chevron-right.svg
* Use a partial for actions panel and revert /mod page
* Load actions panel in iframe and not /mod
* Style UpVote, DownVote and Vomit buttons (#7421)
* Add a iframe to host mod actions menu
* Up and Downvote Icons
* Starting with vomit button
* Completed UI; interactions pending
* Incorporated Andy changes; making mod action-panel
* space reactions away from header
* UI tweaks and corrections 1
* Fixing styles to match crayons
* choose pure white color css variable
* Add thumbs-up emoji; address Lisa comments
* Trying to fix reactions interactions
* remove clearThumbReactions function
Co-authored-by: jacobherrington <jacobherringtondeveloper@gmail.com>
* Add bottom layout for actions panel (#7501)
* WIP for Lisa
* Finalize mod actions bottom section
* Use showing instead of hidden for transition
* Add new optimized SVGs
* Fix weird height issues for actions panel
* Move hover styles below the cascade, yo
* Use margin-top for sticky footer over height: 100%
* Move initialize actions panel button to Webpack (#7506)
* Move actions panel JS code to webpack
* Refactor and use destructuring
Thanks @nickytonline!
Co-Authored-By: Nick Taylor <nick@iamdeveloper.com>
* Rename file
Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
* Configure Experience Level options for Mod Action Panel (#7507)
* Add a iframe to host mod actions menu
* Click interactions (no toggle of dropdowns yet)
Co-authored-by: jacobherrington <jacobherringtondeveloper@gmail.com>
* Fix the iframe's path (#7509)
* Toggle the 'Set Experience Level' menu on button-click (#7529)
* Add a iframe to host mod actions menu
* Add set-exp dropdown functionality
* WIP: making exp level updates async
* Completes async implementation
* Fix controller for "actions_panel" and "/mod"
Co-authored-by: jacobherrington <jacobherringtondeveloper@gmail.com>
* Add close button interaction (#7552)
* Rename actions panel pack file
* Add close button toggle to actions panel
* DB update
* Move more code to Webpack and add conditional tag adjustments section (#7652)
* Move JS code to Webpack
* Clean up a few style issues
* Add styling for tag adjustments
* Add active/inactive functionality
* Add conditional rendering for tag adjustments section
* Add missing variable oops (#7673)
* update with upstream
* Add missing subtract svg (#7695)
* Create 'Flag User' modal (#7626)
* Add a iframe to host mod actions menu
* Starting task
* Phase 1
* Fix "Close Modal" icon
* Implement open modal
* Working on all "Close Modal" actions
* Almost-complete implementation
* Remove Abuse Report snackbar
* Delete unneeded JS code
* Remove "How does this work?" links
* Link to Community Moderation page
* Addressing code review corrections
* Update api call to use "request" method
* Make else path clearer in api call
Co-authored-by: jacobherrington <jacobherringtondeveloper@gmail.com>
* Mod Actions Panel: Prevent nonsensical reaction pairs (#7699)
* Still implementing
* Completed Implementation
* Address code review feednack; refactor "create" method
* Move scss variables to native-css (for ModPanel code only)
* Correct missing native css
* update to native-css again
* More sccs -> native-css fixes
* Adjust ModPanel Button position on mobile (#7744)
* Adjusted ModPanel position on mobile
* Better adjustment
* Fix phantom schema.rb changes
* Fix phantom schema.rb changes
* Finalize tag adjustments (#7740)
* Finalize tag adjustments and flow
* Fix logic for rendering adjust tags options
* Clean up alert response
* Rename user to trusted user
* Use new CSS variables
* Add/remove tag on article's tag section after adjusting
* Fix logic for admin tag input and some other niceties
* Final bug fixes mod panel (#7772)
* Use correct boolean statement
* Clear the value of the textarea not div
* Use the correct attribute
* Use actions panel for /mod page (#7775)
* Fix loading logic with tag adjust button conditional render
* Link to tag moderation for adjust tags section
* Use top over window.parent
Thanks @nickytonline!
Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
* Use Webpack alias to import
Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
* Use place-items shorthand over align-items + justify-content
Thanks @nickytonline!
Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
* Fix typo for utilities
* Add new line to end of file
* Disable linter for use for top function
* Use align-items and justify-content center
* Update SVGs to spec
* Remove unnecessary height and use spacing units for open button
* Remove accidentally added comment
* Error handling when selecting reactions; optimize "reactions.each" loop
* Add comment about clearing innerHTML
* Revert schema back to master
* Use each since there should only be two reactions
* Fix typo oops
* Add missing height oops
* Return if there are no reactions to be destroyed
* Center path with GUI tool shrug
* chose more appropriate name for JS pack; rewrote api calls using async-await
* Rename variables and methods and check categories before clearing
* Use addSnackbarItem instead of hardcoded version
* Place articleModerationTools pack behind user_signed_in
* Correct omission
* Implement dynamic imports for ModPanel tools
* Implemented async/await; added snackbar message for null response use-case
* Fix the "/article/mod" page; make sure all reactions, vomit-user and exp-level working as expected
* Update language to reflect new UI
* Close the modal after the "Confirm Action" button is clicked
* Change text for Spam/Abuse button
* Fix schema to use with master
* Update schema to master again
* Use crayons button for actions panel button
* UI tweak to play nicer with site themes
* Make actions panel work for dev.to/mod
* Add snackbar for reactions
* Update how does this work links
* Add "thumbsup" reactions to logging
* Add thumbsup to categories
* Add external link icon
* Changes to reflect "Privileged" and not "Negative" reactions; spec changes pending
* Updated instance variable
* Starting to update the specs
* Update "thumbsup" points from 10 to 5
* Still working on both requests
* Embracing an easier implemantation (thanks Andy!)
* Add tests for actions panel
* Add some basic tests for actions panel
* Change to flag to admins
* Indicate that 'Reason for Tag adjust' is required
Co-authored-by: Mac Siri <krairit.siri@gmail.com>
* Rename negative_reactions to privileged
* Update rating level to use correct values
* Use a different display value than backend value
* Don't show adjust tags for trusted users
* Add specs for moderation_routes for admin and super_admin
Co-authored-by: Arit Amana <msarit@gmail.com>
Co-authored-by: jacobherrington <jacobherringtondeveloper@gmail.com>
Co-authored-by: Arit Amana <32520970+msarit@users.noreply.github.com>
Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
Co-authored-by: Mac Siri <krairit.siri@gmail.com>
* pages:bind rake task for local coding of HTML Page
* Tweaked task description
* Adds tests and enhancements to the task
* Replaces fixture with tmp file
* Adds check to avoid any side effects in production
* Removes clunky test
* Removes check for Test ENV (no longer in use)
* Adds reference to Pages in docs
* Implement Reddit liquid tag
* Set reddit content in locals
* Change Reddit liquid tag content layout
I decided a UI similar to the Stack Exchange tag would be better.
Now the Reddit tag looks a bit similar.
* Add tests for RedditTag
* Add reddit liquid tag example to docs
Also emphasize notice about compilation of article when using any
liquid tag
* Parse markdown text reddit content for RedditTag
* Display date RedditTag post was published
* Remove file location comments
* Change order of conditional for Reddit liquid tag
Sometimes the attribute `post_hint` might be null and neither condition
would apply.
* Add example to use Reddit liquid tag
* Change reddit svg icon for Reddit liquid tag
* handle and verify status of Reddit links
Here we make sure the passed link is a valid one in terms of URI composition (e.g. protocol)
but also that the URL is one that points to existing content in Reddit.
If the URL isn't returning anything but a successful response code (200) then
we treat it as an invalid one.
* Do not use VCR for RedditTag specs
The generated cassette for this tag was really huge (6000+ lines).
Using mocks (as in the MediumTag spec) still does the job and without
that huge VCR file.
* Remove index line from schema.db
* Improve RedditJsonFromUrlService
- Change User-Agent in requests to one read from app configuration
- Remove Reddit URL check by making a GET request
- Add regexp to validate URL looks like a Reddit URL
* Move RedditJsonFromUrlService methods to RedditTag
Also changed the way the request was being mocked. Previously, it was by
mocking the service class now I'm mocking HTTParty directly and returning
the JSON structure Reddit uses.
* Move from Alpine Linux to Fedora Linux.
This changes the base container image away from Alpine Linux to
Fedora Linux to address some musl libc issues with some of our gems.
It also moved the main file to a Containerfile and symlinks the Dockerfile
to it. This makes our container setup less Docker-centric as Linux users
most likely will be using Podman as their container runtime.
Lastly, it moves the WORKDIR from /usr/src/app to /opt/apps/devto.
The Linux FHS states that /opt is the spot for Optional application
software packages and /usr/src is for kernel source code.
https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard
/opt Optional application software packages
/usr/src Source code, e.g., the kernel source code with its header files.
Also, if SELinux becomes a thing in our future, moving this makes it
easier to manage contexts out of /opt rather than /usr/src.
* Adjust the Containerfile a bit to add some missing packages, make it
more generic and move env vars to the docker-compose.
* Move the Dockerfile to a symlink to the Containerfile.
We need to be able to support more than just Docker for a container
runtime. Moving everything to a Containerfile and symlinking the
Dockerfile helps users run runtimes such as Podman.
* Add in new entrypoint files and fix the app path in docker-entrypoint.sh
* Refactor the docker-compose.yml file so it doesn't build the main
application container three times in a row. We can use the same
container for web, webpacker, and sidekiq.
Also make the volume names very explicit on what their contents and add
in SELinux context support with :Z
* Fix ELASTICSEARCH_URL.
* Remove the absolute path on ip binary and add in iproute to Containerfile.
* Symlink the Dockerfile to Containerfile and add in a container-compose.yml file
for usage with podman-compose. We are waiting for this issue to get resolved
https://github.com/containers/libpod/issues/6153
and for podman-compose to mature a bit more. A user using podman-compose can use
podman-compose -f container-compose.yml
to launch the DEV container stack with Podman.
* Update the .gitignore file to reflect the new container volumes.
* Fix the entrypoint script on the Containerfile and clean up a bunch of things.
* Rework the Containerfile to prep it to run as a non-root user. We have to wait
for this issue to get fixed:
https://github.com/containers/libpod/issues/6153
for Linux users and then we can uncomment the USER line so we are running Rails
as a non-root user. :toot:
* This reworks the compose files so each task that is needed to start the app has
a correct wait command with dockerize. It also adds in containers for doing
yarn and bundle things for development. Since we mount the code directory inside
the container we lose our pre-containerized gems and node_modules.
This means users can run:
Linux
podman-compose -f container-compose.yml up
Mac
docker-compose up
and it should correctly build the app stack with containers!
* Clean up old container related things.
* Add in some container pre-reqs and my name to the "Core team" section! :toot:
* Adjust the seed and sidekiq compose entries so they do not use the web entrypoint
and set the REDIS_URL and REDIS_SESSIONS_URL env vars for seed.
Add in some echos to the entrypoint.sh.
Also set docker-compose to use :delegated on mount points to speed things up.
https://docs.docker.com/storage/bind-mounts/#configure-mount-consistency-for-macos
* Just call yarn install --dev on the yarn container.
* Update documentation to support Docker and Podman as Container Engines and
move the page from docker to containers to reflect the fact not all users run
their containers via Docker.
There are dozens of us... DOZENS!
* Set --local on bundle config so it just impacts this Ruby app.
* Renamed bin/docker-setup to bin/container-setup to reflect the fact that that
we can use Podman as a container engine. I also refactored it so it does some
basic pre-flight checks for docker and docker-compose or podman and
podman-compose to make sure users have a container engine installed.
* Set cache_all_platforms true for bundler.
* Bump docker-compose dockerize -timeout to 45min for slower macOS hardware.
* Move to the consolidated app_initializer:setup rake task for bootstrapping the
app.
* Update docs/installation/readme.md
* Change models and related files
* Update controllers and specs
* More renaming
* Seek and destroy, I mean search and replace
* Round up the stragglers
* Ground control to Major Travis...
* More fixes
* PR feedback
* Various fixes
* Rename view
* Fix list query builder
* Unify request specs
* Fix some API spec errors
* Fix remaining API specs
* Make spec conform to API
* Fix leftover problems
* Fix JS tests
* Fix column name in select
* Fix API specs
* Fix search specs
* Paging Mr. Travis
* Rename positive_reactions_count to public_reactions_count
* Add positive reactions count back in so we can remove it
* Use public_category method for reactions
* Add positive_reactions_count in case any old caches rely on it
* Add positive_rxn_count to account for API endpoints
* Remove unused method
* One more spot...
* Add method back in because of caches
* Update specs to match new functionality
* Fix typo
* Remove unused methods
* feed cards
* frontend
* preactify
* preactify
* .
* fix
* fixing things and adding dropdown
* whoops.
* whoops 2.
* revert body bg color change
* search snippet
* search snippet
* get rid of featured article
* get rid of featured article...
* cover to its own component
* videos
* videos
* reading time
* small-save-filled asset
* author adjustments
* adjustments
* Author --> Meta
* whoops.
* loader
* logged out state
* .
* dropping what's not needed for now
* better name for cover
* get rid of nav overflow
* bringin comments placeholder back
* bringing comments placeholder back
* publish date
* fix
* date
* .
* save button icon
* ghost button
* lets skip the icon for saving for now
* more buttons
* counting logic
* Display top comments on homepage feed
* Comment list and item components
* Remove 'Top Comments' title
* Remove subscribe button, add reading time
* Update snapshots and tests
* Fix article and follower scrolling
* Added reading time
* (Try) to do flare tags
* Button component from Pawel
* More button styles from Pawel
* Comment count style from Pawel
* Handle empty parens for age on older articles
* Dont show 'more comment' button for more than 2 comments
* cover ratio
* flare tag
* cover fix
* fix buttons
* more button fixes
* tags fix
* responsiveness fix
* reading time + a bit of responsiveness
* Reading time in more places
* snapshots
* default color for flare tag
* Update CommentsList test snapshot with new styles
* fixing search results
* fixing buttons
* Fix podcast card tests by updating snapshots
* Line clamping for top comments
* Reflect save button state after click before mouseout
* Now the entire feed card is clickable. (#7638)
* Now pointer cursor is only on feed posts. (#7727)
* Revert podcast card styling
* Update test snapshot
* merge
* Fix rspec on feed page
* Reduce complexity of class check for feed card clicking
* PR feedback/fixes
* Fix featured article test and snapshot
* Last minute test tweaks
* clean up crayons
* padding issue + empty div
* Correct merge error
* Fix search results tests
* Test fixes and snapshot updates
* themes
* podcasts colors
Co-authored-by: ludwiczakpawel <ludwiczakpawel@gmail.com>
Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
* Add correct rate limit exception to Articles::Updater
* Send Retry-After with HTTP 429 back to the client
* Update API specs for error 429
* Test build
* Fix spec
* Add retry after to ImageUploadsController and fix specs
* Generalize a bit
* Upgrade to Ruby 2.7.0
* Upgrade Travis's Ruby as well
* Fix conflict
* Silence all Ruby 2.7 deprecation warnings in dev mode
* Silence dev and test unless CI
Before this change the example curl command returns 400 bad request with an appropriate API key and article ID.
After this change the example curl command does not return error 400 bad request.
* Try out parallel Travis builds
* Add more Bundler options
* Appease the spec gods
I don't think we actually need Timecop.freeze in this spec
* Try inlining factories
* Make sure the time has actually changed
* Add CodeClimate coverage for parallel build
* Explicitly list jobs, don't rely on matrix expansion
* Merge master and move storybook to after_script
* Add missing environment variable
* Remove old cc-test-reporter config
* Move yarn build-storybook back to script, remove conditional coverage upload
* Update yarn constraint and Docker docs
Co-authored-by: rhymes <rhymesete@gmail.com>