Commit graph

10947 commits

Author SHA1 Message Date
dependabot[bot]
db38cebff6
Bump @rails/ujs from 7.0.1 to 7.0.2 (#16592)
Bumps [@rails/ujs](https://github.com/rails/rails) from 7.0.1 to 7.0.2.
- [Release notes](https://github.com/rails/rails/releases)
- [Commits](https://github.com/rails/rails/compare/v7.0.1...v7.0.2)

---
updated-dependencies:
- dependency-name: "@rails/ujs"
  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-02-15 08:53:53 -07:00
dependabot[bot]
b5f43ae8e1
Bump pusher-js from 7.0.3 to 7.0.6 (#16589)
Bumps [pusher-js](https://github.com/pusher/pusher-js) from 7.0.3 to 7.0.6.
- [Release notes](https://github.com/pusher/pusher-js/releases)
- [Changelog](https://github.com/pusher/pusher-js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pusher/pusher-js/compare/v7.0.3...v7.0.6)

---
updated-dependencies:
- dependency-name: pusher-js
  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-02-15 10:53:25 -05:00
dependabot[bot]
422943a1be
Bump @storybook/addon-storysource from 6.4.18 to 6.4.19 (#16593)
Bumps [@storybook/addon-storysource](https://github.com/storybookjs/storybook/tree/HEAD/addons/storysource) from 6.4.18 to 6.4.19.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/v6.4.19/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.4.19/addons/storysource)

---
updated-dependencies:
- dependency-name: "@storybook/addon-storysource"
  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-02-15 10:53:01 -05:00
Jamie Gaskins
9240b34aba
Fix NoMethodError on User#email (#16591)
The email field is not guaranteed to be populated.
2022-02-15 10:50:10 -05:00
Ridhwana
5e93d3a25e
Add a contact email address to the /admin/customization/config (#16497)
* feat: remove the default email and cobine the periodic digest and the contact email under the Email section

* refactor: rename  the email_link to contact link and use the contact_email as a default and fallback to the ForemInstance.email

* chore: alignment

* feat: use the contact_email helper

* feat: move the contact_email to the ForemInstance model

* feat: use ForemInstance.contact_email instead of the application helper method

* removed the application Helper

* feat: set the dafault on the contact_email

* fix: cypress tests

* Update app/lib/constants/settings/general.rb

Co-authored-by: Michael Kohl <me@citizen428.net>

Co-authored-by: Michael Kohl <me@citizen428.net>
2022-02-15 17:37:08 +02:00
Daniel Uber
afa214ac52
Require profile fields to belong to a group (#16390)
* Require profile fields to belong to a group

Remove the empty group dropdown from the group select tag

Remove the optional: true from the belongs_to validation (raise a
validation error on save if the group is not provided)

Update test to remove belongs_to's optional setting

* Update ProfileFields::Add spec to include profile field group

* update factory to ensure a non-empty profile field group

* Add required profile field group to seeded profile fields

Since profile field is required, create was failing (silently).

Add required field so these are available in e2e tests.

* Use factory `association` to create a profile field group

https://github.com/thoughtbot/factory_bot/blob/master/GETTING_STARTED.md#explicit-definition

* provide required profile field group when posting data

* Fix one spec, drop another

Both of these scripts will be removed in the other branch (changing
the attribute name) - dropping the test here seems lower trouble than
modifying an out of data data update script to pass.

* skip test slated for removal

Similar to the last commit - this test exercises a script about to be
archived in the other branch.
2022-02-15 09:27:18 -06:00
dependabot[bot]
3f2366e5a7
Bump @storybook/addon-backgrounds from 6.4.18 to 6.4.19 (#16579)
Bumps [@storybook/addon-backgrounds](https://github.com/storybookjs/storybook/tree/HEAD/addons/backgrounds) from 6.4.18 to 6.4.19.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/v6.4.19/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.4.19/addons/backgrounds)

---
updated-dependencies:
- dependency-name: "@storybook/addon-backgrounds"
  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-02-15 15:23:05 +00:00
dependabot[bot]
f566f74aeb
Bump @storybook/addon-actions from 6.4.18 to 6.4.19 (#16588)
Bumps [@storybook/addon-actions](https://github.com/storybookjs/storybook/tree/HEAD/addons/actions) from 6.4.18 to 6.4.19.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/v6.4.19/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.4.19/addons/actions)

---
updated-dependencies:
- dependency-name: "@storybook/addon-actions"
  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-02-15 15:22:18 +00:00
Taylor Hunt
b61e238f8a
Fix tall aspect-ratio images getting squashed (#16554)
* Fix tall aspect-ratio images getting squashed 

When the `max-height` kicks in, the `width` attribute needs to be overridden, just like `max-width` needs `height: auto`.

* Prefer `object-fit` to `width`

Avoids clashing with GIF-pausing library that sets `.ff-container`

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

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2022-02-15 15:04:06 +00:00
dependabot[bot]
7238d56a04
Bump @storybook/manager-webpack5 from 6.4.18 to 6.4.19 (#16575)
Bumps [@storybook/manager-webpack5](https://github.com/storybookjs/storybook/tree/HEAD/lib/core) from 6.4.18 to 6.4.19.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/v6.4.19/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.4.19/lib/core)

---
updated-dependencies:
- dependency-name: "@storybook/manager-webpack5"
  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-02-15 07:51:07 -07:00
dependabot[bot]
af8ea6dd97
Bump @storybook/builder-webpack5 from 6.4.18 to 6.4.19 (#16585)
Bumps [@storybook/builder-webpack5](https://github.com/storybookjs/storybook/tree/HEAD/lib/core) from 6.4.18 to 6.4.19.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/v6.4.19/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.4.19/lib/core)

---
updated-dependencies:
- dependency-name: "@storybook/builder-webpack5"
  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-02-15 14:21:18 +00:00
dependabot[bot]
52ced7f001
Bump eslint from 8.8.0 to 8.9.0 (#16578)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-15 08:36:11 -05:00
Nick Taylor
4d8792402a
Now the credit amount max toggles when switching between adding/removing credits. (#16568) 2022-02-15 07:18:22 -05:00
Suzanne Aitchison
8dcd20865e
dont rely on user id (#16580) 2022-02-15 11:10:55 +00:00
dependabot[bot]
611bab59d2
Bump focus-trap from 6.7.2 to 6.7.3 (#16576)
Bumps [focus-trap](https://github.com/focus-trap/focus-trap) from 6.7.2 to 6.7.3.
- [Release notes](https://github.com/focus-trap/focus-trap/releases)
- [Changelog](https://github.com/focus-trap/focus-trap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/focus-trap/focus-trap/compare/v6.7.2...v6.7.3)

---
updated-dependencies:
- dependency-name: focus-trap
  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-02-15 05:04:57 -05:00
Jeremy Friesen
663a712a10
Removing deprecation warning (#16572)
Prior to this commit, I saw the following in the Rails test log:

```
DEPRECATION WARNING: 'include Pundit' is deprecated. Please use 'include Pundit::Authorization' instead.
 (called from include at ./app/controllers/application_controller.rb:12)
 ```
2022-02-15 05:02:47 -05:00
Suzanne Aitchison
3982b389f1
Rework user subscription liquid tag to avoid errors (#16460)
* move script to packs, strip ids

* make sure userdata is available before determining ui

* stop working around old html, fix duplicate ID errors

* skip login modal

* remove DEV hard coding

* replace system spec with cypress spec

* update base_data to include apple auth info, add to cypress tests

* add initial version of DUS to resave HTML

* remove data update script
2022-02-15 09:14:03 +00:00
dependabot[bot]
24eb7d70ab
Bump @storybook/addon-a11y from 6.4.18 to 6.4.19 (#16563)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-15 13:34:19 +07:00
dependabot[bot]
8eacd68b59
Bump chart.js from 3.7.0 to 3.7.1 (#16562)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-15 11:56:59 +07:00
dependabot[bot]
f7cef40edc
Bump @storybook/addons from 6.4.18 to 6.4.19 (#16564)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-15 11:53:05 +07:00
dependabot[bot]
a8470b1498
Bump preact from 10.6.5 to 10.6.6 (#16561)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-15 11:52:02 +07:00
Michael Kohl
d5ecf61ee4
Admin API use case 1: endpoint to create users (#16520) 2022-02-15 09:30:00 +07:00
Mac Siri
6feefe6694
Apply safe navigation to Reactions::Send (#16570) 2022-02-14 16:41:53 -05:00
Marcelo Kopmann
292383175b
Fix Github Liquid Tag from repositories with dot character (#16551)
* fix: add dot character in github liquid tag regex

* fix: remove redundant escape inside regexp literal
2022-02-14 16:15:09 -05:00
Jamie Gaskins
66846c7a17
Fix NoMethodError on Nil for article preview (#16569)
* Fix NoMethodError on Nil for article preview

* Remove commented out debugging code
2022-02-14 14:38:29 -05:00
Allison McMillan
36acb7c9a0
add asheren to core team (#16555)
Adding myself to the core team on the readme
2022-02-14 14:23:43 -05:00
dependabot[bot]
4e7fdb8a97
Bump fog-aws from 3.12.0 to 3.13.0 (#16565)
Bumps [fog-aws](https://github.com/fog/fog-aws) from 3.12.0 to 3.13.0.
- [Release notes](https://github.com/fog/fog-aws/releases)
- [Changelog](https://github.com/fog/fog-aws/blob/master/CHANGELOG.md)
- [Commits](https://github.com/fog/fog-aws/compare/v3.12.0...v3.13.0)

---
updated-dependencies:
- dependency-name: fog-aws
  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-02-14 11:33:01 -07:00
dependabot[bot]
9a251803d1
Bump pg from 1.3.1 to 1.3.2 (#16567)
Bumps [pg](https://github.com/ged/ruby-pg) from 1.3.1 to 1.3.2.
- [Release notes](https://github.com/ged/ruby-pg/releases)
- [Changelog](https://github.com/ged/ruby-pg/blob/master/History.rdoc)
- [Commits](https://github.com/ged/ruby-pg/compare/v1.3.1...v1.3.2)

---
updated-dependencies:
- dependency-name: pg
  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-02-14 11:32:35 -07:00
dependabot[bot]
0e8089c404
Bump follow-redirects from 1.14.7 to 1.14.8 (#16550)
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.14.7 to 1.14.8.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.14.7...v1.14.8)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-14 11:12:12 -06:00
Jeremy Friesen
cf53758476
Removing Articles::Builder making policy decision (#16536)
* Removing Articles::Builder making policy decision

This change is a refactoring through triangulation.  Given that
`ArticlePolicy#new?` returned true, I'm prepared to assume that calling
`authorize(Article)` in all cases is acceptable.

So to narrow the Builder making a policy decision I renamed the returned
value to reflect what it was actually doing in the logic.  And in
renaming, flipped the polarity of the boolean.  Why the flip?  Because
`needs_authorization == !store_location`.

In consultation with Allison and Jennie, I'm proceeding with a short-cut
to get me unstuck.  That unstuck is namely "I need to ensure that the
articles#new action can go through authorization."

Given that I'll be spending time in the authorization layer, I hope
these noted short-cuts and comments will be useful in future spelunking
efforts regarding authorization.

Closes #16529

* Update app/policies/article_policy.rb

Co-authored-by: Michael Kohl <me@citizen428.net>

* Disabling spec

* Update app/policies/article_policy.rb

Co-authored-by: Dwight Scott <dwight@forem.com>

* Update app/policies/article_policy.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

Co-authored-by: Michael Kohl <me@citizen428.net>
Co-authored-by: Dwight Scott <dwight@forem.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-02-14 11:39:22 -05:00
yheuhtozr
21a0c1a164
add one missing i18n key (fr only) (#16553) 2022-02-14 06:49:59 -07:00
ludwiczakpawel
5baa099f33
Spec fix (#16431) 2022-02-14 13:17:14 +01:00
Suzanne Aitchison
29b17e4bf9
Admin member area a11y fixes: Overview page (#16524)
* quick fixes on the overview page

* more overview fixes

* put stats in a descrition list

* fix error in twitter link

* fix some more svgs

* disable the remove tag pills

* link description in merge user modal

* link some other descriptions

* prevent duplicate IDs in edit org description label

* fix badly resolved conflict

* updates after merged changes
2022-02-14 08:08:19 +00:00
dependabot[bot]
c8de81cfdf
Bump puma from 5.6.1 to 5.6.2 (#16549)
Bumps [puma](https://github.com/puma/puma) from 5.6.1 to 5.6.2.
- [Release notes](https://github.com/puma/puma/releases)
- [Changelog](https://github.com/puma/puma/blob/master/History.md)
- [Commits](https://github.com/puma/puma/compare/v5.6.1...v5.6.2)

---
updated-dependencies:
- dependency-name: puma
  dependency-type: direct:production
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-11 23:44:12 -05:00
Jamie Gaskins
ffb9c87c4d
Upgrade to Rails 6.1.4.6 (#16548) 2022-02-11 19:19:39 -05:00
dependabot[bot]
bd26b1dd8f
Bump pundit from 2.1.1 to 2.2.0 (#16546)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-11 14:08:26 -06:00
dependabot[bot]
b08ce7a0bb
Bump @babel/eslint-parser from 7.16.5 to 7.17.0 (#16464)
Bumps [@babel/eslint-parser](https://github.com/babel/babel/tree/HEAD/eslint/babel-eslint-parser) from 7.16.5 to 7.17.0.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.17.0/eslint/babel-eslint-parser)

---
updated-dependencies:
- dependency-name: "@babel/eslint-parser"
  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-02-11 10:21:57 -05:00
Suzanne Aitchison
e38688af42
let ff-container receive all normal image styles (#16541) 2022-02-11 14:16:26 +00:00
Jeremy Friesen
c70d3f759c
Renaming policy methods for consistency (#16523)
Our domain of "admin?" method names is already a bit confounding.  The
policy methods renamed the existing Policy::Authorizer methods, and
further obfuscated and confused intention.

This refactor aligns the policy methods with the Policy::Authorizer
methods.  It is a non-breaking change, but one that may add warnings in
the logs.  If you see those, resolve them per instructions.

Related to #16483
2022-02-11 09:10:54 -05:00
Jeremy Friesen
6e485a55a2
Documenting ApplicationPolicy (#16527)
The comments speak for themselves

Related to #16483

In support of https://github.com/orgs/forem/projects/46
2022-02-11 08:51:52 -05:00
Nick Taylor
7e1869f1d1
Added E2E tests for new admin member details view (#16513) 2022-02-11 08:47:01 -05:00
Suzanne Aitchison
2f64ba88e7
Minor accessibility fixes for member detail views (#16538)
* minor fixes for other member detail views

* tidy up redundant spaces
2022-02-11 13:35:06 +00:00
Nick Taylor
bfbe90cfbe
Now Bg color hex is labeled Tag Color (#16492) 2022-02-11 08:31:57 -05:00
Julianna Tetreault
8d1eb6f225
Adds flash messages when adding and removing credits from a User (#16531) 2022-02-11 06:14:09 -07:00
Michael Kohl
a91e505051
Add FeatureFlag.all (#16496) 2022-02-11 13:38:17 +07:00
dependabot[bot]
12b9aa4fc8
Bump ahoy_email from 2.1.1 to 2.1.2 (#16533)
Bumps [ahoy_email](https://github.com/ankane/ahoy_email) from 2.1.1 to 2.1.2.
- [Release notes](https://github.com/ankane/ahoy_email/releases)
- [Changelog](https://github.com/ankane/ahoy_email/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ankane/ahoy_email/compare/v2.1.1...v2.1.2)

---
updated-dependencies:
- dependency-name: ahoy_email
  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-02-10 12:05:50 -07:00
dependabot[bot]
aeee89f948
Bump strong_migrations from 0.7.9 to 0.8.0 (#16534)
Bumps [strong_migrations](https://github.com/ankane/strong_migrations) from 0.7.9 to 0.8.0.
- [Release notes](https://github.com/ankane/strong_migrations/releases)
- [Changelog](https://github.com/ankane/strong_migrations/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ankane/strong_migrations/compare/v0.7.9...v0.8.0)

---
updated-dependencies:
- dependency-name: strong_migrations
  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-02-10 14:05:11 -05:00
dependabot[bot]
f0f608aec8
Bump sidekiq-unique-jobs from 7.1.14 to 7.1.15 (#16532)
Bumps [sidekiq-unique-jobs](https://github.com/mhenrixon/sidekiq-unique-jobs) from 7.1.14 to 7.1.15.
- [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.14...v7.1.15)

---
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-02-10 13:23:35 -05:00
Julianna Tetreault
961f0a695a
Removes leftover comments from Admin::UsersController (#16530) 2022-02-10 10:50:43 -07:00
Jeremy Friesen
87e1622e6b
Favoring method aliasing over explicit delegation (#16526)
Prior to this commit many of the policy methods were of the form:

```
def create?
  edit?
end
```

The above works, but introduces a place for code drift.

We can shorten this to:

```
alias create? edit?
```

This helps keep the policy methods compact and scannable.  All things
authorization policy related should create narrow surface areas.  By
hand-crafting methods, it is easier for "slippage" to occur.

Another advantage of `alias` is it's use is reflected in API
documentation.  With alias you need only write documentinig comments for
one method and the doc generators will relate the alias and the original
method.

If you "hand craft" a method using explicit delegation, the API
documentation won't pick up that two methods are aliases.

Further, I believe we should be moving towards parity between the
GET/POST/PUT methods that are related (e.g. the create/new pair and the
update/edit pair).  This is not the case, as we "silently" suspend
folks.  As we move through the [authorization work][1], we will start
hiding the links/buttons when a user can't take the action.

Related to #16483 and #16523

[1]:https://github.com/orgs/forem/projects/46
2022-02-10 11:09:17 -05:00