[deploy] Change lingering /internal paths to /admin (#9673)

* Change lingering `/internal` paths to `/admin`

* Fix multiline test expectation
This commit is contained in:
Josh Puetz 2020-08-07 18:52:39 -05:00 committed by GitHub
parent ca7a1c1df3
commit 7d4a7cc883
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 73 additions and 81 deletions

12
.github/CODEOWNERS vendored
View file

@ -3,18 +3,18 @@
# for further details
/*.md @forem/oss
/app/assets/stylesheets/internal/ @forem/snackcase
/app/assets/stylesheets/admin/ @forem/snackcase
/app/controllers/articles_controller.rb @forem/hells-bells
/app/controllers/internal/ @forem/snackcase
/app/controllers/admin/ @forem/snackcase
/app/services/notifications/ @forem/delightful
/app/controllers/notifications/ @forem/delightful
/app/workers/notifications/ @forem/delightful
/app/controllers/internal/broadcasts_controller.rb @forem/delightful
/app/controllers/admin/broadcasts_controller.rb @forem/delightful
/app/controllers/async_info_controller.rb @forem/sre
/app/controllers/stories_controller.rb @forem/hells-bells
/app/services/search/ @forem/sre
/app/views/articles/ @forem/hells-bells
/app/views/internal/ @forem/snackcase
/app/views/admin/ @forem/snackcase
/app/views/moderation/ @forem/snackcase
/app/views/notifications/ @forem/delightful
/app/views/stories/ @forem/hells-bells
@ -25,9 +25,9 @@
/lib/data_update_scripts/ @forem/sre
/lib/sidekiq/ @forem/sre
/spec/rails_helper.rb @forem/sre
/spec/requests/internal/ @forem/snackcase
/spec/requests/admin/ @forem/snackcase
/spec/support/ @forem/sre
/spec/system/internal/ @forem/snackcase
/spec/system/admin/ @forem/snackcase
Gemfile @forem/sre @forem/oss
Gemfile.lock @forem/sre @forem/oss
package.json @forem/oss @nickytonline

View file

@ -3,7 +3,7 @@ unless ENV["COVERAGE"] == "false"
add_filter "/spec/"
add_filter "/dashboards/"
add_filter "/app/controllers/admin/"
add_filter "/app/controllers/internal/"
add_filter "/app/controllers/resource_admin/"
add_filter "/app/black_box/"
add_filter "/app/fields/"
add_filter "/app/views/admin/"

View file

@ -211,14 +211,6 @@ module ApplicationHelper
SiteConfig.community_member_label.pluralize
end
# Creates an app internal URL
#
# @note Uses protocol and domain specified in the environment, ensure they are set.
# @param uri [URI, String] parts we want to merge into the URL, e.g. path, fragment
# @example Retrieve the base URL
# app_url #=> "https://dev.to"
# @example Add a path
# app_url("internal") #=> "https://dev.to/internal"
def app_url(uri = nil)
URL.url(uri)
end

View file

@ -10,14 +10,6 @@ module URL
ApplicationConfig["APP_DOMAIN"]
end
# Creates an app URL
#
# @note Uses protocol and domain specified in the environment, ensure they are set.
# @param uri [URI, String] parts we want to merge into the URL, e.g. path, fragment
# @example Retrieve the base URL
# app_url #=> "https://dev.to"
# @example Add a path
# app_url("internal") #=> "https://dev.to/internal"
def self.url(uri = nil)
base_url = "#{protocol}#{domain}"
return base_url unless uri

View file

@ -63,7 +63,7 @@
<% if current_user.has_role?(:super_admin) && @moderatable.class.name == "Article" %>
<h3> <a href="<%= @moderatable.path %>/edit">Edit Post</a> |
<a href="/internal/articles/<%= @moderatable.id %>" data-no-instant>Internal:Article</a> |
<a href="/resource_admin/articles/<%= @moderatable.id %>" data-no-instant>ResourceAdmin:Article</a> |
<a href="/admin/articles/<%= @moderatable.id %>" data-no-instant>Admin:Article</a></h3>
<% elsif current_user.has_role?(:super_admin) && @moderatable.class.name == "Comment" %>
<h3> <a href="/admin/comments/<%= @moderatable.id %>" data-no-instant>Admin:Comment</a> |

View file

@ -4,6 +4,6 @@
<div class="crayons-card text-styles text-padding">
<h1 class="fs-3xl s:fs-4xl l:fs-5xl fw-bold s:fw-heavy lh-tight mb-4 mt-0"><%= title %></h1>
<p>The production <%= title %> page is a page generated at <a href="/internal/pages">/internal/pages</a>! This one is just a placeholder.</p>
<p>The production <%= title %> page is a page generated at <a href="/admin/pages">/admin/pages</a>! This one is just a placeholder.</p>
</div>
</div>

View file

@ -8,7 +8,7 @@ Disallow: /search/?q=*
Disallow: /listings*?q=*
Disallow: /mod/*
Disallow: /mod?*
Disallow: /internal/*
Disallow: /resource_admin/*
Disallow: /admin/*
Sitemap: https://<%= ApplicationConfig["AWS_BUCKET_NAME"] %>.s3.amazonaws.com/sitemaps/sitemap.xml.gz

View file

@ -88,7 +88,7 @@
<% if current_user.has_role?(:super_admin) || current_user.has_role?(:admin) %>
<center>
<h1><a href="/internal/tags/<%= @tag.id %>" data-no-instant><%= @tag.name %> admin</a></h1>
<h1><a href="/admin/tags/<%= @tag.id %>" data-no-instant><%= @tag.name %> admin</a></h1>
<br />
<br />
<br />

View file

@ -6,63 +6,91 @@ title: Configuring Forem
## Overview
As a Forem admin, one of the first steps of managing your site will be to tailor your content, branding and other important details based on your community goals. This is made simple by the configuration page which can be found at https://<span></span>your.forem.url/internal/config.
As a Forem admin, one of the first steps of managing your site will be to tailor
your content, branding and other important details based on your community
goals. This is made simple by the configuration page which can be found at
https://<span></span>your.forem.url/admin/config.
_We advise that you first complete the minimum set up before sending out your Forem link to your community._
_We advise that you first complete the minimum set up before sending out your
Forem link to your community._
## Complete your Set Up, Configure your Forem
Once your Forem instance is set up for the first time, you will most likely see the following banner:
Once your Forem instance is set up for the first time, you will most likely see
the following banner:
![Banner showing outstanding site configuration](https://dev-to-uploads.s3.amazonaws.com/i/2nosvfr7l47ymipmyh4o.png)
This banner indicates that the Forem configuration process hasn't been completed yet.
This banner indicates that the Forem configuration process hasn't been completed
yet.
When you click on the link on banner, it will take you to the configuration page (i.e. https://<span></span>your.forem.url/internal/config).
When you click on the link on banner, it will take you to the configuration page
(i.e. https://<span></span>your.forem.url/admin/config).
On this page you will see that the Get Started section is expanded. It contains all the mandatory fields that need to be filled out in order for the site to be in a usable state. Once it is filled out and submitted, the banner will then disappear.
On this page you will see that the Get Started section is expanded. It contains
all the mandatory fields that need to be filled out in order for the site to be
in a usable state. Once it is filled out and submitted, the banner will then
disappear.
## Access and Permissions
The following permissions are required to be able to view and/or edit the config page:
The following permissions are required to be able to view and/or edit the config
page:
#### Role: super\_admin
When providing this role to a user they will be able to access the config page. However, this page will be a read only view for them. They will see the following:
#### Role: super_admin
When providing this role to a user they will be able to access the config page.
However, this page will be a read only view for them. They will see the
following:
![Super Admin Permissions Role Provided](https://dev-to-uploads.s3.amazonaws.com/i/xpc8g9x46vzgi49ohc0d.png)
#### Role: single\_resource\_admin
When providing this role to a user they will be able to access the config page, and they will be able to edit the config variables.
#### Role: single_resource_admin
When providing this role to a user they will be able to access the config page,
and they will be able to edit the config variables.
![Super Resource Admin Role Provided](https://dev-to-uploads.s3.amazonaws.com/i/z5v2ou64imgqonmefolk.png)
The first admin of your Forem will be given the highest permissions. Thereafter, they can provide the necessary permissions to subsequent users via the https://<span></span>your.forem.url/internal/permissions.
The first admin of your Forem will be given the highest permissions. Thereafter,
they can provide the necessary permissions to subsequent users via the
https://<span></span>your.forem.url/admin/permissions.
## The Configuration Sections
Currently, the configuration page is split into 3 sections. They are as follows:
- A **Get Started section** that contains all required fields.
These are the fields that are required to be filled out, in order to get your Forem in a usable state.
- An **All Site Configuration section** that contains all the possible variables that you can configure on the site.
This section is broken down into sub sections, whereby each subsection will contain a description of what it does,
and then list the fields that are available for configuration. Each field will also contain a concise description
of what it is used for.
- An **Environment Variables section** that provides a read-only view of the environment variables that are
available to be set on the server.
If your instance is hosted by Forem, please get in touch with customer support to change any of these variables.
- A **Get Started section** that contains all required fields. These are the
fields that are required to be filled out, in order to get your Forem in a
usable state.
- An **All Site Configuration section** that contains all the possible variables
that you can configure on the site. This section is broken down into sub
sections, whereby each subsection will contain a description of what it does,
and then list the fields that are available for configuration. Each field will
also contain a concise description of what it is used for.
- An **Environment Variables section** that provides a read-only view of the
environment variables that are available to be set on the server. If your
instance is hosted by Forem, please get in touch with customer support to
change any of these variables.
![The Site Configuration Sections](https://dev-to-uploads.s3.amazonaws.com/i/o5p6kob6ctkzy38gw9vt.png)
All required fields are marked as such. In addition, you will notice that we have set some defaults for certain fields, you may amend them as you see relevant for your Forem.
All required fields are marked as such. In addition, you will notice that we
have set some defaults for certain fields, you may amend them as you see
relevant for your Forem.
## Updating your configurations
In order to update any of the variables within the Get Started and All Site Configuration sections, you will set the new value and then navigate to the end of the section where you will verify that you would like to make the change by typing the following sentence:
In order to update any of the variables within the Get Started and All Site
Configuration sections, you will set the new value and then navigate to the end
of the section where you will verify that you would like to make the change by
typing the following sentence:
```
My username is <specify your username here> and this action is 100% safe and appropriate.
```
You will now see your updated values and the changes on your site will be in effect.
You will now see your updated values and the changes on your site will be in
effect.
![Submit your data](https://dev-to-uploads.s3.amazonaws.com/i/xo0nxykuu8kw984w088n.png)

View file

@ -81,16 +81,16 @@ RSpec.describe ApplicationHelper, type: :helper do
end
it "creates a URL with a path" do
expect(app_url("internal")).to eq("https://dev.to/internal")
expect(app_url("admin")).to eq("https://dev.to/admin")
end
it "creates the correct URL even if the path starts with a slash" do
expect(app_url("/internal")).to eq("https://dev.to/internal")
expect(app_url("/admin")).to eq("https://dev.to/admin")
end
it "works when called with an URI object" do
uri = URI::Generic.build(path: "internal", fragment: "test")
expect(app_url(uri)).to eq("https://dev.to/internal#test")
uri = URI::Generic.build(path: "resource_admin", fragment: "test")
expect(app_url(uri)).to eq("https://dev.to/resource_admin#test")
end
end
@ -120,7 +120,8 @@ RSpec.describe ApplicationHelper, type: :helper do
end
it "has the correct text in the a tag" do
expect(helper.collection_link(collection)).to have_text("#{collection.slug} (#{collection.articles.published.size} Part Series)")
expect(helper.collection_link(collection))
.to have_text("#{collection.slug} (#{collection.articles.published.size} Part Series)")
end
end

View file

@ -24,16 +24,16 @@ RSpec.describe URL, type: :lib do
end
it "creates a URL with a path" do
expect(described_class.url("internal")).to eq("https://dev.to/internal")
expect(described_class.url("admin")).to eq("https://dev.to/admin")
end
it "creates the correct URL even if the path starts with a slash" do
expect(described_class.url("/internal")).to eq("https://dev.to/internal")
expect(described_class.url("/admin")).to eq("https://dev.to/admin")
end
it "works when called with an URI object" do
uri = URI::Generic.build(path: "internal", fragment: "test")
expect(described_class.url(uri)).to eq("https://dev.to/internal#test")
uri = URI::Generic.build(path: "admin", fragment: "test")
expect(described_class.url(uri)).to eq("https://dev.to/admin#test")
end
end

View file

@ -71,25 +71,4 @@ RSpec.describe "BufferUpdates", type: :request do
expect(BufferUpdate.first.body_text).to include(article.path)
end
end
# it "updates last buffered at" do
# post "/internal/buffer_updates",
# params:
# { social_channel: "main_twitter", article_id: article.id, tweet: "Hello this is a test" }
# expect(article.reload.last_buffered).not_to eq(nil)
# end
# it "updates last buffered at with satellite buffer" do
# post "/internal/buffer_updates",
# params:
# { social_channel: "satellite_twitter", article_id: article.id, tweet: "Hello this is a test" }
# expect(article.reload.last_buffered).not_to eq(nil)
# end
# it "updates last facebook buffered at" do
# post "/internal/buffer_updates",
# params:
# { social_channel: "facebook", article_id: article.id, tweet: "Hello this is a test" }
# expect(article.reload.facebook_last_buffered).not_to eq(nil)
# end
end