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

refactor: πŸ’‘ move WorkerFilter component to more generic folder #2558

Merged
merged 2 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
import Component from '@glimmer/component';
import { action } from '@ember/object';

export default class FormTargetWorkerFilterIndexComponent extends Component {
export default class WorkerFilterComponent extends Component {
// =actions

/**
* Sets the target model filter to the passed in value.
* @param {TargetModel} model
* Sets the model filter to the passed in value.
* @param {Model} model
* @param {string} filter
* @param {string} value
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</page.header>

<page.body class='target-workers'>
<Form::Target::WorkerFilter
<WorkerFilter
@name='egress_worker_filter'
@model={{@model}}
@submit={{fn this.targets.saveWorkerFilter @model}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</page.header>

<page.body class='target-workers'>
<Form::Target::WorkerFilter
<WorkerFilter
@name='ingress_worker_filter'
@model={{@model}}
@submit={{fn this.targets.saveWorkerFilter @model}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { render } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';
import { setupIntl } from 'ember-intl/test-support';

module('Integration | Component | form/target/worker-filter', function (hooks) {
module('Integration | Component | worker-filter/index', function (hooks) {
setupRenderingTest(hooks);
setupIntl(hooks, 'en-us');

Expand All @@ -19,7 +19,7 @@ module('Integration | Component | form/target/worker-filter', function (hooks) {
this.cancel = () => {};
this.model = { egress_worker_filter: 'egress filter' };
await render(
hbs`<Form::Target::WorkerFilter @name='egress_worker_filter' @model={{this.model}} @onInput={{this.onInput}} @submit={{this.submit}} @cancel={{this.cancel}} />`,
hbs`<WorkerFilter @name='egress_worker_filter' @model={{this.model}} @onInput={{this.onInput}} @submit={{this.submit}} @cancel={{this.cancel}} />`,
);
Copy link
Collaborator

Choose a reason for hiding this comment

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

is OnInput used? I don't see it being passed to the component

      @name='ingress_worker_filter'
      @model={{@model}}
      @submit={{fn this.targets.saveWorkerFilter @model}}
      @cancel={{fn this.targets.cancelWorkerFilter @model}}
    /> 


assert.dom('[data-test-code-editor-field-editor]').isVisible();
Expand All @@ -34,7 +34,7 @@ module('Integration | Component | form/target/worker-filter', function (hooks) {
this.cancel = () => {};
this.model = { ingress_worker_filter: 'ingress filter' };
await render(
hbs`<Form::Target::WorkerFilter @name='ingress_worker_filter' @model={{this.model}} @onInput={{this.onInput}} @submit={{this.submit}} @cancel={{this.cancel}}/>`,
hbs`<WorkerFilter @name='ingress_worker_filter' @model={{this.model}} @onInput={{this.onInput}} @submit={{this.submit}} @cancel={{this.cancel}}/>`,
);

assert.dom('[data-test-code-editor-field-editor]').isVisible();
Expand Down