Skip to content

Commit b42abc0

Browse files
committed
More functional classes and data-test selectors
1 parent 88719a5 commit b42abc0

29 files changed

Lines changed: 227 additions & 309 deletions

app/components/app-picker.hbs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
<div class="dropdown">
1+
<div class="h-7 text-base13">
22
<select
3-
class="dropdown__select"
3+
class="box-border block w-full h-full m-0 border-0 pr-4 pl-1 text-base text-base13 bg-transparent appearance-none outline-none"
44
onchange={{action "selectApp" value="target.value"}}
55
>
66
{{#each-in this.apps as |id name|}}
@@ -12,5 +12,5 @@
1212
</option>
1313
{{/each-in}}
1414
</select>
15-
{{svg-jar "dropdown-arrow" class="dropdown__arrow"}}
15+
{{svg-jar "dropdown-arrow" class="dropdown__arrow fill-current absolute opacity-75 pointer-events-none"}}
1616
</div>

app/components/deprecation-item.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<Ui::Disclosure as |disclosure|>
2-
<div class="deprecation-item px-3" data-test-deprecation-item>
2+
<div class="deprecation-item px-3 text-lg" data-test-deprecation-item>
33
<div class="flex items-center">
44
<div
55
class="flex items-center flex-grow py-2"

app/components/object-inspector.hbs

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,43 +2,52 @@
22
<div class="split__panel__hd">
33
<div class="toolbar">
44
<button
5-
class="toolbar__icon-button {{if this.isNested "enabled" "disabled"}} js-object-inspector-back"
5+
class="toolbar__icon-button {{if this.isNested "enabled" "disabled"}}"
66
{{on "click" this.popStack}}
7+
data-test-object-inspector-back
78
>
89
{{svg-jar "arrow-back" width="21px" height="21px"}}
910
</button>
1011

11-
<Ui::ToolbarDivider />
12-
13-
<code class="object-inspector-object-name js-object-name">
12+
<code
13+
class="flex-auto truncate font-bold"
14+
data-test-object-name
15+
>
1416
{{@model.firstObject.name}}
1517
</code>
1618

1719
<button
18-
class="send-to-console js-send-object-to-console-btn"
20+
class="send-to-console"
1921
title="Send to Console"
2022
{{on "click" (fn this.sendObjectToConsole @model.lastObject)}}
23+
data-test-send-object-to-console-btn
2124
>
2225
{{svg-jar "send-with-text" width="20px" height="10px"}}
2326
</button>
2427
</div>
2528

2629
{{#if this.trail}}
27-
<code class="object-trail js-object-trail">{{this.trail}}</code>
30+
<code
31+
class="object-trail mb-1 break-all"
32+
data-test-object-trail
33+
>
34+
{{this.trail}}
35+
</code>
2836
{{/if}}
2937
</div>
3038

3139
<div class="split__panel__bd">
3240
<div class="toolbar object-inspector-toolbar">
3341
<button
34-
class="toolbar__radio toolbar__radio--first js-object-display-type-grouped {{if (eq this.propDisplayType "grouped") "active"}}"
42+
class="toolbar__radio toolbar__radio--first {{if (eq this.propDisplayType "grouped") "active"}}"
3543
{{on "click" (fn this.setPropDisplay "grouped")}}
3644
>
3745
Grouped
3846
</button>
3947
<button
40-
class="toolbar__radio js-object-display-type-all {{if (eq this.propDisplayType "all") "active"}}"
48+
class="toolbar__radio {{if (eq this.propDisplayType "all") "active"}}"
4149
{{on "click" (fn this.setPropDisplay "all")}}
50+
data-test-object-display-type-all
4251
>
4352
All
4453
</button>

app/components/object-inspector/dependent-keys.hbs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
<li class="mixin__property-dependency-list">
1+
<li class="mixin__property-dependency-list relative">
22
{{svg-jar "dependent-key-connection" width="20px" height="10px"}}
3-
<ul>
3+
<ul class="m-0 p-0 list-none">
44
{{#each @keys as |depKey|}}
5-
<li class="mixin__property-dependency-item">
5+
<li class="mixin__property-dependency-item relative text-base12 text-sm">
66
{{svg-jar
77
"dependent-key-bullet"
88
width="9px"
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
<div class="mixin mixin_props_no js-object-inspector-errors">
2-
<h2 class="mixin__name mixin__name--errors">
1+
<div class="mixin mixin_props_no" data-test-object-inspector-errors>
2+
<h2 class="mixin__name mixin__name--errors bg-base00">
33
Errors
44
<button
5-
class="send-to-console send-to-console--chevron-only js-send-errors-to-console"
5+
class="send-to-console send-to-console--chevron-only ml-1"
66
{{on "click" @traceErrors}}
7+
data-test-send-errors-to-console
78
>
89
{{svg-jar "send-with-chevron" width="6px" height="9px"}}
910
Trace in the Console
1011
</button>
1112
</h2>
12-
<div class="mixin__properties">
13+
<div class="mixin__properties m-0 text-base font-mono">
1314
{{#each @errors as |error|}}
14-
<div class="mixin__error js-object-inspector-error">
15+
<div class="py-0 px-5 mr-1 text-spec01" data-test-object-inspector-error>
1516
Error while computing: {{error.property}}
1617
</div>
1718
{{/each}}
1819
</div>
1920
</div>
20-

app/components/object-inspector/properties-all.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{{#if this.flatPropertyList.length}}
2-
<ul class="mixin__properties">
2+
<ul class="mixin__properties m-0 text-base font-mono list-none">
33
<ObjectInspector::SortProperties
44
@properties={{this.flatPropertyList}} as |sortedProperties|
55
>

app/components/object-inspector/properties-grouped.hbs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,27 @@
11
{{#each @model.mixins as |mixin|}}
22
<ObjectInspector::Accordion @mixin={{mixin}} as |accordion|>
33
<div
4-
class="mixin {{mixin.type}} {{if accordion.isExpanded "mixin_state_expanded"}} {{if mixin.properties.length "mixin_props_yes" "mixin_props_no"}} js-object-detail"
4+
class="mixin {{mixin.type}} {{if accordion.isExpanded "mixin_state_expanded"}} {{if mixin.properties.length "mixin_props_yes" "mixin_props_no"}}"
5+
data-test-object-detail
56
>
67
{{#if mixin.properties.length}}
78
<h2
8-
class="mixin__name js-object-detail-name"
9+
class="mixin__name sticky top-0 truncate select-none cursor-default text-base15 bg-base01"
910
{{on "click" accordion.toggle}}
11+
data-test-object-detail-name
1012
>
1113
{{mixin.name}}
1214
</h2>
1315
{{else}}
14-
<h2 class="mixin__name mixin__name--no-props js-object-detail-name">
16+
<h2
17+
class="mixin__name mixin__name--no-props sticky top-0 truncate select-none text-base09 cursor-default bg-base01"
18+
data-test-object-detail-name
19+
>
1520
{{mixin.name}}
1621
</h2>
1722
{{/if}}
1823
{{#if accordion.isExpanded}}
19-
<ul class="mixin__properties">
24+
<ul class="mixin__properties m-0 text-base font-mono list-none">
2025
<ObjectInspector::SortProperties
2126
@properties={{mixin.properties}} as |sortedProperties|
2227
>
@@ -29,7 +34,7 @@
2934
@sendToConsole={{fn this.sendToConsole prop}}
3035
/>
3136
{{else}}
32-
<li class="mixin__property">No Properties</li>
37+
<li class="mixin__property flex relative flex-row items-center truncate">No Properties</li>
3338
{{/each}}
3439
</ObjectInspector::SortProperties>
3540
</ul>

app/components/object-inspector/property.hbs

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<li
2-
class="{{if this.isOverridden "mixin__property_state_overridden"}} mixin__property js-object-property"
2+
class="{{if this.isOverridden "mixin__property-state-overridden line-through"}} mixin__property flex flex-row relative items-center truncate"
3+
data-test-object-property
34
>
45
{{!-- Disclosure Triangle --}}
56
{{#if this.hasDependentKeys}}
@@ -19,26 +20,32 @@
1920
{{/if}}
2021

2122
{{!-- Property Icon --}}
22-
<span class="mixin__property-icon-container" title={{if @model.code @model.code this.iconInfo.title}}
23+
<span
24+
class="mixin__property-icon-container flex-shrink-0"
25+
title={{if @model.code @model.code this.iconInfo.title}}
2326
{{on "click" this.toggleDeps}}
2427
>
25-
<span class="mixin__property-icon mixin__property-icon--{{this.iconInfo.type}}"></span>
28+
<span class="mixin__property-icon mixin__property-icon--{{this.iconInfo.type}} inline-block rounded font-mono text-md text-white text-center select-none"></span>
2629
</span>
2730

2831
{{!-- Property Name --}}
29-
<span class="mixin__property-name js-object-property-name">
32+
<span
33+
class="mixin__property-name text-base14 truncate"
34+
data-test-object-property-name
35+
>
3036
{{#if this.isService}}
3137
<span
3238
title="service"
33-
class="js-property-name-service mixin__property--group"
39+
class="mixin__property--group"
40+
data-test-property-name-service
3441
>
3542
{{@model.name}}
3643
</span>
3744
{{else}}
3845
{{#if this.hasDependentKeys}}
3946
<span
4047
title="computed"
41-
class="js-property-name-computed mixin__property--group"
48+
class="mixin__property--group"
4249
>
4350
{{@model.name}}
4451
</span>
@@ -48,60 +55,67 @@
4855
{{/if}}
4956
</span>
5057

51-
<span class="mixin__property-value-separator">: </span>
58+
<span class="mr-1">: </span>
5259

5360
{{#if this.isEdit}}
5461
{{#if this.isDate}}
5562
{{date-property-field
5663
allowInput=true
5764
date=(readonly this.dateValue)
5865
dateFormat="Y-m-d"
59-
class="mixin__property-value-txt js-object-property-value-date"
66+
class="mixin__property-value-txt flex-1 text-base14 outline-none text-base bg-base01 js-object-property-value-date"
6067
onChange=this.dateSelected
6168
onClose=this.finishedEditing
6269
}}
6370
{{else}}
6471
<ObjectInspector::PropertyField
65-
class="mixin__property-value-txt js-object-property-value-txt"
72+
class="mixin__property-value-txt flex-1 text-base14 text-base bg-base01 outline-none"
6673
@value={{this.txtValue}}
6774
@insert-newline={{fn this.save}}
6875
@escape-press={{fn this.finishedEditing}}
6976
@focus-out={{fn this.finishedEditing}}
77+
data-test-object-property-value-txt
7078
/>
7179
{{/if}}
7280
{{else}}
7381
{{#if this.canCalculate}}
7482
<button
75-
class="mixin__calc-btn js-calculate"
83+
class="mixin__calc-btn"
7684
title="compute property"
7785
{{on "click" @calculate bubbles=false}}
86+
data-test-calculate
7887
>
7988
{{svg-jar "calculate" width="16px" height="16px"}}
8089
</button>
8190
{{/if}}
8291
{{#if this.isDate}}
8392
<span
84-
class="{{this.valueType}} mixin__property-value js-object-property-value"
93+
class="{{this.valueType}} mixin__property-value truncate"
8594
{{on "click" this.dateClick}}
95+
data-test-object-property-value
8696
>
8797
{{@model.value.inspect}}
8898
</span>
8999
{{else}}
90100
<span
91-
class="{{this.valueType}} {{if this.isService "type-service"}} mixin__property-value js-object-property-value"
101+
class="{{this.valueType}} {{if this.isService "type-service"}} mixin__property-value truncate"
92102
{{on "click" this.valueClick}}
103+
data-test-object-property-value
93104
>
94105
{{@model.value.inspect}}
95106
</span>
96107
{{/if}}
97108
{{/if}}
98109

99-
<span class="mixin__property-overridden-by">(Overridden by {{@model.overridden}})</span>
110+
<span class="mixin__property-overridden-by absolute right-0 no-underline bg-spec00">
111+
(Overridden by {{@model.overridden}})
112+
</span>
100113

101114
<button
102-
class="mixin__send-btn send-to-console js-send-to-console-btn"
115+
class="mixin__send-btn flex-shrink-0 send-to-console"
103116
title="Send to console"
104117
{{on "click" @sendToConsole}}
118+
data-test-send-to-console-btn
105119
>
106120
{{svg-jar "send-with-text" width="20px" height="10px"}}
107121
</button>

app/components/promise-item.hbs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,10 @@
5555
<div class="list__cell-helper">
5656
{{#if this.isError}}
5757
<button
58-
class="send-to-console send-to-console--chevron-only js-send-to-console-btn"
58+
class="send-to-console send-to-console--chevron-only"
5959
title="Send stack trace to the console"
6060
{{action @sendValueToConsole @model}}
61+
data-test-send-to-console-btn
6162
>
6263
{{svg-jar "send-with-chevron" width="6px" height="9px"}}
6364
Stack Trace

app/components/route-cell-objects.hbs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
<div class="route-cell-objects">
22
<span
3-
class="is-link js-route-handler"
3+
class="is-link inline-block"
44
title={{@route.value.routeHandler.className}}
55
{{on "click" @inspectRoute}}
6+
data-test-route-handler
67
>
78
Route
89
</span>

0 commit comments

Comments
 (0)