* show the toolbar (WIP - includes some hacks and todos)
* allow calling component to pass additional toolbar elements
* add templates behaviour
* get templates working
* tweaks following mention autocomplete refactor
* remove image upload handler no longer needed
* rename method
* some small refactors
* only comment text area controls visibility of templates area
* fix error in role name
* fix mobile view
* update specs
* WIP: new autocomplete, search executed, dropdown positioned
* WIP: most features working in Editor
* handle textarea blur
* fix bug with id not attached to textarea
* updates to textAreaUtils tests
* aria live, fix border style
* replace comment text area
* fix some height and style issues
* update preact tests
* clean up styles, rename files, use portal for popover
* clean up styles, rename files, use portal for popover
* scroll popover items into view if necessary
* refactor cypress specs
* actually remove the package
* add some more specs
* remove storybook stories for now
* remove relative class causing issues
* small fixes for cypress specs
* make live region assertive to ensure change to combobox is known
* some comments
* add a storybook story
* replace % font size, add explainer to story
* Adds the Adjust credit balance modal to index view
* Adds e2e tests for adjusting credit balances via modal
* Adds the ability to update credits to #user_status
* Adjusts the e2e to address failures
* show the pills
* clicking pills removes filter
* add some more spacing
* another alignment tweak
* add cypress spec
* put it behind the feature flag
* make the clear all link a button for consistency
* tweak to comment for clarity
* show the organizations checkboxes
* apply clear filter button and indicator
* filter by org in users query
* add some rspec tests
* add cypress specs
* correct cypress spec
* Fixing UsersQuery to ensure singular user by organization
Co-authored-by: Jeremy Friesen <jeremy.n.friesen@gmail.com>
* prevent ID conflicts in filters modal by caching content
* show roles with expandable section
* minor tweak
* don't use the hidden field
* send array of role
* role -> roles. small refactor
* set initial checked status
* show an indicator when a filter is applied
* add JS to toggle filter clear buttons and indicators
* update some comments, make sure users only appear once in list
* add some cypress specs, fix some bugs
* Adds an Add Organization modal and e2e tests for the modal
* Conditionally redirects to the correct view upon adding org
* Combines modal tests within userIndexView.spec.js
* Removes redundant code and switches assign role and add org button positions
* Updates RSpec tests to account for conditional redirection
* Lowercases the o in organization within _user_actions_dropdown.html.erb
* Fixes failing e2e tests
* Adds the Assign Role modal to the Member Index View
* Adds e2e tests for the Assign role modal
* WIP: Conditionally redirects to the correct view upon assigning a role
* Conditionally renders the redirect in the correct method :|
* Adjusts the conditional redirect to account for ID
* Adds an even more explicit check for the correct refferer
* Add tooltip for cover image button
* Add cover img tooltip to v1 editor
* Use a slightly different message
* Fix tests
* Use proper comment syntax for front matter
* Fix Cypress test
* Use regex to find matching label
* target modal content by a classname to avoid duplicate IDs
* woops - fix missed selector
* use showWindowModal in editUser
* move add org to a partial
* move add role into a partial
* move adjust credits to a partial
* move profile modals to be re-used
* generalise approach to add organisation modal
* generalise add role modal form
* generalise adjust credits modal
* rework unpublish modal
* refactor banish user modal
* refactors
* prevent issues with duplicate ids
* fix banish form action
* make sure role management specs covered in cypress
* let hidden modal content use IDs
* rename file for clarity
* add some JSDoc notes
* cleanup some redundant changes
* one more
* woops - fixed id that contained a classname
* added ability to assign moderator role via admin/super admin
* create Mod User in seeds
* add Cypress specs
* fix failing Cypress tests
* fix failing specs by moving test Mod user to the end
* nudge Travis
* nudge Travis
Co-authored-by: Arit Amana <msarit@gmail.com>
* Adds an empty state to the GDPR delete requests table
* Refactors and fixes gdprDeleteRequests.spec.js
* Updates aria-describedby for the GDPR delete requests table
* WIP: Adds an empty state to the invitations table
* Pulls invited member empty state into partial
* WIP: Center empty state within invited members table body
* Removes partial and adjusts empty space styling
* Adds an e2e for the empty state to invitedUsers.spec.js
* Moves empty state outside of table and adds aria-describedby to table
* Update app/views/admin/invitations/index.html.erb
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* Adjusts ara-describedby erb tag
* Updates the route used within invitedUsers.spec.js to fix e2e failure
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* feat: update all the paths as a first order of business
* feat: update all the folders to no longer appear under users
* feat: update specs
* feat: update specs
* feat: remove User namespace
* feat: remove route namespace
* feat: path change
* feat: move the menu items to the sidebar
* feat: add a badge
* feat: remove tabs partial
* xs font
* feat: update describe blocks
* feat: update cypress tests
* chore: oops member_manager instead of member_management
* feat: c-indicator
* feat: update the tests
* feat: update the gdpr test
* feat: add the invitations
* chore: align
* feat: update the GDPR constant
* feat: rename to GDPR actions
* feat: add member manager route
* remove name from invite user flow
* remove name from invitation instructions
* update invitations spec
* update specs and invitation actions overflow menu name
* allow users to set name when accepting invite
* feat: remove feature flag on the member index view and re-arrange some partials
* feat: remove Feature Flag for the invitations view
* feat: remove Feature Flag for the gdpr view
* feat: remove Feature Flag for the controls
* feat: remove the feature flag in the tests
* remove extra queries that we no longer use
* Update app/views/admin/invitations/index.html.erb
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* Update app/views/admin/invitations/index.html.erb
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* Update app/views/admin/users/index/_controls.html.erb
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* Update app/views/admin/users/gdpr_delete_requests/index.html.erb
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* Update cypress/integration/seededFlows/adminFlows/users/userIndexView.spec.js
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* Update cypress/integration/seededFlows/adminFlows/users/userIndexView.spec.js
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* Update app/views/admin/users/gdpr_delete_requests/index.html.erb
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* feat: attempt to fix Cypress test
* fix: soem other cypress tests
* fix: search bar
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
Similar to checking that "Unpin post" is shown after pinning, wait for
"Log in" to show after signing out before checking that signed out
users can see a pinned post.
Recommended by @aitchiss in a comment on #17385 as a way to limit
false negatives (where we check the previously signed in user's view)
* Reload the config page after changing auth
When testing in Chrome (but not Firefox or Electron) I noticed this
test would fail. The issue appears to have been findByLabelText (used
to check Email enabled, Facebook enabled, etc are not visible) was not
finding the labels when the group was still hidden.
I _think_ there was a time, when this test was first written, that
submitting the form reloaded the page (simple form post), but that may
have been replaced with an xhr submission and some client side
replacement?
I tried not clicking the Authentication after enabling invite only (to
prevent hiding the form content, leaving this section expanded),
however this caused the "Email enabled" check to fail (it was still
visible). I think this means it had been passing because it was not
visible because the section was hidden, not because the label had been
updated properly after the submission.
I'm not sure if fixing the test here papers over a UI issue, but it
would be best if these tests worked consistently across browsers. I
suspect this may have behaved differently in earlier versions of
Chrome, or only been tested interactively in Chrome when the page
still reloaded, and this caused some drift.
* Update cypress/integration/seededFlows/adminFlows/config/authenticationSection.spec.js
prefer reload to calling visit a second time
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
We had seen an increase in CI timeouts (no output received for 10
minutes).
Running this example (signed out user sees the pinned article)
repeatedly I was able to reproduce the failure seen in Travis, and
checking the last few times this occurred it appears to be linked to
the pinArticle.spec.js last test, which fails with an
ApplicationPolicy when pinning.
The likeliest source of this issue is the POST (pin the article) is
received concurrently with the session delete (logging the admin user
out), resulting in a race. If/when the signout occurs before the
article policy is checked (does the current user have permission to
pin an article), the cypress running stalls.
This occurred both interactively (bin/e2e or cypress open) and
headless (cypress run/CI). The error went away reliably after
inserting this guard to check for the "Unpin post" link on the page,
which forces the POST to have completed and redirected back to the
admin page before logging out.
My understanding of this problem is borne out in the local test logs,
where the signout and pin requests arrive concurrently and process out
of order (and the POST gives a 404 instead of a 302).
Started DELETE "/users/sign_out" for 127.0.0.1 at 2022-04-20 12:09:23 -0500
Started POST "/admin/content_manager/articles/1/pin" for 127.0.0.1 at 2022-04-20 12:09:23 -0500
Completed 204 No Content in 42ms (ActiveRecord: 6.2ms | Allocations: 6323)
Completed 404 Not Found in 4ms (ActiveRecord: 0.4ms | Allocations: 833)
* 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
There are two problems engrained in this:
1. The undocumented expectation of `/new` needed to other sites linking
with prefill information.
2. The prefill parameters being lost during the authentication process.
The first bug was introduced as part forem/forem#16536. The second is
likely introduced as part of a Rails upgrade (namely `request.path` most
likely once included the query parameters but with our current
implementation it does not).
Closesforem/forem#17292
* Conditionally disabling Listings
Prior to this commit, we were assuming everyone still had the Listing's
feature turned on.
With this commit, we move from the "implicitly on" nature of
`FeatureFlag.accessible?` to the "explicitly off" nature of
`FeatureFlag.enabled?`. The key differentiator is that we are not
"pushing out a feature flag setting to other forems." Listings now
become an "opt-in".
This requires a few things:
1) Ensure that DEV.to enables the `:listing_feature` before we deploy
this branch.
2) Communicate this change to other Forem adopters and provide a
timeline for when we'll deploy this change.
3) Documentation. Given that we have this feature, but it will be
disabled by default, we want to look into communicating what it is
and how to enable it.
Further, I chose to do the least effort change on our specs. Namely to
treat the specs as though someone fully enabled the listing feature.
This pull request is a "competetor" to #16423.
Closesforem/rfcs#291
Relates to #16420 and #16461.
* Favoring only setting feature for specific tests.
* Adjusting cypress to avoid listing check
* Removing redundant test based on feedback
* Fixing feature spec
* Fixing cypress test
* Revert "conditionally render create post button for admins #16490 (#16606)"
This reverts commit 1cb45995cb.
* Adding conditional create post rendering
This pull request does two things:
- Reverts the forem/forem#16606
- Replaces the conditional rendering with the approach from forem/forem#17076
What to consider:
- How does this impact Cumulative Layout Shift (CLS). Prior to this
commit, we didn't "flicker" the "Create Post" button into view if the
site didn't have the conditional.
- In reverting forem/forem#16606 we remove a dependency on Turbo.
- We reduce one network call, relying instead on the async_info to carry
the visible/hidden logic.
If the "flicker" is a problem we could add a conditional in the page for
if the site has enabled that feature. However, that's a place holder as
we're looking at possible other reasons for allowing/disabling the
create a post.
This is a non-blocking PR, as in we can merge or not merge this and
proceed with what we have. Instead the main goal is to "unify" our approach.
* Update cypress/integration/seededFlows/policyFlows/limitPostCreationToAdmins.spec.js
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* Leveraging change from forem/forem#17143
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* 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
* WIP - Conditional rendering of "Create Post" link
This PR builds on the conversation from forem/forem#17056 and moves in a
slightly different direction.
Important in all of this is that the ability to create a post is
enforced on the server. If the "Create Post" button were to be visible
but the user couldn't create a post when they clicked the button, they
would get an authorization error (or some such response).
This PR posits a different and perhaps competing approach to
forem/forem#16606. This PR provides a general approach in which we add
class attributes in our HTML erb files.
Note: I have not included Cypress tests as I don't want to yet commit
that time. I'm also wondering if this is the "right" thing to do. I
definitely think we want to add some JS tests. But could we do JS and
unit tests? (How do we reach consensus regarding our test approach?)
Again, thank you for the conversation and expect an even more "complete"
PR after we have our discussion.
* Extracting AsyncInfo model to ease testing
* Renaming forbidden to visible
* Adding cypress test to assert no 'Create Post'
These are always treacherous. What happens when we rename the button?
The test will continue to work.
* Apply suggestions from code review
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
* Switching to pack file for policy
Follows on [Suzanne's comment](https://github.com/forem/forem/pull/17076#issuecomment-1088567286)
* Update app/javascript/packs/applyApplicationPolicyToggles.js
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>