Commit graph

425 commits

Author SHA1 Message Date
Ridhwana
b06befdce5
feat: aria-hidden (#17375) 2022-04-20 15:29:25 +02:00
Ridhwana
c520cd9b5f
Limit an organizations displayed and add an overflow count (#17339)
* feat: add an overflow count

* fix: alignment

* refactor: pass in variables more cleanly into partials for re-use in tooltips

* refactor: improve the user helpers

* chore: indentation

* Update app/helpers/admin/users_helper.rb

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

* Update app/helpers/admin/users_helper.rb

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

* Update app/helpers/admin/users_helper.rb

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

* Update spec/helpers/admin/users_helper_spec.rb

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

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2022-04-20 13:10:17 +02:00
Jeremy Friesen
e3215a81ba
Adding fw-heavy to spaces H1 (#17351)
From Anuj:

> Going forward we will be using heavy font-weight for the titles of all
> the admin sections. So it’s good consistency-wise.

This resolves that issue.

Closes forem/forem#17327
2022-04-19 15:44:24 -04:00
Suzanne Aitchison
b4b7d4bd39
Admin member index: invitations responsive layout (#17278)
* add expandable search control at mobile size

* add invitations smaller layout

* replace missing member image

* tweaks following merge

* minor layout tweaks

* add actions to smaller view, update cypress specs
2022-04-19 10:00:15 +01:00
Suzanne Aitchison
e2232cd975
Admin member index: style the GDPR requests table (#17287)
* basic table styles added

* small layout

* Change done to deleted
2022-04-15 14:04:18 +01:00
Ridhwana
2746e77fd5
Adding a modal for the CSV export (#17259) 2022-04-14 18:19:28 +02:00
Julianna Tetreault
317b066853
Hide Role Badges from the Member Index View (for the time being!) (#17282)
* Comments out role bages in the Member Index View for the time being

* Further comments out #cascading_high_level_user_roles
2022-04-14 07:18:38 -06:00
Julien Maury
01c1d44e65
Fix duplicate IDs on homepage (#17092)
* fix duplicate ID main nav

* fix duplicate ID other nav headings

* fix duplicate ID reading list count

* fix duplicate attribute class

* missing case readingCountList on feed

* missing dot in query selector

* Revert "fix duplicate ID other nav headings"

This reverts commit 4f495962c47e08f0f6c41e33e897b2db176432f5.

* use generic class 'other-nav' for tests

* pass a variable 'context' to the partial nav

* pass var 'context' to partial

* fix unwanted typo in partial sidebar

* Update app/views/admin/navigation_links/index.html.erb

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

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

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

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

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

* js-reading-list-count renaming

* use data-testid instead of generic classes for tests

* fix typo in specs

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2022-04-14 10:48:55 +01:00
Suzanne Aitchison
a0a4b8a851
Member index (Phase 2) - Invitations actions (#17213)
* Add actions to invitations table

* table style tweaks

* add specs for cancel and resend actions

* rspec resend test
2022-04-14 08:26:36 +01:00
Suzanne Aitchison
3829e836a2
Admin member index - minor UI/a11y fixes (#17246)
* apply some missing classes

* sweep up minor UI and a11y issues

* add missing context locals in invitations view
2022-04-14 07:59:31 +01:00
Ridhwana
44c9535d06
chore: typo (#17258) 2022-04-12 22:14:59 +02:00
Julianna Tetreault
760a51f5f7
Refactor Member Index View Users Query (#17251)
* Moves eager loading from _member_index view to Admin::UsersController

* Adds .registered to Admin::UsersQuery
2022-04-12 11:20:28 -06:00
Ridhwana
aff29406ac
First version of exporting the Users to a CSV (#17217)
* feat: add the export route

* feat: base export csv

* refactor: move the svg into its own file

* feat: add the export partial

* feat: export teh correct fields etc. for the csv

* user status helper

* feat: ensure that we format the time

* feat: add a spec for the CSV

* remove space

* remove puts

* chore: remove blank space

* feat: update traits

* Update app/views/admin/users/export.csv.erb

Co-authored-by: Jamie Gaskins <jgaskins@hey.com>

* Update spec/requests/admin/users/users_export_spec.rb

Co-authored-by: Jamie Gaskins <jgaskins@hey.com>

* Update spec/requests/admin/users/users_export_spec.rb

Co-authored-by: Jamie Gaskins <jgaskins@hey.com>

* fix: export should not error for unregistered users

Co-authored-by: Jamie Gaskins <jgaskins@hey.com>
2022-04-12 15:24:32 +02:00
Suzanne Aitchison
b1e7d8a5ec
Member index (phase 2) - Search invitations (#17210)
* add ability to search invitations

* add an invited scope

* add a cypress test
2022-04-12 10:40:44 +01:00
Suzanne Aitchison
c8b5282337
Admin member index: invitations table (#17180)
* basic table cols

* more detailed member col, overflow menu

* bottom pagination

* replace with partial
2022-04-11 19:36:55 +01:00
Suzanne Aitchison
a44d09e71a
Update table style for member index view (#17207)
* add minimal table style

* tweak table style vs member index specific style

* rename

* replace padding for smaller screens
2022-04-11 19:07:59 +01:00
Julianna Tetreault
f6d7d431b5
Updates the role tooltip within _member_data.html.erb (#17218) 2022-04-11 11:50:55 -06:00
Julianna Tetreault
bf67ae2fbb
Refactor Member Index View Tooltips (#17170)
* Adjusts Member Index View tooltips to include resource type

* Adds .compact to the list of resource_types in #format_role_tooltip

* Updates users_helper.rb#format_role_tooltip tests

* right align tooltip

* Update app/views/admin/users/_member_index.html.erb

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

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2022-04-11 09:20:26 -06:00
Suzanne Aitchison
dcb46e088b
bring repeating layout code to partials (#17179) 2022-04-08 17:52:18 +01:00
Jeremy Friesen
1d2ecc64f0
Removing Listing rate limiting when feature disabled (#17181)
* Removing Listing rate limiting when feature disabled

Closes forem/forem#17175

* Fixing tests
2022-04-08 11:59:23 -04:00
Suzanne Aitchison
bd097bca25
Member index: add copy email to clipboard functionality (#17146)
* functioning on large screen view

* layout tweak

* tidy up

* remove redundant change

* refocus dropdown button when clipboard copy executes and closes dropdown

* add cypress test

* add missed attr

* implement in responsive layouts

* use runtime copy utility
2022-04-08 14:08:15 +01:00
Suzanne Aitchison
b6e2a735b7
stop capitalizing table headers (#17178) 2022-04-08 14:07:27 +01:00
Ridhwana
83104f8d2b
Refactor the way we show organizations on the member index view (#17177) 2022-04-08 14:48:39 +02:00
Suzanne Aitchison
eae8557cf1
Admin member index: update responsive layouts (#17124)
* add an xl breakpoint and use in member index view

* expand search controls at medium breakpoint

* tweak small screen layout options per breakpoint, add overflow button

* small fix

* switch where role appears depending on breakpoint

* adjust for smallest layout

* tweaks for medium layout

* tweaks for large layout

* tweaks for XL table
2022-04-07 14:36:43 +01:00
Jeremy Friesen
674a971887
Adding link to Spaces admin guide (#17156)
* Adding link to Spaces admin guide

This commit presently links to a missing page, but in consultation with
Ella, she'll be putting the page at the linked URL.

The original copy was:

> Want to learn more about spaces? Check [Admin Guide]

I chose to go with the following, as assistive technology will announce
the link's text as "more about Spaces in the Admin Guide", which I find
more a11y oriented.

> Learn [more about Spaces in the Admin Guide]

Closes forem/forem#17148

* Update app/views/admin/spaces/index.html.erb

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

* Bringing the Learning inside the Linking

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2022-04-07 09:10:50 -04:00
Julianna Tetreault
ccf33c50a0
Add Data (User Details, Status, etc.) to the Member Index View Columns (#17033)
* Adds data to the member column in Member Index View

* Adds roles, statuses, and latest activity to Member Index views

* Adds the list of orgs a user belongs to in Member Index view

* Updates the image URL to link to each users member detail view

* Adds comment_suspended to user current_status and makes roles prettier

* Fixes bullet warning and encapsulates org logic in method

* Properly displays today and yesterday in words

* Refactors #current_organizations to use ternary

* Updates user.rb Member Index View-related methods

* Adjusts the styling of user roles and adds tooltip to roles

* Updates Member Index View to be mobile-friendly

* Updates userIndexView.spec.js

* Updates capitalization within userIndexView.spec.js

* Updates Member Index View per mobile designs and feedback

* Adds member status logic inline with SVGs

* Updates the status column for mobile layout

* Adjust current_role tooltips for Member Index View

* Adds organization name tooltip to member orgas

* Adds organization pics to Member Index View and cleans up helpers

* Addresses PR review feedback (Thanks, Suzanne!)

* Uses CSS in place of SVGs for member statuses

* Adds E2E test for and removes link to org page from Member Index View

* Addresses PR feedback comments by refactoring Member Index View code

* Removes leftover code in user.rb

* Update method that tooltips rely on

* Spells regular correctly :

* Adds a spec that tests Admin::UsersHelper#format_last_activity_timestamp

* Adjusts #cascading_high_level_roles logic and roles

* Adds a spec for #cascading_high_level_roles

* Adds a #last_activity spec to the User model

* Adjusts code a bit per PR feedback. Thanks, Ridhwana! :)

* Updates specs for Member Index View helpers

* Adds Timecop.freeze to help with timestamp failure in user_spec.rb
2022-04-06 11:48:25 -06:00
Jeremy Friesen
8c2b1276a4
Adding copy to assist with space toggle decision (#17147)
This commit adds instruction as to what's happening when a person
toggles on this feature.  So as to not repeat knowlege, I added a
`NUMBER_OF_MINUTES_FOR_CACHE_EXPIRY` constant so the UI can reference that
instead of dropping a hard-coded 15 in the UI.

Closes forem/forem#17097
2022-04-06 11:07:21 -04:00
Monica Mateiu
99401449d4
Display analytics up to yesterday instead of today (#17064)
Stop displaying admin analytics for current day, as the data is incomplete. Instead, show analytics for any given period up to yesterday
2022-04-04 15:17:32 -04:00
Jeremy Friesen
1b2aa68a4d
Ensuring confirmation and flash message for spaces (#17072)
* Ensuring confirmation and flash message for spaces

This change delivers an accessible form, and while it doesn't remove the
Save button nor produce a modal it does deliver the minimum viable
functionality.

In conversations with Suzanne, we spent an hour looking at how we might
make an accessible modal with the checkbox and state management
required as we as removing save buttons.

There are two paths:

1. Extend the current, yet deprecated, stimulus modal controller.
2. Extend the Preact modal work done for the Members Detail View.

We spent about 15 minutes pursuing the stimulus modal controller route,
and realized how much cruft it added to the system.  Not ideal and very
opaque in it's interaction.

The second one we talked about, but for our alloted time was inadequate
to begin further work.  To deliver on that generalized preact modal will
require at least an afternoon of work.

Closes forem/forem#17032

* Update config/locales/controllers/admin/fr.yml

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

* Update app/views/admin/spaces/index.html.erb

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

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
2022-04-04 11:49:15 -04:00
Suzanne Aitchison
71f9a56bd8
Admin member index: responsive UI should occupy full width (#17065)
* allow overflow on member index page, adjust header alignment

* some tweaks to inner mobile layout
2022-03-31 15:52:39 +01:00
Daniel Uber
df4020efa6
Update profile admin instructions (#17062)
* Update instructions copy (remove placeholder)

Admin isn't localized well so I'm leaving this without translation for now.

* Update app/views/admin/profile_fields/index.html.erb

remove excess spacing

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

Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>
2022-03-30 15:32:56 -05:00
Suzanne Aitchison
38a9ac41f7
Admin member index: initial small screen skeleton layout (#17046)
* initial skeleton

* tweaks

* tweaks to header

* Update cypress spec for small screens

* nudge Travis
2022-03-30 16:59:39 +01:00
Suzanne Aitchison
70a5e9437f
Admin member index: show/hide search and filter controls (#17009)
* initial work to show the expand/collapse search and filter on member index

* replace icon with actual button

* simplify logic in pack

* add cypress tests

* make sure both fields part of same form

* add an indicator in mobile view when field has a value

* make sure empty params treated same as missing params

* make sure indicators stay in step with current user input

* partials for inputs

* rename pack file
2022-03-29 15:37:37 +01:00
ludwiczakpawel
0bf6839a81
Admin analytics (#16528) 2022-03-28 21:51:51 +02:00
Ridhwana
1473e58284
add a named blank option to the dropdown (#17019) 2022-03-28 17:44:10 +02:00
Suzanne Aitchison
c5ffa8be92
Admin member index: Update pagination layout & styles (#16995)
* pagination theme for new admin view

* align pagination widget correctly in desktop view

* remove bottom pagination

* re-add pagination to the bottom

* use block styling for the links
2022-03-25 07:50:50 +00:00
Ridhwana
df0efd57d9
feat: change people to members (#16994) 2022-03-24 15:44:46 +02:00
Julianna Tetreault
e132279048
Update Member Index View Layout (#16975)
* Adds Member Index View cbare-bones columns

* Adds conditional search/filter styling to _controls partial
2022-03-23 06:39:46 -06:00
Suzanne Aitchison
198cc7d1ac
Style member index header & tabs behind feature flag (#16964)
* tweak tab and heading layout inc small screens

* role heading and tabs out to invited and GDPR views
2022-03-22 14:29:44 +00:00
ludwiczakpawel
2cec22e146
Removing bootstrap from Config's collapsable sections (#16620)
* .

* updates

* update specs

* expand profile field before deleting

* expand auth section in rspec test

* expand smtp settings summary in rspec

* update user experience section specs

* more spec tweaks

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2022-03-22 14:57:07 +01:00
Ridhwana
28b1c09b83
Updated Member Index View Layout foundation behind a feature flag. (#16958) 2022-03-22 14:53:39 +02: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
Jeremy Friesen
88f4daf952
Penciling in a Default Spaces section (#16897)
* Penciling in a Default Spaces section

This delivers two primary things:

1.  Extracting shared policy examples
2.  Providing a functioning skeleton for toggling on the
    "limit_post_creation_to_admins" feature.

Important is that once merged, it would be possible for this code to
"leak" out.  But how that leaks out is also how you can test that the
feature works.

First, to orient, there is a constraint for a new route.  That
constraint checks if the feature flag exists (e.g. has been explicitly
enabled or explicitly disabled).  In other words, at this point, you
can't accidentally enable the feature via the UI.  But once you have
enabled the feature, you can then toggle the feature on and off.

So, to test this in the browser:

1. Pull down this branch
2. Run `rails runner "FeatureFlag.disable(:limit_post_creation_to_admins)"`
3. Startup your the web server.
4. Login as an administrator
5. Goto /admin/content_manager/spaces
   a. Bask in the glory of a plain HTML form
6. With another browser, login as another non-admin user
7. Go to /settings/extensions, you should see a section Publishing from RSS.
8. Now with the admin's session, update the form to turn on
  "limit_post_creation_to_admins"
9. Back to the non-admin browser, refresh /settings/extensions, you
   should no longer see the section Publishing from RSS.

Note: I have not included an admin menu item as that is related to and
dependent on some refactors I'm working on (see forem/forem#16888 and
forem/forem#16847).  So a bit of "security through obsurity"

Note: In the future, once we resolve forem/forem#16490, we'll start
toggling the "Create a Post" button.

Note: I am not including Cypress tests nor request tests for this
feature because the implementation details related to the testing via
that approach are a little too volitale.

Related to forem/forem#16842

* Updating copy based on forem/forem#16893

* styles

* styles

* dark styles

Co-authored-by: Paweł Ludwiczak <ludwiczakpawel@gmail.com>
2022-03-21 09:56:12 -04:00
Julianna Tetreault
2560032c0c
Remove duplicate banish confirmation modal (#16912) 2022-03-18 09:22:15 -06:00
Jeremy Friesen
e1f7a6548c
Adding docs and specs to AdminMenu.nested_menu_items (#16888)
* Adding docs and specs to AdminMenu.nested_menu_items

This relates to PR forem/forem#16847 which addresses issue
forem/forem#16842.

The goal of this PR is to help me develop an understanding of the
AdminMenu so I can further extend it and better understand it.

There's also a bit of knowledge sharing that I'm looking for, and the
comments and tests are there to help "confirm" that knowledge.  There
might be more that I'd consider regarding a refactor, but I want to make
sure I'm on the right path before I go further.

tl;dr - this is the smallest commit I can make to begin to tease out an
understanding of the method I put under test.

* Update app/models/admin_menu.rb

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

* Adding more documentation

* Update app/models/admin_menu.rb

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

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>
2022-03-18 08:30:41 -04:00
Ridhwana
74a16beacb
Introduce "extensions" (#16840)
* feat: add the feature flag route and controller

* feat: add a ff page

* feat: update to a post with a success banner

* feat: test the feature

* feat: update the styling

* feat: change feature flag to extension witha  few more improvements like adding a model not backed by a table

* feat: update the text

* refactor: if you enable a FF, it gets added under the hood as well

* feat: accessibility name for label

* use keyword args

* use locales

* Update app/views/admin/extensions/index.html.erb

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

* Update app/views/admin/extensions/index.html.erb

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

* Update app/views/admin/extensions/index.html.erb

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

* Update config/locales/controllers/admin/fr.yml

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

* Update app/controllers/admin/extensions_controller.rb

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

* fix: rubucop

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2022-03-18 11:22:17 +02:00
Julianna Tetreault
bf2973bdc4
Refactor the "Banish" Modal in the Member Detail View (#16757)
* Refactors _banish.html.erb by removing duplicate code

* Refactors _banish.html.erb to account for new and old users

* Moves conditional into Admin::UsersController#set_user_to_be_banished

* Reverts last commit, as it didnt work as expected

* Fixes last commit, which reverted to the incorrect code

* Pulls banishable user into instance var and fixes button txt
2022-03-17 10:36:10 -06:00
Julianna Tetreault
c91bdeaeb2
Removes views that have been replaced with the Admin Member Detailed view (#16852) 2022-03-15 06:53:21 -06:00
Julianna Tetreault
aa44786ebd
Remove admin_member_view Feature Flag-Related Conditionals (#16764)
* Removes admin_member_view feature flags and refactors  conditionals

* Removes unused admin/users/_email_tools partial and user_email_tools_spec

* Actually remove the admin/user_email_tools_spec this time

* Removes the edit route from admin.rb users

* Adds a DUS (and spec) to disable and remove admin_member_view flag

* Fixes admin/users_spec.rb failures by updating spec with Member Detail changes

* Fixes spec failures within admin_bans_or_warns_user_spec.rb

* Refactors Admin::UsersController#credit_params due to failing specs

* Removes last traces of edit_admin_user_path and fixes buttons, specs, etc.
2022-03-10 08:29:05 -07:00
Suzanne Aitchison
5ae9eb4257
Implement new color picker in listings category form, cleanup old code (#16770)
* remove old color picker initializer

* update listing category picker

* remove old color picker styles
2022-03-08 12:43:18 +00:00