Skip to content

Commit 606bd73

Browse files
authored
Merge pull request #2676 from appirio-tech/hotfix/enabling_remaining_address_fields
[PROD]Hotfix/enabling remaining address fields
2 parents 9699868 + 7f684f3 commit 606bd73

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/routes/settings/helpers/settings.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ export const formatProfileSettings = (traits) => {
5858
if (traitData && traitData.length > 0) {
5959
data.photoUrl = traitData[0].photoURL
6060
data.firstNLastName = `${traitData[0].firstName} ${traitData[0].lastName}`
61-
data.country = traitData[0].country
6261
}
6362
}
6463

@@ -114,8 +113,10 @@ export const applyProfileSettingsToTraits = (traits, profileSettings) => {
114113
// get first and last name, if don't have should return `undefined`
115114
const [, firstName, lastName] = profileSettings.firstNLastName ? profileSettings.firstNLastName.match(/([^\s]+)\s*(.*)/) : []
116115
const photoURL = profileSettings.photoUrl
117-
const country = profileSettings.country
118116

117+
// define country similar to connect_info if not present for basic_info
118+
const country = _.get(trait, 'traits.data[0].country', profileSettings.country)
119+
119120
// update only if new values are defined
120121
const updatedProps = _.omitBy({
121122
photoURL,

src/routes/settings/routes/profile/components/ProfileSettingsForm.jsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,7 @@ class ProfileSettingsForm extends Component {
124124
required
125125
/>
126126
</div>
127-
{/* TODO as for now PROD doesn't supports `connect_info` we don't have a places where to save this data for now */}
128-
{/* <div className="section-heading">Business address</div>
127+
<div className="section-heading">Business address</div>
129128
{this.getField('Address', 'address')}
130129
{this.getField('City', 'city')}
131130
<div className="field">
@@ -144,7 +143,7 @@ class ProfileSettingsForm extends Component {
144143
onChange={this.onFieldUpdate}
145144
/>
146145
</div>
147-
</div>*/}
146+
</div>
148147
<div className="field">
149148
<div className="label">Country</div>
150149
<div className="input-field">

0 commit comments

Comments
 (0)