Commit graph

14 commits

Author SHA1 Message Date
Anna Buianova
20e242af0d
Rubocop fixes (#20254)
* Fixed redundant alls for rubocop

* Fixed rubocop violations in spec/requests

* Fixed rubocop violations in spec/models

* Fixed Performance/MapMethodChain

* Fixed rubocop violations in spec/requests

* Revert changes to FastlyConfig::Update spec
2023-10-18 17:24:28 -04:00
Mac Siri
842e6880b8
Routine rubocop fix on /spec (#19217)
* Softrun rubocop

* Hardrun rubocop (-A)

* Change a rubocop rule

* Add missing cops

* Undo & redo rubocop -A
2023-03-21 09:55:26 -04:00
Mac Siri
678dda8cf4
Routine Rubopcop lint fixes (#17844)
* Routine Rubopcop lint fixes

* Undo app_secrets_spec changes

* Fix broken spec
2022-06-07 10:17:16 -04:00
Daniel Uber
a9b2164be9
Don't modify environment global in tests (#16943) 2022-05-02 11:11:43 -05:00
Ridhwana
b21397a8c6
"Reply to" and "From" Email addresses for SMTP Configurations (#16499)
* feat: create a from_email_address and a reply_to_email_address

* feat: update other mailers with the new SMTP email settings

* test: update all spec files

* fix: use the SMTP::Settings value

* fix tests

* spec: fix the comma

* feat: tighten some logic

* fix: test

* fix tests

* fix tests

* final fix test commit

* fix test

* fix test

* oops

* feat: add a reply_to for Devise Mailer

* chore: update the description

* use a proc for reply_to

* feat: update text

* Update spec/mailers/digest_mailer_spec.rb

Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>

* Update spec/mailers/verification_mailer_spec.rb

Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>

* Update spec/mailers/shared_examples/renders_proper_email_headers.rb

Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>

* refactor: move OPTIONS to a helper as its only being used in the view layer

Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>
2022-02-16 16:14:54 +02:00
Ridhwana
1025900d16
Improve the UX of the SMTP Section (#16223)
* feat: allow reply_to and email_from to be set for an SMTP config

* feat: use these SMTP values in the mailers

* spec: test the application_mailer

* fix: validate with email, and not url

* feat: mimic macs changes from https://github.com/forem/forem/pull/16216 to use in this PR

* setup packs for admin

* refactor: order the keys and add a const for the auth methods

* feat: rename the header to a more user friendlly name

* chore: move the section with Emails

* feat: add a toggle that will show and hide the SMTP form under certain conditions

* feat: add the javaScript to handle the toggles

* feat: add a better description until we convert to a dropdown

* feat: ensure that we have declared sendgrid_enabled

* chore: add  anote to the config controller

* chore: remove references of the email addresses to keep brnach scoped

* feat: tweak js

* test: cypress workflow to update smtp settings

* feat : update the smtp tests

* remove comments

* update test

* chore: rename NOTE

* feat: polisha dn test ForemInstance.only_sendgrid_enabled?

* chore: remove specs

* Update app/lib/constants/settings/smtp.rb

Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>

* Update spec/system/admin/config/admin_updates_smtp_settings_spec.rb

Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>

* Update spec/system/admin/config/admin_updates_smtp_settings_spec.rb

Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>

* Update spec/system/admin/config/admin_updates_smtp_settings_spec.rb

Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>

* Update app/javascript/packs/admin/config/smtp.js

Co-authored-by: Nick Taylor <nick@iamdeveloper.com>

* refactor js as per comments

* refactor as per comments

* Update cypress/integration/seededFlows/adminFlows/config/emailServerSettingsSection.spec.js

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

* refactor: update the Cypress tests

Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>
Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2022-02-15 18:40:14 +02:00
Ridhwana
5e93d3a25e
Add a contact email address to the /admin/customization/config (#16497)
* feat: remove the default email and cobine the periodic digest and the contact email under the Email section

* refactor: rename  the email_link to contact link and use the contact_email as a default and fallback to the ForemInstance.email

* chore: alignment

* feat: use the contact_email helper

* feat: move the contact_email to the ForemInstance model

* feat: use ForemInstance.contact_email instead of the application helper method

* removed the application Helper

* feat: set the dafault on the contact_email

* fix: cypress tests

* Update app/lib/constants/settings/general.rb

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

Co-authored-by: Michael Kohl <me@citizen428.net>
2022-02-15 17:37:08 +02:00
Mac Siri
3f2653a14d
Prefer custom SMTP config over Sendgrid (#16216) 2022-01-24 14:11:50 -05:00
Mac Siri
e38196df6f
Create Settings::SMTP (#13943)
* Fix typo

* Add SMTP configs to Settings::General

* Expand Settings's show page

* Expand Settings::General's constants

* Move smtp_enabled? logic to ApplicationMailer

* Apply suggestions from code review

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>

* Add missing descriptions and placeholders

* Remove production guard clause

* Change delivery_method to a callback

* Create Settings::SMTP

* Run migration

* Move constants

* Remove SMTP from Settings::General

* Create SMTPSettingsController

* Add back guard clause

* Change which perform_deliveries configuration to use from

* Update config/environments/production.rb

* Rename migration to singular

* Run migration again

* Fix name

* Alphabetize and add validation for authentication

* Move settings and enabled? logic to Settings::SMTP

* Change after_action to before_action

* Fix broken spec

* Fix broken spec

* Create SMTP specs

* Provide default for port

* Create spec for ApplicationMailer

* Fix broken spec

* Move smtp_enabled?

* Search and replace

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
2021-06-14 10:29:43 -04:00
Michael Kohl
6dfabd578f
Rename SiteConfig to Settings::General (#13573)
* Rename SiteConfig

* More renaming

* Update spec

* Update mandatory settings mapping

* More renaming

* e2e test fixes

* You have a rename, and you have a rename

* Spec fix

* More changes

* Temporarily disable specs

* After-merge update

* Undo rename for migration

* undo rename of DUS

* Fix DUS

* Fix merge problem

* Remove redundant DUS

* Fix specs

* Remove unused code

* Change wrong class name

* More cleanup

* Re-add missing values to constant

* Fix constant

* Fix spec

* Remove obsolete fields

* Add accidentally removed field

* Update spec

* Move methods from Settings::General to ForemInstance

* Remove unneeded model

* Change mentions of 'site config'
2021-05-21 14:45:37 +02:00
Molly Struve
265c4d72c1
Optimization: Set ForemInstance.deployed_at Locally to Better Mirror Production (#12500) 2021-02-01 07:43:23 -06:00
Ridhwana
65d439e70d
Attempt to fix random test failures when dealing with the ForemInstance class (#12294)
* fix: set the deployed at to nil

* chore: make sure the heroku env is also set to empty

* Sprinkle more after block

Co-authored-by: Mac Siri <krairit.siri@gmail.com>
2021-01-15 19:44:18 +02:00
Alex
01a4b41fed
Fix shell version logic in async info controller (#12262)
* Add .to_s to ForemInstance.deployed_at

* test: could it possibly be holding onto the cached value across the tests

Co-authored-by: Ridhwana <ridhwana.khan16@gmail.com>
2021-01-13 13:20:34 -05:00
Ridhwana
4549144fbb
Refactor deployed_at and latest_commit_id code (#12224)
* WIP: release footprint in the admin UI

* feat: show the commit ID and the date

* chore: change env optional to empty string

* fix: change the FOREM_BUILD_DATE to RELEASE_FOOTPRINT

* feat: add Not Available as a last option

* test: last deployed time and latest commit id

* feat: update the way we change the env variable!

* fix: we need to set the RELEASE FOOTPRINT so that this clause is not hit - `return path if release_footprint.blank?`

* feat: add a Forem Instance Model

* chore: rename variable

* feat: use the new model that we created

* feat: Update the Forem Instance model to remove Not available from the model method and add it to the view layer

* test: Forem Instance model to return the correct values when present

* feat: use Forem.deployed_at instead of the Application config directly

* chore: remove the initializer

* feat: rename the data keys to reflect what it does

* fix: oops evaluate the var

* refactor: static values that can never change during the lifetime of the app should be constants

* chore: setup the test to have a release footprint before the test gets executed

* chore: remove the methods

* revert to method + cache

* revert to using method

* reset the instance variable
2021-01-13 16:53:59 +02:00