Skip to content

Commit

Permalink
Merge pull request #22956 from code-dot-org/revert-22953-powerschool-…
Browse files Browse the repository at this point in the history
…text-changes

Revert "Change text for Powerschool connect"
  • Loading branch information
ewjordan committed Jun 7, 2018
2 parents 1ef24a6 + 3b29a69 commit 767a3e2
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 39 deletions.
6 changes: 0 additions & 6 deletions apps/i18n/common/en_us.json
Expand Up @@ -792,12 +792,6 @@
"positionTopOutLeft": "to the top outside left position",
"positionTopOutRight": "to the top outside right position",
"positionTopRight": "to the top right position",
"powerschoolConnectConfirm": "Yes, link my account",
"powerschoolConnectDeny": "No, create a new account",
"powerschoolConnectDialogText": "If you have an existing Code.org account, you can link that to Powerschool. That way, you'll also be able to sign into your existing account from your Powerschool dashboard.",
"powerschoolConnectDialogTitle": "Do you have an existing Code.org account?",
"powerschoolForceConnectDialogTitle": "Link your Powerschool login to your Code.org account",
"powerschoolForceConnectDialogContent": "It looks like you already have a Code.org account that uses the same email address as your Powerschool account. Click the \"Link my account\" button and then log into your existing Code.org account. This will connect your Powerschool login with your existing Code.org account so that you can use Powerschool to log into the Code.org account in the future.",
"pre2017MinecraftButton": "Go to Minecraft Education",
"pre2017MinecraftDesc": "Continue learning with Minecraft.",
"pre2017MinecraftTitle": "Minecraft Education",
Expand Down
28 changes: 6 additions & 22 deletions apps/src/code-studio/LinkCleverAccountModal.jsx
Expand Up @@ -70,7 +70,6 @@ export default class LinkCleverAccountModal extends React.Component {
handleCancel: PropTypes.func,
isOpen: PropTypes.bool,
forceConnect: PropTypes.bool,
providerToLink: PropTypes.string,
};

constructor(props) {
Expand All @@ -86,26 +85,11 @@ export default class LinkCleverAccountModal extends React.Component {
this.props.handleSubmit();
};

getStringsForProvider = (provider) => {
return {
title: locale[provider + "ConnectDialogTitle"](),
content: locale[provider + "ConnectDialogText"](),
forceConnectTitle: locale[provider + "ForceConnectDialogTitle"](),
forceConnectContent: locale[provider + "ForceConnectDialogContent"](),
connectDeny: locale[provider + "ConnectDeny"](),
connectConfirm: locale[provider + "ConnectConfirm"](),
};
};

render = () => {
const {
title,
content,
forceConnectTitle,
forceConnectContent,
connectDeny,
connectConfirm,
} = this.getStringsForProvider(this.props.providerToLink);
const title = locale.cleverConnectDialogTitle();
const content = locale.cleverConnectDialogText();
const forceConnectTitle = locale.cleverForceConnectDialogTitle();
const forceConnectContent = locale.cleverForceConnectDialogContent();
return (
<BaseDialog
useUpdatedStyles
Expand All @@ -130,14 +114,14 @@ export default class LinkCleverAccountModal extends React.Component {
onClick={this.cancel}
style={{...styles.buttonPrimary, ...styles.buttonSecondary}}
>
{connectDeny}
{locale.cleverConnectDeny()}
</button>
}
<button
onClick={this.ok}
style={Object.assign({},styles.buttonPrimary)}
>
{connectConfirm}
{locale.cleverConnectConfirm()}
</button>
</div>
</BaseDialog>
Expand Down
5 changes: 2 additions & 3 deletions apps/src/sites/studio/pages/home/_homepage.js
Expand Up @@ -195,7 +195,7 @@ window.CleverTakeoverManager = function (options) {
const self = this;

const linkCleverDiv = $('<div>');
function showLinkCleverModal(cancel, submit, providerToLink) {
function showLinkCleverModal(cancel, submit) {
$(document.body).append(linkCleverDiv);

ReactDOM.render(
Expand All @@ -204,14 +204,13 @@ window.CleverTakeoverManager = function (options) {
handleCancel={cancel}
handleSubmit={submit}
forceConnect={options.forceConnect === 'true'}
provider={providerToLink}
/>,
linkCleverDiv[0]
);
}

if (self.options.cleverLinkFlag) {
showLinkCleverModal(onCancelModal, onConfirmLink, self.options.cleverLinkFlag);
showLinkCleverModal(onCancelModal, onConfirmLink);
}

function closeLinkCleverModal() {
Expand Down
7 changes: 1 addition & 6 deletions dashboard/app/controllers/omniauth_callbacks_controller.rb
Expand Up @@ -88,11 +88,8 @@ def extract_powerschool_data(auth)
def handle_untrusted_email_signin(user)
force_takeover = user.teacher? && user.email.present? && user.email.end_with?('.oauthemailalreadytaken')

# We used to check this based on sign_in_count, but we're explicitly logging it now
seen_oauth_takeover_dialog = (!!user.seen_oauth_connect_dialog) || user.sign_in_count > 1

# If account exists (as looked up by Clever ID) and it's not the first login, just sign in
if user.persisted? && seen_oauth_takeover_dialog && !force_takeover
if user.persisted? && user.sign_in_count > 0 && !force_takeover
sign_in_user
else
# Otherwise, it's either the first login, or a user who must connect -
Expand All @@ -101,8 +98,6 @@ def handle_untrusted_email_signin(user)
session['clever_takeover_id'] = user.uid
session['clever_takeover_token'] = user.oauth_token
session['force_clever_takeover'] = force_takeover
user.seen_oauth_connect_dialog = true
user.save!
sign_in_user
end
end
Expand Down
1 change: 0 additions & 1 deletion dashboard/app/models/user.rb
Expand Up @@ -135,7 +135,6 @@ class User < ActiveRecord::Base
data_transfer_agreement_source
data_transfer_agreement_kind
data_transfer_agreement_at
seen_oauth_connect_dialog
)

# Include default devise modules. Others available are:
Expand Down
1 change: 0 additions & 1 deletion dashboard/config/locales/en.yml
Expand Up @@ -107,7 +107,6 @@ en:
facebook: 'Facebook'
windowslive: 'Microsoft Account'
clever: 'Clever Account'
powerschool: 'Powerschool Account'
forgot_password: 'Forgot your password?'
need_confirmation: "Didn't receive confirmation instructions?"
need_unlock: "Didn't receive unlock instructions?"
Expand Down

0 comments on commit 767a3e2

Please sign in to comment.