Fixes #3245 - Rename Third-Party login: Office 365 to Microsoft 365

This commit is contained in:
Mantas Masalskis 2022-02-06 21:36:30 +01:00
parent ceac28ce4d
commit 98604f84da
12 changed files with 113 additions and 31 deletions

View file

@ -88,9 +88,9 @@ App.Config.set('auth_provider_all', {
class: 'gitlab'
microsoft_office365:
url: '/auth/microsoft_office365'
name: __('Office 365')
name: __('Microsoft')
config: 'auth_microsoft_office365'
class: 'office365'
class: 'microsoft'
google_oauth2:
url: '/auth/google_oauth2'
name: __('Google')

View file

@ -75,6 +75,7 @@
.icon-magnifier { width: 15px; height: 15px; }
.icon-marker { width: 17px; height: 19px; }
.icon-message { width: 24px; height: 24px; }
.icon-microsoft-button { width: 29px; height: 24px; }
.icon-minus-small { width: 16px; height: 16px; }
.icon-minus { width: 20px; height: 20px; }
.icon-mood-bad { width: 60px; height: 59px; }
@ -86,7 +87,7 @@
.icon-mute { width: 16px; height: 16px; }
.icon-not-signed { width: 14px; height: 14px; }
.icon-note { width: 16px; height: 16px; }
.icon-office365-button { width: 29px; height: 24px; }
.icon-oauth2-button { width: 29px; height: 24px; }
.icon-one-ticket { width: 48px; height: 10px; }
.icon-organization { width: 16px; height: 16px; }
.icon-outbound-calls { width: 17px; height: 17px; }
@ -116,7 +117,7 @@
.icon-sms { width: 17px; height: 17px; }
.icon-spinner-small { width: 15px; height: 15px; }
.icon-split { width: 16px; height: 17px; }
.icon-sso-button { width: 29px; height: 24px; }
.icon-sso-button { width: 96.57px; height: 79.92px; }
.icon-status-modified-outer-circle { width: 16px; height: 16px; }
.icon-status { width: 16px; height: 16px; }
.icon-stopwatch { width: 77px; height: 83px; }

View file

@ -3542,6 +3542,8 @@ ol.tabs li {
border: none;
text-align: initial;
@extend %clickable;
&.auth-provider--wide {
padding-right: 25px;
}
@ -3575,8 +3577,9 @@ ol.tabs li {
background: hsl(10, 78%, 53%);
}
&.auth-provider--office365 {
background: hsl(15, 100%, 47%);
&.auth-provider--microsoft {
background: hsl(0, 0%, 93%);
color: hsl(0, 0%, 46%) !important;
}
&.auth-provider--weibo {

View file

@ -0,0 +1,15 @@
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
class Issue3245Office365MicrosoftRename < ActiveRecord::Migration[6.0]
def up
return if !Setting.exists?(name: 'system_init_done')
setting = Setting.find_by name: 'auth_microsoft_office365'
setting.preferences[:title_i18n][0] = 'Microsoft'
setting.preferences[:description_i18n][0] = 'Microsoft'
setting.save!
rescue => e
Rails.logger.error e
end
end

View file

@ -1679,8 +1679,8 @@ Setting.create_if_not_exists(
preferences: {
controller: 'SettingsAreaSwitch',
sub: ['auth_microsoft_office365_credentials'],
title_i18n: ['Office 365'], # rubocop:disable Zammad/DetectTranslatableString
description_i18n: ['Office 365', 'Microsoft Application Registration Portal', 'https://portal.azure.com'], # rubocop:disable Zammad/DetectTranslatableString
title_i18n: ['Microsoft'],
description_i18n: ['Microsoft', __('Microsoft Application Registration Portal'), 'https://portal.azure.com'],
permission: ['admin.security'],
},
state: false,

View file

@ -5819,12 +5819,20 @@ msgstr ""
msgid "Method (AJAX endpoint)"
msgstr ""
#: app/assets/javascripts/app/controllers/_profile/linked_accounts.coffee
msgid "Microsoft"
msgstr ""
#: app/assets/javascripts/app/controllers/_channel/microsoft365.coffee
#: app/assets/javascripts/app/views/microsoft365/index.jst.eco
#: app/assets/javascripts/app/views/microsoft365/list.jst.eco
msgid "Microsoft 365"
msgstr ""
#: db/seeds/settings.rb
msgid "Microsoft Application Registration Portal"
msgstr ""
#: app/assets/javascripts/app/views/import/freshdesk.jst.eco
#: app/assets/javascripts/app/views/import/kayako.jst.eco
#: app/assets/javascripts/app/views/import/otrs.jst.eco
@ -6711,10 +6719,6 @@ msgstr ""
msgid "October"
msgstr ""
#: app/assets/javascripts/app/controllers/_profile/linked_accounts.coffee
msgid "Office 365"
msgstr ""
#: db/seeds/settings.rb
msgid "Office 365 App Credentials"
msgstr ""

View file

@ -523,6 +523,16 @@
message
</title>
<path d="M20.098 3.035A5.351 5.351 0 0 0 19.544 3C14.185 3 8.827 3 3.467 3.003c-.248 0-.497.032-.743.074-.383.063-.6.318-.662.704a4.489 4.489 0 0 0-.06.708C2 8.133 2 11.777 2.002 15.421c0 .104.002.209.008.313.047.813.33 1.109 1.124 1.124 1.054.02 2.067.016 3.12.022.223.002.66 0 .66 0v.354c0 1.341.042 2.682.046 4.025 0 .257-.055.572.247.705.295.13.489-.124.675-.3 1.636-1.53 3.276-3.058 4.905-4.596.15-.14.3-.19.497-.19 2 .004 4 .004 5.997.002.251 0 .503-.01.751-.033.593-.053.842-.294.928-.896.025-.187.04-.379.04-.568.001-3.586.002-7.173 0-10.76a5.875 5.875 0 0 0-.058-.765c-.074-.517-.334-.768-.843-.823zM5 8c0 .552.446 1 .998 1h7.004c.551 0 .998-.444.998-1 0-.552-.446-1-.998-1H5.998A.996.996 0 0 0 5 8zm0 4a1 1 0 0 0 .999 1H17a1 1 0 1 0 0-2H6A.997.997 0 0 0 5 12z" fill-rule="evenodd"/>
</symbol><symbol id="icon-microsoft-button" viewBox="0 0 29 24">
<title>
microsoft-button
</title>
<g fill-rule="nonzero" fill="none">
<path fill="#F25022" d="M2 0h11.406v11.406H2z"/>
<path fill="#7FBA00" d="M14.594 0H26v11.406H14.594z"/>
<path fill="#00A4EF" d="M2 12.594h11.406V24H2z"/>
<path fill="#FFB900" d="M14.594 12.594H26V24H14.594z"/>
</g>
</symbol><symbol id="icon-minus-small" viewBox="0 0 16 16">
<title>
minus-small
@ -588,11 +598,6 @@
oauth2-button
</title>
<path d="M15 15.732a2 2 0 1 0-2 0v4.27h2v-4.27zM10.029 10H21.46c.852 0 1.539.67 1.539 1.496v9.008C23 21.32 22.311 22 21.461 22H6.54C5.687 22 5 21.33 5 20.504v-9.008C5 10.68 5.689 10 6.539 10h1.48L8.01 7.728l.01.134a2.729 2.729 0 0 1-.017-.161c-.059-.78.153-1.681.58-2.57C9.421 3.381 11.192 2 13.996 2c2.803 0 4.671 1.383 5.511 3.132a5.049 5.049 0 0 1 .461 2.73l.01-.133-.01 2.272h-1.98V7.728l.01-.134.003-.041a3.133 3.133 0 0 0-.284-1.555c-.458-.954-1.852-1.989-3.721-1.989-1.87 0-3.227 1.035-3.685 1.99a3.133 3.133 0 0 0-.283 1.553l.003.041.01.135L10.028 10z" fill="#FFF" fill-rule="evenodd"/>
</symbol><symbol id="icon-office365-button" viewBox="0 0 29 24">
<title>
office365-button
</title>
<path d="M23 20.492h-.016V3.558L16.949 1.81 6.033 5.9 6 5.915V18.15l3.726-1.45V6.74L16.95 5.01l-.033 14.642L6 18.15l10.916 4.04 6.068-1.683v-.016" fill-rule="nonzero" fill="#FFF"/>
</symbol><symbol id="icon-one-ticket" viewBox="0 0 48 10">
<title>
one-ticket

Before

Width:  |  Height:  |  Size: 89 KiB

After

Width:  |  Height:  |  Size: 89 KiB

View file

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="29px" height="24px" viewBox="0 0 29 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>microsoft-button</title>
<g id="microsoft-button" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="windows" transform="translate(2.000000, 0.000000)" fill-rule="nonzero">
<rect id="Rectangle" fill="#F25022" x="0" y="0" width="11.4062609" height="11.4062609"></rect>
<rect id="Rectangle" fill="#7FBA00" x="12.5937391" y="0" width="11.4062609" height="11.4062609"></rect>
<rect id="Rectangle" fill="#00A4EF" x="0" y="12.5937391" width="11.4062609" height="11.4062609"></rect>
<rect id="Rectangle" fill="#FFB900" x="12.5937391" y="12.5937391" width="11.4062609" height="11.4062609"></rect>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 892 B

View file

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="29px" height="24px" viewBox="0 0 29 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 45.2 (43514) - http://www.bohemiancoding.com/sketch -->
<title>office365-button</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="office365-button" fill-rule="nonzero" fill="#FFFFFF">
<polyline id="office365" points="23 20.4918622 22.9835112 20.4918622 22.9835112 3.5578176 16.9485936 1.80999994 6.03297769 5.8992337 6 5.91572254 6 18.1504461 9.72647915 16.6994277 9.72647915 6.74016483 16.9485936 5.00883602 16.9156159 19.6509311 6 18.1504461 16.9156159 22.1902133 22.9835112 20.5083511 22.9835112 20.4918622"></polyline>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 890 B

View file

@ -10,5 +10,8 @@
"gulp-util": "^3.0.4",
"gulp-watch": "^4.2.4",
"through2": "^0.6.5"
},
"resolutions": {
"graceful-fs": "^4.2.9"
}
}

View file

@ -0,0 +1,51 @@
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
require 'rails_helper'
RSpec.describe Issue3245Office365MicrosoftRename, type: :db_migration do
it 'renames Office 365 to Microsoft' do
replace_setting_with_old
migrate
new_setting = Setting.find_by(name: 'auth_microsoft_office365')
expect(new_setting.preferences).to include(title_i18n: ['Microsoft'], description_i18n: ['Microsoft', 'Microsoft Application Registration Portal', 'https://portal.azure.com'])
end
def replace_setting_with_old
Setting
.find_by(name: 'auth_microsoft_office365')
.destroy!
Setting.create!(
title: 'Authentication via %s',
name: 'auth_microsoft_office365',
area: 'Security::ThirdPartyAuthentication',
description: 'Enables user authentication via %s. Register your app first at [%s](%s).',
options: {
form: [
{
display: '',
null: true,
name: 'auth_microsoft_office365',
tag: 'boolean',
options: {
true => 'yes',
false => 'no',
},
},
],
},
preferences: {
controller: 'SettingsAreaSwitch',
sub: ['auth_microsoft_office365_credentials'],
title_i18n: ['Microsoft'],
description_i18n: ['Microsoft', 'Microsoft Application Registration Portal', 'https://portal.azure.com'],
permission: ['admin.security'],
},
state: false,
frontend: true
)
end
end

View file

@ -132,8 +132,8 @@ RSpec.describe 'Manage > Settings > Security', type: :system do
include_examples 'Display callback urls for third-party applications #3622'
end
describe 'Authentication via Office 365' do
let(:app_name) { 'Office 365' }
describe 'Authentication via Microsoft' do
let(:app_name) { 'Microsoft' }
let(:app_setting) { 'auth_microsoft_office365' }
include_examples 'for third-party applications button in login page'