Skip to content

Commit aed4a5b

Browse files
committed
Merge branch 'add-modifiers' of github.com:patricklx/ember-inspector into add-modifiers
# Conflicts: # app/components/component-tree-item.hbs # ember_debug/libs/render-tree.js # tests/ember_debug/view-debug-test.js
2 parents ecad95a + dee4e5b commit aed4a5b

15 files changed

+636
-216
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 truncate(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

+8
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,14 @@ class RenderItem {
312312
return this.renderNode.type === 'htmlTag';
313313
}
314314

315+
get isModifier() {
316+
return this.renderNode.type === 'modifier';
317+
}
318+
319+
get isHtmlTag() {
320+
return this.renderNode.type === 'html-element';
321+
}
322+
315323
get name() {
316324
return this.renderNode.name;
317325
}

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)