Remove force_rtl feature flag

Closes USERS-18
flag=none

Per the ticket, there's no more need to be able to force RTL for
a locale, so the FF responsible for that was ripped out.

Test plan:
* The "Turn on RTL Even For Non-RTL Languages" feature
  flag should no longer appear in account settings
* Inspect the main Canvas page's HTML
* The <html> tag should include the attr  dir="ltr"
* Change your language to Hebrew or Arabic (caution,
  be sure you know how to switch back to English if you
  cannot read that language!)
* Canvas should look correct for that language, with
  the text flowing from right to left on the page
* The <html> tag should include the attr  dir="rtl"

Change-Id: Ib54645661c73a8c89fc76897b80b3e1f562b9553
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/216938
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Landon Gilbert-Bland <lbland@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Steve Shepherd <sshepherd@instructure.com>
This commit is contained in:
Charley Kline 2019-11-12 16:01:41 -06:00
parent ccb6643205
commit 66d9d792e2
3 changed files with 3 additions and 17 deletions

View File

@ -274,20 +274,16 @@ module ApplicationHelper
Rails.env.test? && ENV.fetch("DISABLE_CSS_TRANSITIONS", "1") == "1"
end
def use_rtl?
I18n.rtl? || @current_user.try(:feature_enabled?, :force_rtl)
end
# this is exactly the same as our sass helper with the same name
# see: https://www.npmjs.com/package/sass-direction
def direction(left_or_right)
use_rtl? ? {'left' => 'right', 'right' => 'left'}[left_or_right] : left_or_right
I18n.rtl? ? {'left' => 'right', 'right' => 'left'}[left_or_right] : left_or_right
end
def css_variant(opts = {})
variant = use_responsive_layout? ? 'responsive_layout' : 'new_styles'
use_high_contrast = @current_user && @current_user.prefers_high_contrast? || opts[:force_high_contrast]
variant + (use_high_contrast ? '_high_contrast' : '_normal_contrast') + (use_rtl? ? '_rtl' : '')
variant + (use_high_contrast ? '_high_contrast' : '_normal_contrast') + (I18n.rtl? ? '_rtl' : '')
end
def css_url_for(bundle_name, plugin=false, opts = {})

View File

@ -16,7 +16,7 @@
# with this program. If not, see <http://www.gnu.org/licenses/>.
-%><!DOCTYPE html>
<html class="scripts-not-loaded" dir="<%= use_rtl? ? 'rtl' : 'ltr' %>" lang=<%= raw I18n.locale.to_json %>>
<html class="scripts-not-loaded" dir="<%= I18n.rtl? ? 'rtl' : 'ltr' %>" lang=<%= raw I18n.locale.to_json %>>
<head>
<meta charset="utf-8">
<link rel="preconnect" href="https://fonts.gstatic.com/" crossorigin>

View File

@ -218,16 +218,6 @@ responsive_layout:
description: This is a feature to allow the development of a responsive layout
applies_to: RootAccount
root_opt_in: true
force_rtl:
state: hidden
display_name: Turn on RTL Even For Non-RTL Languages
description: This is just a dev-only feature you can turn on to get a preview of
how pages would look in a RTL environment, without having to change your language
to one that is normally RTL
applies_to: User
environments:
production:
state: disabled
enable_i18n_features_in_outcomes_exports:
state: hidden
display_name: Enable i18n features in outcomes exports