Remove excess helper stringify

This commit is contained in:
Stanislav Romanov 2022-09-10 16:55:08 +03:00
parent 998b7ec6e7
commit df665799b8
5 changed files with 4 additions and 26 deletions

View file

@ -1,5 +0,0 @@
import { helper } from '@ember/component/helper';
export default helper(function stringify([value] /*, named*/) {
return JSON.stringify(value, null, 1);
});

View file

@ -2,6 +2,6 @@
{{#if (eq '_geo' key)}}
{{! TODO: add map }}
{{else}}
<Form::Element @label={{namelize key}} @value={{stringify value}} />
<Form::Element @label={{namelize key}} @value={{json-stringify value}} />
{{/if}}
{{/each-in}}

View file

@ -82,7 +82,7 @@
@sortable={{includes field @model.sortableAttributes}}
>
{{#let (get data field) as |value|}}
{{if (eq (type-of value) 'object') (stringify value) value}}
{{if (eq (type-of value) 'object') (json-stringify value) value}}
{{/let}}
</Column>
{{/if}}

View file

@ -6,10 +6,10 @@
<Column @prop='status' />
<Column @prop='type' />
<Column @prop='details'>
{{stringify data.details}}
{{json-stringify data.details}}
</Column>
<Column @prop='error'>
{{stringify data.error}}
{{json-stringify data.error}}
</Column>
<Column @prop='duration' />
<Column @prop='enqueuedAt'>

View file

@ -1,17 +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 | Helper | stringify', function (hooks) {
setupRenderingTest(hooks);
// TODO: Replace this with your real tests.
test('it renders', async function (assert) {
this.set('inputValue', '1234');
await render(hbs`{{stringify this.inputValue}}`);
assert.dom(this.element).hasText('1234');
});
});