Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

:Bug: Fix bundle in sign in widget. #313

Merged

Conversation

nikhilvenkatraman-okta
Copy link
Contributor

@nikhilvenkatraman-okta nikhilvenkatraman-okta commented Oct 2, 2017

  • In the sign in widget, we don't use the courage bundle that is referenced inside courage components. To fix this there was a change to point all courage bundle references to login. We made this change in most places, but a few places were missed.

@mauriciocastillosilva-okta @hor-kanchan-okta @rchild-okta

@upteam-okta

Test by changing browser language

screen shot 2017-10-02 at 4 15 11 pm

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me.
Can you test this with an override? Meaning a key that is passed in the config for other language

@nikhilvenkatraman-okta
Copy link
Contributor Author

@mauriciocastillosilva-okta

Tried this with the following config.

                  baseUrl: 'http://rain.okta1.com:1802',
                  logo: '/img/logo_widgico.png',
                  logoText: 'Windico',
                  i18n: {
                  fr: {
                      'primaryauth.title': 'French Sign in'
                    }
                  },
                  features: {
                    router: true,
                    rememberMe: true,
                    multiOptionalFactorEnroll: true
                  },
                  // Host the assets (i.e. jsonp files) locally
                  assets: {
                    baseUrl: '/'
                  }

screen shot 2017-10-02 at 5 11 41 pm

@nikhilvenkatraman-okta nikhilvenkatraman-okta changed the title 🐛 Fix bundle in sign in widget. :Bug: Fix bundle in sign in widget. Oct 3, 2017
@mauriciocastillosilva-okta
Copy link
Contributor

Please try it as well with an override of a string that is defined in courage bundle

@nikhilvenkatraman-okta
Copy link
Contributor Author

@mauriciocastillosilva-okta @hor-kanchan-okta added a few unit tests

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding the tests. Just minor comments see if we can reuse functions we already have.

@@ -6,6 +6,10 @@ define(['okta/jquery', 'okta/underscore', './Dom'], function ($, _, Dom) {
return this.el('o-form-head').trimmedText();
},

errorBannerText: function () {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you use any of the error functions we already have? I think errorMessage should work, but we also have hasErrors, errorBox and error

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. I'll update the test

@@ -3,6 +3,7 @@ define({
'responseType': 'json',
'response': {
'enroll.call.setup': 'JA: enroll.call.setup',
'security.disliked_food': 'JA: What is the food you least liked as a child?'
'security.disliked_food': 'JA: What is the food you least liked as a child?',
'oform.errorbanner.title': 'Japanese error banner title'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this need the JA: prefix?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need the JA prefix. My goal for this test is just to make sure that I am validating the text value for the key oform.errorbanner.title that is coming from login_ja file. Essentially mocking the behavior we get when we have bundles.login loaded with japanese translations.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right, I think it's more for consistency with the other strings we have... JA: oform.errorbanner.title, but I guess it is more a nit than anything else.

@nikhilvenkatraman-okta
Copy link
Contributor Author

@mauriciocastillosilva-okta updated tests

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nits. Fix those and ⛵️

@@ -3,6 +3,7 @@ define({
'responseType': 'json',
'response': {
'enroll.call.setup': 'JA: enroll.call.setup',
'security.disliked_food': 'JA: What is the food you least liked as a child?'
'security.disliked_food': 'JA: What is the food you least liked as a child?',
'oform.errorbanner.title': 'Japanese error banner title'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right, I think it's more for consistency with the other strings we have... JA: oform.errorbanner.title, but I guess it is more a nit than anything else.

@@ -975,6 +975,48 @@ function (Okta, Q, Backbone, SharedUtil, CryptoUtil, CookieUtil, Logger, OktaAut
expect(test.form.selectedCountry()).toBe('Nihon');
});
});

itp('overrides text for keys in courage bundle for non english languages', function () {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: overrides text in the courage bundle for non English language

});
});

itp('Text for keys in courage bundle are in jp as set in settings.language', function () {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Strings in courage bundle are in jp as set in settings.language

});
});

itp('Text for keys in courage bundle are in en as set in settings.language', function () {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be make more sense as Strings in courage bundle are in English by default and remove the settings object. Thinking because we already tested that a specific language works in the test above (jp)

@nikhilvenkatraman-okta
Copy link
Contributor Author

@mauriciocastillosilva-okta address nits with the last commit.

@mauriciocastillosilva-okta
Copy link
Contributor

🏎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants