No description
Find a file
Julianna Tetreault b12ebfa0e5
RFC #74, Pt. 2: Private Forem Landing Page (#13819)
* Adds landing_page checkbox for Landing Page

* Adds landing_page to page_params in Admin::Pages::Controller

* Adds landing_page to admin_manages_pages and admin_creates_pages specs

* Adjusts copy for Landing Page in pages/_form.html.erb

* Places #post_a_job before #privacy in Pages::Controller
  - Ensures that all page-related methods are properly
 alphabetized

* Alphabetizes remaining out-of-order page-related methods
  - Ensures that all page-related methods within the
 Pages::Controller are in alphabetical order, following
 the order of the other methods

* Adds landing_page check to ApplicationController#verify_private_forem

* Adds a single_landing_page validation to the Page model

* Adds a lock.svg to /images and uses it in the pages index

* Adjusts buttons and checkboxes to use crayons class in pages partial

* Ensures that pages/_form.html.erb destroy button uses crayons

* Adds a landing_page validation-related test to page_spec.rb

* Updates #single_landing_page validation and error message

* WIP: Adds JS modal upon landing_page error in pages/_form.html.erb

* Adds a working modal upon error in pages/_form.html.erb
- Removes redundant #single_landing_page validation from Page
- Adds #has_a_landing_page? in place of #single_landing_page
- Conditionally renders the landing_page checkbox in _form.html.erb
- Adds styles to locked screen/landing page modal
- Adds copy to locked screen/landing page modal
- Beings adding buttons to overwrite current landing_page

* Updates the data-modal-selectors and ids in pages/_form.html.erb

* Uses #landing_page_path within pages/_form.html.erb modal
- Adds a link_to to link to the current landing page in the modal
- Adds styles to buttons and link_to in modal

* Adds back single_landing_page validation to Page.rb

* Reverts changes and updates methods within Page.rb
 - Reverts changes to #single_landing_page
 - Refactors #has_a_landing_page? and #landing_page_path
 - Updates div id in pages/_form.html.erb

* Adjusts #single_landing_page error message slightly

* Adds a test for landing_pages in stories_index_spec.rb

* Adds an overwrite attribute to Pages for the modal in _form
  - Fixes anonymous spelling

* Refactors pages/_form.html.erb and cleans up spelling

* Adds a safe operator to landing_page.path in Page
  - Adjusts the placement of the hidden value in pages/_form.html.erb

* Updates styling for Current Locked Screen link

* Adds the ability to overwrite an active landing page on click
  - Adds Admin::PagesController#update_and_overwrite and refactors
AdminPages::Controller#udpate to work with new method
  - Adds a remote attribute, overwrite, to Admin::PagesController
via a hidden_field in pages/_form.html.erb and an attr_accessor in
the Page model
  - Adds a toggleOverwrite() function to pages/_form.html.erb to
toggle the (soon to be hidden) overwrite checkbox in the form --
the checkbox is toggled on button click

* Adds a guard clause to #landing_page_path in Page.rb

* Adds a safe naviagtor to Admin::PagesController#update_and_overwrite_landing_page

* Adds a type and return to Overwrite button to prevent submit

* Adds a hidden class to the overwrite checkbox field in _form.html.erb
  - Hides the overwrite checkbox since it is only used to overwrite
the landing_page boolean on click of the "Overwrite current locked
screen" button

* Adds Admin::PagesController#create_and_overwrite and removes hidden class

* Adds landing page-related tests to admin_manages_pages_spec.rb

* Remove messy commented out code and place it in GH comment instead

* PR Review Feedback: Renames remote attr, defines class methods, updates views
  - Renames remote attribute to overwrite_landing_page
  - Updates all necessary views, methods, etc. w/ new attr
  - Defines two class methods to make code more extensible
  - Updates all necessary views, methods, etc. w/ new methods

* Remove unnecessary comments and revert changes to ternary in _form.html.erb

* Adjustments for accessibility within _form and index
  - Adds a descriptive id to <p> in _form.html.erb
  - Adds an ariadescribedby field to _form.html.erb
  - Adjusts title within index.html.erb

* Refactors landing_page-related code per PR review requests
  - Adds a landing_page_modal_controller.js that handles
