-
Notifications
You must be signed in to change notification settings - Fork 8
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
Trigger to open the support widget #1331
base: main
Are you sure you want to change the base?
Conversation
ba3ccc1
to
f5123a0
Compare
- yarn add --dev jest @vue/test-utils @vue/vue3-jest babel-jest @babel/preset-env - Add .babelrc - Update jest.config.js - Add styleMock.js to handle CSS imports in Vue components
1d424de
to
8f6c52b
Compare
@@ -101,27 +114,33 @@ export default { | |||
}, | |||
focus () { | |||
const $header = this.$refs.header; | |||
nextTick(() => { |
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.
Need to wait a tick before the input is rendered.
const script = document.createElement('script'); | ||
this.isLoading = true; | ||
script.type = 'text/javascript'; | ||
script.src = `${this.rootURL}/search.js`; | ||
script.src = `https://support.dnsimple.com/search.js`; |
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.
This'll be cleaned up when we add multiple sources (eg. dev site articles).
@@ -32,8 +32,8 @@ | |||
"scripts": { | |||
"live": "concurrently 'bundle exec nanoc live' 'bundle exec rake compile'", | |||
"build": "./node_modules/.bin/webpack && vite build ./_widget", | |||
"lint": "eslint _widget content spec", | |||
"lint:fix": "eslint _widget content spec --fix", | |||
"lint": "eslint _widget src spec", |
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.
🤖 was complaining.
templates/search.js.erb
Outdated
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.
Can't wait to not make this an erb
file. 😄
This PR makes the support widget fill more of the screen, as well:
data-dnsimple-open-support-widget
: can be added to any DOM element to trigger the opening of the widget.data-dnsimple-current-site-url="https://NOTHING.dnsimple.com"
: used to determine if the article is for the site the customer is already on. For example, if the customer is @ dnsimple.com and they search for alias, we want the result to show in the support widget browser. If they are on support.dnsimple.com, then we want to do a full page load to the result.QA
Test using
yarn widget
:alias
.data-dnsimple-current-site-url="https://NOTHING.dnsimple.com"
doesn't match the current site).Test the preview:
alias
.Test on DNSimple.com: