Skip to content

Commit 7f5317e

Browse files
authored
Merge pull request #8 from topcoder-platform/bug-bash
Bug bash
2 parents 86a3be2 + 70ebb94 commit 7f5317e

File tree

7 files changed

+45
-13
lines changed

7 files changed

+45
-13
lines changed

src/shared/components/Settings/Profile/Hobby/styles.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,11 +183,11 @@ textarea {
183183
}
184184

185185
&.col-1 {
186-
width: auto;
186+
// width: auto;
187187
}
188188

189189
&.col-2 {
190-
width: auto;
190+
// width: auto;
191191
}
192192

193193
&.row-1 {

src/shared/components/Settings/Profile/Skills/styles.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@
169169

170170
.col-1,
171171
.col-2 {
172-
width: auto;
172+
// width: auto;
173173
}
174174
}
175175

src/shared/components/Settings/Tools/Devices/index.jsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import PT from 'prop-types';
1212
import ConsentComponent from 'components/Settings/ConsentComponent';
1313
import Select from 'components/Select';
1414
import { PrimaryButton } from 'topcoder-react-ui-kit';
15+
import { toastr } from 'react-redux-toastr';
1516
import ConfirmationModal from '../../CofirmationModal';
1617
import dropdowns from './dropdowns.json';
1718
import DeviceList from './List';
@@ -30,6 +31,7 @@ export default class Devices extends ConsentComponent {
3031
this.onAddDevice = this.onAddDevice.bind(this);
3132
this.loadPersonalizationTrait = this.loadPersonalizationTrait.bind(this);
3233
this.updatePredicate = this.updatePredicate.bind(this);
34+
this.showSuccessToast = this.showSuccessToast.bind(this);
3335

3436
const { userTraits } = props;
3537
this.state = {
@@ -130,6 +132,12 @@ export default class Devices extends ConsentComponent {
130132
});
131133
}
132134

