diff --git a/app/components/class-field-description.hbs b/app/components/class-field-description.hbs index f888b92d3..599c3fafd 100644 --- a/app/components/class-field-description.hbs +++ b/app/components/class-field-description.hbs @@ -1,9 +1,5 @@
- {{!-- TODO: Fix this link for a11y --}} -

{{@field.name}} {{#if @field.params}} @@ -19,6 +15,10 @@ {{#if @field.deprecated}} deprecated {{/if}} + {{!-- TODO: Fix this link for a11y --}} + + {{svg-jar 'link' width='20px' height='20px'}} +

{{#if @model.module}}
diff --git a/app/styles/app.css b/app/styles/app.css index 3c700eb25..342a87e32 100644 --- a/app/styles/app.css +++ b/app/styles/app.css @@ -90,6 +90,24 @@ li.toc-heading:first-child { margin-top: 0; } +a.class-field-description--link { + margin-left: 12px; + vertical-align: middle; + background: none; + cursor: pointer; +} + +a.class-field-description--link svg { + height: 18px; + fill: var(--color-gray-600); + transform: rotate(45deg); + vertical-align: middle; +} + +a.class-field-description--link:hover svg { + fill: var(--color-brand); +} + @media (min-width: 845px) { .es-header { padding: 0 var(--spacing-4); diff --git a/public/assets/images/fa-link.svg b/public/assets/images/fa-link.svg deleted file mode 100644 index 2a91dc245..000000000 --- a/public/assets/images/fa-link.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - diff --git a/public/assets/images/link.svg b/public/assets/images/link.svg new file mode 100644 index 000000000..177175013 --- /dev/null +++ b/public/assets/images/link.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/tests/acceptance/anchors-test.js b/tests/acceptance/anchors-test.js index e4b9f6498..d1ac6dec4 100644 --- a/tests/acceptance/anchors-test.js +++ b/tests/acceptance/anchors-test.js @@ -11,7 +11,9 @@ module('Acceptance | Creating Anchors', function (hooks) { await click(element); assert.equal( currentURL(), - `/ember/1.0/classes/Container/properties?anchor=${element.innerText.trim()}` + `/ember/1.0/classes/Container/properties?anchor=${element.getAttribute( + 'data-test-anchor' + )}` ); }); }); diff --git a/tests/integration/components/class-field-description-test.js b/tests/integration/components/class-field-description-test.js index 4657ab15b..46807a880 100644 --- a/tests/integration/components/class-field-description-test.js +++ b/tests/integration/components/class-field-description-test.js @@ -2,13 +2,7 @@ import EmberObject from '@ember/object'; import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; -import { - render, - click, - findAll, - find, - triggerEvent, -} from '@ember/test-helpers'; +import { render, click, findAll, find } from '@ember/test-helpers'; import hbs from 'htmlbars-inline-precompile'; module('Integration | Component | class field description', function (hooks) { @@ -37,29 +31,6 @@ module('Integration | Component | class field description', function (hooks) { assert.dom(findAll('.args')[0]).hasText('(param1, param2, param3)'); }); - test('On hover -- the link icon shows up', async function (assert) { - this.set('type', 'method'); - this.set( - 'field', - EmberObject.create({ - access: 'public', - deprecated: true, - name: 'concat', - description: 'concatenates', - params: [{ name: 'param1' }, { name: 'param2' }, { name: 'param3' }], - }) - ); - - await render( - hbs`` - ); - - await triggerEvent('.class-field-description--link', 'mouseenter'); - assert - .dom('.class-field-description--link-hover') - .exists('The link icon appears when hovering on the method text'); - }); - test('it calls the provided action on link-click with the field name as an arg', async function (assert) { this.set('updateAnchor', (name) => { assert.equal(