Commit graph

36 commits

Author SHA1 Message Date
Rajat Talesra
96d67abf50
Resolve minor UI bug in Admin-Config (#18668) 2022-11-04 16:13:24 -04:00
Rajat Talesra
cc4f3556cf
Use preact-modal in adminModal (#18613)
* Commented test

* Removed User subscription related modal code

* Fixed test case

* Updated tests

* Added more tests
2022-10-29 23:58:28 +05:30
Takuya N
63c3229e36
Remove use of jQuery on admin config JS (#17206)
Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>
2022-04-15 07:13:00 -06: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
Julianna Tetreault
615137a883
Remove the "Getting Started" Section from the Config (#16033)
* Removes the Getting Started section and related code from the config

* Removes the admin_manages_configuration_spec.rb

* Removes "Required" tags from Config

* Reverts removal of activateMissingKeysModal

* Removes mandatory.rb
2022-01-20 07:31:35 -07:00
Ridhwana
a8fa1c916a
Creator Onboarding Logo Updates for launch [Will be merged and Deployed 17 January] (#16103)
* feat: hide the logo_svg behaind a featur flag if we've ennabled it

* feat: show the input field iis the feature flag is enabled

* feat: show the new logo when the feature fkag is enabled

* chore: change working

* feat: add a logo spec

* fix: with the updated changes we show a community name if there is no logo, hence we sometimes would need to update the community name instead of the logo on preview

* fix: use innerText

* Update app/javascript/admin/controllers/config_controller.js

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

* empty commiit

* empty commiit

Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>
2022-01-17 16:46:06 +02:00
Julianna Tetreault
0dfad5b07f
Remove Setup Banner (VerifySetupCompleted) (#15969)
* Remove all references to VerifySetupCompleted to remove setup banner

* Removes setup banner-related specs

* Adjusts the title in activateMissingKeysModal

* Adds the show expand classes to getStartedBodyContainer in show.html.erb
2022-01-10 10:30:05 -07:00
Nick Taylor
6df9309284
Added the logo upload to the admin -> customization -> config -> images section. (#15729)
Co-authored-by: Michael Kohl <citizen428@forem.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
Co-authored-by: Mac Siri <mac@forem.com>
Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
2021-12-15 14:10:27 -05:00
Nick Taylor
52ec967de5
Fixed issue where element didn't exist in the config Stimulus controller. (#15408) 2021-11-17 15:25:17 -05:00
Ridhwana
aa6d80bc5d
Only enable user invitations page when SMTP is enabled (#15219)
* first pass of styling of the page

* feat: scroll to the position in the config controller in stimulus

* feat: add the tooltip and a cursor thats not allowed

* feat: add a disabled property for all that needs smtp to be enabled

* feat: update the form styling

* feat: update the form

* specs: update the label name

* fix: syntax error

* chore: update the newline

* spec: test the invitation flow

* fix test

* feat: update the form as per suggestions

* spec: update the tests to match the new workflow

* oops committed debugging code

* chore: add a before to set the smtp_enabled method

* feat: update the boldness and fontsize of the link

* feat: remove size
2021-10-29 17:41:30 +02:00
Suzanne Aitchison
5069cd681a
Markdown editor toolbar (#14876)
* rough starting point, roving tabindex in toolbar, bold and italic buttons

* refactor, add link

* add ul

* add ordered list

* core formatters in place, wip

* overflow options

* add keyboard shortcuts

* tidy up some dodgy classes

* add mocks for runtime in test and storybook, use correct modifier key for tooltip

* style tweaks

* refactor tooltips

* add markdown formatters tests

* add tests for toolbar component, fix mistake in overflow menu tooltips

* undo change no longer needed to button

* fix issue accessing runtime in formatters file

* only show darkened buttons and tooltips when focus-visible is true

* mobile view

* fix for responsive buttons & roving tabindex

* tweaks from PR review

* update cursor position on link insertion

* add a new line after block selection formatting

* align icons in center

* tidy up overflow menu listeners

* small refactors

* test for new text area util

* tidy up new lines after syntaxes

* fix logic in cursor offsets for links

* prevent scroll jumps after inserting syntax

* some style tweaks

* insert level 2 heading with new lines above and below

* update icons

* use margin instead of gap
2021-10-19 09:22:54 +01:00
rhymes
e5226b9951
Upgrade Stimulus to 3.0 (#14869)
* Upgrade Stimulus to 3.0

* Remove unused variable

* Bump postcss from 8.3.8 to 8.3.9 (#14956)

Bumps [postcss](https://github.com/postcss/postcss) from 8.3.8 to 8.3.9.
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/8.3.8...8.3.9)

---
updated-dependencies:
- dependency-name: postcss
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-05 20:00:37 +02:00
Daniel Uber
57561b1815
Check required inputs for apple authentication (#14750)
All providers except apple use a common key/secret form partial, but
the apple authentication section uses client_id, key_id, pem, and
team_id.

Assuming all four of these are required, when the enabled provider
name is 'apple', check for those values. For other providers (github,
facebook, etc) only check secret and key as before.
2021-09-17 07:39:53 -05:00
Arit Amana
aa5f18b234
Admin Save Confirmation - Removing Badge Achievements (#14684)
* schema file undelete description

* update with main

* update with origin

* update

* create controller; hook up to badge_achievements

* almost done with implementation

* push up what I have

* complete implementation; generalize snackbar usage

* start writing tests

* add confirmation text entry step to test

* Fix delete via JS

* implement danger notice for errors

* complete cypress test

* create ErrorAlert CustomEvent and implement

* fix failing badge_achievements spec

* start applying PR review changes

* hook up Preact Modal

* fix cypress tests

* remove old comment

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

* consolidate messaging functions

Co-authored-by: Michael Kohl <citizen428@forem.com>
Co-authored-by: Nick Taylor <nick@forem.com>
2021-09-15 21:25:01 -04:00
Arit Amana
877cb5c322
Save Confirmation - Admin (Part 1 of 2) (#14418) 2021-09-02 11:49:05 -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
Michael Kohl
5406b0576e
Split Settings::Authentication from SiteConfig (#13095)
* Split Settings::Authentication from SiteConfig

* Move specs

* Sort fields

* Update settings usages

* Update recaptcha usages

* Add data update script

* Update spec

* Rename SiteConfigParams concern

* Fixes, new route, new controller

* Controller and service refactoring

* More controller and service updates

* Spec updates

* More spec fixes

* Move file

* Fix FeedbackMessagesController

* Update admin/configs_spec

* Fix remaining specs in admin/configs_spec

* Fix configs API

* Formatting

* Clean up old service object

* Various fixes

* Update DUS

* Add model argument to admin_config_label

* Fix key name

* Fix specs

* Add distinct request caches for settings classes

* Fix e2e tests

* Fix remaining system spec

* Make DUS idempotent

* Move routes block

* Cleanup

* Switch to ActiveSupport::CurrentAttributes

* Pinned rails-settings-cached

* Update e2e test

* Update lib/data_update_scripts/20210316091354_move_authentication_settings.rb

Co-authored-by: rhymes <rhymes@hey.com>

* Add guard to DUS

* Temporarily re-add two SiteConfig fields

* Fix config show view

Co-authored-by: rhymes <rhymes@hey.com>
2021-04-12 09:41:09 +02:00
Nick Taylor
f222497913
Disabled 'no default exports' rule for Storybook files and Stimulus controllers (#13032) 2021-03-17 21:29:39 -04:00
Nick Taylor
4a67d66ec5
Stimulus controllers needed to be default exports. (#12543) 2021-02-02 13:35:28 -05:00
Katie Davis
76453b41fb
Updates ESLint rules to error on default imports (#12512)
* add rule

* add named imports

* more missed files

* so many files
2021-02-02 10:24:03 -05:00
Arit Amana
3a984c8ee7
[2020 EOY Issue] Modal alert when enabling Auth Provider without keys (#12135)
* Start hooking things up

* further generalize adminModal, hook up relevant code

* Complete implementation

* remove comments

* Address QA suggestions

* Address QA suggestions

* Use object parameter for adminModal

* starting the admin cypress tests

* Code review suggestions

* remove incomplete test

* rename data attributes to make more sense

* complete the work

* use destructuring

* edit warning modal text
2021-01-13 13:54:39 -05:00
rhymes
202053cf96
Admin: Change label of toggle buttons in Configuration panel (#12183) 2021-01-11 16:38:16 +01:00
Julianna Tetreault
ca6ba1af7d
Replace collective_noun with community_name (#11846) [deploy]
* Removes collective_noun and collective_noun_disabled from app

* Config Generalization: replaces community_qualified_name with community_name
  - Generalizes SiteConfig after the removal of collective_noun field
  - Updates copy where necessary to be readable with community_name
  - Makes the community_name SiteConfig description more explicit
  - Adds flexibility for Admins by removing appended "community"

* Adds a data_update script to remove collective_noun and collective_noun_disabled

* Removes appended community from stories_controller.rb

* Removes unnecessary quotation marks around SiteConfig.community_name.to_s

* Makes SiteConfig community_name description more explicit

* Removes topic from #email_from and replaces arg with _

* Removes argument from #email_from (facepalm)

* Reverts changes to application_mailer and notify_mailer_spec

* Removes default "Community" topic from application_mailer and makes topic optional

* Refactors #prepopulate_new_form to resolve Code Climate failures

* Refactors #email_from even further by use of a ternary operator per review suggestion

* Simplifies the data_update script used to remove collective_noun per review request

* Adds a data_update script to append community to community_name

* Updates data_update script to correctly append Community to community_name

* Removes RemoveCollectiveNounFromConfig and updates other script

* Removes superfluous false from data_update script

* Updates data_update script to be more idiomatic
2020-12-28 09:34:17 -07:00
rhymes
7eb7cef1b9
Upgrade Admin to Stimulus 2.0 (#11776)
* Upgrade Stimulus to 2.0

* Convert ArticleController to use Stimulus 2

* Convert ModalController to Stimulus 2

* Convert BufferController to Stimulus 2

* Convert ConfigController to use Stimuus 2

* Convert ImageUploadController to Stimulus 2

* Convert Reaction controller to Stimulus 2
2020-12-08 10:43:56 +01:00
Arit Amana
42e10e7b42
[EOY2020 Issue] Default new forems to Email Authentication only (#11696)
* Set default Auth Providers to empty array

* complete implementation; tests remain

* tests

* fix failing specs authenticator_spec.rb

* Fix failing specs

* fix more failing specs

* fix more failing specs 2

* update failing spec

* Update app/views/admin/configs/_auth_provider_settings.html.erb

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

* Update app/assets/stylesheets/admin.scss

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

Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>
2020-12-02 16:49:07 -05:00
Ben Halpern
f3a69bbd84
Allow Forems to specify which domains are allowed for registration (#11442)
* Allow authors to restrict which emails can sign up

* Add form and tests

* Check for email presence in allowed email flow

* Fix test domains

* Fix codeclimate issue
2020-11-17 08:43:46 -05:00
rhymes
f9506affb5
Use faster JS selection methods (#11409)
* Add JS tips section to frontend documentation

* Replace document.getElementsByTagName('body') with document.body

* Replace querySelectorAll with faster selecting methods where appropriate

* Replace querySelector with faster selecting methods where appropriate

* Fix typo

* Fix forEach and getElementsByClassName

* Change querySelector* to faster methods in erb files

* Change querySelector* to faster methods in ruby files

* Fix runkit tag

* Various fixes

* Update app/assets/javascripts/initializers/initializeEllipsisMenu.js

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

* Update app/assets/javascripts/utilities/slideSidebar.js

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

* Commenting out flaky spec

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
2020-11-16 17:35:50 +01:00
Josh Puetz
2223e5468b
Email login always on (#11307)
* Starting out

* Building away...

* Hooking buttons up

* Hook Auth Provider buttons to Array Field

* trying to fix NoNameError

* Remains InviteOnlyMode disable and tests

* Smashing remaining tasks

* Last of tasks

* add tests

* Complete specs and tests 😅

* Fix bug

* Additional guard

* pass event to functions

* Position Email Auth first

* Fix bug in Email Auth Modal

* Fix spacing issue

* Update docs for adminModal.js

* Show/hide Enabled Indicator with Enable/Undo buttons

* Complete Auth Providers functionality

* Only update `allow_email_password_registration` from admin

* Remove duplicated methods

* Some refactoring around fact that Email Login is now always on (#11382)

* Fix merge (again!)

Co-authored-by: Arit Amana <msarit@gmail.com>
Co-authored-by: Arit Amana <32520970+msarit@users.noreply.github.com>
2020-11-12 09:32:58 -06:00
Arit Amana
4d93112084
Make final Auth Provider Refactor code changes (#11303) 2020-11-07 07:49:16 -05:00
Arit Amana
08796b5cee
[Team Email Login] Refactor Authentication Provider Enable/Disable (#11185)
* Starting out

* Building away...

* Hooking buttons up

* Hook Auth Provider buttons to Array Field

* trying to fix NoNameError

* Remains InviteOnlyMode disable and tests

* Smashing remaining tasks

* Last of tasks

* add tests

* Complete specs and tests 😅

* Fix bug

* Additional guard

* pass event to functions

* Position Email Auth first

* Fix bug in Email Auth Modal

* Fix spacing issue

* Update docs for adminModal.js

* Show/hide Enabled Indicator with Enable/Undo buttons

* Complete Auth Providers functionality

* Update app/javascript/admin/controllers/config_controller.js

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

* Update app/javascript/admin/controllers/config_controller.js

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

* Update app/controllers/admin/configs_controller.rb

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

* Update helper names

* better implementation of EnabledIndicator show/hide

* Small copy changes

* Update spec/helpers/authentication_helper_spec.rb

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

* Update app/views/admin/configs/show.html.erb

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

* Update app/helpers/authentication_helper.rb

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

Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>
2020-11-06 18:19:34 -05:00
Lisa Sy
8d08191e9a
[Front-End Q/A] Config Authentication view (#11169)
* Update spacing and add Crayons classes

* Update modal interaction and style

* WIP Hide collapsed container

* Refactor invite only mode UX using tooltip

* Fix recaptcha toggle

* Implement button-text change and enabled-indicator hide

* Remove small icon alignment

* Update app/views/admin/configs/show.html.erb

* Fix icon and row alignment

* Fix enabled-indicator bug

Co-authored-by: Arit Amana <msarit@gmail.com>
2020-11-03 20:12:19 -08:00
Arit Amana
e00cb5df17
[Team Email Login] Genericize AdminConfig Modal (#11145)
* Genericize AdminConfig Modal

* Rename function, add JSDoc documentation

* Tests for modal-building function

* Still trying to get jest test to pass

* Fix failing jest test
2020-10-29 15:01:37 -04:00
Arit Amana
1912ffdc46
[Team Email Login] Refactor the Email Authentication flow (#11090)
* Hooked "Enable" button to hidden checkbox

* Hooked "Close" button to close email settings and show "Enable/Edit" button

* Additional hookups

* Start building generalized Modal blocks

* Everything hooked up except styling and a few Qs

* last of the hookups; ensure logic flow

* clean up

* specs to cover email auth refactor

* Fix bug surfaced by Vaidehi

* Incorporate PR feedback

* prevent email auth disable if invite-only-mode

* adjust emailAuthModal body text

* Sundry improvements

* Last-mile tweaks

* Trying to get 3rd party auth deselect to work

* delete unnecssary function

* remove superfluous comment

* Move inline styling into CSS file

* Incorporate PR feedback

* Incorporate more PR feedback

* Make Confirm btn intent clearer

* Add TODO comment
2020-10-28 13:37:11 -04:00
Jacob Herrington
c91c07920f
Add config option for Forem collective noun (#11107)
Not everyone will want to use "Community" to describe their Forem, so
now they have some flexibility there.
2020-10-27 12:45:52 -04:00
Arit Amana
8e57cf17ad
[Team Email Login] Admin enable/disable recaptcha during email signup (#10846)
* Initial Implementation

* Complete hookup of recaptcha guard

* Write tests for recaptcha during email signup

* Addressing PR changes 1

* Create helper method and write specs

* fix bug
2020-10-19 16:20:18 -04:00
Jacob Herrington
c37b283865
Allow Forem admins to enable an invite only mode. (#10758)
* Add invite only mode field to SiteConfig

* Add UI elements for invite only mode
2020-10-12 11:27:22 -04:00