135+
showSuccessToast = () => {
136+
setImmediate(() => {
137+
toastr.success('Success!', 'Your information has been updated.');
138+
});
139+
}
140+
133141
/**
134142
* Add new device
135143
* @param answer user consent answer value
@@ -150,15 +158,15 @@ export default class Devices extends ConsentComponent {
150158
const newDeviceTrait = { ...deviceTrait };
151159
newDeviceTrait.traits.data.push(newDevice);
152160
this.setState({ deviceTrait: newDeviceTrait });
153-
updateUserTrait(handle, 'device', newDeviceTrait.traits.data, tokenV3);
161+
updateUserTrait(handle, 'device', newDeviceTrait.traits.data, tokenV3).then(this.showSuccessToast);
154162
} else {
155163
const newDevices = [];
156164
newDevices.push(newDevice);
157165
const traits = {
158166
data: newDevices,
159167
};
160168
this.setState({ deviceTrait: { traits } });
161-
addUserTrait(handle, 'device', newDevices, tokenV3);
169+
addUserTrait(handle, 'device', newDevices, tokenV3).then(this.showSuccessToast);
162170
}
163171
const empty = {
164172
deviceType: '',

src/shared/components/Settings/Tools/ServiceProviders/index.jsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import _ from 'lodash';
1212
import ConsentComponent from 'components/Settings/ConsentComponent';
1313
import Select from 'components/Select';
1414
import { PrimaryButton } from 'topcoder-react-ui-kit';
15+
import { toastr } from 'react-redux-toastr';
1516
import ConfirmationModal from '../../CofirmationModal';
1617
import dropdowns from './dropdowns.json';
1718
import ServiceProviderList from './List';
@@ -30,6 +31,7 @@ export default class ServiceProviders extends ConsentComponent {
3031
this.onAddServiceProvider = this.onAddServiceProvider.bind(this);
3132
this.loadPersonalizationTrait = this.loadPersonalizationTrait.bind(this);
3233
this.updatePredicate = this.updatePredicate.bind(this);
34+
this.showSuccessToast = this.showSuccessToast.bind(this);
3335

3436
const { userTraits } = props;
3537
this.state = {
@@ -151,6 +153,12 @@ export default class ServiceProviders extends ConsentComponent {
151153
});
152154
}
153155

156+
showSuccessToast = () => {
157+
setImmediate(() => {
158+
toastr.success('Success!', 'Your information has been updated.');
159+
});
160+
}
161+
154162
/**
155163
* Add new serviceProvider
156164
* @param answer user consent answer value
@@ -169,15 +177,15 @@ export default class ServiceProviders extends ConsentComponent {
169177
const newServiceProviderTrait = { ...serviceProviderTrait };
170178
newServiceProviderTrait.traits.data.push(newServiceProvider);
171179
this.setState({ serviceProviderTrait: newServiceProviderTrait });
172-
updateUserTrait(handle, 'service_provider', newServiceProviderTrait.traits.data, tokenV3);
180+
updateUserTrait(handle, 'service_provider', newServiceProviderTrait.traits.data, tokenV3).then(this.showSuccessToast);
173181
} else {
174182
const newServiceProviders = [];
175183
newServiceProviders.push(newServiceProvider);
176184
const traits = {
177185
data: newServiceProviders,
178186
};
179187
this.setState({ serviceProviderTrait: { traits } });
180-
addUserTrait(handle, 'service_provider', newServiceProviders, tokenV3);
188+
addUserTrait(handle, 'service_provider', newServiceProviders, tokenV3).then(this.showSuccessToast);
181189
}
182190
const empty = {
183191
serviceProviderType: '',

src/shared/components/Settings/Tools/Software/index.jsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import _ from 'lodash';
1212
import ConsentComponent from 'components/Settings/ConsentComponent';
1313
import Select from 'components/Select';
1414
import { PrimaryButton } from 'topcoder-react-ui-kit';
15+
import { toastr } from 'react-redux-toastr';
1516
import ConfirmationModal from '../../CofirmationModal';
1617
import dropdowns from './dropdowns.json';
1718
import SoftwareList from './List';
@@ -31,6 +32,7 @@ export default class Software extends ConsentComponent {
3132
this.onAddSoftware = this.onAddSoftware.bind(this);
3233
this.loadPersonalizationTrait = this.loadPersonalizationTrait.bind(this);
3334
this.updatePredicate = this.updatePredicate.bind(this);
35+
this.showSuccessToast = this.showSuccessToast.bind(this);
3436

3537
const { userTraits } = props;
3638
this.state = {
@@ -152,6 +154,12 @@ export default class Software extends ConsentComponent {
152154
});
153155
}
154156

157+
showSuccessToast = () => {
158+
setImmediate(() => {
159+
toastr.success('Success!', 'Your information has been updated.');
160+
});
161+
}
162+
155163
/**
156164
* Add new software
157165
* @param answer user consent answer value
@@ -170,15 +178,15 @@ export default class Software extends ConsentComponent {
170178
const newSoftwareTrait = { ...softwareTrait };
171179
newSoftwareTrait.traits.data.push(newSoftware);
172180
this.setState({ softwareTrait: newSoftwareTrait });
173-
updateUserTrait(handle, 'software', newSoftwareTrait.traits.data, tokenV3);
181+
updateUserTrait(handle, 'software', newSoftwareTrait.traits.data, tokenV3).then(this.showSuccessToast);
174182
} else {
175183
const newSoftwares = [];
176184
newSoftwares.push(newSoftware);
177185
const traits = {
178186
data: newSoftwares,
179187
};
180188
this.setState({ softwareTrait: { traits } });
181-
addUserTrait(handle, 'software', newSoftwares, tokenV3);
189+
addUserTrait(handle, 'software', newSoftwares, tokenV3).then(this.showSuccessToast);
182190
}
183191
const empty = {
184192
softwareType: '',

src/shared/components/Settings/Tools/Subscriptions/index.jsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import PT from 'prop-types';
1111
import _ from 'lodash';
1212
import ConsentComponent from 'components/Settings/ConsentComponent';
1313
import { PrimaryButton } from 'topcoder-react-ui-kit';
14+
import { toastr } from 'react-redux-toastr';
1415
import ConfirmationModal from '../../CofirmationModal';
1516
import SubscriptionList from './List';
1617

@@ -29,6 +30,7 @@ export default class Subscription extends ConsentComponent {
2930
this.onAddSubscription = this.onAddSubscription.bind(this);
3031
this.loadPersonalizationTrait = this.loadPersonalizationTrait.bind(this);
3132
this.updatePredicate = this.updatePredicate.bind(this);
33+
this.showSuccessToast = this.showSuccessToast.bind(this);
3234
const { userTraits } = props;
3335
this.state = {
3436
formInvalid: false,
@@ -141,6 +143,12 @@ export default class Subscription extends ConsentComponent {
141143
});
142144
}
143145

146+
showSuccessToast = () => {
147+
setImmediate(() => {
148+
toastr.success('Success!', 'Your information has been updated.');
149+
});
150+
}
151+
144152
/**
145153
* Add new subscription
146154
* @param answer user consent answer value
@@ -159,15 +167,15 @@ export default class Subscription extends ConsentComponent {
159167
const newSubscriptionTrait = { ...subscriptionTrait };
160168
newSubscriptionTrait.traits.data.push(newSubscription);
161169
this.setState({ subscriptionTrait: newSubscriptionTrait });
162-
updateUserTrait(handle, 'subscription', newSubscriptionTrait.traits.data, tokenV3);
170+
updateUserTrait(handle, 'subscription', newSubscriptionTrait.traits.data, tokenV3).then(this.showSuccessToast);
163171
} else {
164172
const newSubscriptions = [];
165173
newSubscriptions.push(newSubscription);
166174
const traits = {
167175
data: newSubscriptions,
168176
};
169177
this.setState({ subscriptionTrait: { traits } });
170-
addUserTrait(handle, 'subscription', newSubscriptions, tokenV3);
178+
addUserTrait(handle, 'subscription', newSubscriptions, tokenV3).then(this.showSuccessToast);
171179
}
172180
const empty = {
173181
name: '',

src/shared/containers/Settings.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,15 +220,15 @@ function mapDispatchToProps(dispatch) {
220220
},
221221
addUserTrait: (handle, traitId, data, tokenV3) => {
222222
dispatch(actions.settings.modifyUserTraitInit());
223-
dispatch(actions.settings.addUserTrait(handle, traitId, data, tokenV3));
223+
return dispatch(actions.settings.addUserTrait(handle, traitId, data, tokenV3));
224224
},
225225
addUserSkill: (handle, skill, tokenV3) => {
226226
dispatch(actions.profile.addSkillInit());
227227
dispatch(actions.profile.addSkillDone(handle, tokenV3, _.assign(skill, { tagId: skill.id })));
228228
},
229229
updateUserTrait: (handle, traitId, data, tokenV3) => {
230230
dispatch(actions.settings.modifyUserTraitInit());
231-
dispatch(actions.settings.updateUserTrait(handle, traitId, data, tokenV3));
231+
return dispatch(actions.settings.updateUserTrait(handle, traitId, data, tokenV3));
232232
},
233233
deleteUserTrait: (handle, traitId, tokenV3) => {
234234
dispatch(actions.settings.modifyUserTraitInit());

0 commit comments

Comments
 (0)