Commit graph

11331 commits

Author SHA1 Message Date
dependabot[bot]
73b5cfd2e7
Bump i18n-tasks from 1.0.8 to 1.0.9 (#17229)
Bumps [i18n-tasks](https://github.com/glebm/i18n-tasks) from 1.0.8 to 1.0.9.
- [Release notes](https://github.com/glebm/i18n-tasks/releases)
- [Changelog](https://github.com/glebm/i18n-tasks/blob/main/CHANGES.md)
- [Commits](https://github.com/glebm/i18n-tasks/compare/v1.0.8...v1.0.9)

---
updated-dependencies:
- dependency-name: i18n-tasks
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-11 13:40:13 -05: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
dependabot[bot]
42f6a4f41c
Bump @storybook/addon-a11y from 6.4.20 to 6.4.21 (#17225)
Bumps [@storybook/addon-a11y](https://github.com/storybookjs/storybook/tree/HEAD/addons/a11y) from 6.4.20 to 6.4.21.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.4.21/addons/a11y)

---
updated-dependencies:
- dependency-name: "@storybook/addon-a11y"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-11 12:21:37 -06:00
dependabot[bot]
887ae5c7f3
Bump @testing-library/jest-dom from 5.16.3 to 5.16.4 (#17223)
Bumps [@testing-library/jest-dom](https://github.com/testing-library/jest-dom) from 5.16.3 to 5.16.4.
- [Release notes](https://github.com/testing-library/jest-dom/releases)
- [Changelog](https://github.com/testing-library/jest-dom/blob/main/CHANGELOG.md)
- [Commits](https://github.com/testing-library/jest-dom/compare/v5.16.3...v5.16.4)

---
updated-dependencies:
- dependency-name: "@testing-library/jest-dom"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-11 12:21:19 -06: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
Jeremy Friesen
e2618c50f5
Adding logic to hide Create Post on empty dashboard (#17149)
* Adding logic to hide Create Post on empty dashboard

As implemented, folks won't see this page if they can't create a post.
However, as our implementation drifts, we should continue to apply the
same policy.

See forem/forem#16999 for the conditional logic that redirects users.

* Adding a hack to fix a unit test
2022-04-11 13:52:35 -04:00
Julianna Tetreault
f6d7d431b5
Updates the role tooltip within _member_data.html.erb (#17218) 2022-04-11 11:50:55 -06:00
Jeremy Friesen
f790c3c0c1
Encapsulating the "why we hide/show" something (#17166)
* Encapsulating the "why we hide/show" something

Prior to this commit, we were relying on our views/templates to
understand why it might want to append the "hidden" dom class.  That is
not ideal, because it required repeating knowledge about the conditions
of the policy outside of the policy's domain.

With this commit, we're removing a duplication of knowledge; or more
appropriately asking the steward responsible for the knowledge to
produce the answer.

* Refining the note to not describe a course of action
2022-04-11 13:40:16 -04:00
Daniel Uber
6e08c7ca14
Disable flakey admin charts spec (#17165)
* Disable flaky test cases

These two tests (counting the number of items returned by the service
in the past week) depend on synchronizing the database time with the
process time, and fail when zonebie is active and the current timezone
is more than 12 hours ahead of UTC ("Samoa" for example fails).

* Use UTC times when calculating the periods for overview charts

The database will use UTC to calculate DATE() for grouping, and
ensuring the same time used when filtering avoids issues where the
ruby/server time and the database time are in distinct timezones, and
posts are published on different days in the two instances.

* Remove unused test-side date helper

* Revert "Use UTC times when calculating the periods overview charts"

This just moved the problem to the request specs. Since the spec is
still failing it's better to get the test suppressed while a fix is
determined

This reverts commit cbad78efcee9df51fd4f0a5214d00358c5253167.
2022-04-11 13:23:47 -04:00
Jeremy Friesen
02ff835e7f
Conditionally removing listing reference (#17211)
* Conditionally removing listing reference

Prior to this commit, our notifications would send listing related information.

* Update app/views/mailers/notify_mailer/new_badge_email.html.erb

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

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
2022-04-11 13:02:17 -04:00
Takuya N
3edffcbb22
Replace #to_s(:format) with #to_fs (#17219)
https://github.com/rails/rails/pull/43772
https://github.com/rails/rails/pull/44354

Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>
2022-04-11 12:59:54 -04: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
Daniel Uber
8276d1d8c6
Remove profile admin feature flag (#17194)
Remove test cases built around it (modified when the guards were removed).
2022-04-11 09:27:35 -05:00
Takuya N
8bed053f85
Remove unused articles/_splash.html.erb (#17198)
Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>
2022-04-11 08:26:05 -06:00
Takuya N
b5ea75cf39
Use correct trademarks in supported embeds (#17195)
Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>
2022-04-11 07:32:45 -06:00
ludwiczakpawel
cc6679f194
box sizing (#17185) 2022-04-11 12:16:58 +02:00
Takuya N
9d49da082a
Use the latest repo URLs in package.json (#17199)
Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>
2022-04-11 11:10:07 +02:00
Miguel Nieto A
13c433cd56
fix: 🐛 Fix Color displaying over button in settings (#17172) 2022-04-11 10:59:57 +02:00
ludwiczakpawel
d6f204afc1
Toggle component (#17126)
* toggle

* box-sizing

* fixes

* whoopsy

* add specs for toggle component

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2022-04-11 09:44:43 +02:00
Jeremy Friesen
168698fe28
Conditionally removing listing from Admin > Consumer Apps menu (#17182)
Related to forem/forem#16437
2022-04-08 21:55:45 -04:00
Daniel Uber
7f1fdc7324
Produce a meaningful slug from podcast episode title (#17184)
* Use sluggerize to produce a slug from podcast episode title

This is essentially the process we use for Article#title_to_slug
without the random trailing bits on the end (since podcast episodes
had not worked that way previously).

* Add test case for slug generation

* Oh, the test only works if you checkin the fixture, too
2022-04-08 16:30:16 -05:00
Daniel Uber
2ddefcbba5
Remove guard clauses and update expectations (#17138) 2022-04-08 15:20:19 -05:00
dependabot[bot]
88109368ae
Bump stripe from 5.48.0 to 5.49.0 (#17192)
Bumps [stripe](https://github.com/stripe/stripe-ruby) from 5.48.0 to 5.49.0.
- [Release notes](https://github.com/stripe/stripe-ruby/releases)
- [Changelog](https://github.com/stripe/stripe-ruby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/stripe/stripe-ruby/compare/v5.48.0...v5.49.0)

---
updated-dependencies:
- dependency-name: stripe
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-08 14:17:06 -06:00
Daniel Uber
c8149e8e1a
Enable :profile_admin feature flag (#17187)
This makes profile fields available for all forems.

There is a follow up task to remove the conditionals around this (and
remove the flag).
2022-04-08 14:03:55 -05:00
dependabot[bot]
0382b86755
Bump honeycomb-beeline from 2.9.0 to 2.10.0 (#17190)
Bumps [honeycomb-beeline](https://github.com/honeycombio/beeline-ruby) from 2.9.0 to 2.10.0.
- [Release notes](https://github.com/honeycombio/beeline-ruby/releases)
- [Changelog](https://github.com/honeycombio/beeline-ruby/blob/main/CHANGELOG.md)
- [Commits](https://github.com/honeycombio/beeline-ruby/compare/v2.9.0...v2.10.0)

---
updated-dependencies:
- dependency-name: honeycomb-beeline
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-08 15:02:09 -04:00
dependabot[bot]
4d812bd204
Bump rubocop from 1.26.1 to 1.27.0 (#17191)
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.26.1 to 1.27.0.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.26.1...v1.27.0)

---
updated-dependencies:
- dependency-name: rubocop
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-08 15:01:56 -04:00
dependabot[bot]
647ee0fc1c
Bump ransack from 3.0.0 to 3.0.1 (#17193)
Bumps [ransack](https://github.com/activerecord-hackery/ransack) from 3.0.0 to 3.0.1.
- [Release notes](https://github.com/activerecord-hackery/ransack/releases)
- [Changelog](https://github.com/activerecord-hackery/ransack/blob/main/CHANGELOG.md)
- [Commits](https://github.com/activerecord-hackery/ransack/compare/v3.0.0...v3.0.1)

---
updated-dependencies:
- dependency-name: ransack
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-08 15:01:29 -04: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
dependabot[bot]
d6421923be
Bump sidekiq-cron from 1.2.0 to 1.3.0 (#17169)
Bumps [sidekiq-cron](https://github.com/ondrejbartas/sidekiq-cron) from 1.2.0 to 1.3.0.
- [Release notes](https://github.com/ondrejbartas/sidekiq-cron/releases)
- [Changelog](https://github.com/ondrejbartas/sidekiq-cron/blob/master/Changes.md)
- [Commits](https://github.com/ondrejbartas/sidekiq-cron/compare/v1.2.0...v1.3.0)

---
updated-dependencies:
- dependency-name: sidekiq-cron
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-07 14:38:47 -06:00
Dwight Scott
8276c40bfa
use vcr on liquid tag spec (#17171)
* Trigger Build

* fixes a failing spec

https://app.travis-ci.com/github/forem/forem/jobs/566327366
2022-04-07 15:53:34 -04:00
Dwight Scott
dfdae481e4
cache open graph response (#17157)
* Trigger Build

* Cache the HTML response for quicker previews

* remove unnecessary comments
2022-04-07 13:53:20 -04:00
Arit Amana
e4446a778c
Revalidate embedded links that redirect (#17150)
* complete implementation and add specs

* delete irrelevant spec and comment

* refactor validate_link method to return passed-in url

* better naming

* handle NotAllowed status in link validation
2022-04-07 13:32:07 -04:00
Suzanne Aitchison
be64f43c1a
Refactor runtime to webpacker JS (#17142)
* add runtime utilities in webpack land, refactor webpack JS using old class

* access Runtime in legacy JS code via window.Forem namespace

* refactor

* make sure data-runtime added only after page does initial load
2022-04-07 15:39:38 +01: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
07983e38be
Adjusting conditional create post rendering (#17132)
* 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>
2022-04-07 09:11:37 -04: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
Takuya N
aec2349ea7
Use label bug instead of type: bug (#17159)
Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>
2022-04-07 13:12:03 +01:00
dependabot[bot]
a9e386ba0c
Bump i18n-tasks from 1.0.7 to 1.0.8 (#17153)
Bumps [i18n-tasks](https://github.com/glebm/i18n-tasks) from 1.0.7 to 1.0.8.
- [Release notes](https://github.com/glebm/i18n-tasks/releases)
- [Changelog](https://github.com/glebm/i18n-tasks/blob/main/CHANGES.md)
- [Commits](https://github.com/glebm/i18n-tasks/compare/v1.0.7...v1.0.8)

---
updated-dependencies:
- dependency-name: i18n-tasks
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-06 13:45:15 -06:00
Mac Siri
d28aa37ed2
Add Oauth check to AwardContributorFromGithub (#17155)
* Add oauth check to AwardContributorFromGithub

* Add spec

* Simplify spec
2022-04-06 15:41:20 -04:00
dependabot[bot]
0ca5096a9e
Bump brakeman from 5.2.1 to 5.2.2 (#17154)
Bumps [brakeman](https://github.com/presidentbeef/brakeman) from 5.2.1 to 5.2.2.
- [Release notes](https://github.com/presidentbeef/brakeman/releases)
- [Changelog](https://github.com/presidentbeef/brakeman/blob/main/CHANGES.md)
- [Commits](https://github.com/presidentbeef/brakeman/compare/v5.2.1...v5.2.2)

---
updated-dependencies:
- dependency-name: brakeman
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-06 12:41:06 -06:00
dependabot[bot]
ec06d95854
Bump sidekiq-unique-jobs from 7.1.16 to 7.1.18 (#17152)
Bumps [sidekiq-unique-jobs](https://github.com/mhenrixon/sidekiq-unique-jobs) from 7.1.16 to 7.1.18.
- [Release notes](https://github.com/mhenrixon/sidekiq-unique-jobs/releases)
- [Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.1.16...v7.1.18)

---
updated-dependencies:
- dependency-name: sidekiq-unique-jobs
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-06 12:40:57 -06:00
Jeremy Friesen
a9a5ad214b
Narrowing when we apply "hidden" by policy attributes (#17143)
Prior to this commit, we always assumed a policy based attribute would
have the "hidden" class and then we'd rely on JavaScript to toggle the
visibility.

With this approach, we are "cheating" a bit by specifically referencing
a feature flag that is the driver for the visibility behavior.

This mirrors the one-off behavior of forem/forem#16606.  Namely, when
the flag is off, we render without default hiding.  And when it's on, we
include the "hidden" attribute.

In both cases, we will still leveraged the [applyApplicationPolicyToggles.js][1]
introduced in forem/forem#17076.

An impact could be that if multiple flags are fiddling with the policy,
we could see an area disappear or wrongly remain present.  This would be
a warning to fix (the server would still enforce correct policies so
this would be a bit of a "heads up we have a mismatch in understanding
that happens to impact UI behavior").

[1]:https://github.com/forem/forem/blob/main/app/javascript/packs/applyApplicationPolicyToggles.js
2022-04-06 13:57:01 -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
Jeremy Friesen
faaf2ec028
Favoring explicit declaration over inferrence (#17089)
This commit does three things:

1. Documents a method
3. Implies the question: "Do we want to use class_attribute in Forem's codebase?"
2. Switches from an inferrence to an explicit (and configurable)

In my experience, I want to favor "explicit" declarations instead of
inferring what they should be.  In this case, the inferrence is perhaps
adequate.  But as I look to `ApplicationController::PUBLIC_CONTROLLERS`,
I think that is a prime case for a `class_attribute`.  (The `api_action`
happened to be the lowest hanging fruit to begin the conversation.)

We still need some clarity into the `verify_private_forem` method as it
looks like it's doing a few different things.

There is precedence for using `class_attribute` found in
[`UniqueCrossModelSlugValidator.model_and_attribute_name_for_uniqueness_test`][1] (also
introduced by me).

[1]:https://github.com/forem/forem/blob/main/app/validators/unique_cross_model_slug_validator.rb
2022-04-06 10:42:08 -04:00
Arit Amana
5cf2229b58
Better Error Msg when Listing URL embedded and Listings are disabled (#17116)
* complete implementations and specs

* remove unused error msgs

* add "listing" and "listings" as ReservedWords
2022-04-06 08:38:53 -04:00