From cbda994938f1e09a7faf8b1047cecd34b1fd6fb5 Mon Sep 17 00:00:00 2001 From: Joe Gaudet Date: Tue, 5 Dec 2023 15:01:04 -0800 Subject: [PATCH] Fix gt lt decorators --- addon/components/field-for.js | 3 ++- addon/components/form-for.js | 2 -- package-lock.json | 11 +++++++++++ package.json | 1 + tests/integration/components/form-for-test.js | 8 ++++---- 5 files changed, 18 insertions(+), 7 deletions(-) diff --git a/addon/components/field-for.js b/addon/components/field-for.js index 246a090..7434a59 100644 --- a/addon/components/field-for.js +++ b/addon/components/field-for.js @@ -2,7 +2,8 @@ import Component from '@glimmer/component'; import { tracked } from '@glimmer/tracking'; import { arg } from 'ember-arg-types'; import { array, func, bool, string, object, any, oneOfType } from 'prop-types'; -import { oneWay, notEmpty, gt, union, readOnly } from '@ember/object/computed'; +import { notEmpty, gt, union } from 'macro-decorators'; +import { oneWay, readOnly } from '@ember/object/computed'; import { dasherize } from '@ember/string'; import { isArray } from '@ember/array'; import { action, defineProperty, computed, get } from '@ember/object'; diff --git a/addon/components/form-for.js b/addon/components/form-for.js index a550091..dcb4232 100644 --- a/addon/components/form-for.js +++ b/addon/components/form-for.js @@ -9,8 +9,6 @@ import { A } from '@ember/array'; import { inject as service } from '@ember/service'; import { Promise } from 'rsvp'; import { tracked } from '@glimmer/tracking'; -import { isArray } from '@ember/array'; - export default class FormForComponent extends Component { @service formFor; @service router; diff --git a/package-lock.json b/package-lock.json index a11eb39..6403017 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,6 +21,7 @@ "ember-element-helper": "^0.3.1", "ember-event-helpers": "^0.1.1", "is-plain-object": "^5.0.0", + "macro-decorators": "^0.1.2", "prop-types": "^15.8.1", "webpack": "^5.66.0" }, @@ -27054,6 +27055,11 @@ "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==", "dev": true }, + "node_modules/macro-decorators": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/macro-decorators/-/macro-decorators-0.1.2.tgz", + "integrity": "sha512-BV5XPmCm9kPSMtgfZiv0vTjOooe5pTIPIVkdoqbC49H1B7z22KB39H50R2ZNclZDQlmVyviLozRatKnOYZkwzg==" + }, "node_modules/magic-string": { "version": "0.24.1", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.24.1.tgz", @@ -57108,6 +57114,11 @@ "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==", "dev": true }, + "macro-decorators": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/macro-decorators/-/macro-decorators-0.1.2.tgz", + "integrity": "sha512-BV5XPmCm9kPSMtgfZiv0vTjOooe5pTIPIVkdoqbC49H1B7z22KB39H50R2ZNclZDQlmVyviLozRatKnOYZkwzg==" + }, "magic-string": { "version": "0.24.1", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.24.1.tgz", diff --git a/package.json b/package.json index 1b4588e..4b760dd 100644 --- a/package.json +++ b/package.json @@ -38,6 +38,7 @@ "ember-composable-helpers": "^4.3.0", "ember-element-helper": "^0.3.1", "ember-event-helpers": "^0.1.1", + "macro-decorators": "^0.1.2", "is-plain-object": "^5.0.0", "prop-types": "^15.8.1", "webpack": "^5.66.0" diff --git a/tests/integration/components/form-for-test.js b/tests/integration/components/form-for-test.js index 5182e7f..1fa9937 100644 --- a/tests/integration/components/form-for-test.js +++ b/tests/integration/components/form-for-test.js @@ -776,10 +776,10 @@ module('Integration | Component | form for', function (hooks) { assert .dom('[data-test-field-for="object_foo"]') - .hasStyle({ gridArea: 'foo / foo / foo / foo' }); + .hasStyle({ gridArea: 'foo' }); assert .dom('[data-test-form-button="submit"') - .hasStyle({ gridArea: 'submit / submit / submit / submit' }); + .hasStyle({ gridArea: 'submit' }); }); test('it should append the gridTemplatePrefix to the grid areas for form fields and buttons', async function (assert) { @@ -803,9 +803,9 @@ module('Integration | Component | form for', function (hooks) { assert .dom('[data-test-field-for="object_foo"]') - .hasStyle({ gridArea: 'ff-foo / ff-foo / ff-foo / ff-foo' }); + .hasStyle({ gridArea: 'ff-foo' }); assert .dom('[data-test-form-button="submit"') - .hasStyle({ gridArea: 'ff-submit / ff-submit / ff-submit / ff-submit' }); + .hasStyle({ gridArea: 'ff-submit' }); }); });