and further customizes the dismiss and overwrite button, and
handles opening the modal
  - Adds a _landing_page_modal partial to extract modal-specific
html outside of the _form.html.erb partial
  - Refactors _form.html.erb to account for the _landing_page_modal
partial and the landing_page_modal_controller.js
  - Refactors the overwrite checkbox to be a hidden_field rather than
a hidden checkbox and removes existing hidden_field to accomodate it
  - Loads the @landing_page within Admin::PagesController#edit for
use by the _landing_page_modal.html.erb partial
  - Refactors Page#single_landing_page to be more readable
  - Removes useless JS from _form.html.erb

* Removes #landing_page_exists? class method since it isnt used now

* Uses the #landing_page class method within ApplicationController

* Removes pending status from test in admin_manages_pages_spec.rb

* Adds an e2e test for landing pages and adds to seeds_e2e
  - Adds a landingPage.spec.js to test landing pages
  - Adds a Page to seeds_e2e.rb for landingPage.spec.js

* Removes references to articles from e2e test and adds clickable link

* Adds another Page to seeds_e2e.rb and updates link names in test

* Adds the Current Locked Screen title to modal and opens in new link

* Renames Dismiss to Cancel and updates all necessary code

* Adjusts landingPage.spec.js

* check for existing landing page before showing modal

* Update Cypress tests and fix bug in LandingPageModalController

* Apply suggestions from code review

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Orders Pages by created_at desc in /admin/pages/index.html.erb for consistency

