Skip to content

Commit a9e301e

Browse files
committed
add modifiers
1 parent 9c45111 commit a9e301e

File tree

11 files changed

+567
-176
lines changed

11 files changed

+567
-176
lines changed

app/components/component-tree-arg.js

+9
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,15 @@ export default class ComponentTreeArg extends Component {
1212

1313
get displayValue() {
1414
if (this.isObject) {
15+
if (this.args.value.inspect) {
16+
if (this.args.value.type === 'function') {
17+
return this.args.value.inspect
18+
.replace(/"/g, '\\"')
19+
.replace('bound ', '')
20+
.replace('{ ... }', '');
21+
}
22+
return this.args.value.inspect.replace(/"/g, '\\"');
23+
}
1524
return '...';
1625
} else if (typeof this.args.value === 'string') {
1726
// Escape any interior quotes – we will add the surrounding quotes in the template

app/components/component-tree-item.hbs

+10
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,16 @@
8787
<span class="component-name">
8888
{{@item.name}}
8989
</span>
90+
{{#each-in @item.args.named as |name value|}}
91+
<div class="arg-token flex ml-2">
92+
<span class="key-token">
93+
{{name}}
94+
</span>
95+
={{if (is-string value) "\""}}
96+
<ComponentTreeArg @value={{value}} />
97+
{{if (is-string value) "\""}}
98+
</div>
99+
{{/each-in}}
90100
{{/if}}
91101
</code>
92102
</div>

app/components/object-inspector/property.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ export default class ObjectInspectorProperty extends Component<ObjectInspectorPr
119119
}
120120

121121
get cannotEdit() {
122-
if (this.args.model.name === '...' || !this.isCalculated) return true;
123-
return this.isFunction || this.isOverridden || this.readOnly;
122+
if (this.args.model.name === '...' || !this.isCalculated || this.readOnly) return true;
123+
return this.args.model?.value?.type !== 'type-string' && this.args.model?.value?.type !== 'type-number';
124124
}
125125

126126
@action

app/controllers/component-tree.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -301,15 +301,15 @@ class RenderItem {
301301
}
302302

303303
get isComponent() {
304-
return this.renderNode.type === 'component' || this.renderNode.type === 'remote-element';
304+
return this.renderNode.type === 'component';
305305
}
306306

307307
get isModifier() {
308308
return this.renderNode.type === 'modifier';
309309
}
310310

311311
get isHtmlTag() {
312-
return this.renderNode.type === 'htmlTag';
312+
return this.renderNode.type === 'html-element';
313313
}
314314

315315
get name() {

ember-cli-build.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -381,19 +381,18 @@ module.exports = function (defaults) {
381381
if (env === 'test') {
382382
// `ember test` expects the index.html file to be in the
383383
// output directory.
384-
output = mergeTrees([dists.basic, dists.chrome]);
385-
} else {
386384
// Change base tag for running tests in development env.
387385
dists.basic = replace(dists.basic, {
388386
files: ['tests/index.html'],
389387
patterns: [
390388
{
391389
match: /<base.*\/>/,
392-
replacement: '<base href="../" />',
390+
replacement: '',
393391
},
394392
],
395393
});
396-
394+
output = mergeTrees([dists.basic, dists.chrome]);
395+
} else {
397396
dists.testing = mergeTrees([dists.basic, dists.chrome]);
398397

399398
output = mergeTrees([

0 commit comments

Comments
 (0)