Revert "FEATURE: default value to fields in automation"

This reverts commit 4d32635c69.
This commit is contained in:
Gabriel Grubba 2024-12-24 12:08:53 -03:00
parent 6239f6994f
commit 196354e059
No known key found for this signature in database
GPG Key ID: 5FE41764F62D556C
2 changed files with 0 additions and 31 deletions

View File

@ -2,14 +2,6 @@ import Component from "@glimmer/component";
import { action } from "@ember/object";
export default class BaseField extends Component {
constructor() {
super(...arguments);
if (this.args.field.extra?.default_value) {
this.args.field.metadata.value = this.args.field.extra.default_value;
}
}
get displayPlaceholders() {
return (
this.args.placeholders?.length && this.args.field?.acceptsPlaceholders

View File

@ -28,27 +28,4 @@ module("Integration | Component | da-choices-field", function (hooks) {
assert.strictEqual(this.field.metadata.value, 1);
});
test("can have a default value", async function (assert) {
this.field = new AutomationFabricators(getOwner(this)).field({
component: "choices",
extra: {
content: [
{ name: "Zero", id: 0 },
{ name: "One", id: 1 },
],
default_value: 0,
},
});
await render(
hbs` <AutomationField @automation={{this.automation}} @field={{this.field}} />`
);
assert.strictEqual(this.field.metadata.value, 0);
await selectKit().expand();
await selectKit().selectRowByValue(1);
assert.strictEqual(this.field.metadata.value, 1);
});
});