From 196354e05995cbe1fbd5b3f3dfed26f62a767ce0 Mon Sep 17 00:00:00 2001 From: Gabriel Grubba Date: Tue, 24 Dec 2024 12:08:53 -0300 Subject: [PATCH] Revert "FEATURE: default value to fields in automation" This reverts commit 4d32635c695b1da36dbe3343bb55c223a720106a. --- .../admin/components/fields/da-base-field.gjs | 8 ------- .../components/da-choices-field-test.js | 23 ------------------- 2 files changed, 31 deletions(-) diff --git a/plugins/automation/admin/assets/javascripts/admin/components/fields/da-base-field.gjs b/plugins/automation/admin/assets/javascripts/admin/components/fields/da-base-field.gjs index 534201b0e98..3c0d4475f79 100644 --- a/plugins/automation/admin/assets/javascripts/admin/components/fields/da-base-field.gjs +++ b/plugins/automation/admin/assets/javascripts/admin/components/fields/da-base-field.gjs @@ -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 diff --git a/plugins/automation/test/javascripts/integration/components/da-choices-field-test.js b/plugins/automation/test/javascripts/integration/components/da-choices-field-test.js index 26ff6fb7b8c..3062136d6ab 100644 --- a/plugins/automation/test/javascripts/integration/components/da-choices-field-test.js +++ b/plugins/automation/test/javascripts/integration/components/da-choices-field-test.js @@ -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` ` - ); - - assert.strictEqual(this.field.metadata.value, 0); - - await selectKit().expand(); - await selectKit().selectRowByValue(1); - - assert.strictEqual(this.field.metadata.value, 1); - }); });