Skip to content

Commit

Permalink
Merge branch 'release/9.0.12'
Browse files Browse the repository at this point in the history
  • Loading branch information
smoyte committed Mar 23, 2024
2 parents 126d32e + 59d4fb3 commit 8e882a7
Show file tree
Hide file tree
Showing 13 changed files with 28 additions and 26 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9.0.11
9.0.12
2 changes: 1 addition & 1 deletion app/controllers/gdrive/browse_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module GDrive
class BrowseController < ApplicationController
before_action -> { nav_context(:files, :gdrive) }
before_action -> { nav_context(:wiki, :gdrive) }

def index
@browse_decorator = BrowseDecorator.new
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/gdrive/item_groups_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module GDrive
class ItemGroupsController < ApplicationController
include Destructible

before_action -> { nav_context(:files, :gdrive) }
before_action -> { nav_context(:wiki, :gdrive) }

def new
@item = Item.find(params[:item_id])
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/gdrive/items_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module GDrive
class ItemsController < ApplicationController
include Destructible

before_action -> { nav_context(:files, :gdrive) }
before_action -> { nav_context(:wiki, :gdrive) }
before_action :load_config

helper_method :sample_item
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module GDrive
module Migration
module Dashboard
class FilesController < ApplicationController
before_action -> { nav_context(:files, :gdrive, :migration, :dashboard, :files) }
before_action -> { nav_context(:wiki, :gdrive, :migration, :dashboard, :files) }

def index
@main_config = MainConfig.find_by(community: current_community)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module GDrive
module Migration
module Dashboard
class OwnersController < ApplicationController
before_action -> { nav_context(:files, :gdrive, :migration, :dashboard, :owners) }
before_action -> { nav_context(:wiki, :gdrive, :migration, :dashboard, :owners) }

def index
@main_config = MainConfig.find_by(community: current_community)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module GDrive
module Migration
module Dashboard
class StatusController < ApplicationController
before_action -> { nav_context(:files, :gdrive, :migration, :dashboard, :status) }
before_action -> { nav_context(:wiki, :gdrive, :migration, :dashboard, :status) }

def show
authorize(current_community, :setup?, policy_class: SetupPolicy)
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/gdrive/setup/auth_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module Setup
class AuthController < ApplicationController
USERINFO_URL = "https://www.googleapis.com/oauth2/v2/userinfo?access_token="

before_action -> { nav_context(:files, :gdrive, :setup, :auth) }
before_action -> { nav_context(:wiki, :gdrive, :setup, :auth) }

# We can't use a subdomain on this page due to Google API restrictions.
prepend_before_action :set_current_community_from_callback_state, only: :callback
Expand Down
28 changes: 15 additions & 13 deletions app/decorators/nav/builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,10 @@ def main_items(display:)
)
items << customizer.filter_item(
name: :wiki,
path: "/wiki",
path: h.wiki_pages_path,
permitted: h.policy(sample_wiki_page).show?,
icon: "info-circle"
)
items << customizer.filter_item(
name: :files,
path: h.gdrive_home_path,
permitted: GDrive::BrowsePolicy.new(user, :folder).index?,
icon: "file"
)
items << customizer.filter_item(
name: :billing,
path: h.accounts_path,
Expand Down Expand Up @@ -273,11 +267,19 @@ def sub_items(main_item = nil)
icon: "copy"
}
]
when :files
when :wiki
sample_wiki_page = Wiki::Page.new(community: community)
[
{
name: :wiki,
parents: :wiki,
path: h.wiki_pages_path,
permitted: h.policy(sample_wiki_page).show?,
icon: "info-circle"
},
{
name: :gdrive,
parents: :files,
parents: :wiki,
path: h.gdrive_home_path,
permitted: GDrive::BrowsePolicy.new(user, :folder).index?,
icon: {name: "google", style: :brands}
Expand Down Expand Up @@ -309,21 +311,21 @@ def sub_sub_items
path: h.people_member_types_path,
permitted: h.policy(sample_member_type).index?
}]
elsif context[0..3] == %i[files gdrive migration dashboard]
elsif context[0..3] == %i[wiki gdrive migration dashboard]
depth = 4
[{
name: :status,
parents: %i[files gdrive migration dashboard],
parents: %i[wiki gdrive migration dashboard],
path: h.gdrive_migration_dashboard_status_path,
permitted: GDrive::SetupPolicy.new(user, community).setup?
}, {
name: :owners,
parents: %i[files gdrive migration dashboard],
parents: %i[wiki gdrive migration dashboard],
path: h.gdrive_migration_dashboard_owners_path,
permitted: GDrive::SetupPolicy.new(user, community).setup?
}, {
name: :files,
parents: %i[files gdrive migration dashboard],
parents: %i[wiki gdrive migration dashboard],
path: h.gdrive_migration_dashboard_files_path,
permitted: GDrive::SetupPolicy.new(user, community).setup?
}]
Expand Down
2 changes: 1 addition & 1 deletion app/views/gdrive/browse/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<% content_for(:title) { "Files" } %>
<% content_for(:title) { "Google Drive" } %>
<% content_for(:action_links) do %>
<% if @setup_policy.setup? %>
<% if @config && !@no_credentials && !@authorization_error %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/gdrive/migration/consent/intro.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
If you'd rather not help with this effort, you can <%= link_to("opt out", gdrive_migration_consent_opt_out_path) %>.
</p>

<%= link_to("Yes, I am ready help!", gdrive_migration_consent_auth_url, class: "btn btn-primary") %>
<%= link_to("Yes, I am ready to help!", gdrive_migration_consent_auth_url, class: "btn btn-primary") %>
</div>
4 changes: 2 additions & 2 deletions config/locales/en/nav.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ en:
protocols: "Protocols"
wiki:
_self: "Wiki"
files:
_self: "Files"
wiki:
_self: "Wiki"
gdrive:
_self: "Google Drive"
migration:
Expand Down
2 changes: 1 addition & 1 deletion lib/gather/error_reporter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class ErrorReporter
def report(error, env: nil, data: nil)
if Settings.error_reporting == "sentry" && Rails.env.production?
Sentry.with_scope do |scope|
scope.set_context("Gather", env: env, data: data)
scope.set_context("Gather", data.merge(request_env: env))
Sentry.capture_exception(error)
end
elsif Settings.error_reporting == "email"
Expand Down

0 comments on commit 8e882a7

Please sign in to comment.