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
Add new Contact Us information page #3719
Add new Contact Us information page #3719
Conversation
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.
Some questions and typos
const FormattedMessage = require('react-intl').FormattedMessage; | ||
|
||
const HelpForm = props => { | ||
const prefix = 'https://mitscratch.freshdesk.com/widgets/feedback_widget/new?&widgetType=embedded&widgetView=yes&screenshot=No&searchArea=No&captcha=yes'; |
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 in case: is this accessible in China?
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.
Good question. They do support both traditional and simplified Chinese, and it looks like there are websites in China that use Freshdesk, so I think the answer is yes, but we'll definitely check.
Questions:
|
Using the Freshdesk Feedback form * adds new component HelpForm for the Freshdesk component * adds new contact-us view * modifies Information page css with style for a header on the right hand nav section * adds new route for the contact-us page (is identical to the old scratchr2 URL)
0825d4b
to
8fc9b57
Compare
@apple502j good questions.
|
Decided that there is no need for the Nav sidebar since we don’t want the link to the Discussions right now. It could come back if we add the knowledge base.
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.
Offline we discussed:
- Passing this by the design team for input about what to do about the page width.
- Increasing the height of the form to avoid the scroll-box inside a scrolling window issue, and to be transparent about the fields we're gathering
The other line comments I left are probably optional
src/views/contact-us/contact-us.jsx
Outdated
let subject = ''; | ||
let body = ''; | ||
const url = (window.location && window.location.search) || ''; | ||
// assumes that scratchr2 will only ever send one parameter | ||
const params = url.split('?')[1]; | ||
if (typeof (params) !== 'undefined' && params.indexOf('studio') !== -1) { | ||
subject = `Inappropriate content reported in studio ${params.split('=')[1]}`; | ||
body = `https://scratch.mit.edu/studios/${params.split('=')[1]}`; | ||
} else if (typeof (params) !== 'undefined' && params.indexOf('profile') !== -1) { | ||
subject = `Inappropriate content reported in profile ${params.split('=')[1]}`; | ||
body = `https://scratch.mit.edu/users/${params.split('=')[1]}`; | ||
} else if (typeof (params) !== 'undefined' && params.indexOf('confirmation') !== -1) { | ||
subject = 'Problem with email confirmation'; | ||
} |
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.
I think this might be more readable and flexible if it happened outside of the component and resulted in passing in subject
and body
as props.
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.
Looking at other pages in www that use the search string the better approach looked like creating a constructor, and putting the values in the state.
Scratchr2 has links to contact us from the report (profile|studio) dialogs. Looking at the scratchr2 source, there’s also one for confirmations, so this change handles the additional details in the same way - in the subject and description. In the future we could consider pre-filling specific form fields that we define.
b8821b0
to
ee09ba5
Compare
* With Carl decided to put the sidebar back even with just one item. It’s still one we want to emphasize. * made sure the freshdesk js file would not block loading the form (it doesn’t appear to be needed for the form, it’s probably mainly for the pop-up version) * moved the query processing into a constructor (more idomatic react) * expanded the form so it should not need to scroll - also noted that in incognito mode a captcha is shown, so created enough space for that to be visible.
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.
LGTM! I have one comment about the iframe height, but not sure if that's a blocker or not.
<iframe | ||
className="freshwidget-embedded-form" | ||
frameBorder="0" | ||
height="744px" |
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.
I didn't know you could include px
for the height
attribute — maybe React is stripping it out?
We should also add to the test plan that we're going to look at availability from China. |
id="freshwidget-embedded-form" | ||
scrolling="no" | ||
src={`${prefix}&${title}&${username}&${browser}&${formSubject}&${formDescription}`} | ||
title={<FormattedMessage id="contactUs.questionsForum" />} |
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.
It looks like this is being rendered as [object Object]
— I think we need to change it to use formatMessage
(although I'm not sure what this attribute is here for).
Resolves:
Moves the contact-us form from the legacy scratchr2 system to www.
Changes:
Slight update to the wording to make it a bit more friendly. Also uses the Freshdesk formwidget to submit directly to Freshdesk instead of sending an email (will allow us to remove one email path from scratchr2)
Note: Information Page template is NOT responsive, and that is out of scope for this change.
Test Coverage:
Testing
window.navigator.userAgent
in the console)