* Pages API pt 1 (read/get/index+show)
* Update spec/requests/api/v1/docs/pages_spec.rb
Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
* Update spec/requests/api/v1/docs/pages_spec.rb
Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
* API Key not required for index & show
* API Feature flag has long since been removed
* Page schema
* Fix spec broken by merge
Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
* Minor fixes
* Replaced justify-content-between with justify-content
* Override all heading tags, paragraph tag
* Fixed a tag underline css
* Removed bootstrap library
* Removed duplicate crayons-select class
As I was looking to implement the new Spaces feature (see
forem/forem#16842), I began looking at how to adjust the admin menu. I
found the Menu and AdminMenu. I wanted to add the "spaces" item under
the `:content_manager` scope. Looking at the implementation, I saw I
would need some additional branching logic.
To get an understanding of the implementation, I chose factor towards
classes.
This refactor does a few things:
1) Clarifies a method name (e.g. "children?" becomes
"has_multiple_children?")
2) Adds some tests of the menu implementation.
3) Removes deeply nested hashs in favor of first class objects.
4) Removes a complex method for determining menu visibility, instead
favoring a method that either takes a boolean OR a lambda.
There are further refactors to consider, especially in regards to the
helper methods and some of the coercion of strings into different
formats. But this refactor gets me the part I most am interested in:
Making it easier to specify a menu item as visible or not.
* Focus flash message button on load
* update specs
* Update app/javascript/packs/admin/flashMessages.js
Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
* Update app/javascript/packs/admin/flashMessages.js
Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
* Adds a help icon to the creator settings setup page
* Moves the help icon styles from the a tag to the inline_svg_tag
* Removes reused class and aligns help icon to the right
* Refactors help icon out into a partial used across necessary views
* Moves .admin-help-button class from admin.scss to scaffolds.scss
* Adds further utility classes to align help icon as expected
* 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
* 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
* Show the navigation options regardless of screen size
* Add link back to forem homepage for small screens
* Fix link URL + add small padding
* Remove padding class
* 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'
* chore: remove current_admin routes file
* feat: move all the admin routes into the admin file
* chore: remove conditionals for the sidebar and tabbed navbar
* remove some more notes where we use the admin_restructure feature flag
* chore: amend the tests now that the old routes and the admin_restructure flag are removed
* chore: remove more references to the admin_restructure flag
* chore: fix the tests
* chore: remove sidebar_spec
* chore: add slash back
* chore: comment it out for now whilst I try and figure out why its not passing
* 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
* make clean_fork executable
* fix attribute className not in a JSX context
* delete useless role main on main tag
* delete useless role banner on header
* 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>
* 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
* 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>
* 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
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>
* 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
* fix: badge achievements
Co-authored-by: Michael Kohl <me@citizen428.net>
Co-authored-by: rhymes <rhymes@hey.com>
* feat: add a feature flag for data update scripts
* feat: write some tests for it
* chore: oops
* stub the data update scripts out wherever the profile admin is
* chore: remove some unneeded ones
* refactor: use call_original
* feat: add a feature flag to all the Forems (but not enable it as yet)
* feat: add tech_menu_items to the admin helper
* feat: add the tech resources to /admin if the user has the correct role
* feat: use a partial that will show the data update scripts in the navbar with the correct role
* chore: use a method
* test: chore
* feat: setup the data to need permission single_resource_admin with DataUpdateScript permissions
* chore: remove the if current_user.tech_admin?
* chore: remove line
* feat: add a DUS for single_resource_admin roles to be added to users with tech_admin roles
* fix: move all teh routes outside of the block where tech_admin is required.
* chore: use the constant and remove the method
* chore: add a comma
* Update config/routes.rb
Co-authored-by: rhymes <rhymes@hey.com>
* feat: add a tech admin role to the dropdown
* feat: add the tech admin role along with single_resource_admin
* chore: oops
* refactor: amend the spec to use let blocks
Co-authored-by: rhymes <rhymes@hey.com>
* 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
* Adds ability for admins to create new tags via /admin/tags
* Merge branch 'master' of github.com:forem/forem into fdoxyz/admin-new-tags-11026
* Fix rubocop pre-hook
* UI Tweaks
* replaces show with edit action & other minor changes
* Reverse unrelated changes
* Removed more unrelated edits
* Fix specs
* Fix moderator link
* Simplify admin and add links to help pages
* Add line
* Add line
* Update app/views/layouts/admin.html.erb
* Update app/controllers/admin/configs_controller.rb
* Move svg to own file