Skip to content

Commit 5a1df6c

Browse files
committed
fix issue-2163 by revert its pr-2257
1 parent 9db5d08 commit 5a1df6c

File tree

4 files changed

+8
-40
lines changed

4 files changed

+8
-40
lines changed

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

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ 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';
1615
import ConfirmationModal from '../../CofirmationModal';
1716
import dropdowns from './dropdowns.json';
1817
import DeviceList from './List';
@@ -31,7 +30,6 @@ export default class Devices extends ConsentComponent {
3130
this.onAddDevice = this.onAddDevice.bind(this);
3231
this.loadPersonalizationTrait = this.loadPersonalizationTrait.bind(this);
3332
this.updatePredicate = this.updatePredicate.bind(this);
34-
this.showSuccessToast = this.showSuccessToast.bind(this);
3533

3634
const { userTraits } = props;
3735
this.state = {
@@ -132,12 +130,6 @@ export default class Devices extends ConsentComponent {
132130
});
133131
}
134132

135-
showSuccessToast = () => {
136-
setImmediate(() => {
137-
toastr.success('Success!', 'Your information has been updated.');
138-
});
139-
}
140-
141133
/**
142134
* Add new device
143135
* @param answer user consent answer value
@@ -158,15 +150,15 @@ export default class Devices extends ConsentComponent {
158150
const newDeviceTrait = { ...deviceTrait };
159151
newDeviceTrait.traits.data.push(newDevice);
160152
this.setState({ deviceTrait: newDeviceTrait });
161-
updateUserTrait(handle, 'device', newDeviceTrait.traits.data, tokenV3).then(this.showSuccessToast);
153+
updateUserTrait(handle, 'device', newDeviceTrait.traits.data, tokenV3);
162154
} else {
163155
const newDevices = [];
164156
newDevices.push(newDevice);
165157
const traits = {
166158
data: newDevices,
167159
};
168160
this.setState({ deviceTrait: { traits } });
169-
addUserTrait(handle, 'device', newDevices, tokenV3).then(this.showSuccessToast);
161+
addUserTrait(handle, 'device', newDevices, tokenV3);
170162
}
171163
const empty = {
172164
deviceType: '',

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

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ 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';
1615
import ConfirmationModal from '../../CofirmationModal';
1716
import dropdowns from './dropdowns.json';
1817
import ServiceProviderList from './List';
@@ -31,7 +30,6 @@ export default class ServiceProviders extends ConsentComponent {
3130
this.onAddServiceProvider = this.onAddServiceProvider.bind(this);
3231
this.loadPersonalizationTrait = this.loadPersonalizationTrait.bind(this);
3332
this.updatePredicate = this.updatePredicate.bind(this);
34-
this.showSuccessToast = this.showSuccessToast.bind(this);
3533

3634
const { userTraits } = props;
3735
this.state = {
@@ -153,12 +151,6 @@ export default class ServiceProviders extends ConsentComponent {
153151
});
154152
}
155153

156-
showSuccessToast = () => {
157-
setImmediate(() => {
158-
toastr.success('Success!', 'Your information has been updated.');
159-
});
160-
}
161-
162154
/**
163155
* Add new serviceProvider
164156
* @param answer user consent answer value
@@ -177,15 +169,15 @@ export default class ServiceProviders extends ConsentComponent {
177169
const newServiceProviderTrait = { ...serviceProviderTrait };
178170
newServiceProviderTrait.traits.data.push(newServiceProvider);
179171
this.setState({ serviceProviderTrait: newServiceProviderTrait });
180-
updateUserTrait(handle, 'service_provider', newServiceProviderTrait.traits.data, tokenV3).then(this.showSuccessToast);
172+
updateUserTrait(handle, 'service_provider', newServiceProviderTrait.traits.data, tokenV3);
181173
} else {
182174
const newServiceProviders = [];
183175
newServiceProviders.push(newServiceProvider);
184176
const traits = {
185177
data: newServiceProviders,
186178
};
187179
this.setState({ serviceProviderTrait: { traits } });
188-
addUserTrait(handle, 'service_provider', newServiceProviders, tokenV3).then(this.showSuccessToast);
180+
addUserTrait(handle, 'service_provider', newServiceProviders, tokenV3);
189181
}
190182
const empty = {
191183
serviceProviderType: '',

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

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ 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';
1615
import ConfirmationModal from '../../CofirmationModal';
1716
import dropdowns from './dropdowns.json';
1817
import SoftwareList from './List';
@@ -32,7 +31,6 @@ export default class Software extends ConsentComponent {
3231
this.onAddSoftware = this.onAddSoftware.bind(this);
3332
this.loadPersonalizationTrait = this.loadPersonalizationTrait.bind(this);
3433
this.updatePredicate = this.updatePredicate.bind(this);
35-
this.showSuccessToast = this.showSuccessToast.bind(this);
3634

3735
const { userTraits } = props;
3836
this.state = {
@@ -154,12 +152,6 @@ export default class Software extends ConsentComponent {
154152
});
155153
}
156154

157-
showSuccessToast = () => {
158-
setImmediate(() => {
159-
toastr.success('Success!', 'Your information has been updated.');
160-
});
161-
}
162-
163155
/**
164156
* Add new software
165157
* @param answer user consent answer value
@@ -178,15 +170,15 @@ export default class Software extends ConsentComponent {
178170
const newSoftwareTrait = { ...softwareTrait };
179171
newSoftwareTrait.traits.data.push(newSoftware);
180172
this.setState({ softwareTrait: newSoftwareTrait });
181-
updateUserTrait(handle, 'software', newSoftwareTrait.traits.data, tokenV3).then(this.showSuccessToast);
173+
updateUserTrait(handle, 'software', newSoftwareTrait.traits.data, tokenV3);
182174
} else {
183175
const newSoftwares = [];
184176
newSoftwares.push(newSoftware);
185177
const traits = {
186178
data: newSoftwares,
187179
};
188180
this.setState({ softwareTrait: { traits } });
189-
addUserTrait(handle, 'software', newSoftwares, tokenV3).then(this.showSuccessToast);
181+
addUserTrait(handle, 'software', newSoftwares, tokenV3);
190182
}
191183
const empty = {
192184
softwareType: '',

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

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ 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';
1514
import ConfirmationModal from '../../CofirmationModal';
1615
import SubscriptionList from './List';
1716

@@ -30,7 +29,6 @@ export default class Subscription extends ConsentComponent {
3029
this.onAddSubscription = this.onAddSubscription.bind(this);
3130
this.loadPersonalizationTrait = this.loadPersonalizationTrait.bind(this);
3231
this.updatePredicate = this.updatePredicate.bind(this);
33-
this.showSuccessToast = this.showSuccessToast.bind(this);
3432
const { userTraits } = props;
3533
this.state = {
3634
formInvalid: false,
@@ -143,12 +141,6 @@ export default class Subscription extends ConsentComponent {
143141
});
144142
}
145143

146-
showSuccessToast = () => {
147-
setImmediate(() => {
148-
toastr.success('Success!', 'Your information has been updated.');
149-
});
150-
}
151-
152144
/**
153145
* Add new subscription
154146
* @param answer user consent answer value
@@ -167,15 +159,15 @@ export default class Subscription extends ConsentComponent {
167159
const newSubscriptionTrait = { ...subscriptionTrait };
168160
newSubscriptionTrait.traits.data.push(newSubscription);
169161
this.setState({ subscriptionTrait: newSubscriptionTrait });
170-
updateUserTrait(handle, 'subscription', newSubscriptionTrait.traits.data, tokenV3).then(this.showSuccessToast);
162+
updateUserTrait(handle, 'subscription', newSubscriptionTrait.traits.data, tokenV3);
171163
} else {
172164
const newSubscriptions = [];
173165
newSubscriptions.push(newSubscription);
174166
const traits = {
175167
data: newSubscriptions,
176168
};
177169
this.setState({ subscriptionTrait: { traits } });
178-
addUserTrait(handle, 'subscription', newSubscriptions, tokenV3).then(this.showSuccessToast);
170+
addUserTrait(handle, 'subscription', newSubscriptions, tokenV3);
179171
}
180172
const empty = {
181173
name: '',

0 commit comments

Comments
 (0)