From 1595d6e22f55a01a5186455d9689387ab76ce1a0 Mon Sep 17 00:00:00 2001 From: Lukas Nys Date: Sun, 10 Sep 2023 14:54:38 +0200 Subject: [PATCH 1/9] move anchor image to the end of the title (#882) --- app/components/class-field-description.hbs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/components/class-field-description.hbs b/app/components/class-field-description.hbs index f888b92d..2cab1c8f 100644 --- a/app/components/class-field-description.hbs +++ b/app/components/class-field-description.hbs @@ -1,9 +1,6 @@
{{!-- TODO: Fix this link for a11y --}} {{#if @model.module}}
From b70a507e60ae8e952140df4eadf04808b5e17b80 Mon Sep 17 00:00:00 2001 From: Lukas Nys Date: Sun, 10 Sep 2023 14:56:00 +0200 Subject: [PATCH 2/9] update svg to match guidemaker-ember-template icon (#882) --- public/assets/images/fa-link.svg | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/public/assets/images/fa-link.svg b/public/assets/images/fa-link.svg index 2a91dc24..17717501 100644 --- a/public/assets/images/fa-link.svg +++ b/public/assets/images/fa-link.svg @@ -1,5 +1,3 @@ - - - - + + + \ No newline at end of file From d6f4ca95737aedf9048b0e13f79c24a739a66476 Mon Sep 17 00:00:00 2001 From: Lukas Nys Date: Sun, 10 Sep 2023 15:09:43 +0200 Subject: [PATCH 3/9] move click handler to anchor icon (#882) --- app/components/class-field-description.hbs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/components/class-field-description.hbs b/app/components/class-field-description.hbs index 2cab1c8f..035686d4 100644 --- a/app/components/class-field-description.hbs +++ b/app/components/class-field-description.hbs @@ -1,6 +1,6 @@
{{!-- TODO: Fix this link for a11y --}} - From 815b8b52716e3e92e66ffaaa5872eae8c1afec33 Mon Sep 17 00:00:00 2001 From: Lukas Nys Date: Sun, 10 Sep 2023 15:15:21 +0200 Subject: [PATCH 4/9] remove now irrelevant test (#882) we're no longer hiding the link icon until the header is hovered, which makes this test irrelevant --- .../class-field-description-test.js | 31 +------------------ 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/tests/integration/components/class-field-description-test.js b/tests/integration/components/class-field-description-test.js index 4657ab15..46807a88 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( From a87910e1cb989883e1f5e6482193a4d130990483 Mon Sep 17 00:00:00 2001 From: Lukas Nys Date: Sun, 10 Sep 2023 15:18:11 +0200 Subject: [PATCH 5/9] move class-field-description--link class to correct element (#882) --- app/components/class-field-description.hbs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/components/class-field-description.hbs b/app/components/class-field-description.hbs index 035686d4..e43b2886 100644 --- a/app/components/class-field-description.hbs +++ b/app/components/class-field-description.hbs @@ -1,6 +1,5 @@
- {{!-- TODO: Fix this link for a11y --}} -

{{@field.name}} {{#if @field.params}} @@ -16,8 +15,9 @@ {{#if @field.deprecated}} deprecated {{/if}} - - {{svg-jar 'fa-link' class='class-field-description--link-hover' width='20px' height='20px'}} + {{!-- TODO: Fix this link for a11y --}} + + {{svg-jar 'fa-link' width='20px' height='20px'}}

{{#if @model.module}} From 1d4ccf423854ccf92b91b7316f82a72c9c0445a9 Mon Sep 17 00:00:00 2001 From: Lukas Nys Date: Sun, 10 Sep 2023 15:19:27 +0200 Subject: [PATCH 6/9] style: style anchor link to match guidemaker-ember-template (#882) --- app/styles/app.css | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/app/styles/app.css b/app/styles/app.css index 3c700eb2..342a87e3 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); From 544dab085c88e39978488adea13d443d8000b4c1 Mon Sep 17 00:00:00 2001 From: Lukas Nys Date: Sun, 10 Sep 2023 15:23:52 +0200 Subject: [PATCH 7/9] rename fa-link.svg to link.svg since its no longer from fa (#882) --- app/components/class-field-description.hbs | 2 +- public/assets/images/{fa-link.svg => link.svg} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename public/assets/images/{fa-link.svg => link.svg} (100%) diff --git a/app/components/class-field-description.hbs b/app/components/class-field-description.hbs index e43b2886..eceadc0b 100644 --- a/app/components/class-field-description.hbs +++ b/app/components/class-field-description.hbs @@ -17,7 +17,7 @@ {{/if}} {{!-- TODO: Fix this link for a11y --}} - {{svg-jar 'fa-link' width='20px' height='20px'}} + {{svg-jar 'link' width='20px' height='20px'}} {{#if @model.module}} diff --git a/public/assets/images/fa-link.svg b/public/assets/images/link.svg similarity index 100% rename from public/assets/images/fa-link.svg rename to public/assets/images/link.svg From 000eef15c473a9a9e9b32cc02cb033dbc5d4ca3d Mon Sep 17 00:00:00 2001 From: Lukas Nys Date: Sun, 10 Sep 2023 15:53:05 +0200 Subject: [PATCH 8/9] fix anchor test (#882) --- app/components/class-field-description.hbs | 2 +- tests/acceptance/anchors-test.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/components/class-field-description.hbs b/app/components/class-field-description.hbs index eceadc0b..76c6cd2d 100644 --- a/app/components/class-field-description.hbs +++ b/app/components/class-field-description.hbs @@ -16,7 +16,7 @@ deprecated {{/if}} {{!-- TODO: Fix this link for a11y --}} - + {{svg-jar 'link' width='20px' height='20px'}} diff --git a/tests/acceptance/anchors-test.js b/tests/acceptance/anchors-test.js index e4b9f649..d1ac6dec 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' + )}` ); }); }); From 62a632f8f43175c192fabf2e53f1adf756d78277 Mon Sep 17 00:00:00 2001 From: Lukas Nys Date: Sun, 10 Sep 2023 16:02:04 +0200 Subject: [PATCH 9/9] cleanup: remove unused class (#882) --- app/components/class-field-description.hbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/components/class-field-description.hbs b/app/components/class-field-description.hbs index 76c6cd2d..599c3faf 100644 --- a/app/components/class-field-description.hbs +++ b/app/components/class-field-description.hbs @@ -16,7 +16,7 @@ deprecated {{/if}} {{!-- TODO: Fix this link for a11y --}} - + {{svg-jar 'link' width='20px' height='20px'}}