-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
work in progress - adds user context filter to dashboard calendar.
- Loading branch information
1 parent
8badc84
commit 08f3f5e
Showing
7 changed files
with
84 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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 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
9 changes: 9 additions & 0 deletions
9
packages/ilios-common/addon/components/dashboard/user-context-filter.hbs
This file contains 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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<div class="dashboard-user-context-filter"> | ||
<button type="button" {{on "click" this.toggle}}> | ||
{{#if (eq 'instructor' @userContext)}} | ||
Show all | ||
{{else}} | ||
Show instructed only | ||
{{/if}} | ||
</button> | ||
</div> |
10 changes: 10 additions & 0 deletions
10
packages/ilios-common/addon/components/dashboard/user-context-filter.js
This file contains 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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import Component from '@glimmer/component'; | ||
import { action } from '@ember/object'; | ||
|
||
export default class DashboardUserContextFilterComponent extends Component { | ||
@action | ||
toggle() { | ||
const newUserContext = 'instructor' === this.args.userContext ? null : 'instructor'; | ||
this.args.setUserContext(newUserContext); | ||
} | ||
} |
This file contains 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
1 change: 1 addition & 0 deletions
1
packages/ilios-common/app/components/dashboard/user-context-filter.js
This file contains 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default } from 'ilios-common/components/dashboard/user-context-filter'; |
16 changes: 16 additions & 0 deletions
16
packages/test-app/tests/integration/components/dashboard/user-context-filter-test.js
This file contains 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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { module, test } from 'qunit'; | ||
import { setupRenderingTest } from 'test-app/tests/helpers'; | ||
import { setupIntl } from 'ember-intl/test-support'; | ||
// import { render } from '@ember/test-helpers'; | ||
// import { hbs } from 'ember-cli-htmlbars'; | ||
import { setupMirage } from 'ember-cli-mirage/test-support'; | ||
|
||
module('Integration | Component | dashboard/user-context-filter', function (hooks) { | ||
setupRenderingTest(hooks); | ||
setupIntl(hooks, 'en-us'); | ||
setupMirage(hooks); | ||
|
||
test('it renders', async function (/* assert */) { | ||
// @todo implement [ST 2024/04/18] | ||
}); | ||
}); |