-
Notifications
You must be signed in to change notification settings - Fork 3
Feature/improve settings navigation #617
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
base: master
Are you sure you want to change the base?
Changes from all commits
7f5d129
9bcd5e0
d00660c
086c80b
196be49
585b22e
44013a0
a652c7d
e1fc39e
c0657da
06cefe2
03c2ab6
695be67
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 |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| {{#if this.isInternalRoute}} | ||
| <LinkTo @route={{@link}} rel={{this.rel}} ...attributes>{{yield}}</LinkTo> | ||
| <LinkTo @route={{@link}} @current-when={{this.currentWhen}} rel={{this.rel}} ...attributes>{{yield}}</LinkTo> | ||
| {{else}} | ||
| <a href={{@link}} rel={{this.rel}} ...attributes>{{yield}}</a> | ||
| {{/if}} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,8 +4,10 @@ import RouterService from '@ember/routing/router-service'; | |
|
|
||
| interface OSSAnchorArgs { | ||
| link: string; | ||
| routePrefix?: string; | ||
| noopener?: boolean; | ||
| noreferrer?: boolean; | ||
| disableAutoActive?: boolean; | ||
| } | ||
|
|
||
| export default class OSSAnchor extends Component<OSSAnchorArgs> { | ||
|
|
@@ -19,6 +21,10 @@ export default class OSSAnchor extends Component<OSSAnchorArgs> { | |
| return this.args.noreferrer ?? true; | ||
| } | ||
|
|
||
| get currentWhen(): boolean | undefined { | ||
| return this.args.disableAutoActive !== undefined ? !this.args.disableAutoActive : undefined; | ||
| } | ||
cursor[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| get rel(): string { | ||
| const relations: string[] = []; | ||
|
|
||
|
|
@@ -34,8 +40,9 @@ export default class OSSAnchor extends Component<OSSAnchorArgs> { | |
| } | ||
|
|
||
| get isInternalRoute(): boolean { | ||
| const route = this.args.routePrefix ? this.args.routePrefix + '.' + this.args.link : this.args.link; | ||
| try { | ||
| return Boolean(this.router.urlFor(this.args.link)); | ||
| return Boolean(this.router.urlFor(route)); | ||
|
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. LinkTo route mismatch between validation and navigationHigh Severity The Additional Locations (1) |
||
| } catch (error) { | ||
| return false; | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,7 @@ | ||
| <OSS::Anchor | ||
| @link={{@link}} | ||
| @routePrefix={{@routePrefix}} | ||
| @disableAutoActive={{@disableAutoActive}} | ||
| class={{this.computedClasses}} | ||
| disabled={{this.locked}} | ||
| {{on "click" this.onClick}} | ||
|
|
@@ -16,13 +18,13 @@ | |
| <div class="oss-sidebar-item__icon"> | ||
| {{yield (hash expanded=@expanded) to="icon"}} | ||
| </div> | ||
| {{else}} | ||
| {{else if @icon}} | ||
| <div class="oss-sidebar-item__icon"> | ||
| <OSS::Icon @style={{fa-icon-style @icon}} @icon={{fa-icon-value @icon}} /> | ||
| </div> | ||
| {{/if}} | ||
|
|
||
| <div class="oss-sidebar-item__label"> | ||
| <div class={{concat "oss-sidebar-item__label" (unless @icon " oss-sidebar-item__label--no-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. Label no-icon class ignores icon named block usageMedium Severity The |
||
| {{@label}} | ||
| </div> | ||
|
|
||
|
|
||
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.
Storybook args defined but not used in template
Low Severity
The
disableAutoActiveproperty is defined inargTypesand added toBasicUsage.args, but the story template at line 71 does not pass@disableAutoActive={{this.disableAutoActive}}or@routePrefix={{this.routePrefix}}to the component. This creates non-functional Storybook controls that appear in the UI but have no effect when changed, which is confusing for developers using Storybook to explore the component's API.Additional Locations (1)
addon/components/o-s-s/anchor.stories.js#L16-L36