-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add icon to header to link to User Guide #7821
base: master
Are you sure you want to change the base?
Changes from 10 commits
6f90081
27885e6
0260970
7959024
816286a
c885359
f48c206
70c1493
3001795
86afb9b
d2aa9cb
2fb40ba
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,5 +15,6 @@ | |
{{#if this.session.isAuthenticated}} | ||
<UserMenu /> | ||
{{/if}} | ||
<UserGuideLink /> | ||
</div> | ||
</header> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<div class="user-guide-link" data-test-user-guide-link> | ||
<a | ||
href="https://iliosproject.gitbook.io/ilios-user-guide" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
<FaIcon | ||
@icon="circle-question" | ||
@title={{t "general.iliosUserGuide"}} | ||
data-test-user-guide-link-icon | ||
/> | ||
</a> | ||
</div> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
@use "../ilios-common/mixins" as cm; | ||
@use "../ilios-common/colors" as c; | ||
@use "../mixins" as m; | ||
|
||
.user-guide-link { | ||
@include m.header-menu; | ||
|
||
@include cm.for-tablet-and-up { | ||
margin-left: 0.25rem; | ||
margin-right: 0.5rem; | ||
} | ||
|
||
@include cm.for-phone-only { | ||
/* stylelint-disable property-disallowed-list */ | ||
font-size: 3.5vw; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't love using this disallowed property, Could this be done by controlling width and height of the icon? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I removed this disallowed property and used height/width instead. |
||
} | ||
|
||
a { | ||
svg { | ||
align-items: center; | ||
color: c.$white; | ||
display: flex; | ||
height: 1.85em; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm wondering if this can be done as a percentage of the container. Not sure, just feels a little arbitrary and might break if we accidentally slightly change the header height. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I changed this to use pixels instead. Using percentage of the container did not seem to work. |
||
width: 1.85em; | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { module, test } from 'qunit'; | ||
import { setupRenderingTest } from 'frontend/tests/helpers'; | ||
import { render } from '@ember/test-helpers'; | ||
import { hbs } from 'ember-cli-htmlbars'; | ||
import { setLocale, setupIntl } from 'ember-intl/test-support'; | ||
|
||
module('Integration | Component | user-guide-link', function (hooks) { | ||
setupRenderingTest(hooks); | ||
setupIntl(hooks, 'en-us'); | ||
|
||
test('it renders', async function (assert) { | ||
await render(hbs`<UserGuideLink />`); | ||
|
||
assert.dom('[data-test-user-guide-link]').exists(); | ||
assert.dom('[data-test-user-guide-link-icon]').exists(); | ||
assert.dom('[data-test-user-guide-link-icon]').hasText('Ilios User Guide'); | ||
|
||
await setLocale('es'); | ||
|
||
assert.dom('[data-test-user-guide-link-icon]').hasText('Ilios Guía de usuario'); | ||
|
||
await setLocale('fr'); | ||
|
||
assert.dom('[data-test-user-guide-link-icon]').hasText("Ilios Guide d'utilisation"); | ||
}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is quite a header menu, too many styles in there don't apply here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the mixin and used a simpler style to get the same effect.