Skip to content

Commit

Permalink
Ember 3.5.1, lots of template lint fixes (#896)
Browse files Browse the repository at this point in the history
* Ember 3.5.1, lots of template lint fixes

* Remove deprecated propertyDidChange

* Set jquery version to 2.x for Ember 2.7

* Ignore lint for one computed
  • Loading branch information
RobbieTheWagner committed Dec 14, 2018
1 parent ad1f323 commit fefd549
Show file tree
Hide file tree
Showing 55 changed files with 1,718 additions and 473 deletions.
9 changes: 7 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,19 @@

# dependencies
/bower_components/
/node_modules/

# misc
/coverage/
!.*

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try

# ember-inspector specific
/scripts
/skeletons
/dist_prev/
/scripts/
/skeletons/
/ember_debug/vendor/startup-wrapper.js
3 changes: 3 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ module.exports = {
// node files
{
files: [
'.eslintrc.js',
'.stylelintrc.js',
'.template-lintrc.js',
'ember-cli-build.js',
'testem.js',
'blueprints/*/index.js',
Expand Down
2 changes: 2 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ config/secrets.json
.node_modules.ember-try/
bower.json.ember-try
package.json.ember-try

.idea/
15 changes: 15 additions & 0 deletions .template-lintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
'use strict';

module.exports = {
extends: 'recommended',
rules: {
'link-rel-noopener': false,
'no-inline-styles': false,
'no-invalid-interactive': false,
'no-outlet-outside-routes': false,
'no-partial': false,
'no-unbound': false,
'simple-unless': false,
'table-groups': false
}
};
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
# runs tests with current locked deps and linting
- stage: test
script:
- yarn lint:hbs
- yarn lint:js
- yarn test

Expand All @@ -52,7 +53,7 @@ install:
- travis_retry yarn install --ignore-engines

script:
- travis_retry node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO --skip-cleanup=true --- node_modules/.bin/ember test --filter="Ember Debug"
- travis_retry node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO --- node_modules/.bin/ember test --filter="Ember Debug"

after_success:
- travis_retry test $TRAVIS_BRANCH == "stable" && yarn run upload
Expand Down
11 changes: 8 additions & 3 deletions app/templates/-main.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
{{#draggable-column
width=navWidth
classes="split__panel split__panel--sidebar-1"
setIsDragging=(route-action 'setIsDragging')}}
setIsDragging=(route-action "setIsDragging")
}}
<div class="split__panel__hd">
{{iframe-picker}}
</div>
Expand All @@ -20,8 +21,12 @@
<div class="split__panel__hd">
{{outlet "toolbar"}}
{{#unless inspectorExpanded}}
{{sidebar-toggle action="toggleInspector" side="right"
isExpanded=false classNames="toolbar__icon-button"}}
{{sidebar-toggle
action="toggleInspector"
side="right"
isExpanded=false
classNames="toolbar__icon-button"
}}
{{/unless}}
</div>

Expand Down
22 changes: 16 additions & 6 deletions app/templates/application.hbs
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
{{#x-app active=active isDragging=isDragging}}
{{#x-app
active=active
isDragging=isDragging
}}
{{#if isEmberApplication}}
<div class="split">
<div class="split__panel">
{{partial 'main'}}
{{partial "main"}}
</div>

{{#if inspectorExpanded}}
{{#draggable-column
side="right"
width=inspectorWidth
classes="split__panel"
setIsDragging=(route-action 'setIsDragging')}}
{{object-inspector application=this model=mixinStack mixinDetails=mixinDetails
toggleInspector="toggleInspector"}}
setIsDragging=(route-action "setIsDragging")
}}
{{object-inspector
application=this
model=mixinStack
mixinDetails=mixinDetails
toggleInspector="toggleInspector"
}}
{{/draggable-column}}
{{/if}}
</div>
Expand All @@ -22,7 +30,9 @@
<li>This is not an Ember application.</li>
<li>You are using an old version of Ember (&lt; rc5).</li>
{{#if isChrome}}
<li>You are using the file:// protocol (instead of http://), in which case:
<li>
You are using the file:// protocol (instead of http://), in which case:

<ul>
<li>Visit the URL: chrome://extensions.</li>
<li>Find the Ember Inspector.</li>
Expand Down
35 changes: 29 additions & 6 deletions app/templates/component-tree-toolbar.hbs
Original file line number Diff line number Diff line change
@@ -1,16 +1,39 @@
<div class="toolbar">
<button class="{{if inspectingViews 'active'}} toolbar__icon-button js-inspect-views" {{action "toggleViewInspection"}}>
{{svg-jar "inspect" width="16px" height="17px"}}
<button
class="{{if inspectingViews "active"}} toolbar__icon-button js-inspect-views"
{{action "toggleViewInspection"}}
>
{{svg-jar
"inspect"
width="16px"
height="17px"
}}
</button>

<div class="divider"></div>

<button class="toolbar__icon-button" title="expand all" {{action "expandOrCollapseAll" true}}>
{{svg-jar "chevron-down" width="16px" height="16px"}}
<button
class="toolbar__icon-button"
title="expand all"
{{action "expandOrCollapseAll" true}}
>
{{svg-jar
"chevron-down"
width="16px"
height="16px"
}}
</button>

<button class="toolbar__icon-button" title="collapse all" {{action "expandOrCollapseAll" false}}>
{{svg-jar "chevron-right" width="16px" height="16px"}}
<button
class="toolbar__icon-button"
title="collapse all"
{{action "expandOrCollapseAll" false}}
>
{{svg-jar
"chevron-right"
width="16px"
height="16px"
}}
</button>

<div class="divider"></div>
Expand Down
15 changes: 11 additions & 4 deletions app/templates/component-tree.hbs
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
<div class="list__content js-component-tree" style="height: 100%;">
{{#vertical-collection displayedList estimateHeight=20 as |item i|}}
<div onmouseenter={{action "previewLayer" item}}
onmouseleave={{action "hidePreview"}}>
{{#vertical-collection
displayedList
estimateHeight=20
as |item|
}}
<div
onmouseenter={{action "previewLayer" item}}
onmouseleave={{action "hidePreview"}}
>
{{component-tree-item
item=item
pinnedObjectId=pinnedObjectId
toggleExpanded=(action "toggleExpanded" item)
inspect=(action "inspect")
scrollToElement=(action "scrollToElement")
sendObjectToConsole=(action "sendObjectToConsole")}}
sendObjectToConsole=(action "sendObjectToConsole")
}}
</div>
{{/vertical-collection}}
</div>
34 changes: 23 additions & 11 deletions app/templates/components/component-tree-item.hbs
Original file line number Diff line number Diff line change
@@ -1,26 +1,38 @@
<div {{action inspect item.view.objectId}}
<div
style={{labelStyle}}
class="component-tree-item {{if item.view.isComponent "component-tree-item--component"}} {{if (eq pinnedObjectId item.view.objectId) "component-tree-item--selected"}}">
class="component-tree-item {{if item.view.isComponent "component-tree-item--component"}} {{if (eq pinnedObjectId item.view.objectId)"component-tree-item--selected"}}"
{{action inspect item.view.objectId}}
>
{{#if item.hasChildren}}
<button {{action toggleExpanded bubbles=false}}
class="component-tree-item__expand {{if item.expanded "expanded" "collapsed"}}">
{{svg-jar "disclosure-triangle"
<button
class="component-tree-item__expand {{if item.expanded "expanded" "collapsed"}}"
{{action toggleExpanded bubbles=false}}
>
{{svg-jar
"disclosure-triangle"
title="Toggle visibility"
width="9px" height="9px"
width="9px"
height="9px"
}}
</button>
{{/if}}

<code class="component-tree-item__tag {{if item.view.isComponent "component-tree-item__bracket"}}">
<code
class="component-tree-item__tag {{if item.view.isComponent "component-tree-item__bracket"}}"
>
{{item.view.name}}
</code>

{{#if item.view.isComponent}}
<button {{action scrollToElement item.view.objectId bubbles=false}}
class="component-tree-item__view-element">
{{svg-jar "eye"
<button
class="component-tree-item__view-element"
{{action scrollToElement item.view.objectId bubbles=false}}
>
{{svg-jar
"eye"
title="Scroll into view"
width="20px" height="20px"
width="20px"
height="20px"
}}
</button>
{{/if}}
Expand Down
40 changes: 31 additions & 9 deletions app/templates/components/deprecation-item.hbs
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
<tr class="list__row {{if isExpanded 'list__row_arrow_expanded' 'list__row_arrow_collapsed'}} js-deprecation-item" {{action "toggleExpand"}}>
{{#list.cell class="list__cell_main js-deprecation-main-cell" title=model.message}}
<tr
class="list__row {{if isExpanded "list__row_arrow_expanded" "list__row_arrow_collapsed"}} js-deprecation-item"
{{action "toggleExpand"}}
>
{{#list.cell
class="list__cell_main js-deprecation-main-cell"
title=model.message
}}
<div class="list__cell-arrow"></div>
<span class="pill pill--not-clickable js-deprecation-count">{{model.count}}</span>
<span class="js-deprecation-message">{{model.message}}</span>
{{#if model.url}}
<a href={{model.url}} class="external-link js-deprecation-url" target="_blank" title="Transition Plan">
<a
href={{model.url}}
class="external-link js-deprecation-url"
target="_blank"
title="Transition Plan"
>
Transition Plan
</a>
{{/if}}
Expand All @@ -15,10 +26,19 @@
{{#each model.sources as |single|}}
{{#deprecation-item-source model=single as |source|}}
<tr class="list__row js-deprecation-source">
{{#list.cell class="list__cell_main list__cell_size_larger" style="padding-left:48px"}}
{{#list.cell
class="list__cell_main list__cell_size_larger"
style="padding-left:48px"
}}
<span class="source">
{{#if source.isClickable}}
<a class="js-deprecation-source-link" href="#" {{action openResource source.model.map}}>{{source.url}}</a>
<a
class="js-deprecation-source-link"
href="#"
{{action openResource source.model.map}}
>
{{source.url}}
</a>
{{else}}
<span class="js-deprecation-source-text">{{source.url}}</span>
{{/if}}
Expand All @@ -27,9 +47,10 @@
{{#list.cell}}
&nbsp; &nbsp;
<button
{{action traceSource model source.model}}
class="send-to-console send-to-console--chevron-only js-trace-deprecations-btn"
title="Trace deprecations in console">
title="Trace deprecations in console"
{{action traceSource model source.model}}
>
{{svg-jar "send-with-chevron" width="6px" height="9px"}}
Trace in the Console
</button>
Expand All @@ -41,9 +62,10 @@
<tr class="list__row js-deprecation-full-trace">
{{#list.cell class="list__cell_main" clickable=true style="padding-left:48px"}}
<button
{{action traceDeprecations model}}
class="send-to-console send-to-console--chevron-only js-full-trace-deprecations-btn"
title="Trace deprecations in console">
title="Trace deprecations in console"
{{action traceDeprecations model}}
>
{{svg-jar "send-with-chevron" width="6px" height="9px"}}
Trace in the Console
</button>
Expand Down
8 changes: 6 additions & 2 deletions app/templates/components/draggable-column.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{{#resizable-column width=width class=classes}}
{{#resizable-column
class=classes
width=width
}}
{{yield}}
{{/resizable-column}}

Expand All @@ -7,4 +10,5 @@
on-drag=(action "didDrag")
position=width
setIsDragging=setIsDragging
side=side}}
side=side
}}
15 changes: 11 additions & 4 deletions app/templates/components/expandable-render.hbs
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
{{#if node.children}}
<a href='#' {{action "expand"}} class='title'>
<span class='expander'>{{#if expanded}}-{{else}}+{{/if}}</span>
{{unbound node.name}} <span class='duration'>{{unbound node.duration}}</span></a>
<a
href="#"
class="title"
{{action "expand"}}
>
<span class="expander">{{#if expanded}}-{{else}}+{{/if}}</span>
{{unbound node.name}} <span class="duration">{{unbound node.duration}}</span>
</a>
{{else}}
<div class='title'>{{unbound node.name}} <span class='duration'>{{unbound node.duration}}</span></div>
<div class="title">
{{unbound node.name}} <span class="duration">{{unbound node.duration}}</span>
</div>
{{/if}}
5 changes: 4 additions & 1 deletion app/templates/components/iframe-picker.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<div class="dropdown">
<select class="dropdown__select" onchange={{action "selectIframe" value="target.value"}}>
<select
class="dropdown__select"
onchange={{action "selectIframe" value="target.value"}}
>
{{#each model as |iframe|}}
<option value={{iframe.val}}>{{iframe.name}}</option>
{{/each}}
Expand Down
Loading

0 comments on commit fefd549

Please sign in to comment.