-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7811 from michaelchadwick/frontend-4116-add-ics-t…
…o-main-nav Move ICS Feed button from Ilios Calendar to Main Navigation
- Loading branch information
Showing
14 changed files
with
106 additions
and
98 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
27 changes: 27 additions & 0 deletions
27
packages/ilios-common/addon/components/dashboard/navigation.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,27 @@ | ||
import Component from '@glimmer/component'; | ||
import { service } from '@ember/service'; | ||
import { tracked } from '@glimmer/tracking'; | ||
import { dropTask } from 'ember-concurrency'; | ||
|
||
export default class NavigationComponent extends Component { | ||
@service currentUser; | ||
@service iliosConfig; | ||
|
||
@tracked icsFeedUrl; | ||
@tracked icsInstructions; | ||
|
||
constructor() { | ||
super(...arguments); | ||
this.setup.perform(); | ||
} | ||
|
||
setup = dropTask(async () => { | ||
const user = await this.currentUser.getModel(); | ||
const icsFeedKey = user.icsFeedKey; | ||
const apiHost = this.iliosConfig.apiHost; | ||
const loc = window.location.protocol + '//' + window.location.hostname; | ||
const server = apiHost ? apiHost : loc; | ||
this.icsFeedUrl = server + '/ics/' + icsFeedKey; | ||
this.icsInstructions = 'Copy My ICS Link'; | ||
}); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,23 @@ | ||
import Component from '@glimmer/component'; | ||
import { restartableTask, timeout } from 'ember-concurrency'; | ||
import { restartableTask } from 'ember-concurrency'; | ||
import { service } from '@ember/service'; | ||
|
||
export default class IcsFeedComponent extends Component { | ||
@service flashMessages; | ||
|
||
textCopied = restartableTask(async () => { | ||
await timeout(3000); | ||
this.flashMessages.success('general.copiedIcsFeedUrl'); | ||
}); | ||
|
||
popperOptions = { | ||
placement: 'right', | ||
modifiers: [ | ||
{ | ||
name: 'flip', | ||
options: { | ||
fallbackPlacements: ['bottom'], | ||
}, | ||
}, | ||
], | ||
}; | ||
} |
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
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
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
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
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