Commit graph

7701 commits

Author SHA1 Message Date
Joe Doss
9ccd06bfa5
Fix a few bugs with the create_buildkite_pr_build.sh script (#11872)
* Fix a few bugs with the create_buildkite_pr_build.sh script.

This will ${PULL_REQUEST_ID:-} will allow for PULL_REQUEST_ID to be not set in
the if statement so the script won't fail.

It fixes the jq lookups on GITHUB_EVENT_PATH for setting:

PULL_REQUEST_ID
COMMENT_USER_LOGIN
COMMENT_URL

from GITHUB_EVENT_PATH

It fixes the jq lookups on

* Add in missing dub quotes
2020-12-14 08:35:29 -06:00
rhymes
174950a827
Remove duplicate test file (#11883)
* Remove duplicate membership test

* Restore single Membership.test.jsx
2020-12-14 14:59:26 +01:00
Anna Buianova
5430448305
Confirmations that users GDPR data was deleted (#11039)
* Display gdpr delete requests for deleted users in admin

* Added a test for destroy a gdpr request

* Reorganized gdpr requests menu

* Update schema version

* Added a link to the flash notice after user delete by admin

* Fix namespace for tests

* Aligh schema.rb with master

* Added a missing newline

* Removed unused partial

* Fix typo

Co-authored-by: Michael Kohl <me@citizen428.net>

* Replaced string with symbols for AR

Co-authored-by: Michael Kohl <me@citizen428.net>

* Added an AuditLog record on gdpr delete confirmation

* Make email and user_id required in Users::GdprDeleteRequest

* Checked out package.json from master

* Fix Gdpr => GDPR

* Added missing space

* Remove unneeded freeze

Co-authored-by: Michael Kohl <me@citizen428.net>
2020-12-14 12:49:45 +03:00
Ben Halpern
e5cbfe61f4
Add campaign articles to sidebar controller (#11879)
* Add campaign articles to sidebar controller

* Fix sidebar additional erb logic
2020-12-13 19:44:17 -05:00
Ben Halpern
3308bf5e3d
Add sidebar bust logic (#11878)
* Add sidebar bust logic

* Fix typo
2020-12-13 19:43:44 -05:00
benhalpern
ae7c9a4f75 Fetch homepage right sidebar async (and don't fetch for narrow screens) 2020-12-13 18:41:47 -05:00
Joe Doss
24eb8b3354
Rework the PULL_REQUEST_ID logic, again (#11871)
and move github.event.issue.number to the workflow file....
2020-12-11 16:03:53 -06:00
Joe Doss
f88608ccf6
Rework the PULL_REQUEST_ID logic (#11869) 2020-12-11 15:31:52 -06:00
Nick Taylor
b922b0f319
E2E Test: Initial Adminisitrator Login Flow (#11840)
* Set baseUrl for Cypress tests.

* Fixed login form for tests.

* Added fixture data for initial admin credentials.

* First e2e test.

* Fixed a typo in a comment.

* Using an input of type submit like the login previously had was fine.

* Added a check to ensure user is redirected to the home page.

* Forgot to commit adding @testing-library/cypress

* Renamed and move login flow under loginFlows in integrations.

* Added testing library to support files so it does not need to be imported into every test explicitly by the test writer.

* Added some more Cypress related files that will be required for testing going forward.

* Took onboarding into account when checking the URL post login.
2020-12-11 13:44:18 -05:00
Joe Doss
20598be83f
Add GITHUB_TOKEN to workflow. (#11866) 2020-12-11 12:17:05 -06:00
rhymes
c0ac718642
Disable Google reCAPTCHA in env file sample (#11863)
* Disable Google reCAPTCHA in env file sample

* Update .env_sample

Co-authored-by: Jacob Herrington <jacobherringtondeveloper@gmail.com>

Co-authored-by: Jacob Herrington <jacobherringtondeveloper@gmail.com>
2020-12-11 18:17:48 +01:00
Joe Doss
c87951d4f2
Add create_buildkite_pr_build.sh (#11849)
* Remove rebase workflow as it will not work as expected with third party forks.

* Add the create_buildkite_pr_build.sh script.

This script will use the GitHub API to gather information about the PR, the PR
Author and create a Pull Request pipeline build on Buildkite.

You can mock out the things needed to work on this script locally with the
following environment variables exported:

export BUILDKITE_API_ACCESS_TOKEN=notarealtoken
export GITHUB_EVENT_PATH=$(curl --silent 2d0e0bdefc/github_actions_event_context.json)
export GITHUB_REPOSITORY=forem/forem
export GITHUB_TOKEN=notarealtoken

Note: You will need to get your own BUILDKITE_API_ACCESS_TOKEN and GITHUB_TOKEN
tokens.

You can then run the script locally to create builds from a pull request. The
GITHUB_EVENT_PATH JSON data is from https://github.com/forem/forem/pull/1181
which might not build on Buildkite down the road if is is closed. You might need
to pull down that JSON data and find and replace the PR number 11818 with thing
else.

Also this script could be busted out into it's own GitHub Action repo so you can
work on it outside of the Forem repo, but I don't have the mental fortitude to
work on GitHub Actions at this time. It is the most painful CI systems I have used
to date in terms of having an very very poor feedback loop/developer experience.
It desperately needs a REPL or mock shell for you to develop actions in so you don't
have to keep submitting PRs to your main branch to see results.
2020-12-11 09:41:02 -06:00
Anna Buianova
f4c88341ce
Rubocop fixes (#11862) 2020-12-11 17:36:42 +03:00
rhymes
f8a8e0320b
Fix Dependabot GitHub action syntax (#11864) 2020-12-11 15:10:20 +01:00
Alex
494359fd21
Create services for busting organizations, podcast episodes, listings, and users (#11832)
* Create service for bust_organization

* Create bust_podcast_episode_service

* Add error spec to BustOrganization

* Create bust_listings

* Create bust_user service
2020-12-11 08:59:24 -05:00
Ben Halpern
c5960f4640
Make mod button only show up for trusted user (#11856) 2020-12-11 07:51:04 -05:00
Molly Struve
5f5bdb4a32
Refactor:Remove old teams from CODEOWNERS and update general teams (#11850) 2020-12-11 06:49:01 -06:00
dependabot[bot]
bcadebb3ef
Bump ini from 1.3.5 to 1.3.7 (#11858)
Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.7.
- [Release notes](https://github.com/isaacs/ini/releases)
- [Commits](https://github.com/isaacs/ini/compare/v1.3.5...v1.3.7)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-12-10 22:37:43 -05:00
Ridhwana
23235c2276
feat: update the contact email address in the database (#11848) 2020-12-10 12:35:46 -06:00
Jacob Herrington
563a2c5a22
Fix misleading comment (#11847)
I'm updating this comment based on @citizen428's feedback.

https://github.com/forem/forem/pull/11836#discussion_r539811288
2020-12-10 12:34:23 -06:00
Mac Siri
6a150d11c5
Update aspect ratio of images on the Admin's config page (#11527) 2020-12-10 09:21:52 -05:00
Jacob Herrington
f2722f8701
Don't attempt to call summary on profile during onboarding (#11836) 2020-12-10 08:55:46 -05:00
Nick Taylor
e28b75b19a
Fixed eslint/jest configurations for cypress. (#11841) 2020-12-10 12:48:37 +01:00
Michael Kohl
1729cf02ad
Move Twilio from labor to services (#11824)
* Move Twilio from labor to services

* Update usage
2020-12-10 10:21:09 +07:00
Michael Kohl
59e2f5a025
Remove app/labor/color_from_image.rb (#11825)
* Remove app/labor/color_from_image.rb

* Remove miro gem

* Delete TODO
2020-12-10 10:08:06 +07:00
Nick Taylor
02f0a9ca1d
Add Cypress for end to end testing (E2E) (#11835)
* Added eslint plugin/rules for Cypress.

* Added Cypress to the project for end to end testing.

* Added ~/.cache folder to cache Cypress binary on Travis.
2020-12-09 17:08:20 -05:00
Joe Doss
e91dffb1a5
Just use the master branch for now. (#11834) 2020-12-09 13:55:25 -06:00
Fernando Valverde
c2982ef0fc
Ensure Article's username method returns a downcased string (#11813)
* Adds a lower() query to the DB in Stories#show

* Restructure spec

* bypass article callbacks in order to test edge case

* Fixes spec

* Change the approach to unsure downcase path in Article model

* Move .downcase call to set_caches before_save callback

* Adds data update script for fixing offending Article paths

* Moves model tests to correct block

* Apply suggestions from code review

Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>

Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>
2020-12-09 12:56:40 -06:00
Mac Siri
b00ebc2778
Disable duplicate resave data upgrade script (#11829) 2020-12-09 12:20:30 -05:00
Joe Doss
eee63068dc
Scope PR comment bot to only run when the PR is opened. (#11830) 2020-12-09 10:44:04 -06:00
Jacob Herrington
692acd3cb2
Render Profile Fields on user profiles (#11485)
* Render left sidebar attributes on profile

* Display header profile fields

* Make changes to protect DEV data

* Don't render DEV header fields twice

* Wrap profile UI changes in a FeatureFlag

* Add spec to test mulitple display areas

* Use select over reject

Co-authored-by: Michael Kohl <me@citizen428.net>

* Move comment for documentation generators

* Update dev profile fields csv data

Co-authored-by: Michael Kohl <me@citizen428.net>
Co-authored-by: Ben Halpern <bendhalpern@gmail.com>
2020-12-09 09:41:11 -06:00
Alex
8598ed090e
Create services for busting pages, tags, events, and podcasts (#11812)
* Create bust_page service and spec

* Specify spec with .once

* Create bust_tag service and spec

* Create bust_event service and spec

* Create bust_podcast service and spec
2020-12-09 10:37:02 -05:00
Joe Doss
67342a4edf
Add github.event.comment.author_association == 'CONTRIBUTOR' to if statement (#11822)
This should be the last PR to get the `/ci` and `/rebase` commands working in
GitHub Actions. The issue is that our membership settings for `forem/forem` have
everyone set to 'CONTRIBUTOR' instead of 'MEMBER' or 'OWNER'.

Adding github.event.comment.author_association == 'CONTRIBUTOR' should fix this
issue.

I also cleaned up all action files to make the main name of the workflow as
succinct as possible to better organize the left menut of the GitHub Actions
page.

This PR won't fix the issues with the "Run forem/build-containers pipeline"
job in buildkite.yml but I will address those issues in another  PR.
2020-12-09 08:36:57 -06:00
Joe Doss
66dc8081b1
Update buildkite.yml (#11821)
Uncomments if statement as I was able to get the info I needed out of the debug statement. Using admin privs to re-enable the if statement sans tests.
2020-12-08 18:37:16 -06:00
Joe Doss
5edff0182f
Update buildkite.yml (#11820)
Admin merging to disable the conditional for a quick test. TravisCI tests do not need to run for this PR.
2020-12-08 18:31:20 -06:00
Joe Doss
a8b9e9ab95
Add debug to actions. (#11819) 2020-12-08 18:12:06 -06:00
Joe Doss
4504ac15ec
GitHub Action bug fixes (#11816)
* Update if statement w/r/t github.event.issue.pull_request conditional and update
cirrus-actions/rebase to 1.4.

* Fix running the PR comment workflow so it only runs if

github.event.pull_request.head.repo.full_name != github.repository

How neat!
2020-12-08 16:54:28 -06:00
Ben Halpern
1c81978da2
Fix admin header links (#11811) 2020-12-08 14:46:55 -06:00
Ben Halpern
6389dae3c0
Fix feed dropdown (#11810) 2020-12-08 15:32:53 -05:00
Fernando Valverde
0ac3e83b0c
Remove resource_admin dashboards (Administrate) (#11792)
* First cleanup commit

* Email messages preview

* Tweak tests

* spec typo fix

* Remove lingering Administrate Fields & Abuse report link fix

* Add missing gemfile lock update

* Extract email_messages into its own controller & add test
2020-12-08 12:38:13 -06:00
Ben Halpern
686b174012
Add onboarding param to safe list (#11814) 2020-12-08 13:34:53 -05:00
Ridhwana
7a9629172d
Profile generalization for the onboarding workflow (#11629)
* feat: v1 of the profile form

* feat: fix inputs and create a handleChange event

* feat: update the submit values to represent values from the form

* feat: ensure that errors and success is handled on send

* refactor: remove unused code

* feat: replace the old profile form with a new one

* fix: use the renames file

* refactor: safety net for groups

* chore: fix code climate issue

* tests: amend + add tests

* test: fix broken spec

* feat: update the setup for the test

* tests: refactored them to move the fake response into the before all

* feat: clunky way to quickly cater for color field since it was a quick and easy implementation

* feat: add a field.description to the color field

* refactor: pull some duplicate code into a new function

* chore: cater for a textarea field

* overflow issue

* refactor: use FormField instead of manual divs

* Update spec/requests/users_onboarding_spec.rb

Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>

* Update spec/requests/users_onboarding_spec.rb

Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>

* refactor: move out of method and into a constant

* refactor: user_onboarding_update to be more readable

* refactor: use current.save instead of declaring a new variable

* refactor: remove explicit check for bookean

* refactor: use request from '@utilities/http' instead :)

* refactor: no need for if with destructured groups

* refactor: move color field to its own component

* chore: remove colorfield now thats its a component

* fix: forgot about field

* feat: a text area component

* chore: remove textField function in favor of component

* refactor: checkbox refactor

* refactor: add a switch statement

* chore: move into a more organized folder

* fix: move the handler to props and off from field

* fix: add a conditional so we dont hit an error undefined method `success?' for nil:NilClass

* refactor: change from component to function

* feat: add a key attribute

* refactor: add role for readers

* refactor: remove unnecessary guard clauses

* refactor: use function instead of an arrow

* chore: document components

* test

* padding

* fixes

* test: fix the tests by using more general matchers

Co-authored-by: Paweł Ludwiczak <ludwiczakpawel@gmail.com>
Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>
2020-12-08 19:53:00 +02:00
Alex
d0eb582236
Add bust_article service (#11788)
* Add bust_article service

* Make timestamps lambdas

* Remove nil safe operators

* Updated bust_article specs

* Add spec for TIMEFRAMES and relative time
2020-12-08 11:56:43 -05:00
Joe Doss
bb849bf319
Try to fix GitHub Action conditionals again... (#11807) 2020-12-08 10:38:09 -06:00
John Losito
c55dacf598
Check github actions weekly with dependabot (#11779)
* Check github actions weekly with dependabot

* Update dependabot.yml
2020-12-08 11:36:25 -05:00
Ben Halpern
2c96c14021
Use static error files in serviceworker (#11806)
* Use static error files in serviceworker

* Bump static cache version
2020-12-08 11:20:23 -05:00
Ridhwana
bae2571ad6
Replace the "setup onboarding profile fields" temp rake task with a data update script (#11800)
* feat: replace the temp rake task with a data update script

* oops we need a user
2020-12-08 17:50:43 +02:00
Joe Doss
71ad902315
Fix YAML so it is actually valid GitHub Action YAMLs. (#11801) 2020-12-08 09:48:49 -06:00
Joe Doss
08447cfea2
Update buildkite.yml (#11799) 2020-12-08 09:02:09 -06:00
ludwiczakpawel
73e560f7a2
Updating navigation (especially mobile) (#10424)
* .

* .

* .

* .

* .

* specs

* specs

* .

* .

* merge

* moving cheese around

* layout

* .

* merge

* Fixed invalid selector for search.

* Fixed issue with URL not updating after a search.

* do things better

* kinda merge

* whoops

* whoops

* .

* .

* im a backend developer

* tooltips 1.0.1

* tooltips 1.0.1

* fix

* specs

* .

* reduce the spacing

* schema drop

* reverts

* revert

* reverts

* revert

* drop unused nav

* drop unused nav

* drop unused nav

* drop unused nav

* typos

* paths fixes

* speeding up JS

* js

* search

* Reworked initializeTopBarIcons.js

* Reworked initializeNavigation.js

* Small refactor and updated exported function API docs.

* Fixed a bug I created when refactoring the top navigation icons.

* sidebar nav links

* spec

* Fixed issues with logged out experience for top nav icons.

* Small refactor of top nav icons.

* Small refactor and added some API docs.

* Added @testing-library/dom

* Added tests for top navigation utilities.

* spec

* spec

Co-authored-by: Nick Taylor <nick@dev.to>
2020-12-08 15:59:21 +01:00