feat: 🎸 add icons and clean up state change language

This commit is contained in:
Randall Morey committed 2021-06-03 17:08:40 -04:00
1 parent f7854b642c
commit d0eb41e03b
11 files changed
+45 -81

No files matched your search

-15
View File
@@ -1,15 +0,0 @@
/**
* Empty auth method definition
*/
export class AuthMethod {}
/**
* Simple OIDC auth method definition to contain possible oidc states.
* @property states {[string]} states
*/
export class AuthMethodOIDC extends AuthMethod {
/**
* Possible auth-method statuses
*/
static states = ['inactive', 'active-private', 'active-public'];
}
+21
View File
@@ -75,6 +75,27 @@ export default class AuthMethodModel extends GeneratedAuthMethodModel {
return this.type === 'oidc';
}
/**
* @type {boolean}
*/
get isInactive() {
return this.attributes.state === 'inactive';
}
/**
* @type {boolean}
*/
get isPrivate() {
return this.attributes.state === 'active-private';
}
/**
* @type {boolean}
*/
get isPublic() {
return this.attributes.state === 'active-public';
}
// =methods
/**
-1
View File
@@ -1 +0,0 @@
export { default } from 'api/classes/auth-method';
@@ -1,22 +0,0 @@
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
import setupMirage from 'ember-cli-mirage/test-support/setup-mirage';
import { AuthMethod, AuthMethodOIDC } from 'api/classes/auth-method';
module('Unit | Class | auth method', function (hooks) {
setupTest(hooks);
setupMirage(hooks);
test('it exists', function (assert) {
assert.ok(AuthMethod);
assert.ok(AuthMethodOIDC);
});
test('oidc auth method lists states', function (assert) {
assert.deepEqual(AuthMethodOIDC.states, [
'inactive',
'active-private',
'active-public',
]);
});
});
@@ -31,3 +31,4 @@ set-password: Set Password
change-password: Change Password
edit-form: Edit Form
change-origin: Change Origin URL
change-state: Change State
@@ -45,7 +45,6 @@ auth-method:
delete: Delete Auth Method
make-primary: Make Primary
remove-as-primary: Remove as Primary
status: Status
notifications:
make-primary-success: Auth method successfully elected to primary.
remove-as-primary-success: Auth method successfully removed as primary.
+3 -6
View File
@@ -8,9 +8,6 @@ connection:
success:
description: "Local proxy address ({protocol}): {address}:{port}"
primary: Primary
auth-method:
oidc:
states:
inactive: Inactive
active-private: Active Private
active-public: Active Public
inactive: Inactive
active-private: Private
active-public: Public
+1 -1
View File
@@ -43,7 +43,7 @@
"@ember/test-helpers": "^2.1.4",
"@glimmer/component": "^1.0.3",
"@glimmer/tracking": "^1.0.3",
"@hashicorp/structure-icons": "^1.8.1",
"@hashicorp/structure-icons": "^1.9.0-0",
"@storybook/addon-actions": "^6.0.26",
"@storybook/addon-docs": "^6.0.26",
"@storybook/addon-knobs": "^6.0.26",