Commit graph

11192 commits

Author SHA1 Message Date
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
dependabot[bot]
706ec6a388
Bump honeycomb-beeline from 2.8.2 to 2.9.0 (#17002)
Bumps [honeycomb-beeline](https://github.com/honeycombio/beeline-ruby) from 2.8.2 to 2.9.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.8.2...v2.9.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-03-24 16:19:16 -04:00
dependabot[bot]
57ec784132
Bump knapsack_pro from 3.2.0 to 3.2.1 (#17004)
Bumps [knapsack_pro](https://github.com/KnapsackPro/knapsack_pro-ruby) from 3.2.0 to 3.2.1.
- [Release notes](https://github.com/KnapsackPro/knapsack_pro-ruby/releases)
- [Changelog](https://github.com/KnapsackPro/knapsack_pro-ruby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v3.2.0...v3.2.1)

---
updated-dependencies:
- dependency-name: knapsack_pro
  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-03-24 12:41:16 -06:00
Jamie Gaskins
92c8c1a760
Add unscoped index on articles.feed_source_url (#16984)
We already have a partial unique index for this column scoped on
`published = true`, which is still useful. This index does not make that
index redundant because that index is used to enforce a constraint that
we *only* want to apply to published articles. This index will be used
when `WHERE published` is not part of the query.
2022-03-24 11:57:55 -04:00
Daniel Uber
659ddb8829
Add a safe default value for cloudinary secure (#16989)
* Add a comment, and a safe default value for cloudinary

When moving a site from imgproxy to cloudinary, we observed that
wrapping the cloud name in quotes caused off-looking urls (with the
user name in %22 escaped quotes).

Additionally, if cloudinary is enabled, cloudinary secure should
be set to true. We leave the others blank to prevent conditionally enabling this
service (we check for ENV var presence) mistakenly, but the secure
flag won't turn it on or off and is safe to keep a default value.

* remove unnecessary comment

quoting the env vars had no effect when tested.
2022-03-24 09:29:07 -05:00
Ridhwana
df0efd57d9
feat: change people to members (#16994) 2022-03-24 15:44:46 +02:00
dependabot[bot]
cd3e42fe82
Bump minimist from 1.2.5 to 1.2.6 (#16990)
Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/substack/minimist/releases)
- [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-24 06:51:33 -06:00
dependabot[bot]
b4699938ed
Bump liquid from 5.2.0 to 5.3.0 (#16987)
Bumps [liquid](https://github.com/Shopify/liquid) from 5.2.0 to 5.3.0.
- [Release notes](https://github.com/Shopify/liquid/releases)
- [Changelog](https://github.com/Shopify/liquid/blob/master/History.md)
- [Commits](https://github.com/Shopify/liquid/compare/v5.2.0...v5.3.0)

---
updated-dependencies:
- dependency-name: liquid
  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-03-24 06:48:40 -06:00
Jeremy Friesen
301c0c1d22
Reducing duplication of knowledge (#16991)
As part of my AuthN/AuthZ work I'm reviewing policies.  I've been
looking at Dashboard pseudo-policies.  The dashboard has some implicit
organization policies that I'm looking to expose and describe.

This refactor simply leverages methods already on the user.

Discovered while working on forem/forem#16985
2022-03-24 08:16:53 -04:00
Jeremy Friesen
e6b26c7ed4
Favoring re-use of authorization error (#16992)
We only have one reference to the UnauthorizedError, which is shadows
the ApplicationPolicy::NotAuthorizedError.  This commit removes the
exception.

Related to forem/forem#16985 but only barely
2022-03-24 08:16:28 -04:00
Anna Buianova
b08c1a2285
Fix redundant slack notifications when article was published (#16977)
* Don't send redundant slack messages when article was published

* Move Article callbacks

* Moved callbacks for rubocop
2022-03-24 09:59:01 +03:00
dependabot[bot]
25404a9f34
Bump stripe from 5.45.0 to 5.46.0 (#16988)
Bumps [stripe](https://github.com/stripe/stripe-ruby) from 5.45.0 to 5.46.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.45.0...v5.46.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-03-23 17:36:23 -04:00
dependabot[bot]
0db3770959
Bump peter-evans/create-or-update-comment from 1.4.5 to 2 (#16969)
Bumps [peter-evans/create-or-update-comment](https://github.com/peter-evans/create-or-update-comment) from 1.4.5 to 2.
- [Release notes](https://github.com/peter-evans/create-or-update-comment/releases)
- [Commits](https://github.com/peter-evans/create-or-update-comment/compare/v1.4.5...v2)

---
updated-dependencies:
- dependency-name: peter-evans/create-or-update-comment
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-23 12:26:06 -06:00
Jeremy Friesen
ea3bc697e2
Removing a JS message about connect (#16982)
* Removing a JS message about connect

Related to forem/forem#14734

* Remvoing another reference

I ran `rg Connect[^i]` to see about any remaining references to
Connect.  This one seems to be the last.
2022-03-23 12:30:59 -04:00
Jeremy Friesen
38ef49a2f2
Adjusting article copy to be more general (#16973)
* Adjusting article copy to be more general

Our language regarding articles needs minor revisions to speak a bit
more generally about content.  This follows on the features of
AuthN/AuthZ work to allow forem admins to configure their forems such
that a subset of their forem members may not have the ability to create
articles.

Closes forem/forem#16890
Closes forem/forem#16891

* Update app/views/users/_notifications.html.erb

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

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2022-03-23 11:34:33 -04:00
Jeremy Friesen
aa3d6c8104
Refactoring methods to remove duplication (#16974)
As I'm looking at the dashboard, there's lots of small duplication.
This refactor is a way to help me collect my thoughts regarding how to
approach the larger issue at hand.
2022-03-23 09:07:47 -04:00
Jeremy Friesen
b9b52c91a2
Adding Admin > Content Manager > Spaces menu item (#16951)
This menu item will show up once you have added the
`:limit_post_creation_to_admins` feature flag (regardless of whether
it is enabled or not).

If you wish to add the menu item:

```console
rails console runner "FeatureFlag.add(:limit_post_creation_to_admins)"
```

In "adding" the item, it will default to disabled.  However, as an
administrator you should now be able to toggle on and off the
authorization enforcement.

If you wish to remove the menu item:

```console
rails console runner "FeatureFlag.remove(:limit_post_creation_to_admins)"
```

Future plans for this will be to remove the `FeatureFlag.exist?`
conditional so that the menu item shows up.  A major consideration is
that we'll assume that all Forem's have a "default space" in which
folks (by default) can post.

Builds on forem/forem#16897
Closes forem/forem#16842
2022-03-23 08:55:50 -04: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
Jeremy Friesen
4cdfc4cc13
Adding ArticlePolicy#has_existing_articles_or_can_create_new_ones? (#16944)
* Adding ArticlePolicy#has_existing_articles_or_can_create_new_ones?

As part of our aspirations to only show users what is relevant to them
and "hiding" what is not, this method will help us with the edge case of
"should we show the user a dashboard listing of posts?"

Related to forem/forem#16837

* Adding further documentation

* Adding clarifying comment
2022-03-22 16:01:44 -04:00
dependabot[bot]
0f7a674ec0
Bump rubocop from 1.26.0 to 1.26.1 (#16971)
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.26.0 to 1.26.1.
- [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.0...v1.26.1)

---
updated-dependencies:
- dependency-name: rubocop
  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-03-22 12:41:52 -06:00
dependabot[bot]
24ac7a7435
Bump strong_migrations from 0.8.0 to 1.0.0 (#16970)
Bumps [strong_migrations](https://github.com/ankane/strong_migrations) from 0.8.0 to 1.0.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.8.0...v1.0.0)

---
updated-dependencies:
- dependency-name: strong_migrations
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-22 12:38:17 -06:00
Jamie Gaskins
2058c57274
Optimize URL.database_available? (#16968)
This method was making a DB query every time. Chances are that if the
table is there the first time, it'll continue to exist. This is an
assumption generally baked into ActiveRecord - it caches the schema for
every table when its corresponding model is used and never checks it
again for the life of the process.
2022-03-22 13:04:12 -04:00
Jeremy Friesen
73ff4169e8
Removing instance variable and before action (#16954)
There is no reason to create an instance variable as we don't pass this
to the view.  Further, by adding this as a before_action there's a
disconnect in logic.

This commit attempts to address those issues.

What follows is a three-fold change:

1. Removing the before action (let's just call the method)
2. Reworking the method to reduce, just a bit, the method cost
3. Removing an unused instance variable

Here are the benchmarks.  Note the "follows_limit" as written below is
the "Proposed" route.

```ruby
require 'benchmark'

def follows_limit_original(params:, default: 80, max: 1000)
  per_page = (params[:per_page] || default).to_i
  @follows_limit = [per_page, max].min
end

def follows_limit(params:, default: 80, max: 1000)
  return default unless params.key?(:per_page)
  per_page = params[:per_page].to_i
  return max

  per_page
end

def follows_limit_alt(params:, default: 80, max: 1000)
  per_page = params.fetch(:per_page, default).to_i
  return max if per_page > max
  per_page
end

TIMES = 10_000
Benchmark.bmbm do |b|
  b.report("Original no params") { 1000.times { follows_limit_original(params: {}) } }
  b.report("Original less than max") { 1000.times { follows_limit_original(params: {per_page: 90 }) } }
  b.report("Original greater than max") { 1000.times { follows_limit_original(params: {per_page: 9000 }) } }
  b.report("Proposed no params") { 1000.times { follows_limit(params: {}) } }
  b.report("Proposed less than max") { 1000.times { follows_limit(params: {per_page: 90 }) } }
  b.report("Proposed greater than max") { 1000.times { follows_limit(params: {per_page: 9000 }) } }
  b.report("Alt no params") { 1000.times { follows_limit_alt(params: {}) } }
  b.report("Alt less than max") { 1000.times { follows_limit_alt(params: {per_page: 90 }) } }
  b.report("Alt greater than max") { 1000.times { follows_limit_alt(params: {per_page: 9000 }) } }
end
```

```shell
$ ruby /Users/jfriesen/git/forem/bench.rb
Rehearsal -------------------------------------------------------------
Original no params          0.000403   0.000002   0.000405 (  0.000405)
Original less than max      0.000109   0.000005   0.000114 (  0.000114)
Original greater than max   0.000161   0.000006   0.000167 (  0.000166)
Proposed no params          0.000076   0.000001   0.000077 (  0.000076)
Proposed less than max      0.000114   0.000009   0.000123 (  0.000126)
Proposed greater than max   0.000112   0.000011   0.000123 (  0.000123)
Alt no params               0.000104   0.000007   0.000111 (  0.000114)
Alt less than max           0.000113   0.000009   0.000122 (  0.000122)
Alt greater than max        0.000111   0.000001   0.000112 (  0.000115)
---------------------------------------------------- total: 0.001354sec

                                user     system      total        real
Original no params          0.000108   0.000000   0.000108 (  0.000110)
Original less than max      0.000109   0.000001   0.000110 (  0.000111)
Original greater than max   0.000109   0.000000   0.000109 (  0.000109)
Proposed no params          0.000071   0.000000   0.000071 (  0.000071)
Proposed less than max      0.000103   0.000001   0.000104 (  0.000103)
Proposed greater than max   0.000102   0.000000   0.000102 (  0.000103)
Alt no params               0.000093   0.000000   0.000093 (  0.000093)
Alt less than max           0.000103   0.000000   0.000103 (  0.000104)
Alt greater than max        0.000102   0.000000   0.000102 (  0.000103)
```
2022-03-22 12:57:57 -04:00
Andy Zhao
5fab2f86b0
Always show the browse section of podcasts regardless of featured (#16329)
* Always show the browse section regardless of featured

* Add tests for /pod

* Use safe operator if there are no episodes to show

* Fix test for new podcast page

* Fix test again for podcast page
2022-03-22 12:56:54 -04:00
yheuhtozr
8b8d14479b
youtube tag timestamp format fix (#16873)
* youtube tag timestamp format fix

* spec update
2022-03-22 08:55:45 -06:00
Takuya N
26e10fc71e
Use the canonical URLs to link from sorted pages (#16928)
Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>
2022-03-22 14:51:36 +00:00
Nick Taylor
56f576c4f2
Remove myself from the core team (#16967) 2022-03-22 10:49:39 -04:00
Daniel Uber
837659892b
symlink .env_sample as .env.test (#16939)
* symlink .env_sample as .env.test

* Remove unneeded copy from test setup

Now that there's always a valid environment (.env.test) present, we
don't need the .env file for test setup.
2022-03-22 09:32:50 -05: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
Daniel Uber
6869917904
validate will send forem feeds importer user agent, just like import (#16925)
follow on to #15942 which enabled downloading existing DEV feeds, this
allows setting a feed url to DEV.

It's possible this user agent should be brought inline with the
tags choice of community name and url, but in the short term I'm
making this consistent with the existing feed importer.
2022-03-21 16:43:24 -05:00
Jeremy Friesen
d12d3b3ef1
Removing before actions in favor of explicit method (#16942)
There is an incredible amount of conditionals in play within this
controller.  I'm working to disentangle the logic so we can introduce
unified authorization policies.

The first step is removing the quasi-opaque "before_action" behavior
related to authorization.  My strong preference is to make that explicit
and in doing so begin to see how to adjust the policy enforcement/creation.

This relates to forem/forem#16913
2022-03-21 17:24:15 -04:00
Jeremy Friesen
26149ddf31
Adding inline documentation (#16955)
While exploring the DashboardsController, I came across method calls to
`not_found`.  Idiomatically, I assumed that these methods were returning
a value.  However, in looking at the code, it raises an exception.

_Note: I excpect methods that raise exceptions, especially as the only
thing they do, to end in a `!`._

By adding the documentation my "IntelliSense" provides insight into the
expected behavior of this function (e.g. "Raises an exception").
Without the documentation, I don't see any useful information.
2022-03-21 17:18:06 -04:00
Nick Taylor
37cf5107f5
Created a utility function for checking the flash success message for user udpates in the admin (#16956) 2022-03-21 15:38:31 -05:00
Daniel Uber
7e099db0f4
Match error class using case instead of if/elsif/else (#16952)
* prefer case to multiple if branches

case klass works fine on inheritance chains (we don't need to match on
inheritance explicitly).

* Verify case on error class behaves as before

* Fix tests

I don't know how I committed tests that were failing, but don't do that
2022-03-21 15:34:49 -05:00
Arit Amana
161e18e5df
Better error upon Tweet embed when Twitter keys missing (#16916)
* complete implementation; specs remain

* complete specs

* better implementation

* more appropriate error msg

* ALSO change error msg in spec
2022-03-21 16:21:37 -04:00
dependabot[bot]
b97f49d294
Bump autoprefixer from 10.4.2 to 10.4.4 (#16946)
Bumps [autoprefixer](https://github.com/postcss/autoprefixer) from 10.4.2 to 10.4.4.
- [Release notes](https://github.com/postcss/autoprefixer/releases)
- [Changelog](https://github.com/postcss/autoprefixer/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/autoprefixer/compare/10.4.2...10.4.4)

---
updated-dependencies:
- dependency-name: autoprefixer
  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-03-21 15:35:37 -04:00
dependabot[bot]
9d9ef91d59
Bump cypress-failed-log from 2.9.4 to 2.9.5 (#16945)
Bumps [cypress-failed-log](https://github.com/bahmutov/cypress-failed-log) from 2.9.4 to 2.9.5.
- [Release notes](https://github.com/bahmutov/cypress-failed-log/releases)
- [Commits](https://github.com/bahmutov/cypress-failed-log/compare/v2.9.4...v2.9.5)

---
updated-dependencies:
- dependency-name: cypress-failed-log
  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-03-21 15:34:56 -04:00
dependabot[bot]
41648d51ed
Bump lint-staged from 12.3.5 to 12.3.7 (#16947)
Bumps [lint-staged](https://github.com/okonet/lint-staged) from 12.3.5 to 12.3.7.
- [Release notes](https://github.com/okonet/lint-staged/releases)
- [Commits](https://github.com/okonet/lint-staged/compare/v12.3.5...v12.3.7)

---
updated-dependencies:
- dependency-name: lint-staged
  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-03-21 15:34:48 -04:00
dependabot[bot]
91e3b5e2cb
Bump @faker-js/faker from 5.5.3 to 6.0.0 (#16948)
Bumps [@faker-js/faker](https://github.com/faker-js/faker) from 5.5.3 to 6.0.0.
- [Release notes](https://github.com/faker-js/faker/releases)
- [Changelog](https://github.com/faker-js/faker/blob/main/CHANGELOG.md)
- [Commits](https://github.com/faker-js/faker/compare/v5.5.3...v6.0.0)

---
updated-dependencies:
- dependency-name: "@faker-js/faker"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-21 15:34:20 -04:00
dependabot[bot]
ec7ba00ae0
Bump postcss from 8.4.8 to 8.4.12 (#16949)
Bumps [postcss](https://github.com/postcss/postcss) from 8.4.8 to 8.4.12.
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/8.4.8...8.4.12)

---
updated-dependencies:
- dependency-name: postcss
  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-03-21 15:33:38 -04:00
dependabot[bot]
1a48369e8b
Bump parallel from 1.21.0 to 1.22.0 (#16950)
Bumps [parallel](https://github.com/grosser/parallel) from 1.21.0 to 1.22.0.
- [Release notes](https://github.com/grosser/parallel/releases)
- [Commits](https://github.com/grosser/parallel/compare/v1.21.0...v1.22.0)

---
updated-dependencies:
- dependency-name: parallel
  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-03-21 14:50:57 -04: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
Takuya N
392030f3bf
Update Travis CI badge to the latest (#16929)
Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>
2022-03-21 11:20:45 -04:00
Takuya N
5c9538e3a1
Update yarn from 1.22.5 to 1.22.18 (#16938)
Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>
2022-03-21 10:53:24 -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
Takuya N
8b085d58a8
Fix typo: Gitpod (#16930)
Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>
2022-03-21 07:16:20 -06:00
Arit Amana
2731c37cd6
Fix embed link validation failures (#16920)
* complete fix and update specs

* issue head req not get

* fix broken specs
2022-03-18 14:45:43 -04:00
dependabot[bot]
2ee82b5ec7
Bump rubocop-rails from 2.14.1 to 2.14.2 (#16921)
Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from 2.14.1 to 2.14.2.
- [Release notes](https://github.com/rubocop/rubocop-rails/releases)
- [Changelog](https://github.com/rubocop/rubocop-rails/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop-rails/compare/v2.14.1...v2.14.2)

---
updated-dependencies:
- dependency-name: rubocop-rails
  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-03-18 12:26:01 -06:00