* feat: add a color contrast utility
* feat: add an error when the color contrast is low
* feat: add form validations
* refactor: treat WCAGColorContrast as a library that can be intercanged at any time
* fix: styling
* test: add a test for the contrast
* feat: add test for WCAGColorContrast
* feat: update cypress tests for brand color and color contrast ratios
* feat: update the message to read better
* chore: update the styling
* refactor: address all feedback/suggestions
* Update cypress/integration/creatorOnboardingFlows/creatorSettings.spec.js
Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
* Replaced other .trigger('change')s with .blur()
Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
Co-authored-by: Nick Taylor <nick@dev.to>
* Added alias for app/javascript/controllers
* Added hooks for Stimulus controller.
* Fixed eslint issue with @controllers alias.
* Initial working logo preview.
* Added explicit accept values for png and svg files only for a logo.
* Fixed content layout shift issue and resize to max height 80px.
* Cleaned up logo preview resizing.
* Added focus style to Upload logo label.
* Now the logo preview image has empty alt text as it's visual only.
* Fixed position of upload logo button.
* Removed tooltip for logo.
* Fixed check to load client-side controller.
* Put back tooltip, minus the aria-describedby
* Fixed E2E tests I broke.
* Made the logo preview visible to the accessibility tree.
* feat: update the brand colors on the page when we select a new one
* feat: update the radio button_tags to use crayons-radio
* feat: remove the fill attributes in the svg
* Added support for JPG image upload.
* Fixed height adjustment when width exceeds max preview width.
* feat: add form-background class with an accent
* feat: update the briightness accent on the page
* Fixed JS error if user cancelled file selection for a logo.
* Added the @routes webpack alias for routes.js.erb.
* Fixed data tooltip for assistive technologies.
* Fixed preview logo alignment with upload logo button.
* remove required as it's not doing anything
* feat: update the code brigtness code
* Opting to not show friendly error message if route fails to load.
* Fixed validation message not appearing for logo.
* Revert "Added the @routes webpack alias for routes.js.erb."
This reverts commit 3b6621dcde541f2fa05df6ff75af38955842b88e.
* Reverted to default styling of input[type="file"].
* Moved creator_settings_controller to admin/controllers.
* Updated E2E test for logo preview on the creator settings page.
* create tests for the brand color updates
* feat: update the description
* Update cypress/integration/creatorOnboardingFlows/creatorSettings.spec.js
Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
* Update app/javascript/admin/controllers/creator_settings_controller.js
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* feat: do not update branding if an invalid color is provided
* feat: move the brightness code to its own accent calculator file in js utilities
* test: brightness ratios
* chore: remove whitespace
Co-authored-by: Nick Taylor <nick@dev.to>
Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* 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
* 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
* hook up frontend parts
* complete backend, save success alert issues
* fix broken existing specs
* complete snackbar confirmation on page redirect
* rollback success alert; but leave foundation for it in place
* preserve a11y features of snackbar; complete cypress tests
* test redirect after braodcast destroy
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.
* 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>
* Test with Grid layout
* Use Flexbox
* Replace with utility classes
* Wire up Tools -> Emails
* Stash: will rebase with a better commit message
* Fix transition between Email and Tools component
* Refactor Verify Email Ownership button a bit
* Use respond_to for verify_email_ownership
* Wrap the Preact Snackbar controller in Stimulus and use it from users/tools/email_controller
* Add HTML5 validation to EmailComponent
* Validation and cleanup
* Add Email history list and fix styling
* Additional styling cleanups
* Add error handling
* Close panel after email operations
* Actually use <local-time> GitHub time element correctly
* Add specs for Tools component and controller
* Email to Emails
* Add tests for Admin::Users::Tools::EmailsComponent
* Fix bug with ToolsComponent instantiation in ToolsController
* Add notes to show page
* Add ToolsComponent css
* Use Rails UJS instead of manual Stimulus to connect remote helpers
* Make Notes section come alive by adding its code
* Make Credits section come alive by adding its code
* Go back to vertical flex
* Finalize small restructuring of credits code
* Simplify ToolsComponent instantiation
* Add basic Add user to org functionality
* Make update user permissions form work
* Make remove user from org work
* Use generic Stimulus AjaxController to cleanup code
* Use Stimulus AjaxController for NotesComponent
* Use Stimulus AjaxController for CreditsComponent
* Use Stimulus AjaxController for OrganizationsController
* Add Admin::Users::Tools::ReportsComponent
* Do not display snackbar message if there is no message
* Add Admin::Users::Tools::ReactionsComponent
* Fix EmailsComponent spec
* Add CreditsComponent tests
* Fix quotes
* Add OrganizationsComponent specs
* Add ReportsComponent spec
* Add ReactionsComponent spec
* Fix rubocop violation
* Fix ToolsComponent specs
* Remove unused variable
* More tests
* Use keyword argument for ToolsComponent
* Fill in Tools requests specs
* Use Rspec shared_examples for ToolsController and EmailsController
* Add tests for Admin::Users::Tools::CreditsController
* Add tests for Admin::Users::Tools::NotesController
* Add tests for Admin::Users::Tools::OrganizationsController
* Add tests for Admin::Users::Tools::ReactionsController and ReportsController
* Fix bugs and add tests to Admin::OrganizationMembershipsController
* Add comments to deprecated sections of the UsersController
* Fix bugs and add tests to Admin::UsersController #send_email and #verify_email_ownership
* Add User model tests
* Feature flag fixes
* Add Cypress Tools - Emails tests
* Add Cypress Tools - Notes tests
* Add Cypress Tools - Credits tests
* Add Cypress Tools - Organizations tests
* Add Cypress Tools - Reports and Reactions tests
* Mark the replace target as a polite region
* Update view_component gem
* Tiny fixes
* Fix spec
* Wrap component rendering in render_component
* Move user.related_negative_reactions to a Reaction scope
* Move user.reports to a FeedbackMessage scope
* Move user.last_verification_date as EmailAuthorization class method
* Revert encapsulation to private
* Fix boxes backlinks names
* Add keyboard focus styling to boxes
* Remove duplicate styling
* Remove duplicated header element
* Improve heading hiearchy
* Fix <legend> and labels
* Backlink should be Tools not Users
* Announce section change to screen reader and fix focus
* Fix specs
* Add focus style for backlinks
* Enable email sending in e2e mode
* Use Settings instead of env variable
* Add LandingPage domain model
* Rely on Rails data integrity and remove previous code
* Remove superfluous equality check
* Restore landing_page class method
* Add and fix specs
* Do not attach landing page modal controller unnecessarily
* 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>
* Add SiteConfig.feed_pinned_article and validation
* Display pinned article at the top of feed
* Add (basic) functionality to pin/unpin post
* Admins can pin other users posts as well
* Hide the button if looking at the non pinned post
* Add pinned/unpinned snackbar message
* Rename SiteConfig usage to Settings::General
* Add pinned article to the Admin articles index
* Show the pin post button when there's no pinned article
* Move pinning to a separate controller
* Fix SiteConfig reference
* Hide PinController actions to unauthorized users
* PinnedArticlesController#show action and refactor some of the code
* Add Modal interaction
* Fix modal-pinned checkbox interaction
* Fixed pin/unpin post
* Add ArticleDecorator#pinned? specs
* Add PinnedArticlePolicy and PinnedArticlesController specs
* Add ability to actually pin an article from the admin after submit
* Add partial Cypress pin/unpin spec
* Fix pinned article and add basic Cypress interaction tests
* Add Crayons styling to modal
* Only render the pinned article on the default Feed page
* Use persisted?
* Add some comments
* Update app/javascript/articles/Article.jsx
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* Update app/javascript/packs/homePageFeed.jsx
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* Fix Cypress tests
* Update app/javascript/admin/controllers/article_controller.js
Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
* Fix pinning in article show page
* Used PinnedArticle domain model
* Fix spec
* Update cypress/integration/adminFlows/articles/pinArticle.spec.js
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* Update cypress/integration/adminFlows/articles/pinArticle.spec.js
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* Update cypress/integration/adminFlows/articles/pinArticle.spec.js
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* Update cypress/integration/adminFlows/articles/pinArticle.spec.js
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* Update cypress/integration/adminFlows/articles/pinArticle.spec.js
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* Update cypress/integration/articleFlows/pinArticle.spec.js
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* Update cypress/integration/articleFlows/pinArticle.spec.js
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* Update app/views/admin/articles/index.html.erb
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* Fix merge woes
* Add missing article pin post flows
* Add missing admin article flows
* Add Unpin to Admin as well
* Add Audit::Log entries for pin/unpin actions
* Update app/controllers/stories/feeds_controller.rb
Co-authored-by: Michael Kohl <citizen428@dev.to>
* Do not rate limit in E2E tests
* Use .find instead of .filter
* Rename ArticleIdValidator to ExistingArticleIdValidator
* Treat draft and deleted articles the same
* Make sure posts can be pinned after the pinned article is unpublished or deleted
* Use .get directly
* Fix spec and fix PinnedArticlesController#show
* Strengthen pinArticle Cypress tests
* Add Cypress test heading guard
* Add another Cypress test heading guard
* Remove duplicate validator
* Try using the Tools: header instead of the article title
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
Co-authored-by: Michael Kohl <citizen428@dev.to>
* 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'
* feat: add the collapse style css + a script for the intercepting the bootstrap event
* chore: remove old code
* Add some guards for missing elements and simplify show/hide collapse interaction
* Update app/assets/stylesheets/admin.scss
Co-authored-by: rhymes <rhymes@hey.com>
Co-authored-by: rhymes <rhymes@hey.com>
* fix: remove hardcoded paths
* fix: use path helpers
* swap href for link_to
* feat: use path helpers
* feat: use a data path to send through the path that we will be calling
* feat: pass route through to js
* dus index path
* chore: change to use path_helpers
* feat: update DUS controller
* chore: oops remove these paths
* feat: add the nested sidebar with some elements
* feat: create a tabbed nav item menu
* feat: add the tabbed nav_item partial to the views that need tabbed nav items
* fix: change variable back
* feat: style the sidebar a bit more
* chore: add some more styles
* feat: add a spec for the nested navigational items
* refactor: a more dynamic tabbed admin helper
* feat: add some more nav items
* fix: controller for reports
* refactor: shorthand if statement
* chore: add the whitespace back
* refactor: rubocop fixes
* chore: use any
* chore: remove whitespace
* refactor: rename the variable
* refactor: use a DSL style admin helper
* chore: variable renaming and routes
* rubocop: fixes
* refactor: move files to more apt places
* chore: keep overview as it was previously
* Update app/views/admin/secrets/index.html.erb
Co-authored-by: Michael Kohl <me@citizen428.net>
* Update app/views/admin/shared/_tabbed_navbar.erb
Co-authored-by: Michael Kohl <me@citizen428.net>
* Update app/views/admin/badges/index.html.erb
Co-authored-by: Michael Kohl <me@citizen428.net>
* chore: disable blocklength
* refactor: move the logic to the model instead of in the view
* chore: remove get_ prefix
* chore: move the request mangling to a helper that finds the controller and scope
* Update app/helpers/admin_helper.rb
Co-authored-by: rhymes <rhymes@hey.com>
* Update app/helpers/admin_helper.rb
Co-authored-by: rhymes <rhymes@hey.com>
* refactor: Address feedback
* oops
* oops use tr
* feat: update specs
* feat: make the navbar a dropdown
* feat: add a cursor pointer to the dropdown
* feat: add the icons which results in changed data structure
* fix: badge achievements
* feat: rename to an html file, show and collapse links + show active links
* chore: rename tabbed view to an html file
* fix: scope should be apps not app
* feat: add icons for the admin menu
* feat: increase the margin left
* feat: move the overview into the feature flag block and add an icon
* chore:remove files
* chore: indent
* feat: update crayons -link to have no text-decoration
* feat: current link for a scope with one controller
* Update app/lib/menu.rb
Co-authored-by: Michael Kohl <me@citizen428.net>
* Update app/models/admin_menu.rb
Co-authored-by: Michael Kohl <me@citizen428.net>
* refactor: we added svg to the builder so remove it from creating the hash
* feat: undo change to crayons and add it to the admin stylesheet
* Update app/views/admin/shared/_nested_sidebar.html.erb
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* refactor: change to use ul and li's + a button
* chore: add bracket to next line
* feat: add aria-page
* chore: remove brackets
* feat: added focus specifically for the sidebar
* Update app/views/admin/shared/_nested_sidebar.html.erb
Co-authored-by: Jamie Gaskins <jgaskins@hey.com>
* chore: remove additional title
* chore: indent
* feat: add a visibilee keyword to the payload and set it to true by default
* feat: move the feature flagged routes into the correct sections
* feat: check if an item is visible before rendering it
* feat: amend the tabbed_navbar to be more accessible and add in visibilty checks
* chore: update comment
* chore: amend the styles
* chore: change url to path
* chore: comment
* test: add more tests
* Update app/assets/stylesheets/admin.scss
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* Update app/views/admin/shared/_nested_sidebar.html.erb
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* Update app/views/layouts/admin.html.erb
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* chore: merge
* feat: use focus for browsers that dont support focus-visible (I'm looking at you Safari) and move it within the crayons-link so we dont see it on mouse click
* WIP: first pass of stimulus controller code
* feat: interaction design
* chore: remove unnecessary condiition
* chore: only add transparent background when not the current link
* Update app/models/admin_menu.rb
Co-authored-by: Michael Kohl <me@citizen428.net>
* feat; comment explaining
* feat: add an id on the button to be clicked
* feat: disable currentNavItem
* chore: remove event params
* chore: update cursor
* feat: (safe fail)
only show the tabbed navbar when the roures contain values form the data structure
* chore: pass events through + tests
* trigger an onload event and test the disabling of the menu item
* refactor: tabbed menu items
* feat: account for the visibility of the feature flags
* chore: rubocop fixes
* chore: indentation
* feat: some refactors and updates for rubocop
* Update app/javascript/admin/controllers/sidebar_controller.js
Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>
* feat: set to true
Co-authored-by: Michael Kohl <me@citizen428.net>
Co-authored-by: rhymes <rhymes@hey.com>
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
Co-authored-by: Jamie Gaskins <jgaskins@hey.com>
Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>
* adds focusTrap wrapper to preact Modal component
* add view specific code for focus trap in admin add nav link
* add script to return a focustrap toggle, use in add nav link modal partial
* add trap to edit nav link modal
* add handlers for sign up modal
* update modal controller for admin section, update nav link modals to use
* update other admin modals with new data values for trap
* remove unneeded erb script file
* remove unneeded target
* refactor to remove extra unneeded param
* remove duplicate code, store getFocusTrapToggle in window
* trap focus in comment and bookmark showModal instances for not logged in user
* remove need for activator id
* clean up id refs no longer needed
* remove custom code and re-use focsu-trap lib
* update storybook docs
* update default export in focusTrap
* prevent close button click triggering a modal toggle twice
* ensure if user navigates from a modal the trap is deactivated
* add jsdoc comments and add dynamic import
* ensure admin controller modal traps are cleaned up on disconnect
* update sign up modal to use crayons
* update modal controller and admin nav links modals to use preact modal
* update profile fields modals for new controller
* tweak styling of sign up and admin modals to match previous
* update listings modal to use crayons modal, adapt focus trap to work with click outside
* memoize deactivate callback to ensure modal can be presented on first page load
* add missed focustrap changes
* fix focus trap issues in onboarding flow
* refactor onboarding focus trap, remove getFocusTrapToggle
* tweaks for styling and article modal toggle
* add click outside tests to modal
* add cypress tests for the login modal
* update liquid tag tests affected by change
* refactors to address review comments
* fix issue with login modal presented twice on comment add
* change ids to selectors in admin modals
* small pr comment refactors
* add listings e2e tests
* add nav link modal tests
* fix issue with help modal
* tweak to fix ui bug from merge
* remove context from showLoginModal
* rename toggleModal
* rename state property for clarity
Co-authored-by: Nick Taylor <nick@dev.to>
* Use grid instead of flex
* Use child margin instead of flex gap
* use .grid instead of .flex.flex-column
* Missed one conditional flex gap
* gap-2 safely deleted since there’s only one element
* Add class for crayons-btn-actions
This pattern occurs pretty often. Easy class addition and easy swap out once flex gap is supported in target browsers
* Use crayons-btn-actions
* Adjust styling to use negative margins
* apply crayons-btn-actions
* use margin-right instead of gap
* use .grid instead of .flex.flex-column
* use margin instead of gap for indicators/tooltips in headings
* remove unused class for clarity
* use flex and add margin to small element
* remove gap from flex container and add margin to figure
* crayons-article__main has neither flex nor grid thus gap has no effect
* fix typo
* use actual grid columns
* use gap instead of flex-column
* Apply crayons-btn-actions
* Fix modal window display
* Safari bein a real pain here
Apparently Safari uses a different model to calculate height than other browsers. who knew.
* Added svg image picker to navigation link form
* Added svg image picker to navigation link form
* removed unnecessary attribute at _form.html.erb
* Added targets into SvgIconUploadController
* Fixed accept file type in .erb and stimulus controller
* Fixed UI form elements
* feat: add an error column to the data update script
* feat: save the error to the error field
* feat: save the error when the script fails
* feat: show the script error on the data update script page
* chore: pass the error to mark_as_failed instead of having its own function
* refactor: use presence
* test: ensure that we test an error case of a data update script
* chore: rename errorneous to failing
* test: update some specs, working on the others
* chore: update tests now that there are two files
* chore: change error from a string to a text to allow for more char
* feat: order the data update scripts by the latest script that ran
* feat: when the script has succeeded reset error to nil
* feat: create a model function that will allow the script to be force run
* chore: oops remove the functions form the worker to the model so it can be re-used
* feat: create an endpoint that will call the model method force run when we hit the api by clicking the button
* feat: ensure that the we add an ajax call that calls the controller endpoint
* chore: remove newline
* refactor: change to a more Restful route
* refactor: use Stimulus
* fix: move the code from the model back into the worker so that we can reuse it in the controller
* feat:call the worker in the force_run action and create a show route
* feat: very first draft of using a polling mechanism on the show method after we kickoff the sidekiq job (still need to error handle)
* chore: some syntax changes and unused variables
* fix: call the method correctly with the paramters
* feat: do some error handling
* feat: error handing on the frontend
* chore: use e instead of err
* refactor: just pass the id instead of the whole script
* chore: remove the button
* fix: allow the id to be passed
* feat: handle errors better
* feat: limit the filename column width
* refactor: use a common function to set the banner error
* test: add a test fro rerun button
* test: v1 of the data update script request
* test: write some specs for the js controller
* Update app/controllers/admin/data_update_scripts_controller.rb
Co-authored-by: Michael Kohl <me@citizen428.net>
* tests: update the data worker spec
* chore: clean up the js controller and its tests
* chore: remove whitespaces
* chore: swap the functions based on the controller
* chore: updates to the UI
* chore: remove the standard error catch
* chore: update the alert and error messages
* chore: remove test for error handling for sidekiq run
Co-authored-by: Michael Kohl <me@citizen428.net>
* 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
* 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
* 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
* 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