* Targets specific edit button in landingPage.spec.js

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
Co-authored-by: rhymes <github@rhymes.dev>
2021-06-10 11:46:24 -06:00
.buildkite Removes this dupe container block since we are going to run this pipeline (#11506) 2020-11-19 15:05:49 -06:00
.gems Bugfix for #7663 and refactor of container setup (#7747) 2020-05-28 12:11:51 -05:00
.github Set husky explicilty to version 4.x. (#13514) 2021-04-26 13:26:12 -04:00
.vscode Added the MDX extension for VS Code. (#12816) 2021-02-25 10:22:18 +01:00
.yarn/releases Update to latest yarn version (#10441) 2020-09-28 13:24:35 -04:00
app RFC #74, Pt. 2: Private Forem Landing Page (#13819) 2021-06-10 11:46:24 -06:00
bin Remove Elasticsearch ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ (#13606) 2021-05-03 11:09:45 -04:00
config Create DiscussionLocks (#13905) 2021-06-10 11:04:33 -04:00
cypress RFC #74, Pt. 2: Private Forem Landing Page (#13819) 2021-06-10 11:46:24 -06:00
datadog Declare DD_VERSION in prerun.sh 2nd try (#13258) 2021-04-05 17:10:46 -04:00
db Create DiscussionLocks (#13905) 2021-06-10 11:04:33 -04:00
docs API: Remove Admin Config endpoint (#13934) 2021-06-08 09:43:51 +02:00
lib [15-min-fix] Deleted unused data update scripts (#13942) 2021-06-09 12:17:25 +03:00
log Initial commit 2018-02-28 16:11:08 -05:00
public change Dev_favicon to Forem_favicon (#13872) 2021-06-03 18:07:58 -05:00
scripts Switch references to Forem master branch to main (#12325) 2021-04-16 11:51:06 -05:00
spec RFC #74, Pt. 2: Private Forem Landing Page (#13819) 2021-06-10 11:46:24 -06:00
vendor Bump rubocop from 1.16.0 to 1.16.1 (#13952) 2021-06-10 08:20:06 -05:00
.codeclimate.yml [deploy] Rubocop: fix violations of Layout/LineLength (#9197) 2020-07-08 08:36:36 -05:00
.dockerignore Add FOREM_BUILD_SHA and FOREM_BUILD_DATE to the container. (#9999) 2020-08-25 18:19:04 -05:00
.editorconfig Export articles/posts (#576) 2018-11-21 11:13:36 -05:00
.env_sample When AWS_ID is the placeholder value, act as though AWS not setup (#13850) 2021-05-26 13:54:16 -05:00
.erb-lint.yml Upgrade Rails to 6.1.3.1 (#11333) 2021-04-05 10:39:48 -04:00
.eslintignore Remove non application files from frontend code coverage (#11752) 2020-12-04 20:00:20 -05:00
.eslintrc.js Disabled 'no default exports' rule for Storybook files and Stimulus controllers (#13032) 2021-03-17 21:29:39 -04:00
.gitattributes Adding file extensions to gitattributes (#10945) 2020-10-20 11:09:46 +02:00
.gitdocs.js Adapt "gitdocs serve" to work in a remote dev env (#8791) 2020-06-25 21:02:45 -04:00
.gitignore Rename SiteConfig to Settings::General (#13573) 2021-05-21 14:45:37 +02:00
.gitpod.dockerfile Remove Elasticsearch ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ (#13606) 2021-05-03 11:09:45 -04:00
.gitpod.yml Remove Elasticsearch ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ (#13606) 2021-05-03 11:09:45 -04:00
.nvmrc Update to use Node 14.x (#13136) 2021-03-29 11:27:20 -04:00
.postcssrc.yml Initial commit 2018-02-28 16:11:08 -05:00
.prettierignore Use yarn 1.21.1 (#5786) 2020-02-05 17:04:06 -05:00
.prettierrc.json Extracting prettier config (#10847) 2020-10-14 22:28:31 -04:00
.rspec [deploy] Spec Speedup: Use Knapsack to Run Parallel Builds (#8390) 2020-06-11 10:27:11 -05:00
.rubocop.yml Bump rubocop from 1.15.0 to 1.16.0 (#13894) 2021-06-02 09:11:38 -04:00
.rubocop_todo.yml Fix new Rubocop violations (#10808) 2020-10-20 09:28:53 -04:00
.ruby-version Update to Ruby 2.7.2 (#10594) 2020-11-05 16:11:09 +01:00
.simplecov Remove resource_admin dashboards (Administrate) (#11792) 2020-12-08 12:38:13 -06:00
.slugignore Expand slugignore & Add auto remove node_module rake task (#12372) 2021-01-22 07:24:26 -05:00
.travis.yml [Travis] Only cache vendor/bundle and node_modules (#13758) 2021-05-14 10:26:10 -04:00
.yardopts Adds Ruby source code documentation to docs.dev.to (#2656) 2019-05-02 13:50:58 -04:00
.yarnclean Remove assets folder from .yarnclean (#13869) 2021-05-27 10:39:59 -04:00
.yarnrc Update to latest yarn version (#10441) 2020-09-28 13:24:35 -04:00
babel.config.js Replace globals with node env (#10767) 2020-10-14 17:05:38 -04:00
CODE_OF_CONDUCT.md Replace ban/banned with suspend/suspended in user facing text (#5816) [deploy] 2020-02-10 10:12:53 -05:00
config.ru Upgrade Rails to 6.1.3.1 (#11333) 2021-04-05 10:39:48 -04:00
container-compose.yml Remove Elasticsearch ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ (#13606) 2021-05-03 11:09:45 -04:00
Containerfile Update Bundler version (#13278) 2021-04-06 12:44:53 -05:00
CONTRIBUTING.md Change link in Contributing Docs (#9530) 2020-07-27 10:06:59 +07:00
cypress.dev.json Cleaning Test Runs for End to End (E2E) Tests (#12143) 2021-01-29 13:34:01 +01:00
cypress.json Disable Cypress's video feature (#13638) 2021-05-03 17:43:19 -04:00
docker-compose.yml Update docker-compose.yml file to permit login (#13792) 2021-05-24 20:03:36 -05:00
Dockerfile Bugfix for #7663 and refactor of container setup (#7747) 2020-05-28 12:11:51 -05:00
empty-module.js Initial commit 2018-02-28 16:11:08 -05:00
Gemfile Bump acts-as-taggable-on from 7.0.0 to 8.0.0 (#13940) 2021-06-08 09:31:43 -05:00
Gemfile.lock Bump rubocop from 1.16.0 to 1.16.1 (#13952) 2021-06-10 08:20:06 -05:00
Guardfile Upgrade rubocop* packages to the latest version and fix violations (#11972) 2020-12-21 18:29:43 +01:00
jest.config.js Get a11y lint script paths from rails helper (#13912) 2021-06-10 09:25:29 +01:00
jsconfig.json Added the @components webpack alias to the project (#12808) 2021-02-24 16:07:48 +01:00
LICENSE.md Ran all markdown files through prettier to fix a handful. (#4599) 2019-10-28 08:20:53 -04:00
package.json Bump @testing-library/dom from 7.31.0 to 7.31.2 (#13929) 2021-06-08 16:16:44 +01:00
postcss.config.js Suppress Postcss warnings & Re-enable Benhalpern deploy (#11521) 2020-11-20 11:27:49 -05:00
Procfile remove rake jobs:work references from code (#6082) [deploy] 2020-02-14 15:18:08 -05:00
Procfile.dev Adapt dev env to run on a remote box (#8232) 2020-06-18 13:01:49 +02:00
Procfile.dev-hot Initial commit 2018-02-28 16:11:08 -05:00
Rakefile Remove fix-db-schema-conflicts gem (#12432) 2021-01-26 10:52:38 -05:00
README.md Remove Vaidehi from Forem Core Team (#13769) 2021-05-14 12:31:31 -07:00
release-tasks.sh Remove Elasticsearch ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ (#13606) 2021-05-03 11:09:45 -04:00
SECURITY.md [deploy] 🚀 Feature: Chat channel membership manager component (#8945) 2020-07-20 08:08:31 -04:00
svgo.config.js Bump svgo from 1.3.2 to 2.0.1 (#12731) 2021-02-19 08:05:33 -05:00
testSetup.js Fixed some frontend tests causing unhandled rejection errors (#11627) 2020-11-26 06:11:25 -05:00
yarn.lock Bump ssri from 6.0.1 to 6.0.2 (#13954) 2021-06-10 18:07:25 +02:00


Forem 🌱

For Empowering Community

ruby version rails version Travis Status for forem/forem Code Climate maintainability Code Climate technical debt CodeTriage badge Dependabot Badge GitPod badge Netlify badge GitHub code size in bytes GitHub commit activity GitHub issues ready for dev Honeybadger badge Knapsack Pro Parallel CI builds for dev.to

Welcome to the Forem codebase, the platform that powers dev.to. We are so excited to have you. With your help, we can build out Forems usability, scalability, and stability to better serve our communities.

What is Forem?

Forem is open source software for building communities. Communities for your peers, customers, fanbases, families, friends, and any other time and space where people need to come together to be part of a collective. See our announcement post for a high-level overview of what Forem is.

dev.to (or just DEV) is hosted by Forem. It is a community of software developers who write articles, take part in discussions, and build their professional profiles. We value supportive and constructive dialogue in the pursuit of great code and career growth for all members. The ecosystem spans from beginner to advanced developers, and all are welcome to find their place within our community. ❤️

Table of Contents

Community

For a place to have open discussions on features, voice your ideas, or get help with general questions please visit our community at forem.dev.

Contributing

We encourage you to contribute to Forem! Please check out the Contributing to Forem guide for guidelines about how to proceed.

Getting Started

This section provides a high-level quick start guide. If you're looking for the installation guide, you'll want to refer to our complete Developer Documentation.

We run on a Rails backend, and we are currently transitioning to a Preact-first frontend.

A more complete overview of our stack is available in our docs.

Prerequisites

Local

Containers

Linux

OS X

Installation Documentation

View Full Installation Documentation.

Developer Documentation

Check out our dedicated docs page for more technical documentation.

Core team

Vulnerability disclosure

Forem is the open source software which powers DEV.

We welcome security research on DEV under the terms of our vulnerability disclosure policy.

Acknowledgments

Thank you to the Twemoji project for the usage of their emojis.

License

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Please see the LICENSE file in our repository for the full text.

Like many open source projects, we require that contributors provide us with a Contributor License Agreement (CLA). By submitting code to the Forem project, you are granting us a right to use that code under the terms of the CLA.

Our version of the CLA was adapted from the Microsoft Contributor License Agreement, which they generously made available to the public domain under Creative Commons CC0 1.0 Universal.

Any questions, please refer to our license FAQ doc or email yo@dev.to.


Sloan, the sloth mascot
Happy Coding ❤️

⬆ Back to Top