Skip to content
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

Initial Salesforce ID Edit commit #1791

Merged
merged 2 commits into from Mar 13, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -10,6 +10,12 @@ const SalesforceLink = createReactClass({
current_user: PropTypes.object
},

updateSalesforceId() {
const rawSalesforceId = prompt('Update the Salesforce record ID or url for this course.');
const salesforceId = extractSalesforceId(rawSalesforceId);
ServerActions.linkToSalesforce(this.props.course.id, salesforceId);
},

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... I think other wording works just fine for updating as well. linkToSalesforce could just be reused with the different button text and I think it'll be fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah okay! Will do.

linkToSalesforce() {
const rawSalesforceId = prompt('Enter the Salesforce record ID or url for this course.');
const salesforceId = extractSalesforceId(rawSalesforceId);
Expand All @@ -32,6 +38,7 @@ const SalesforceLink = createReactClass({
const openLink = SalesforceServer + this.props.course.flags.salesforce_id;
return (
<div>
<p key="edit_salesforce_id"><button onClick={this.updateSalesforceId} className="button">Update Salesforce ID</button></p>
<p key="open_salesforce"><a href={openLink} className="button" target="_blank">Open in Salesforce</a></p>
<p key="update_salesforce"><button onClick={this.updateSalesforceRecord} className="button" target="_blank">Update Salesforce record</button></p>
</div>
Expand Down