-
Notifications
You must be signed in to change notification settings - Fork 19
Feat/add pinned items to inline collapsed #2141
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
Open
mistrykaran91
wants to merge
1
commit into
main
Choose a base branch
from
feat/add-pinned-items-to-inline-collapsed
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...cal-next--inline-collapse-chip-submenu-element-examples-chromium-dark-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
...al-next--inline-collapse-chip-submenu-element-examples-chromium-light-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
...-navbar-vertical-next--inline-collapse-element-examples-chromium-dark-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
...navbar-vertical-next--inline-collapse-element-examples-chromium-light-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -290,4 +290,75 @@ describe('SiNavbarVerticalNextItemComponent', () => { | |
| expect(linkElement).not.toHaveClass('hide-badge-collapsed'); | ||
| }); | ||
| }); | ||
|
|
||
| describe('pinned input', () => { | ||
| @Component({ | ||
| imports: [SiNavbarVerticalNextItemComponent], | ||
| template: `<a | ||
| si-navbar-vertical-next-item | ||
| [pinned]="pinned()" | ||
| [activeOverride]="activeOverride()" | ||
| > | ||
| Pinned Test Item | ||
| </a>` | ||
| }) | ||
| class TestHostWithPinnedComponent { | ||
| readonly pinned = signal(false); | ||
| readonly activeOverride = signal<boolean | undefined>(undefined); | ||
| } | ||
|
|
||
| let pinnedFixture: ComponentFixture<TestHostWithPinnedComponent>; | ||
| let pinnedComponent: TestHostWithPinnedComponent; | ||
|
|
||
| beforeEach(async () => { | ||
| TestBed.resetTestingModule(); | ||
|
Member
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. is this really needed?
Member
Author
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 think so |
||
| mockNavbar.chipMode.set(false); | ||
| mockNavbar.chipPortalAttached.set(false); | ||
| await TestBed.configureTestingModule({ | ||
| providers: [{ provide: SI_NAVBAR_VERTICAL_NEXT, useValue: mockNavbar }] | ||
| }).compileComponents(); | ||
|
|
||
| pinnedFixture = TestBed.createComponent(TestHostWithPinnedComponent); | ||
| pinnedComponent = pinnedFixture.componentInstance; | ||
| pinnedFixture.detectChanges(); | ||
|
mistrykaran91 marked this conversation as resolved.
|
||
| }); | ||
|
|
||
| it('should not add is-pinned-chip class when chipMode is false', async () => { | ||
| pinnedComponent.pinned.set(true); | ||
| await pinnedFixture.whenStable(); | ||
|
|
||
| const link = pinnedFixture.nativeElement.querySelector('a'); | ||
| expect(link).not.toHaveClass('is-pinned-chip'); | ||
| expect(link).not.toHaveClass('is-chip'); | ||
| }); | ||
|
|
||
| it('should add is-pinned-chip class when chipMode is true and item is not active', async () => { | ||
| mockNavbar.chipMode.set(true); | ||
| pinnedComponent.pinned.set(true); | ||
| await pinnedFixture.whenStable(); | ||
|
|
||
| const link = pinnedFixture.nativeElement.querySelector('a'); | ||
| expect(link).toHaveClass('is-pinned-chip'); | ||
| expect(link).toHaveClass('is-chip'); | ||
| }); | ||
|
|
||
| it('should not add is-pinned-chip class when chipMode is true but item is active', async () => { | ||
| mockNavbar.chipMode.set(true); | ||
| pinnedComponent.pinned.set(true); | ||
| pinnedComponent.activeOverride.set(true); | ||
| await pinnedFixture.whenStable(); | ||
|
|
||
| const link = pinnedFixture.nativeElement.querySelector('a'); | ||
| expect(link).not.toHaveClass('is-pinned-chip'); | ||
| }); | ||
|
|
||
| it('should not add is-pinned-chip class when item is not pinned', async () => { | ||
| mockNavbar.chipMode.set(true); | ||
| pinnedComponent.pinned.set(false); | ||
| await pinnedFixture.whenStable(); | ||
|
|
||
| const link = pinnedFixture.nativeElement.querySelector('a'); | ||
| expect(link).not.toHaveClass('is-pinned-chip'); | ||
| }); | ||
| }); | ||
| }); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@panch1739 for the pinned items, should they support text + icon or only icon?
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.
Just one thing to consider if we go with icon only, what should be the scenario in case of text only navbar
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.
@mistrykaran91 after discussing with @spike-rabbit, we thought we could start only with icons
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.
@mistrykaran91 For the text-only version, let's skip the key item feature...at least for now.