chore: Remove unused delete method
This commit is contained in:
5 files changed
+27
-46
No files matched your search
@@ -5,6 +5,12 @@
|
||||
@error={{@model.errors.base}}
|
||||
as |form|
|
||||
>
|
||||
<form.input
|
||||
@value={{@model.type}}
|
||||
@label={{t "form.label.type"}}
|
||||
readonly={{true}}
|
||||
@disabled={{true}} />
|
||||
|
||||
<form.input
|
||||
@name="name"
|
||||
@type="name"
|
||||
|
||||
@@ -50,21 +50,4 @@ export default class ScopesScopeAuthMethodsRoute extends Route {
|
||||
this.notify.error(error.message, { closeAfter: null });
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete an auth-method in current scope and redirect to auth-methods
|
||||
* @param {AuthMethodModel} authMethod
|
||||
*/
|
||||
@action
|
||||
async delete(authMethod) {
|
||||
try {
|
||||
await authMethod.destroyRecord();
|
||||
this.refresh();
|
||||
this.notify.success(this.intl.t('notify.delete-success'));
|
||||
this.transitionTo('scopes.scope.auth-methods');
|
||||
} catch (error) {
|
||||
//TODO: replace with translated strings
|
||||
this.notify.error(error.message, { closeAfter: null });
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,9 +12,6 @@
|
||||
</page.navigation>
|
||||
|
||||
<page.body>
|
||||
|
||||
{{@model.type}}
|
||||
|
||||
<Form::AuthMethod
|
||||
@model={{@model}}
|
||||
@submit={{route-action "save" @model}}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
import { module, test } from 'qunit';
|
||||
import { setupRenderingTest } from 'ember-qunit';
|
||||
import { render, find } from '@ember/test-helpers';
|
||||
import { hbs } from 'ember-cli-htmlbars';
|
||||
|
||||
module('Integration | Component | form/auth-method', function (hooks) {
|
||||
setupRenderingTest(hooks);
|
||||
|
||||
test('it renders', async function (assert) {
|
||||
this.submit = () => {};
|
||||
this.cancel = () => {};
|
||||
|
||||
await render(hbs`
|
||||
<Form::AuthMethod
|
||||
@submit={{this.submit}}
|
||||
@cancel={{this.cancel}}
|
||||
/>`);
|
||||
|
||||
assert.ok(find('form'));
|
||||
});
|
||||
});
|
||||
@@ -1,26 +0,0 @@
|
||||
import { module, test } from 'qunit';
|
||||
import { setupRenderingTest } from 'ember-qunit';
|
||||
import { render } from '@ember/test-helpers';
|
||||
import { hbs } from 'ember-cli-htmlbars';
|
||||
|
||||
module('Integration | Component | form/auth-method/index', function(hooks) {
|
||||
setupRenderingTest(hooks);
|
||||
|
||||
test('it renders', async function(assert) {
|
||||
// Set any properties with this.set('myProperty', 'value');
|
||||
// Handle any actions with this.set('myAction', function(val) { ... });
|
||||
|
||||
await render(hbs`<Form::AuthMethod::Index />`);
|
||||
|
||||
assert.equal(this.element.textContent.trim(), '');
|
||||
|
||||
// Template block usage:
|
||||
await render(hbs`
|
||||
<Form::AuthMethod::Index>
|
||||
template block text
|
||||
</Form::AuthMethod::Index>
|
||||
`);
|
||||
|
||||
assert.equal(this.element.textContent.trim(), 'template block text');
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user