Commit graph

60 commits

Author SHA1 Message Date
Mac Siri
afa73e06e3
Replace Webpacker with Esbuild (#20470)
* Migrate to esbuild WIP

* Add exclude

* Remove redundant file

* Move file

* Move to javascript_include_tag

* Lint fix

* WIP

* WIP

* Add watch mode to esbuild WIP

* Get jest working

* Remove babel

* Revert "Remove babel"

This reverts commit 6da35260aa19d6f97f586deb66c0ecaf48433b73.

* More WIP

* Got image to load

* WIP

* Resolve audit

* Lint fix

* WIP

* Fix jest spec

* [CI] Remove asset-restore for test build stage

* Production compliant

* Temp disable sourcemap

* Update glob

* Add esbuild helper to stimulus

* Import fragment

* Temp disable coverage to see failing tests

* Fix broken spec

* Address lint

* Set proper es6 target

* Use esbuild for everything

* wait what

* Revert "Set proper es6 target"

This reverts commit 98f5278093421baa8ffe2ca580845b01c1a1eadf.

* Revert "Use esbuild for everything"

This reverts commit 0ac46738f07ffcb6af095ccb1ffa5e439b7fefa3.

* Replace uglifier with terser

* New compiled assets version

* Remvoe honeybadger-io/webpack

* Remove cypress coverage checks for now

* Update jsconfig.json

* Update docker-compose

* Remove public/packs-test from ci cache
2024-01-25 20:29:21 +00:00
Joshua Wehner
7f41dae631
Pages API: Read (get index+show) (#18970)
* 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>
2023-01-25 17:15:27 +01:00
Rajat Talesra
ff790c147e
Removed jQuery usage from admin ( -- now it exists only in views/videos) (#18976)
* Remove jQuery

* Added jquery back to videos

* Removed jquery code

* Nit fix

* Revert incorrect code

* Updated jquery code to javascript

* Removed jquery from comments
2023-01-24 21:03:12 +05:30
Rajat Talesra
4ae1721848
Remove bootstrap library fully with some minor fixes (#18945)
* 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
2023-01-16 20:07:12 +05:30
Rajat Talesra
497f494ef3
Removed nav related classes from feedback tabs (#18924)
* Removed bootstrap from listing_categories, listings, navigation_links

* Removed not-used bootstrap classes from admin/tags

* Removed bootstrap from admin/settings

* Fix collapse glitch in profile-fields

* Feedback partial progress

* Feedback partial progress

* Removed form-control

* Replaced card with crayons-card

* Fixed profile field UI

* Removed collapse hide and show classes

* Removed collapse hide and show classes

* Removed collapse hide and show classes

* Nit height fix

* Nit width fix

* Updated tests

* Removed nav related classes from feedback tabs

* Remove btn-classes from commets too.

* Removed row and col-12 classes

* Removed bootstrap classes from Authentication

* Removed bootstrap classes from Mascot

* Removed bootstrap classes from Onboarding

* Removed bootstrap classes from lock/unlock discussions

* Notes design changes

* Removed bootstrap classes from Organization

* Removed bootstrap classes from Organization

* Remove alert bootstrap class from admin.html.erb

* Fixed tab_pane related code

* Enable click listener on notice

* Enable click listener on notice

* Applied suggested changes

* close bootstrap class removed

* Removed element completely
2023-01-09 20:18:28 +05:30
Josh Puetz
fc1031f52a
Add Google Analytics 4 Support (#18124) 2022-07-21 09:26:13 -05:00
Takuya N
1cb86b973a
Update Bootstrap from 4.4.1 to 4.5.3 (#17391)
Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>
2022-04-22 07:37:12 -04:00
Suzanne Aitchison
87dc5da17b
tweak crayons layout for admin section (#17122) 2022-04-05 13:14:50 +01:00
Jeremy Friesen
71e9f2bfb4
Refactoring AdminMenu and Menu towards classes (#16847)
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.
2022-03-21 13:31:20 -04:00
ludwiczakpawel
b321d1ec11
Removing bootstrap: admin sidebar navigation (#16618)
* nav

* nav

* move cheese around

* helpers

* optimize

* optimize

* optimization

* optimization

* children helper

* children helper

* Update app/views/admin/shared/_nested_sidebar.html.erb

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

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2022-03-01 15:46:45 +01:00
Suzanne Aitchison
4d07a1ef7b
Tweaks to the admin flash messages flow (#16582)
* 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>
2022-02-16 10:07:21 +00:00
Nick Taylor
7e1869f1d1
Added E2E tests for new admin member details view (#16513) 2022-02-11 08:47:01 -05:00
Jeremy Friesen
2fd94fcc87
Ensuring that body.dataset is JSON parsable (#16441)
Prior to this commit, if our community name included a `"` we would
encounter a parse error.  Using the [j][1] which is a terse alias for
[escape_javascript][2], we will now be escaping those characters that
cause grief in some of our parsings.

I believe there is a larger audit that needs to occur regarding all
`data-` renderings.

Hopefully this will catch a flakey test.

Closes #16440

[1]:https://api.rubyonrails.org/classes/ActionView/Helpers/JavaScriptHelper.html#method-i-j
[2]:https://api.rubyonrails.org/classes/ActionView/Helpers/JavaScriptHelper.html#method-i-escape_javascript
2022-02-08 07:30:43 -05:00
ludwiczakpawel
df34cbbd7e
Admin layout update (#16345)
* .

* Brand colors

* Update app/views/layouts/admin.html.erb

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

* another label change

* Update app/views/layouts/admin.html.erb

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

Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2022-01-31 11:53:46 +01:00
Nick Taylor
13fc65953b
Removed font-awesome from the admin section (#16239) 2022-01-21 08:56:22 -05:00
Michael Kohl
19d6a26f7b
Update remaining Crayons icons (#16100)
Co-authored-by: Nick Taylor <nick@forem.com>
2022-01-18 13:41:04 +07:00
Suzanne Aitchison
15fed1cce4
Revise skip link behaviour (#15401)
* Revise skip link route change behaviour

* remove cypress test for divergent behaviour no longer needed

* fix import path

* remove duplicate styles - woops

* use translated string
2021-11-18 13:45:08 +00:00
ludwiczakpawel
1f685d93d1
Remove unused assets (#15367)
* remove unused assets

* spec update

* spec

* spec

* minus

* whoops

* whoops
2021-11-16 19:57:37 +01:00
Julianna Tetreault
807e11b80c
Provide "Help" on the Creator Onboarding Setup Page (#15308)
* 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
2021-11-11 08:42:56 -07:00
Nick Taylor
dad0f9d4cc
Added a skip link for the admin area. (#15340) 2021-11-10 06:37:48 -05:00
Ridhwana
44cd136ae0
feat: update the admin foreme links (#15230) 2021-10-29 10:18:54 -06:00
Ben Halpern
49247fdc8c
Remove organization dependency and improve display ad UX (#14913) 2021-10-05 08:29:08 -04:00
Arit Amana
8cbbc222e9
Heavy Confirmation Flow for Broadcast-Destroy (#14819)
* 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
2021-09-29 07:43:00 -04: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
rhymes
7ff882b8ce
Refactor Admin Member Detail view - Tools section (#14283)
* 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
2021-08-17 18:55:53 +02:00
Fernando Valverde
0b809e1621
[15-min fix] Small tweaks for small screen usage in Admin (#14341)
* first changes

* Trigger CI
2021-08-04 12:21:57 -06:00
Fernando Valverde
1826e50564
[15-min fix] Show the navigation options regardless of screen size (#14313)
* 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
2021-07-23 14:25:00 -06:00
Andy Zhao
0eaea33710
Replace admin guide links (#13967)
* Replace admin guide links

* Add missing /docs/

* Add proper links
2021-06-23 15:01:01 -04:00
rhymes
3be26dae97
Remove duplicate jquery import, remove jquery-rails and use @rails/ujs (#13891)
* Remove unused jQuery include in Listings

* Use @rails/ujs in the admin

* Remove jquery-rails

* Content is mandatory for listings

* form_with defaults to local: true

* Update app/views/listings/delete_confirm.html.erb

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

* Update cypress/integration/listingFlows/deleteListing.spec.js

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

* Update cypress/integration/listingFlows/deleteListing.spec.js

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

* Update cypress/integration/listingFlows/deleteListing.spec.js

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

* Apply feedback on e2e and fix a bullet warning

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2021-06-01 15:28:09 +02: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
Ridhwana
ba5c97de50
RFC 50 - Remove old admin routes and related code (#13579)
* 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
2021-05-03 16:03:38 +02:00
Ridhwana
b027a0c342
fix: change aria-page to aria-current (#13558) 2021-04-28 21:33:29 +02:00
Ridhwana
c5bcb4c021
RFC 50: fix some more hardcoded paths (#13473)
* 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
2021-04-26 17:49:54 +02:00
Julien Maury
36adcd740d
Remove some HTML errors (#13288)
* 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
2021-04-07 11:46:12 +01:00
Michael Kohl
7c31a9cc98
Remove buffer gem and related code: step 1 (#12993)
* Remove buffer gem and related code

* Remove more Buffer-related code

* Remove one more Buffer spec

* Remove DUS

* Remove more Buffer code
2021-03-24 09:58:38 +07:00
Ridhwana
c53cfc5951
RFC#50-P4: Feature Flagged Routes and Interaction Design (#12967)
* 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>
2021-03-23 11:12:54 +02:00
Ridhwana
45c0d84e48
RFC#50-P3 Navigation Item Focus (Styling and Behaviour) (#12936)
* 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>
2021-03-10 13:07:16 +02:00
Ridhwana
4b902b01c0
RFC#50-P2 Restructuring the sidebar to add nested nav items + tabbed nav items (#12886)
* 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>
2021-03-08 13:14:30 +02:00
Jacob Herrington
2ae6ca570e
Fix double render of Overview in admin navbar (#12857) 2021-03-02 07:35:10 -06:00
Jacob Herrington
92217be4ed
Add admin overview page (#12726)
* Add admin overview page

* Rename admin_portals spec

* Fix admin nav bug

* Add ahoy tracking to admin overview

* Fix PR Feedback

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

* Make decorative element more visible

* Remove inline layout styles

Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>
2021-03-01 18:59:05 -06:00
Ridhwana
a61f88fc16
Adds a feature flag for Data Update Scripts (#12641)
* 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)
2021-02-10 18:22:27 +02:00
Ridhwana
05e31971cb
Navigation Items and Role access for Data Update Scripts (#12292)
* 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>
2021-02-09 17:41:14 +02: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
Ben Halpern
1c81978da2
Fix admin header links (#11811) 2020-12-08 14:46:55 -06:00
Fernando Valverde
c740b4e6dd
Adds ability for admins to create new tags via /admin/tags (#11240)
* 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
2020-12-02 08:12:57 -06:00
Ben Halpern
992dc54b0f
Simplify admin config permissions and add links to help pages (#11362)
* 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
2020-11-13 09:56:13 -05:00
Ben Halpern
ec5d0d0d93
Wrap siteconfig images in optimizer (#11276)
* Wrap siteconfig images in optimizer

* Add to admin area
2020-11-05 12:35:07 -05:00
Nick Taylor
d5dcda6af6
Renamed internal.js pack file to admin.js (#11046) 2020-10-23 17:57:39 -04:00
Ben Halpern
7675379b6b
Fix honeybadger key typo (#10991) 2020-10-21 15:51:12 -04:00
Jacob Herrington
35648a696c
Add a link to the Forem Admin Guide to /admin (#11000) 2020-10-21 12:13:41 -05:00