From 449723d8c7544244d139d9624e470488e7433abb Mon Sep 17 00:00:00 2001 From: Ridhwana Date: Thu, 6 May 2021 15:12:06 +0200 Subject: [PATCH] [15-min-fix] Remove/Update the last of the admin hardcoded paths (#13681) * chore: hardcoded paths * hardcoded docs path * Update docs/admin/admin-search.md Co-authored-by: rhymes Co-authored-by: rhymes --- docs/admin/admin-search.md | 4 ++-- docs/admin/readme.md | 2 +- docs/backend/auth-apple.md | 3 ++- docs/backend/configuration.md | 4 ++-- docs/creators/configure-forem.md | 4 ++-- spec/requests/admin/invitations_spec.rb | 2 +- spec/requests/admin/permissions_spec.rb | 8 ++++---- 7 files changed, 14 insertions(+), 13 deletions(-) diff --git a/docs/admin/admin-search.md b/docs/admin/admin-search.md index 3d671f795..a9aa6048d 100644 --- a/docs/admin/admin-search.md +++ b/docs/admin/admin-search.md @@ -12,8 +12,8 @@ documentation, but if you're looking for an example of how it's being used on Forem, we've implemented it to help searching and sorting user reports. The view responsible for managing user reports can be found at -`localhost:3000/admin/reports` and Ransack can be seen in use on the index -action of the [`admin/feedback_messages_controller`][feedback_messages]. +`/admin/moderation/reports` and Ransack can be seen in use on the +index action of the [`admin/feedback_messages_controller`][feedback_messages]. For Forem, Ransack is being used exclusively in admin, for search problems in other parts of the app we use [PostgreSQL Full Text Search][postgres_fts]. diff --git a/docs/admin/readme.md b/docs/admin/readme.md index 9fb53fbe8..ab551df0a 100644 --- a/docs/admin/readme.md +++ b/docs/admin/readme.md @@ -22,7 +22,7 @@ Rolify by assigning the role `single_resource_admin` to a user. `single_resource_admin` users are given access to a Ruby class. In the codebase, there are admin models, not backed by database tables, that exist for this purpose. For example, if you needed to give a user access to only -`/admin/welcome`, you'd run the following command in the Rails console: +`/admin/apps/welcome`, you'd run the following command in the Rails console: ```ruby user = User.find(some_user_id) diff --git a/docs/backend/auth-apple.md b/docs/backend/auth-apple.md index a4a4f81a0..afc84a62b 100644 --- a/docs/backend/auth-apple.md +++ b/docs/backend/auth-apple.md @@ -56,7 +56,8 @@ Account. # Configuring the Rails Application Now with both the Service ID and Key you'll need to enable Apple Authentication -and pass in the credentials in the admin dashboard `/admin/config`. +and pass in the credentials in the admin dashboard +`/admin/customization/config`. ![Admin Authentication Configuration Dashboard](https://user-images.githubusercontent.com/6045239/92613383-25a83780-f278-11ea-94a7-b710da544c9d.png) diff --git a/docs/backend/configuration.md b/docs/backend/configuration.md index a7ab70a47..e801a9679 100644 --- a/docs/backend/configuration.md +++ b/docs/backend/configuration.md @@ -21,7 +21,7 @@ environments. Examples: Settings managed via your ENV can be found in [Configuring Environment Variables](/getting-started/config-env)) and viewed at -`/admin/config` (see [the Admin guide](/admin)): +`/admin/customization/config` (see [the Admin guide](/admin)): ![Screenshot of env variable admin interface](https://user-images.githubusercontent.com/47985/73627243-67d41f80-467e-11ea-9121-221275ff8a89.png) @@ -37,7 +37,7 @@ Examples: These settings can be accessed via the [`SiteConfig`](https://github.com/forem/forem/blob/master/app/models/site_config.rb) object and various models in the `Settings::` namespace and viewed / modified -via `/admin/config` (see [the Admin guide](/admin)). +via `/admin/customization/config` (see [the Admin guide](/admin)). ![Screenshot of site configuration admin interface](https://user-images.githubusercontent.com/47985/73627238-6276d500-467e-11ea-8724-afb703f056bc.png) diff --git a/docs/creators/configure-forem.md b/docs/creators/configure-forem.md index 781223d50..6a7142d3c 100644 --- a/docs/creators/configure-forem.md +++ b/docs/creators/configure-forem.md @@ -9,7 +9,7 @@ title: Configuring Forem 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://your.forem.url/admin/config. +https://your.forem.url/admin/customization/config. _We advise that you first complete the minimum set up before sending out your Forem link to your community._ @@ -25,7 +25,7 @@ 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://your.forem.url/admin/config). +(i.e. https://your.forem.url/admin/customization/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 diff --git a/spec/requests/admin/invitations_spec.rb b/spec/requests/admin/invitations_spec.rb index 01dc6a492..15a52101e 100644 --- a/spec/requests/admin/invitations_spec.rb +++ b/spec/requests/admin/invitations_spec.rb @@ -51,7 +51,7 @@ RSpec.describe "/admin/invitations", type: :request do expect do delete admin_invitation_path(invitation.id) end.to change { User.all.count }.by(-1) - expect(response.body).to redirect_to "/admin/invitations" + expect(response.body).to redirect_to admin_invitations_path end end end diff --git a/spec/requests/admin/permissions_spec.rb b/spec/requests/admin/permissions_spec.rb index 331360c37..028ffed02 100644 --- a/spec/requests/admin/permissions_spec.rb +++ b/spec/requests/admin/permissions_spec.rb @@ -10,7 +10,7 @@ RSpec.describe "/admin/permissions", type: :request do it "blocks the request" do expect do - get "/admin/permissions" + get admin_permissions_path end.to raise_error(Pundit::NotAuthorizedError) end end @@ -20,7 +20,7 @@ RSpec.describe "/admin/permissions", type: :request do before do sign_in super_admin - get "/admin/permissions" + get admin_permissions_path end it "allows the request" do @@ -33,7 +33,7 @@ RSpec.describe "/admin/permissions", type: :request do before do sign_in single_resource_admin - get "/admin/permissions" + get admin_permissions_path end it "allows the request" do @@ -50,7 +50,7 @@ RSpec.describe "/admin/permissions", type: :request do it "blocks the request" do expect do - get "/admin/permissions" + get admin_permissions_path end.to raise_error(Pundit::NotAuthorizedError) end end