Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
scratch-www
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
scratch-www
Commits
3f90e985
Commit
3f90e985
authored
Jul 13, 2017
by
Ray Schamp
Committed by
GitHub
Jul 13, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1413 from rschamp/hotfix/rip-smartystreets
[Master] Remove SmartyStreets API
parents
c8afebfa
84a37a67
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
1 addition
and
59 deletions
+1
-59
.travis.yml
.travis.yml
+0
-2
src/components/registration/steps.jsx
src/components/registration/steps.jsx
+1
-33
src/lib/smarty-streets.js
src/lib/smarty-streets.js
+0
-22
src/views/teacherregistration/l10n.json
src/views/teacherregistration/l10n.json
+0
-1
webpack.config.js
webpack.config.js
+0
-1
No files found.
.travis.yml
View file @
3f90e985
...
...
@@ -53,8 +53,6 @@ env:
-
SENTRY_DSN_VAR=SENTRY_DSN_$TRAVIS_BRANCH
-
SENTRY_DSN=${!SENTRY_DSN_VAR}
-
SENTRY_DSN=${SENTRY_DSN:-$SENTRY_DSN_STAGING}
# SMARTY_STREETS_API_KEY
-
secure
:
"
uQKNgJaJEju8ErGUxIbLE0Y6ee4j6OFFbBpqyuKrNMk6apvvvXLp3lTdGZJq6j/ZwQeQ384m5bbfmhFwr7piPFj7W/zBXVKcifbF6ShfP7skMl834Kkefs3uEWU0VZw3nURgzNInSOPqqGLsISFywpwBXUWKfL0Q87KHNU0/I0EkwvImm3SAlNpR38m3yKcMF3h0zK8Fh2mO7iyHEIhtssdWabaRjf3t6Mr5vikACeXYJg+k4oEQZtsnSNnlLYWumdEDsxwonMozGKUBqlXwhHCdYNOJ1DUGuntbXOnylLt1/LA9I9B4hWQOrRDwqjyIOI+2dpADoCN040+Zr1VSrJhk7Wb7ogeaQLzZ4W/3dX54rbsnFHa+MuKqOsAxQ0Tjfk5xWq/pbLRsAyW6Pl7Q1v4yWOQ2COnM/tfJ6UaH9bxppOyKsX8n33rFjlvZU6CtY1GGa7fpB2zOKI5B5OovLjHeokIe/Tx+4coEDZqt44qkTGWr/eWDxrvkQqpQ29F9My3wBgB3gdou+3lWExS0a9M2wwp4EIduXEKNZXLGDuVefH5f3eFy09wH+nhctmMF8uhMbPefFubEi7fqXTkxntmDTy+/pD2A2w1jJhBwLhwlik335k+Wrbl3dclt7cjJ6fRVX9b+AuBCbGr633vM4xbk90whwXizSECIt5InGSw="
-
SKIP_CLEANUP=true
-
NODE_ENV=production
-
WWW_VERSION=${TRAVIS_COMMIT:0:5}
...
...
src/components/registration/steps.jsx
View file @
3f90e985
...
...
@@ -3,8 +3,6 @@ var React = require('react');
var
api
=
require
(
'
../../lib/api
'
);
var
countryData
=
require
(
'
../../lib/country-data
'
);
var
intl
=
require
(
'
../../lib/intl.jsx
'
);
var
log
=
require
(
'
../../lib/log
'
);
var
smartyStreets
=
require
(
'
../../lib/smarty-streets
'
);
var
Avatar
=
require
(
'
../../components/avatar/avatar.jsx
'
);
var
Button
=
require
(
'
../../components/forms/button.jsx
'
);
...
...
@@ -667,36 +665,6 @@ module.exports = {
onChangeCountry
:
function
(
field
,
choice
)
{
this
.
setState
({
countryChoice
:
choice
});
},
onValidSubmit
:
function
(
formData
,
reset
,
invalidate
)
{
if
(
formData
.
address
.
country
!==
'
us
'
)
{
return
this
.
props
.
onNextStep
(
formData
);
}
this
.
setState
({
waiting
:
true
});
var
address
=
{
street
:
formData
.
address
.
line1
,
secondary
:
formData
.
address
.
line2
||
''
,
city
:
formData
.
address
.
city
,
state
:
formData
.
address
.
state
,
zipcode
:
formData
.
address
.
zip
};
smartyStreets
(
address
,
function
(
err
,
res
)
{
this
.
setState
({
waiting
:
false
});
if
(
err
)
{
// We don't want to prevent registration because
// address validation isn't working. Log it and
// move on.
log
.
error
(
err
);
return
this
.
props
.
onNextStep
(
formData
);
}
if
(
res
&&
res
.
length
>
0
)
{
return
this
.
props
.
onNextStep
(
formData
);
}
else
{
return
invalidate
({
'
all
'
:
this
.
props
.
intl
.
formatMessage
({
id
:
'
teacherRegistration.addressValidationError
'
})
});
}
}.
bind
(
this
));
},
render
:
function
()
{
var
formatMessage
=
this
.
props
.
intl
.
formatMessage
;
var
stateOptions
=
countryData
.
subdivisionOptions
[
this
.
state
.
countryChoice
];
...
...
@@ -712,7 +680,7 @@ module.exports = {
tipContent=
{
formatMessage
({
id
:
'
registration.nameStepTooltip
'
})
}
/>
</
p
>
<
Card
>
<
Form
onValidSubmit=
{
this
.
onValidSubmit
}
>
<
Form
onValidSubmit=
{
this
.
props
.
onNextStep
}
>
<
Select
label=
{
formatMessage
({
id
:
'
general.country
'
})
}
name=
"address.country"
options=
{
getCountryOptions
(
this
.
props
.
intl
)
}
...
...
src/lib/smarty-streets.js
deleted
100644 → 0
View file @
c8afebfa
var
defaults
=
require
(
'
lodash.defaults
'
);
var
api
=
require
(
'
./api
'
);
module
.
exports
=
function
smartyStreetApi
(
params
,
callback
)
{
defaults
(
params
,
{
'
auth-id
'
:
process
.
env
.
SMARTY_STREETS_API_KEY
,
'
match
'
:
'
invalid
'
});
api
({
host
:
'
https://api.smartystreets.com
'
,
uri
:
'
/street-address
'
,
params
:
params
},
function
(
err
,
body
,
res
)
{
if
(
err
)
return
callback
(
err
);
if
(
res
.
statusCode
!==
200
)
{
return
callback
(
'
There was an error contacting the address validation server.
'
);
}
return
callback
(
err
,
body
);
});
};
src/views/teacherregistration/l10n.json
View file @
3f90e985
...
...
@@ -22,7 +22,6 @@
"teacherRegistration.orgChoiceLibrary"
:
"Library"
,
"teacherRegistration.orgChoiceCamp"
:
"Camp"
,
"teacherRegistration.notRequired"
:
"Not Required"
,
"teacherRegistration.addressValidationError"
:
"This doesn't look like a real address"
,
"teacherRegistration.addressLine1"
:
"Address Line 1"
,
"teacherRegistration.addressLine2"
:
"Address Line 2 (Optional)"
,
"teacherRegistration.zipCode"
:
"ZIP"
,
...
...
webpack.config.js
View file @
3f90e985
...
...
@@ -125,7 +125,6 @@ module.exports = {
'
process.env.NODE_ENV
'
:
'
"
'
+
(
process
.
env
.
NODE_ENV
||
'
development
'
)
+
'
"
'
,
'
process.env.SENTRY_DSN
'
:
'
"
'
+
(
process
.
env
.
SENTRY_DSN
||
''
)
+
'
"
'
,
'
process.env.API_HOST
'
:
'
"
'
+
(
process
.
env
.
API_HOST
||
'
https://api.scratch.mit.edu
'
)
+
'
"
'
,
'
process.env.SMARTY_STREETS_API_KEY
'
:
'
"
'
+
(
process
.
env
.
SMARTY_STREETS_API_KEY
||
''
)
+
'
"
'
,
'
process.env.SCRATCH_ENV
'
:
'
"
'
+
(
process
.
env
.
SCRATCH_ENV
||
'
development
'
)
+
'
"
'
}),
new
webpack
.
optimize
.
CommonsChunkPlugin
(
'
common
'
,
'
js/common.bundle.js
'
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment