feat: 🎸 add "no primary auth method" warning to index
This commit is contained in:
5 files changed
+36
-1
No files matched your search
@@ -24,6 +24,9 @@ auth-method:
|
||||
none:
|
||||
title: No Auth Methods
|
||||
description: No auth methods were found for this scope.
|
||||
no-primary-auth-method:
|
||||
title: No Primary Auth Method Found
|
||||
description: A primary auth method auto-vivifies users when they authenticate for the first time. The primary auth method is also presented first to unauthenticated users. Each scope may have one primary auth method. Please choose a primary auth method for this scope.
|
||||
types:
|
||||
password: Password
|
||||
actions:
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
import Controller from '@ember/controller';
|
||||
|
||||
export default class ScopesScopeAuthMethodsIndexController extends Controller {
|
||||
get hasPrimaryAuthMethod() {
|
||||
return this.model.filterBy('isPrimary');
|
||||
}
|
||||
}
|
||||
@@ -30,6 +30,17 @@
|
||||
<page.body>
|
||||
{{#if @model}}
|
||||
|
||||
{{#if (feature-flag 'primary-auth-method')}}
|
||||
{{#unless this.hasPrimaryAuthMethod}}
|
||||
<Rose::Notification
|
||||
@style="warning"
|
||||
@heading={{t "resources.auth-method.messages.no-primary-auth-method.title"}}
|
||||
>
|
||||
{{t "resources.auth-method.messages.no-primary-auth-method.description"}}
|
||||
</Rose::Notification>
|
||||
{{/unless}}
|
||||
{{/if}}
|
||||
|
||||
<Rose::Table as |table|>
|
||||
<table.header as |header|>
|
||||
<header.row as |row|>
|
||||
|
||||
@@ -85,7 +85,7 @@ module.exports = function (environment) {
|
||||
},
|
||||
|
||||
featureFlags: {
|
||||
'primary-auth-method': false,
|
||||
'primary-auth-method': true,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
import { module, test } from 'qunit';
|
||||
import { setupTest } from 'ember-qunit';
|
||||
|
||||
module('Unit | Controller | scopes/scope/auth-methods/index', function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
// TODO: Replace this with your real tests.
|
||||
test('it exists', function (assert) {
|
||||
let controller = this.owner.lookup(
|
||||
'controller:scopes/scope/auth-methods/index'
|
||||
);
|
||||
assert.ok(controller);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user