remove manual access token html template ref to notifications

the notifications url gets added via the layout template partial
and is only included in one of our manual access token creation
templates, so I'm just going to remove it from the html template,
to be consistent with the others.

fixes FOO-3480
refs FOO-3412
flag = none

test plan:
 • have a multi-sharded canvas setup using MRA
 • have a user with an active email communication channel that
   has been created on a shard different than your default shard
   (where the siteadmin account resides)
 • log in as the user and navigate to their user settings page
 • create a new access token using the |+ New Access Token| button
 • check the notifications sent to the user and note that the link
   on the text “Manage User Settings” points to the correct host
   of that user's home account, instead of the primary root account
   on the default shard
 • verify in the html template we no longer include the link
   "Update your notification settings"
 • re-generating access tokens should behave similarly

Change-Id: Ib764f315c154baf1fb1a043c2f66baab6adfb804
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/316964
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: August Thornton <august@instructure.com>
This commit is contained in:
August Thornton 2023-04-25 14:41:12 -07:00
parent 0c3baa9f7b
commit b3d35ebfa4
6 changed files with 51 additions and 5 deletions

View File

@ -1,5 +1,5 @@
<% define_content :link do %>
<% if user %>
<% if user&.account&.primary_domain&.host %>
<%= url_for({ controller: :profile, action: :settings, host: user.account.primary_domain.host }) %>
<% else %>
<%= settings_profile_url %>

View File

@ -1,5 +1,7 @@
<% remove_profile_url_in_layout = true %>
<% define_content :link do %>
<% if user %>
<% if user&.account&.primary_domain&.host %>
<%= url_for({ controller: :profile, action: :settings, host: user.account.primary_domain.host }) %>
<% else %>
<%= settings_profile_url %>

View File

@ -1,5 +1,5 @@
<% define_content :link do %>
<% if user %>
<% if user&.account&.primary_domain&.host %>
<%= url_for({ controller: :profile, action: :settings, host: user.account.primary_domain.host }) %>
<% else %>
<%= settings_profile_url %>

View File

@ -1,5 +1,5 @@
<% define_content :link do %>
<% if user %>
<% if user&.account&.primary_domain&.host %>
<%= url_for({ controller: :profile, action: :settings, host: user.account.primary_domain.host }) %>
<% else %>
<%= settings_profile_url %>

View File

@ -1,5 +1,5 @@
<% define_content :link do %>
<% if user %>
<% if user&.account&.primary_domain&.host %>
<%= url_for({ controller: :profile, action: :settings, host: user.account.primary_domain.host }) %>
<% else %>
<%= settings_profile_url %>

View File

@ -0,0 +1,44 @@
# frozen_string_literal: true
#
# Copyright (C) 2023 - present Instructure, Inc.
#
# This file is part of Canvas.
#
# Canvas is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation, version 3 of the License.
#
# Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
# details.
#
# You should have received a copy of the GNU Affero General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
require File.expand_path(File.dirname(__FILE__) + "/../spec_helper")
require File.expand_path(File.dirname(__FILE__) + "/messages_helper")
describe "manually_created_access_token_created" do
before :once do
user_model
enable_default_developer_key!
@token = @user.access_tokens.create!(purpose: "test")
end
let(:asset) { @token }
let(:message_data) do
{ user: @user }
end
let(:notification_name) { :manually_created_access_token_created }
include_examples "a message"
it "removes notification settings url link" do
msg = generate_message(notification_name, :email, asset, message_data)
expect(msg.html_body).to include "Manage User Settings"
expect(msg.html_body).not_to include "Update your notification settings"
end
end