Skip to content

Modular logistics and supply chain operating system (LSOS)

hotfix organization 2fa settings as should not display method selection

Ronald A. Richardson3fc5bdb32e47
diff --git a/console/app/components/two-fa-settings.hbs b/console/app/components/two-fa-settings.hbs
index 10bb7dd7..62e6d123 100644
--- a/console/app/components/two-fa-settings.hbs
+++ b/console/app/components/two-fa-settings.hbs
@@ -11,19 +11,21 @@
<Toggle @isToggled={{this.isTwoFaEnforced}} @onToggle={{this.onTwoFaEnforcedToggled}} />
</div>
{{/if}}
- <label class="text-base font-medium">Choose an authentication method</label>
- <p class="text-sm text-gray-600 dark:text-gray-300 mt-1">In addition to your username and password, you'll have to enter a code (delivered via app or SMS) to sign in to your account</p>
- {{#each @twoFaMethods as |method|}}
- <div class="border rounded-lg px-4 py-3 mt-2 transition duration-300 {{if (eq this.selectedTwoFaMethod method.key) 'border-blue-500' 'border-gray-200 dark:border-gray-700'}}">
- <input type="radio" name="2fa-method" id="{{method.name}}" checked={{eq this.selectedTwoFaMethod method.key}} {{on "change" (fn this.onTwoFaSelected method.key)}} />
- <label for="{{method.name}}">
- {{method.name}}
- {{#if method.recommended}}
- <span class="bg-blue-500 rounded-xl text-white px-2 py-1 ml-2 text-xs font-semibold">Recommended</span>
- {{/if}}
- <p class="text-sm text-gray-600 dark:text-gray-300 mt-1">{{method.description}}</p>
- </label>
- </div>
- {{/each}}
+ {{#if this.showMethodSelection}}
+ <label class="text-base font-medium">Choose an authentication method</label>
+ <p class="text-sm text-gray-600 dark:text-gray-300 mt-1">In addition to your username and password, you'll have to enter a code (delivered via app or SMS) to sign in to your account</p>
+ {{#each @twoFaMethods as |method|}}
+ <div class="border rounded-lg px-4 py-3 mt-2 transition duration-300 {{if (eq this.selectedTwoFaMethod method.key) 'border-blue-500' 'border-gray-200 dark:border-gray-700'}}">
+ <input type="radio" name="2fa-method" id="{{method.name}}" checked={{eq this.selectedTwoFaMethod method.key}} {{on "change" (fn this.onTwoFaSelected method.key)}} />
+ <label for="{{method.name}}">
+ {{method.name}}
+ {{#if method.recommended}}
+ <span class="bg-blue-500 rounded-xl text-white px-2 py-1 ml-2 text-xs font-semibold">Recommended</span>
+ {{/if}}
+ <p class="text-sm text-gray-600 dark:text-gray-300 mt-1">{{method.description}}</p>
+ </label>
+ </div>
+ {{/each}}
+ {{/if}}
</div>
{{/if}}
\ No newline at end of file
diff --git a/console/app/components/two-fa-settings.js b/console/app/components/two-fa-settings.js
index 5c659c77..7fed84d8 100644
--- a/console/app/components/two-fa-settings.js
+++ b/console/app/components/two-fa-settings.js
@@ -68,6 +68,15 @@ export default class TwoFaSettingsComponent extends Component {
*/
@tracked showEnforceOption;
+ /**
+ * Indicates whether the settings should render an option to select 2fa `mn=ethod`
+ * Method is a flag that indicates which method users can receive a 2FA code from.
+ *
+ * @property {boolean} showEnforceOption
+ * @public
+ */
+ @tracked showMethodSelection;
+
/**
* Class constructor to initialize the component.
*
@@ -77,11 +86,12 @@ export default class TwoFaSettingsComponent extends Component {
* @param {Object} options.twoFaSettings - The current Two-Factor Authentication settings.
* @param {Array} options.twoFaMethods - Available Two-Factor Authentication methods.
*/
- constructor(owner, { twoFaSettings, twoFaMethods, showEnforceOption }) {
+ constructor(owner, { twoFaSettings, twoFaMethods, showEnforceOption, showMethodSelection = true }) {
super(...arguments);
const userSelectedMethod = isArray(twoFaMethods) ? twoFaMethods.find(({ key }) => key === twoFaSettings.method) : null;
+ this.showMethodSelection = showMethodSelection === true;
this.showEnforceOption = showEnforceOption === true;
this.isTwoFaEnabled = twoFaSettings.enabled === true;
this.isTwoFaEnforced = twoFaSettings.enforced === true;
diff --git a/console/app/templates/console.hbs b/console/app/templates/console.hbs
index 4aa3ca91..64c2532c 100644
--- a/console/app/templates/console.hbs
+++ b/console/app/templates/console.hbs
@@ -17,5 +17,5 @@
{{!-- Add Locale Selector to Header --}}
<EmberWormhole @to="view-header-actions">
- <LocaleSelector />
+ <LocaleSelector class="mr-0.5" />
</EmberWormhole>
\ No newline at end of file
diff --git a/console/app/templates/console/settings/two-fa.hbs b/console/app/templates/console/settings/two-fa.hbs
index 1e91a881..3b8e76e7 100644
--- a/console/app/templates/console/settings/two-fa.hbs
+++ b/console/app/templates/console/settings/two-fa.hbs
@@ -9,6 +9,7 @@
{{#if this.loadCompanyTwoFaSettings.isIdle}}
<TwoFaSettings
@showEnforceOption={{true}}
+ @showMethodSelection={{false}}
@twoFaMethods={{this.methods}}
@twoFaSettings={{this.twoFaSettings}}
@onTwoFaToggled={{this.onTwoFaToggled}}