muba-posting 9.0.7 → 9.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Posting.js +8 -2
- package/Publish5.js +11 -6
- package/package.json +1 -1
package/Posting.js
CHANGED
|
@@ -306,7 +306,7 @@ export default class Posting extends React.Component {
|
|
|
306
306
|
if (bddAd.status === 'PENDING_CREATED') {
|
|
307
307
|
const languages = bddAd?.languages.length > 0 ? bddAd?.languages : this.state.postingAd.languages
|
|
308
308
|
const languageId = languages[0].language;
|
|
309
|
-
this.
|
|
309
|
+
await this.setStateAsync({
|
|
310
310
|
postingAd: { ...this.state.postingAd, ...bddAd, languageId: languageId, languages: languages },
|
|
311
311
|
originalAd: { ...this.state.postingAd, ...bddAd, languageId: languageId, languages: languages },
|
|
312
312
|
adId: null,
|
|
@@ -314,13 +314,19 @@ export default class Posting extends React.Component {
|
|
|
314
314
|
fullPosting: true
|
|
315
315
|
})
|
|
316
316
|
} else {
|
|
317
|
-
this.
|
|
317
|
+
await this.setStateAsync({
|
|
318
318
|
postingAd: { ...this.state.postingAd, ...bddAd },
|
|
319
319
|
originalAd: { ...this.state.postingAd, ...bddAd }
|
|
320
320
|
});
|
|
321
321
|
}
|
|
322
322
|
}
|
|
323
323
|
|
|
324
|
+
setStateAsync(state) {
|
|
325
|
+
return new Promise(resolve => {
|
|
326
|
+
this.setState(state, resolve);
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
|
|
324
330
|
async _goToPage(view, editingStepOne, params) {
|
|
325
331
|
const prevViews = [...this.state.prevViews];
|
|
326
332
|
|
package/Publish5.js
CHANGED
|
@@ -80,12 +80,12 @@ export default class Publish5 extends React.Component {
|
|
|
80
80
|
|
|
81
81
|
componentDidMount = () => {
|
|
82
82
|
this.refreshData();
|
|
83
|
-
this.loadFeaturesOptions();
|
|
84
83
|
}
|
|
85
84
|
|
|
86
|
-
|
|
85
|
+
loadFeaturesOptions() {
|
|
87
86
|
const labels = {}
|
|
88
87
|
const options = {};
|
|
88
|
+
|
|
89
89
|
this.props.features.forEach(feature => {
|
|
90
90
|
if (feature.name === 'landTypes') {
|
|
91
91
|
options[feature.name + 'Options'] = [];
|
|
@@ -108,14 +108,14 @@ export default class Publish5 extends React.Component {
|
|
|
108
108
|
});
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
-
|
|
111
|
+
refreshData() {
|
|
112
112
|
if (this.state.adType != this.props.postingAd.adType) {
|
|
113
113
|
const age = this.props.postingAd.adTypeDetails.filter(function (detail) { return detail.value == "age" });
|
|
114
114
|
const floorType = this.props.postingAd.adTypeDetails.filter(function (detail) { return detail.value == "floorType" });
|
|
115
115
|
const floorNumber = this.props.postingAd.adTypeDetails.filter(function (detail) { return detail.value == "floorNumber" });
|
|
116
116
|
const orientationType = this.props.postingAd.adTypeDetails.filter(function (detail) { return detail.value == "orientation" });
|
|
117
117
|
|
|
118
|
-
|
|
118
|
+
this.setState({
|
|
119
119
|
age: age,
|
|
120
120
|
floorType: floorType,
|
|
121
121
|
floorNumber: floorNumber,
|
|
@@ -138,6 +138,8 @@ export default class Publish5 extends React.Component {
|
|
|
138
138
|
elements: [{ section: true, value: null, label: orientationType[0]?.label }, ...this.state.orientationOptions.elements.slice(1)],
|
|
139
139
|
selectedItem: this.props.postingAd.orientation + ''
|
|
140
140
|
}
|
|
141
|
+
}, () => {
|
|
142
|
+
this.loadFeaturesOptions();
|
|
141
143
|
});
|
|
142
144
|
}
|
|
143
145
|
}
|
|
@@ -385,8 +387,11 @@ class IconFeature extends React.Component {
|
|
|
385
387
|
}
|
|
386
388
|
|
|
387
389
|
async onPressIcon() {
|
|
388
|
-
|
|
389
|
-
|
|
390
|
+
this.setState({
|
|
391
|
+
selected: !this.state.selected
|
|
392
|
+
}, () => {
|
|
393
|
+
this.props.onPress(this.state.selected);
|
|
394
|
+
})
|
|
390
395
|
}
|
|
391
396
|
|
|
392
397
|
render() {
|