This repository has been archived by the owner on Nov 21, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into 172_download-xls
- Loading branch information
Showing
11 changed files
with
118 additions
and
33 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,65 @@ | ||
import React from "react"; | ||
import React, { Component } from "react"; | ||
import ClipboardButton from "react-clipboard.js"; | ||
import {getFormID, getFormURL, getAdminURL} from "../utils"; | ||
import URLDisplay from "./URLDisplay"; | ||
|
||
export default function FormCreated(props) { | ||
const adminToken = props.params.adminToken; | ||
const formID = getFormID(adminToken); | ||
export default class FormCreated extends Component { | ||
constructor(props) { | ||
super(props); | ||
this.state = { | ||
copied: false | ||
}; | ||
} | ||
|
||
const userformURL = getFormURL(formID); | ||
const adminURL = getAdminURL(adminToken); | ||
onClipboardCopied() { | ||
this.setState({copied: true}); | ||
} | ||
|
||
return ( | ||
<form> | ||
<h3>Here we go! Your form is now ready to be filled.</h3> | ||
<div className="form-group"> | ||
<label>This is the <a href={userformURL}>link to give to the form fillers</a>:</label> | ||
<p>They will be presented the form you just built.</p> | ||
<URLDisplay url={userformURL} /> | ||
render() { | ||
const adminToken = this.props.params.adminToken; | ||
const formID = getFormID(adminToken); | ||
|
||
<hr /> | ||
const userformURL = getFormURL(formID); | ||
const adminURL = getAdminURL(adminToken); | ||
|
||
<label>And this is the <a href={adminURL}>link to the administration dashboard</a>:</label> | ||
<p>Keep this URL in a safe place and give it only to the administrators.</p> | ||
const twitterText = `I've just created a form, it is at ${userformURL}!`; | ||
const twitterUrl = `https://twitter.com/intent/tweet?text=${twitterText}`; | ||
|
||
const emailSubject = `Hey, I just created a new form`; | ||
const emailBody = `Hi folks, | ||
I just created a new form and it's available at: | ||
${userformURL} | ||
Please, take some time to fill it, | ||
`; | ||
|
||
const emailUrl = `mailto:?subject=${emailSubject}&body=${encodeURIComponent(emailBody)}`; | ||
return ( | ||
<form> | ||
<h3>Neat, your form is now ready!</h3> | ||
<div className="form-group"> | ||
<ul className="list-inline"> | ||
<li><button className="btn btn-link"><i className="glyphicon glyphicon-send" /> | ||
<a href={emailUrl}> Send by email</a></button> | ||
</li> | ||
<li><button className="btn btn-link"><i className="glyphicon glyphicon-cloud" /> | ||
<a href={twitterUrl}> Tweet it</a></button> | ||
</li> | ||
<li> | ||
<ClipboardButton | ||
className="btn btn-link" | ||
data-clipboard-text={userformURL} | ||
onSuccess={this.onClipboardCopied.bind(this)}> | ||
<i className="glyphicon glyphicon-copy" /> <a>{this.state.copied ? "Copied!" : "Copy to clipboard"}</a> | ||
</ClipboardButton> | ||
</li> | ||
</ul> | ||
<URLDisplay url={userformURL} /> | ||
<URLDisplay url={adminURL} type="admin" /> | ||
</div> | ||
</form> | ||
); | ||
</div> | ||
</form> | ||
); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"name": "Formbuilder", | ||
"description": "Create your own forms and surveys, get your data back.", | ||
"repository": "https://github.com/Kinto/formbuilder", | ||
"website": "https://github.com/Kinto/formbuilder#readme", | ||
"logo": "https://avatars0.githubusercontent.com/u/13413813", | ||
"env": { | ||
"PROJECT_NAME": { | ||
"description": "Name of the project. Defaults to \"formbuilder\".", | ||
"value": "$APP" | ||
}, | ||
"SERVER_URL": { | ||
"description": "URL of the Kinto server. It's default value depends on the environment that's being used (development, production, etc.)", | ||
"value": "" | ||
}, | ||
"HOST": { | ||
"description": "Listens connection on the specified host. Defaults to \"localhost\".", | ||
"value": "0.0.0.0" | ||
}, | ||
"NPM_CONFIG_PRODUCTION": { | ||
"description": "Install dev dependencies", | ||
"value": "false" | ||
} | ||
} | ||
} |
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