-
Notifications
You must be signed in to change notification settings - Fork 155
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
Replace Canny with Nolt (closes #775) #1107
base: the-future
Are you sure you want to change the base?
Changes from 4 commits
cae2379
50d7d73
70ae6de
e6ada64
6019671
c7d0ffe
78ec104
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* eslint no-undef: "off" */ | ||
import Component from '@ember/component'; | ||
|
||
export default Component.extend({ | ||
didInsertElement() { | ||
this._super(...arguments); | ||
|
||
nolt('init', { | ||
selector: '.nolt-button', | ||
url: 'https://kitsu.nolt.io/', | ||
}); | ||
}, | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
query noltToken { | ||
noltToken{ | ||
token | ||
} | ||
} | ||
wopian marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,15 +13,14 @@ function adwords() { | |
} | ||
|
||
/** | ||
* Inject Canny's SDK script into the `head` on initialization. | ||
* Inject Nolt's SDK script into the `head` on initialization. | ||
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. LOL |
||
*/ | ||
function canny() { | ||
const c = function() { | ||
c.q.push(arguments); | ||
function nolt() { | ||
window.noltQueue = window.noltQueue || []; | ||
window.nolt = function() { | ||
noltQueue.push(arguments); /* eslint no-undef: "off" */ | ||
}; | ||
c.q = []; | ||
window.Canny = c; | ||
injectScript('https://canny.io/sdk.js').catch(() => {}); | ||
injectScript('https://cdn.nolt.io/widgets.js').catch(() => {}); | ||
} | ||
|
||
/** | ||
|
@@ -61,7 +60,7 @@ export function initialize() { | |
|
||
// Inject scripts | ||
adwords(); | ||
canny(); | ||
nolt(); | ||
onesignal(); | ||
} | ||
|
||
|
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { computed, get } from '@ember/object'; | ||
import { inject as service } from '@ember/service'; | ||
import ApolloService from 'ember-apollo-client/services/apollo'; | ||
import { setContext } from 'apollo-link-context'; | ||
|
||
export default ApolloService.extend({ | ||
session: service(), | ||
|
||
link: computed('session.token', function() { | ||
const httpLink = this._super(...arguments); | ||
|
||
const token = get(this, 'session.token'); | ||
|
||
const authLink = setContext(() => { | ||
if (!token) return {}; | ||
|
||
return { headers: { Authorization: `Bearer ${token}` } }; | ||
}); | ||
|
||
return authLink.concat(httpLink); | ||
}) | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
{{nolt-feedback-script}} | ||
|
||
<nav id="kitsu-navbar" class="navbar navbar-fixed-top navbar-light primary-nav" role="navigation"> | ||
<div class="container"> | ||
<div class="row"> | ||
|
@@ -88,17 +90,10 @@ | |
{{link-to (t "header.groups") "groups.index" class="nav-link"}} | ||
</li> | ||
{{! Feedback}} | ||
<li class="nav-item dropdown"> | ||
<a class="nav-link dropdown-toggle {{if isFeedbackRoute "active"}}" href="#" data-toggle="dropdown" data-href-to-ignore=true> | ||
<li class="nav-item nolt-button"> | ||
<a class="nav-link" href="#" data-href-to-ignore=true> | ||
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. We should probably link this to |
||
{{t "header.feedback"}} | ||
</a> | ||
<div class="dropdown-menu"> | ||
<a class="dropdown-item" href={{href-to "feedback.bugs"}}>{{t "feedback.bugs"}}</a> | ||
<a class="dropdown-item" href={{href-to "feedback.feature-requests"}}>{{t "feedback.features"}}</a> | ||
<a class="dropdown-item" href="https://kitsu-stuff.com" target="_blank" rel="noopener">{{t "feedback.database"}}</a> | ||
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. We still need this 😅 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 shocked I didn't notice this |
||
<a class="dropdown-item" href={{href-to "feedback.mobile-bugs"}}>{{t "feedback.mobile-bugs"}}</a> | ||
<a class="dropdown-item" href={{href-to "feedback.mobile-features"}}>{{t "feedback.mobile-features"}}</a> | ||
</div> | ||
</li> | ||
</ul> | ||
</div> | ||
|
This file was deleted.
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.
Hmmm. Would it be better to create a component that detects its own id and uses that to build a selector?