muba-posting 4.1.16 → 4.1.19

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 CHANGED
@@ -64,9 +64,9 @@ export default class Posting extends React.Component {
64
64
  businessId: this.props.businessId,
65
65
  picturesUploaded: 0,
66
66
  postingAd: {
67
- category: null,
68
- subCategory: null,
69
- subCategoryDetails: [],
67
+ transaction: null,
68
+ adType: null,
69
+ adTypeDetails: [],
70
70
  exactlyLocated: true,
71
71
  latitude: null,
72
72
  longitude: null,
@@ -363,7 +363,11 @@ export default class Posting extends React.Component {
363
363
  }
364
364
 
365
365
  async _saveEditAd() {
366
- const response = await this.props.request(this, UPDATE_AD, { ...this.state.postingAd, id: { adId: this.state.postingAd.id } });
366
+ const ad = { ...this.state.postingAd, id: { adId: this.state.postingAd.id } };
367
+ if (this.state.originView === Views.EDIT_SELECTOR && Views.PUBLISH_4 !== this.state.view) {
368
+ delete ad.images;
369
+ }
370
+ const response = await this.props.request(this, UPDATE_AD, ad);
367
371
  if (this.props.adId) {
368
372
  if (this.state.originView === Views.EDIT_SELECTOR) {
369
373
  this.setState({ isLoading: true });
package/PostingEdit.js CHANGED
@@ -10,7 +10,7 @@ export default class PostingEdit extends React.Component {
10
10
  super(props);
11
11
 
12
12
  this.state = {
13
- showFunctionalities: this.props.postingAd.subCategoryDetails.filter(function (detail) { return detail.value == "floorType" }).length > 0
13
+ showFunctionalities: this.props.postingAd.adTypeDetails.filter(function (detail) { return detail.value == "floorType" }).length > 0
14
14
  };
15
15
  }
16
16
 
@@ -22,7 +22,7 @@ export default class PostingEdit extends React.Component {
22
22
 
23
23
  refresh() {
24
24
  this.setState({
25
- showFunctionalities: this.props.postingAd.subCategoryDetails.filter(function (detail) { return detail.value == "floorType" }).length > 0
25
+ showFunctionalities: this.props.postingAd.adTypeDetails.filter(function (detail) { return detail.value == "floorType" }).length > 0
26
26
  });
27
27
  }
28
28
 
@@ -47,7 +47,7 @@ export default class PostingEdit extends React.Component {
47
47
  <View style={commonStyles.homeIcon} >
48
48
  <Image source={require('./assets/images/type.png')} style={commonStyles.homeIconImage} />
49
49
  </View>
50
- <Text style={commonStyles.editIconText}>{strings('edit.category')}</Text>
50
+ <Text style={commonStyles.editIconText}>{strings('edit.transaction')}</Text>
51
51
  </TouchableOpacity>
52
52
  <TouchableOpacity style={[commonStyles.col, commonStyles.col4, commonStyles.homeLinkBox]} activeOpacity={0.5} onPress={() => this.navigateToPublish2()}>
53
53
  <View style={commonStyles.homeIcon} >
package/Preview.js CHANGED
@@ -41,8 +41,8 @@ export default class Preview extends React.Component {
41
41
  this.setState({
42
42
  mainPicture: params.mainPicture,
43
43
  location: params.location,
44
- category: params.categoryName,
45
- subCategory: params.subCategoryName,
44
+ transaction: params.transactionName,
45
+ adType: params.adTypeName,
46
46
  surface: params.surface,
47
47
  showPrice: params.showPrice,
48
48
  price: params.price,
@@ -161,11 +161,11 @@ export default class Preview extends React.Component {
161
161
  </View>
162
162
  <View style={commonStyles.row}>
163
163
  <FontAwesomeIcon style={commonStyles.previewIcon} name="key" />
164
- <Text style={commonStyles.previewInfoText}>{this.state.category}</Text>
164
+ <Text style={commonStyles.previewInfoText}>{this.state.transaction}</Text>
165
165
  </View>
166
166
  <View style={commonStyles.row}>
167
167
  <FontAwesomeIcon style={commonStyles.previewIcon} name="tags" />
168
- <Text style={commonStyles.previewInfoText}>{this.state.subCategory}</Text>
168
+ <Text style={commonStyles.previewInfoText}>{this.state.adType}</Text>
169
169
  </View>
170
170
  </View>
171
171
  <View style={commonStyles.col5}>
package/Publish1.js CHANGED
@@ -6,20 +6,20 @@ import RadioButtonGroup from 'muba-radio-button-group';
6
6
  import { Views } from './utils/Views';
7
7
  const window = Dimensions.get('window');
8
8
 
9
- const GET_CATEGORIES = { method: 'GET', url: '/controller/categories' };
9
+ const GET_TRANSACTIONS = { method: 'GET', url: '/controller/transactions' };
10
10
 
11
11
  export default class Publish1 extends React.Component {
12
12
  constructor(props) {
13
13
  super(props);
14
14
 
15
- this.oldCategory = this.props.postingAd.category;
16
- this.oldSubCategory = this.props.postingAd.subCategory;
15
+ this.oldTransaction = this.props.postingAd.transaction;
16
+ this.oldAdType = this.props.postingAd.adType;
17
17
 
18
18
  this.state = {
19
19
  isLoading: false,
20
20
  showTypeBienError: false,
21
- transactionOptions: { elements: [], selectedItem: this.props.postingAd.category },
22
- typeBienOptions: { elements: [], selectedItem: this.props.postingAd.subCategory },
21
+ transactionOptions: { elements: [], selectedItem: this.props.postingAd.transaction },
22
+ typeBienOptions: { elements: [], selectedItem: this.props.postingAd.adType },
23
23
  };
24
24
  }
25
25
 
@@ -30,18 +30,18 @@ export default class Publish1 extends React.Component {
30
30
  viewLoaded: true
31
31
  });
32
32
 
33
- const responseJson = await this.props.request(this.props.context, GET_CATEGORIES, {
33
+ const responseJson = await this.props.request(this.props.context, GET_TRANSACTIONS, {
34
34
  userId: this.props.postingAd.userId
35
35
  });
36
36
 
37
37
  if (responseJson.httpStatus === 200) {
38
- this.jsonCategories = responseJson.list;
39
- this.props.postingAd.category = this.props.postingAd.category != null ? this.props.postingAd.category : this.jsonCategories[0].value;
40
- this.props.postingAd.subCategory = this.props.postingAd.subCategory != null ? this.props.postingAd.subCategory : this.jsonCategories[0].subList[0].value;
38
+ this.jsonTransactions = responseJson.list;
39
+ this.props.postingAd.transaction = this.props.postingAd.transaction != null ? this.props.postingAd.transaction : this.jsonTransactions[0].value;
40
+ this.props.postingAd.adType = this.props.postingAd.adType != null ? this.props.postingAd.adType : this.jsonTransactions[0].subList[0].value;
41
41
 
42
42
  await this.setState({
43
- transactionOptions: { elements: this.jsonCategories.map(jsonCategory => { return { label: jsonCategory.label, value: jsonCategory.value } }), selectedItem: this.props.postingAd.category },
44
- typeBienOptions: { elements: this.getSubCategories(this.props.postingAd.category), selectedItem: this.props.postingAd.subCategory }
43
+ transactionOptions: { elements: this.jsonTransactions.map(jsonTransaction => { return { label: jsonTransaction.label, value: jsonTransaction.value } }), selectedItem: this.props.postingAd.transaction },
44
+ typeBienOptions: { elements: this.getAdTypes(this.props.postingAd.transaction), selectedItem: this.props.postingAd.adType }
45
45
  })
46
46
  }
47
47
  this.props.hideLoading();
@@ -53,62 +53,62 @@ export default class Publish1 extends React.Component {
53
53
  this.setState({ minHeight: minHeight })
54
54
  }
55
55
 
56
- if (prevProps.postingAd.category !== this.props.postingAd.category
57
- || prevProps.postingAd.subCategory !== this.props.postingAd.subCategory) {
58
- this.oldCategory = this.props.postingAd.category;
59
- this.oldSubCategory = this.props.postingAd.subCategory;
56
+ if (prevProps.postingAd.transaction !== this.props.postingAd.transaction
57
+ || prevProps.postingAd.adType !== this.props.postingAd.adType) {
58
+ this.oldTransaction = this.props.postingAd.transaction;
59
+ this.oldAdType = this.props.postingAd.adType;
60
60
 
61
61
  this.setState({
62
- transactionOptions: { ...this.state.transactionOptions, selectedItem: this.props.postingAd.category },
63
- typeBienOptions: { elements: this.getSubCategories(this.props.postingAd.category), selectedItem: this.props.postingAd.subCategory }
62
+ transactionOptions: { ...this.state.transactionOptions, selectedItem: this.props.postingAd.transaction },
63
+ typeBienOptions: { elements: this.getAdTypes(this.props.postingAd.transaction), selectedItem: this.props.postingAd.adType }
64
64
  });
65
65
  }
66
66
  }
67
67
 
68
- getSubCategories(category) {
69
- return this.jsonCategories?.find((categoryJson) =>
70
- categoryJson.value === category
68
+ getAdTypes(transaction) {
69
+ return this.jsonTransactions?.find((transactionJson) =>
70
+ transactionJson.value === transaction
71
71
  ).subList;
72
72
  }
73
73
 
74
- async changeCategory(category) {
75
- this.props.postingAd.category = category;
76
- this.props.postingAd.subCategory = undefined;
74
+ async changeTransaction(transaction) {
75
+ this.props.postingAd.transaction = transaction;
76
+ this.props.postingAd.adType = undefined;
77
77
 
78
- const subCategories = this.getSubCategories(category);
79
- let currentSubCategory = this.state.typeBienOptions.selectedItem;
78
+ const adTypes = this.getAdTypes(transaction);
79
+ let currentAdType = this.state.typeBienOptions.selectedItem;
80
80
 
81
- if (currentSubCategory != null) {
82
- if (currentSubCategory.includes('for-sale')) {
83
- currentSubCategory = currentSubCategory.substring(0, currentSubCategory.indexOf('for-sale'));
84
- } else if (currentSubCategory.includes('for-rent')) {
85
- currentSubCategory = currentSubCategory.substring(0, currentSubCategory.indexOf('for-rent'));
86
- } else if (currentSubCategory.includes('vacational')) {
87
- currentSubCategory = currentSubCategory.substring(0, currentSubCategory.indexOf('vacational'));
81
+ if (currentAdType != null) {
82
+ if (currentAdType.includes('sale')) {
83
+ currentAdType = currentAdType.substring(0, currentAdType.indexOf('sale'));
84
+ } else if (currentAdType.includes('rent')) {
85
+ currentAdType = currentAdType.substring(0, currentAdType.indexOf('rent'));
86
+ } else if (currentAdType.includes('vacational')) {
87
+ currentAdType = currentAdType.substring(0, currentAdType.indexOf('vacational'));
88
88
  }
89
89
 
90
- currentSubCategory = subCategories.find((element) => { return element.value.startsWith(currentSubCategory) });
90
+ currentAdType = adTypes.find((element) => { return element.value.startsWith(currentAdType) });
91
91
 
92
- if (currentSubCategory === undefined) {
93
- currentSubCategory = this.getSubCategories(category)[0].value;
92
+ if (currentAdType === undefined) {
93
+ currentAdType = this.getAdTypes(transaction)[0].value;
94
94
  } else {
95
- currentSubCategory = currentSubCategory.value;
95
+ currentAdType = currentAdType.value;
96
96
  }
97
97
 
98
- this.props.postingAd.subCategory = currentSubCategory;
98
+ this.props.postingAd.adType = currentAdType;
99
99
  }
100
- await this.setState({ typeBienOptions: { elements: this.getSubCategories(category), selectedItem: this.props.postingAd.subCategory } });
100
+ await this.setState({ typeBienOptions: { elements: this.getAdTypes(transaction), selectedItem: this.props.postingAd.adType } });
101
101
  }
102
102
 
103
- changeSubcategory(value) {
104
- this.props.postingAd.subCategory = value;
103
+ changeAdType(value) {
104
+ this.props.postingAd.adType = value;
105
105
  }
106
106
 
107
107
  async nextStep() {
108
108
  if (this.validateForm()) {
109
109
  for (var i = 0; i < this.state.typeBienOptions.elements.length; i++) {
110
110
  if (this.state.typeBienOptions.elements[i].value == this.state.typeBienOptions.selectedItem) {
111
- this.props.postingAd.subCategoryDetails = this.state.typeBienOptions.elements[i].subList;
111
+ this.props.postingAd.adTypeDetails = this.state.typeBienOptions.elements[i].subList;
112
112
  break;
113
113
  }
114
114
  }
@@ -120,7 +120,7 @@ export default class Publish1 extends React.Component {
120
120
  this.props.goToPage(Views.PUBLISH_2_B);
121
121
  }
122
122
  } else {
123
- if (this.oldCategory != this.state.transactionOptions.selectedItem || this.oldSubCategory != this.state.typeBienOptions.selectedItem) {
123
+ if (this.oldTransaction != this.state.transactionOptions.selectedItem || this.oldAdType != this.state.typeBienOptions.selectedItem) {
124
124
  this.props.goToPage(Views.PUBLISH_3, true);
125
125
  } else {
126
126
  this.props.saveEditAd();
@@ -130,7 +130,7 @@ export default class Publish1 extends React.Component {
130
130
  }
131
131
 
132
132
  validateForm() {
133
- return this.radioButtonSubcategory.onSubmitValidate();
133
+ return this.radioButtonAdType.onSubmitValidate();
134
134
  }
135
135
 
136
136
  render() {
@@ -149,7 +149,7 @@ export default class Publish1 extends React.Component {
149
149
  titleStyle={commonStyles.progressbarField}
150
150
  radioButtonStyle={commonStyles.radioButton}
151
151
  options={this.state.transactionOptions}
152
- onClick={(value) => this.changeCategory(value)} />
152
+ onClick={(value) => this.changeTransaction(value)} />
153
153
 
154
154
  <RadioButtonGroup
155
155
  style={commonStyles.progressbarFieldContainer}
@@ -159,14 +159,14 @@ export default class Publish1 extends React.Component {
159
159
  titleStyle={commonStyles.progressbarField}
160
160
  radioButtonStyle={commonStyles.radioButton}
161
161
  options={this.state.typeBienOptions}
162
- onClick={(value) => this.changeSubcategory(value)}
163
- ref={(element) => this.radioButtonSubcategory = element} />
162
+ onClick={(value) => this.changeAdType(value)}
163
+ ref={(element) => this.radioButtonAdType = element} />
164
164
  </View>
165
165
  </View>
166
166
  <View style={commonStyles.buttomButton}>
167
167
  <TouchableHighlight style={commonStyles.actionButton} underlayColor="#ff5d00" onPress={() => this.nextStep()}>
168
168
  <Text style={commonStyles.actionButtonText}>
169
- {this.props.postingAd.id == null || this.props.fullPosting || this.oldCategory != this.state.transactionOptions.selectedItem || this.oldSubCategory != this.state.typeBienOptions.selectedItem ?
169
+ {this.props.postingAd.id == null || this.props.fullPosting || this.oldTransaction != this.state.transactionOptions.selectedItem || this.oldAdType != this.state.typeBienOptions.selectedItem ?
170
170
  strings('setup.next').toUpperCase()
171
171
  :
172
172
  strings('setup.enregistrer').toUpperCase()}
package/Publish3.js CHANGED
@@ -15,19 +15,19 @@ export default class Publish3 extends React.Component {
15
15
  constructor(props) {
16
16
  super(props);
17
17
 
18
- if (this.props.postingAd.pricePeriod === -1 && this.props.postingAd.subCategoryDetails.filter(function (detail) { return detail.value == "pricePeriod" }).length > 0) {
18
+ if (this.props.postingAd.pricePeriod === -1 && this.props.postingAd.adTypeDetails.filter(function (detail) { return detail.value == "pricePeriod" }).length > 0) {
19
19
  this.props.postingAd.pricePeriod = 'MONTLY';
20
20
  }
21
- const pricePeriod = this.props.postingAd.subCategoryDetails.filter(function (detail) { return detail.value == "pricePeriod" });
21
+ const pricePeriod = this.props.postingAd.adTypeDetails.filter(function (detail) { return detail.value == "pricePeriod" });
22
22
 
23
23
  this.state = {
24
- area: this.props.postingAd.subCategoryDetails.filter(function (detail) { return detail.value == "surface" }),
25
- condition: this.props.postingAd.subCategoryDetails.filter(function (detail) { return detail.value == "conservation" }),
26
- pieces: this.props.postingAd.subCategoryDetails.filter(function (detail) { return detail.value == "pieces" }),
27
- rooms: this.props.postingAd.subCategoryDetails.filter(function (detail) { return detail.value == "rooms" }),
28
- baths: this.props.postingAd.subCategoryDetails.filter(function (detail) { return detail.value == "baths" }),
29
- pax: this.props.postingAd.subCategoryDetails.filter(function (detail) { return detail.value == "pax" }),
30
- minNights: this.props.postingAd.subCategoryDetails.filter(function (detail) { return detail.value == "minNights" }),
24
+ area: this.props.postingAd.adTypeDetails.filter(function (detail) { return detail.value == "surface" }),
25
+ condition: this.props.postingAd.adTypeDetails.filter(function (detail) { return detail.value == "conservation" }),
26
+ pieces: this.props.postingAd.adTypeDetails.filter(function (detail) { return detail.value == "pieces" }),
27
+ rooms: this.props.postingAd.adTypeDetails.filter(function (detail) { return detail.value == "rooms" }),
28
+ baths: this.props.postingAd.adTypeDetails.filter(function (detail) { return detail.value == "baths" }),
29
+ pax: this.props.postingAd.adTypeDetails.filter(function (detail) { return detail.value == "pax" }),
30
+ minNights: this.props.postingAd.adTypeDetails.filter(function (detail) { return detail.value == "minNights" }),
31
31
  pricePeriod: pricePeriod,
32
32
  conditionOptions: {
33
33
  elements: [
@@ -54,7 +54,7 @@ export default class Publish3 extends React.Component {
54
54
  },
55
55
  surface: this.props.postingAd.surface,
56
56
  price: this.props.postingAd.price,
57
- subCategory: this.props.postingAd.subCategory,
57
+ adType: this.props.postingAd.adType,
58
58
  requiredErrorCondition: false,
59
59
  viewLoaded: false
60
60
  };
@@ -88,41 +88,41 @@ export default class Publish3 extends React.Component {
88
88
  this.setState({ minHeight: minHeight })
89
89
  }
90
90
 
91
- if (prevProps.postingAd.subCategory !== this.props.postingAd.subCategory
91
+ if (prevProps.postingAd.adType !== this.props.postingAd.adType
92
92
  || prevProps.postingAd.surface !== this.props.postingAd.surface
93
93
  || prevProps.postingAd.price !== this.props.postingAd.price
94
94
  || prevProps.postingAd.condition !== this.props.postingAd.condition) {
95
95
  this.setState({
96
- subCategory: this.props.postingAd.subCategory,
96
+ adType: this.props.postingAd.adType,
97
97
  surface: this.props.postingAd.surface,
98
98
  price: this.props.postingAd.price,
99
99
  conditionOptions: { ...this.state.conditionOptions, selectedItem: this.props.postingAd.condition },
100
- area: this.props.postingAd.subCategoryDetails.filter(function (detail) { return detail.value == "surface" }),
101
- condition: this.props.postingAd.subCategoryDetails.filter(function (detail) { return detail.value == "conservation" }),
102
- pieces: this.props.postingAd.subCategoryDetails.filter(function (detail) { return detail.value == "pieces" }),
103
- rooms: this.props.postingAd.subCategoryDetails.filter(function (detail) { return detail.value == "rooms" }),
104
- baths: this.props.postingAd.subCategoryDetails.filter(function (detail) { return detail.value == "baths" }),
105
- pax: this.props.postingAd.subCategoryDetails.filter(function (detail) { return detail.value == "pax" }),
106
- minNights: this.props.postingAd.subCategoryDetails.filter(function (detail) { return detail.value == "minNights" }),
107
- pricePeriod: this.props.postingAd.subCategoryDetails.filter(function (detail) { return detail.value == "pricePeriod" })
100
+ area: this.props.postingAd.adTypeDetails.filter(function (detail) { return detail.value == "surface" }),
101
+ condition: this.props.postingAd.adTypeDetails.filter(function (detail) { return detail.value == "conservation" }),
102
+ pieces: this.props.postingAd.adTypeDetails.filter(function (detail) { return detail.value == "pieces" }),
103
+ rooms: this.props.postingAd.adTypeDetails.filter(function (detail) { return detail.value == "rooms" }),
104
+ baths: this.props.postingAd.adTypeDetails.filter(function (detail) { return detail.value == "baths" }),
105
+ pax: this.props.postingAd.adTypeDetails.filter(function (detail) { return detail.value == "pax" }),
106
+ minNights: this.props.postingAd.adTypeDetails.filter(function (detail) { return detail.value == "minNights" }),
107
+ pricePeriod: this.props.postingAd.adTypeDetails.filter(function (detail) { return detail.value == "pricePeriod" })
108
108
  });
109
109
  }
110
110
  }
111
111
 
112
112
  async refreshData() {
113
- if (this.state.subCategory != this.props.postingAd.subCategory) {
114
- const pricePeriod = this.props.postingAd.subCategoryDetails.filter(function (detail) { return detail.value == "pricePeriod" });
113
+ if (this.state.adType != this.props.postingAd.adType) {
114
+ const pricePeriod = this.props.postingAd.adTypeDetails.filter(function (detail) { return detail.value == "pricePeriod" });
115
115
 
116
116
  await this.setState({
117
- area: this.props.postingAd.subCategoryDetails.filter(function (detail) { return detail.value == "surface" }),
118
- condition: this.props.postingAd.subCategoryDetails.filter(function (detail) { return detail.value == "conservation" }),
119
- pieces: this.props.postingAd.subCategoryDetails.filter(function (detail) { return detail.value == "pieces" }),
120
- rooms: this.props.postingAd.subCategoryDetails.filter(function (detail) { return detail.value == "rooms" }),
121
- baths: this.props.postingAd.subCategoryDetails.filter(function (detail) { return detail.value == "baths" }),
122
- pax: this.props.postingAd.subCategoryDetails.filter(function (detail) { return detail.value == "pax" }),
123
- minNights: this.props.postingAd.subCategoryDetails.filter(function (detail) { return detail.value == "minNights" }),
124
- pricePeriod: this.props.postingAd.subCategoryDetails.filter(function (detail) { return detail.value == "pricePeriod" }),
125
- subCategory: this.props.postingAd.subCategory,
117
+ area: this.props.postingAd.adTypeDetails.filter(function (detail) { return detail.value == "surface" }),
118
+ condition: this.props.postingAd.adTypeDetails.filter(function (detail) { return detail.value == "conservation" }),
119
+ pieces: this.props.postingAd.adTypeDetails.filter(function (detail) { return detail.value == "pieces" }),
120
+ rooms: this.props.postingAd.adTypeDetails.filter(function (detail) { return detail.value == "rooms" }),
121
+ baths: this.props.postingAd.adTypeDetails.filter(function (detail) { return detail.value == "baths" }),
122
+ pax: this.props.postingAd.adTypeDetails.filter(function (detail) { return detail.value == "pax" }),
123
+ minNights: this.props.postingAd.adTypeDetails.filter(function (detail) { return detail.value == "minNights" }),
124
+ pricePeriod: this.props.postingAd.adTypeDetails.filter(function (detail) { return detail.value == "pricePeriod" }),
125
+ adType: this.props.postingAd.adType,
126
126
  pricePeriodOptions: {
127
127
  elements: [{ section: true, value: null, label: pricePeriod[0]?.label }, ...this.state.pricePeriodOptions.elements.slice(1)],
128
128
  selectedItem: this.props.postingAd.pricePeriod
@@ -160,7 +160,7 @@ export default class Publish3 extends React.Component {
160
160
  if (this.props.postingAd.id == null || this.props.fullPosting) {
161
161
  this.props.goToPage(Views.PUBLISH_4);
162
162
  } else {
163
- if (this.props.editingStepOne && this.props.postingAd.subCategoryDetails.filter(function (detail) { return detail.value == "floorType" }).length > 0) {
163
+ if (this.props.editingStepOne && this.props.postingAd.adTypeDetails.filter(function (detail) { return detail.value == "floorType" }).length > 0) {
164
164
  this.props.goToPage(Views.PUBLISH_5, true);
165
165
  } else {
166
166
  this.props.saveEditAd();
@@ -385,7 +385,7 @@ export default class Publish3 extends React.Component {
385
385
  <View style={commonStyles.buttomButton}>
386
386
  <TouchableHighlight style={commonStyles.actionButton} underlayColor="#ff5d00" onPress={() => this.nextStep()}>
387
387
  <Text style={commonStyles.actionButtonText}>
388
- {this.props.postingAd.id == null || this.props.fullPosting || (this.props.editingStepOne && this.props.postingAd.subCategoryDetails.filter(function (detail) { return detail.value == "floorType" }).length > 0) ?
388
+ {this.props.postingAd.id == null || this.props.fullPosting || (this.props.editingStepOne && this.props.postingAd.adTypeDetails.filter(function (detail) { return detail.value == "floorType" }).length > 0) ?
389
389
  strings('setup.next').toUpperCase()
390
390
  :
391
391
  strings('setup.enregistrer').toUpperCase()}
package/Publish4.js CHANGED
@@ -14,6 +14,7 @@ export default class Publish4 extends React.Component {
14
14
  super(props);
15
15
 
16
16
  this.state = {
17
+ images: this.props.postingAd.images,
17
18
  popupSelectPhotoVisible: false,
18
19
  showErrorNoSelectedImages: false,
19
20
  allPhotosSelected: false,
@@ -31,12 +32,16 @@ export default class Publish4 extends React.Component {
31
32
  });
32
33
  }
33
34
 
34
- if (prevProps.maxPictures !== this.props.maxPictures || prevProps.postingAd.images.length !== this.props.postingAd.images.length) {
35
+ if (prevProps.maxPictures !== this.props.maxPictures || this.state.images.length !== this.props.postingAd.images.length) {
35
36
  if (this.props.postingAd.images.length == this.props.maxPictures) {
36
37
  this.setState({ allPhotosSelected: true });
37
38
  }
38
39
  }
39
40
 
41
+ if (!prevProps.showView && this.props.showView && !this.isSameList(this.props.postingAd.images, this.state.images)) {
42
+ this.setState({ images: this.props.postingAd.images })
43
+ }
44
+
40
45
  const componentsHeight = this.props.headerHeight + this.props.progressBarHeight;
41
46
  const minHeight = window.height - componentsHeight;
42
47
  if (this.state.minHeight != minHeight) {
@@ -44,53 +49,75 @@ export default class Publish4 extends React.Component {
44
49
  }
45
50
  }
46
51
 
52
+ /*shouldComponentUpdate(nextProps, nextState) {
53
+ return !this.isSameList(this.state.images, nextState.images) || (!this.props.showView && nextProps.showView && !this.state.viewLoaded);
54
+ } */
55
+
56
+ isSameList = (firstList, secondList) => {
57
+ if (firstList.length != secondList.length) {
58
+ return false;
59
+ }
60
+ for (let index = 0; index < firstList.length; ++index) {
61
+ if (firstList[index].id != secondList[index].id || firstList[index].uri != secondList[index].uri) {
62
+ return false;
63
+ }
64
+ }
65
+ return true;
66
+ }
67
+
47
68
  async loadImage(imgUri) {
48
69
  if (imgUri) {
49
70
  let fileType = imgUri.substring(imgUri.lastIndexOf('.') + 1).toLowerCase();
50
71
 
51
72
  const image = {
52
73
  uri: imgUri,
53
- name: 'photo_' + this.props.postingAd.images.length + '.' + fileType,
74
+ name: 'photo_' + this.state.images.length + '.' + fileType,
54
75
  type: 'image/' + fileType,
55
- mainPicture: this.props.postingAd.images.length === 0,
76
+ mainPicture: this.state.images.length === 0,
56
77
  referenceType: 'AD',
57
78
  referenceId: this.props.postingAd.id,
58
- extraInfo: this.props.postingAd.images.length
79
+ extraInfo: this.state.images.length
59
80
  }
60
81
 
61
- let imagesArray = this.props.postingAd.images;
82
+ let imagesArray = this.state.images;
62
83
  imagesArray.push(image);
63
- this.props.postingAd.images = imagesArray;
64
84
 
65
- this.setState({ showErrorNoSelectedImages: false });
85
+ await this.setState({
86
+ showErrorNoSelectedImages: false,
87
+ images: imagesArray
88
+ });
66
89
 
67
- if (this.props.postingAd.images.length == this.props.maxPictures) {
90
+ if (this.state.images.length == this.props.maxPictures) {
68
91
  this.setState({ allPhotosSelected: true });
69
- } else if (this.props.postingAd.images.length == 1) {
70
- this.selectMainPhoto(this.props.postingAd.images[0]);
92
+ } else if (this.state.images.length == 1) {
93
+ this.selectMainPhoto(this.state.images[0]);
71
94
  }
72
95
  }
73
96
  }
74
97
 
75
- async deleteImage(itemDeleted) {
76
- if (itemDeleted.id) {
98
+ async deleteImage(itemId, index) {
99
+ if (itemId) {
77
100
  if (!this.props.postingAd.deletedFiles) {
78
101
  this.props.postingAd.deletedFiles = [];
79
102
  }
80
- this.props.postingAd.deletedFiles.push(itemDeleted.id);
103
+ this.props.postingAd.deletedFiles.push(itemId);
81
104
  }
82
105
 
83
- let filteredArray = this.props.postingAd.images.filter(item => item !== itemDeleted);
106
+ let imagesArray = [...this.state.images];
107
+ imagesArray.splice(index, 1)
108
+
109
+ await this.setState({
110
+ allPhotosSelected: false,
111
+ images: imagesArray
112
+ });
84
113
 
85
- this.props.postingAd.images = filteredArray;
86
- await this.setState({ allPhotosSelected: false });
87
- if (this.props.postingAd.images.length >= 1) {
88
- this.selectMainPhoto(this.props.postingAd.images[0]);
114
+ if (this.state.images.length >= 1) {
115
+ this.selectMainPhoto(this.state.images[0]);
89
116
  }
90
117
  }
91
118
 
92
119
  selectMainPhoto(itemSelected) {
93
- let imagesArray = this.props.postingAd.images.slice();
120
+ let imagesArray = this.state.images.slice();
94
121
 
95
122
  for (let imageObject of imagesArray) {
96
123
  imageObject.mainPicture = false;
@@ -108,17 +135,20 @@ export default class Publish4 extends React.Component {
108
135
  ++index;
109
136
  }
110
137
 
111
- this.props.postingAd.images = imagesArray;
112
- this.setState({ updateMainPhoto: true });
138
+ this.setState({
139
+ updateMainPhoto: true,
140
+ images: imagesArray
141
+ });
113
142
  }
114
143
 
115
144
  nextStep() {
116
- if (this.props.postingAd.images.length == 0) {
145
+ if (this.state.images.length == 0) {
117
146
  this.setState({ showErrorNoSelectedImages: true });
118
147
  } else {
148
+ this.props.postingAd.images = this.state.images;
119
149
  this.setState({ showErrorNoSelectedImages: false });
120
150
  if (this.props.postingAd.id == null || this.props.fullPosting) {
121
- if (this.props.postingAd.subCategoryDetails.filter(function (detail) { return detail.value == "floorType" }).length > 0) {
151
+ if (this.props.postingAd.adTypeDetails.filter(function (detail) { return detail.value == "floorType" }).length > 0) {
122
152
  this.props.goToPage(Views.PUBLISH_5);
123
153
  } else {
124
154
  this.props.goToPage(Views.PUBLISH_6);
@@ -129,6 +159,21 @@ export default class Publish4 extends React.Component {
129
159
  }
130
160
  }
131
161
 
162
+ rerenderImage(index) {
163
+ const images = this.state.images;
164
+ if (images[index].uri.indexOf('?t=') < 0) {
165
+ images[index].uri = images[index].uri + '?t=' + Date.now();
166
+ } else {
167
+ images[index].uri = images[index].uri.substring(0, images[index].uri.indexOf('?t=')) + '?t=' + Date.now();
168
+ }
169
+
170
+ setTimeout(() => {
171
+ this.setState({
172
+ images: images
173
+ });
174
+ }, 500);
175
+ }
176
+
132
177
  render() {
133
178
  return (
134
179
  <View style={this.props.showView ? '' : commonStyles.displayNone}>
@@ -167,12 +212,13 @@ export default class Publish4 extends React.Component {
167
212
  </TouchableOpacity>
168
213
  </TouchableOpacity>
169
214
  }
170
- {this.props.postingAd.images.map((item, index) => {
215
+ {this.state.images.map((item, index) => {
171
216
  return (
172
- <ImageBackground style={[commonStyles.photoBox, commonStyles.photoBoxImage]} source={{ uri: item.uri }} borderRadius={10} key={index}>
217
+ <ImageBackground style={[commonStyles.photoBox, commonStyles.photoBoxImage]} source={{ uri: item.uri }} borderRadius={10} key={index}
218
+ onError={() => this.rerenderImage(index)}>
173
219
  <ImageBackground style={[commonStyles.photoControls, commonStyles.row]} source={require('./assets/images/bg-shadow.png')} resizeMode='stretch' borderRadius={1.5}>
174
220
 
175
- <TouchableHighlight style={commonStyles.leftIcon} onPress={() => this.deleteImage(item)}>
221
+ <TouchableHighlight style={commonStyles.leftIcon} onPress={() => this.deleteImage(item.id, index)}>
176
222
  <FontAwesomeIcon style={commonStyles.whiteIcon} name="cancel-circled" />
177
223
  </TouchableHighlight>
178
224
  <TouchableHighlight style={commonStyles.rightIcon} onPress={() => this.selectMainPhoto(item)}>
package/Publish5.js CHANGED
@@ -4,17 +4,16 @@ import { strings } from 'muba-i18n';
4
4
  import commonStyles from './commonStyles';
5
5
  import InputSelect from 'muba-input-select';
6
6
  import { Views } from './utils/Views';
7
- import { Orientation } from 'expo-screen-orientation';
8
7
  const window = Dimensions.get('window');
9
8
 
10
9
  export default class Publish5 extends React.Component {
11
10
  constructor(props) {
12
11
  super(props);
13
12
 
14
- const age = this.props.postingAd.subCategoryDetails.filter(function (detail) { return detail.value == "age" });
15
- const floorType = this.props.postingAd.subCategoryDetails.filter(function (detail) { return detail.value == "floorType" });
16
- const floorNumber = this.props.postingAd.subCategoryDetails.filter(function (detail) { return detail.value == "floorNumber" });
17
- const orientationType = this.props.postingAd.subCategoryDetails.filter(function (detail) { return detail.value == "orientation" });
13
+ const age = this.props.postingAd.adTypeDetails.filter(function (detail) { return detail.value == "age" });
14
+ const floorType = this.props.postingAd.adTypeDetails.filter(function (detail) { return detail.value == "floorType" });
15
+ const floorNumber = this.props.postingAd.adTypeDetails.filter(function (detail) { return detail.value == "floorNumber" });
16
+ const orientationType = this.props.postingAd.adTypeDetails.filter(function (detail) { return detail.value == "orientation" });
18
17
 
19
18
  this.state = {
20
19
  isLoading: false,
@@ -76,8 +75,8 @@ export default class Publish5 extends React.Component {
76
75
  { label: '20', value: '20' },
77
76
  ],
78
77
  selectedItem: this.props.postingAd.floorNumber,
79
- subCategory: this.props.postingAd.subCategory,
80
- subCategoryDetails: this.props.postingAd.subCategoryDetails,
78
+ adType: this.props.postingAd.adType,
79
+ adTypeDetails: this.props.postingAd.adTypeDetails,
81
80
  viewLoaded: false
82
81
  },
83
82
  orientationOptions: {
@@ -109,19 +108,19 @@ export default class Publish5 extends React.Component {
109
108
  }
110
109
 
111
110
  async refreshData() {
112
- if (this.state.subCategory != this.props.postingAd.subCategory) {
113
- const age = this.props.postingAd.subCategoryDetails.filter(function (detail) { return detail.value == "age" });
114
- const floorType = this.props.postingAd.subCategoryDetails.filter(function (detail) { return detail.value == "floorType" });
115
- const floorNumber = this.props.postingAd.subCategoryDetails.filter(function (detail) { return detail.value == "floorNumber" });
116
- const orientationType = this.props.postingAd.subCategoryDetails.filter(function (detail) { return detail.value == "orientation" });
111
+ if (this.state.adType != this.props.postingAd.adType) {
112
+ const age = this.props.postingAd.adTypeDetails.filter(function (detail) { return detail.value == "age" });
113
+ const floorType = this.props.postingAd.adTypeDetails.filter(function (detail) { return detail.value == "floorType" });
114
+ const floorNumber = this.props.postingAd.adTypeDetails.filter(function (detail) { return detail.value == "floorNumber" });
115
+ const orientationType = this.props.postingAd.adTypeDetails.filter(function (detail) { return detail.value == "orientation" });
117
116
 
118
117
  await this.setState({
119
118
  age: age,
120
119
  floorType: floorType,
121
120
  floorNumber: floorNumber,
122
121
  orientation: orientationType,
123
- subCategory: this.props.postingAd.subCategory,
124
- subCategoryDetails: this.props.postingAd.subCategoryDetails,
122
+ adType: this.props.postingAd.adType,
123
+ adTypeDetails: this.props.postingAd.adTypeDetails,
125
124
  ageOptions: {
126
125
  elements: [{ section: true, value: null, label: age[0]?.label }, ...this.state.ageOptions.elements.slice(1)],
127
126
  selectedItem: this.props.postingAd.age
@@ -260,8 +259,8 @@ export default class Publish5 extends React.Component {
260
259
  <IconFeatures
261
260
  iconSource={require('./assets/images/garden.png')}
262
261
  iconHoverSource={require('./assets/images/garden-hover.png')}
263
- iconText={this.state.subCategoryDetails.filter(function (detail) { return detail.value == "garden" })[0]?.label}
264
- visible={this.state.subCategoryDetails.filter(function (detail) { return detail.value == "garden" }).length > 0}
262
+ iconText={this.state.adTypeDetails.filter(function (detail) { return detail.value == "garden" })[0]?.label}
263
+ visible={this.state.adTypeDetails.filter(function (detail) { return detail.value == "garden" }).length > 0}
265
264
  selected={this.props.postingAd.garden}
266
265
  onPress={(value) => this.props.postingAd.garden = value}
267
266
  ref={(element) => this.inputGarden = element} />
@@ -269,8 +268,8 @@ export default class Publish5 extends React.Component {
269
268
  <IconFeatures
270
269
  iconSource={require('./assets/images/terrace.png')}
271
270
  iconHoverSource={require('./assets/images/terrace-hover.png')}
272
- iconText={this.state.subCategoryDetails.filter(function (detail) { return detail.value == "terrace" })[0]?.label}
273
- visible={this.state.subCategoryDetails.filter(function (detail) { return detail.value == "terrace" }).length > 0}
271
+ iconText={this.state.adTypeDetails.filter(function (detail) { return detail.value == "terrace" })[0]?.label}
272
+ visible={this.state.adTypeDetails.filter(function (detail) { return detail.value == "terrace" }).length > 0}
274
273
  selected={this.props.postingAd.terrace}
275
274
  onPress={(value) => this.props.postingAd.terrace = value}
276
275
  ref={(element) => this.inputTerrace = element} />
@@ -278,8 +277,8 @@ export default class Publish5 extends React.Component {
278
277
  <IconFeatures
279
278
  iconSource={require('./assets/images/garage.png')}
280
279
  iconHoverSource={require('./assets/images/garage-hover.png')}
281
- iconText={this.state.subCategoryDetails.filter(function (detail) { return detail.value == "garage" })[0]?.label}
282
- visible={this.state.subCategoryDetails.filter(function (detail) { return detail.value == "garage" }).length > 0}
280
+ iconText={this.state.adTypeDetails.filter(function (detail) { return detail.value == "garage" })[0]?.label}
281
+ visible={this.state.adTypeDetails.filter(function (detail) { return detail.value == "garage" }).length > 0}
283
282
  selected={this.props.postingAd.garage}
284
283
  onPress={(value) => this.props.postingAd.garage = value}
285
284
  ref={(element) => this.inputGarage = element} />
@@ -287,8 +286,8 @@ export default class Publish5 extends React.Component {
287
286
  <IconFeatures
288
287
  iconSource={require('./assets/images/elevator.png')}
289
288
  iconHoverSource={require('./assets/images/elevator-hover.png')}
290
- iconText={this.state.subCategoryDetails.filter(function (detail) { return detail.value == "elevator" })[0]?.label}
291
- visible={this.state.subCategoryDetails.filter(function (detail) { return detail.value == "elevator" }).length > 0}
289
+ iconText={this.state.adTypeDetails.filter(function (detail) { return detail.value == "elevator" })[0]?.label}
290
+ visible={this.state.adTypeDetails.filter(function (detail) { return detail.value == "elevator" }).length > 0}
292
291
  selected={this.props.postingAd.elevator}
293
292
  onPress={(value) => this.props.postingAd.elevator = value}
294
293
  ref={(element) => this.inputElevator = element} />
@@ -296,8 +295,8 @@ export default class Publish5 extends React.Component {
296
295
  <IconFeatures
297
296
  iconSource={require('./assets/images/sea.png')}
298
297
  iconHoverSource={require('./assets/images/sea-hover.png')}
299
- iconText={this.state.subCategoryDetails.filter(function (detail) { return detail.value == "seaViews" })[0]?.label}
300
- visible={this.state.subCategoryDetails.filter(function (detail) { return detail.value == "seaViews" }).length > 0}
298
+ iconText={this.state.adTypeDetails.filter(function (detail) { return detail.value == "seaViews" })[0]?.label}
299
+ visible={this.state.adTypeDetails.filter(function (detail) { return detail.value == "seaViews" }).length > 0}
301
300
  selected={this.props.postingAd.seaViews}
302
301
  onPress={(value) => this.props.postingAd.seaViews = value}
303
302
  ref={(element) => this.inputSeaViews = element} />
@@ -305,8 +304,8 @@ export default class Publish5 extends React.Component {
305
304
  <IconFeatures
306
305
  iconSource={require('./assets/images/views.png')}
307
306
  iconHoverSource={require('./assets/images/views-hover.png')}
308
- iconText={this.state.subCategoryDetails.filter(function (detail) { return detail.value == "mountainsViews" })[0]?.label}
309
- visible={this.state.subCategoryDetails.filter(function (detail) { return detail.value == "mountainsViews" }).length > 0}
307
+ iconText={this.state.adTypeDetails.filter(function (detail) { return detail.value == "mountainsViews" })[0]?.label}
308
+ visible={this.state.adTypeDetails.filter(function (detail) { return detail.value == "mountainsViews" }).length > 0}
310
309
  selected={this.props.postingAd.mountainsViews}
311
310
  onPress={(value) => this.props.postingAd.mountainsViews = value}
312
311
  ref={(element) => this.inputMountainViews = element} />
@@ -314,8 +313,8 @@ export default class Publish5 extends React.Component {
314
313
  <IconFeatures
315
314
  iconSource={require('./assets/images/pool.png')}
316
315
  iconHoverSource={require('./assets/images/pool-hover.png')}
317
- iconText={this.state.subCategoryDetails.filter(function (detail) { return detail.value == "pool" })[0]?.label}
318
- visible={this.state.subCategoryDetails.filter(function (detail) { return detail.value == "pool" }).length > 0}
316
+ iconText={this.state.adTypeDetails.filter(function (detail) { return detail.value == "pool" })[0]?.label}
317
+ visible={this.state.adTypeDetails.filter(function (detail) { return detail.value == "pool" }).length > 0}
319
318
  selected={this.props.postingAd.pool}
320
319
  onPress={(value) => this.props.postingAd.pool = value}
321
320
  ref={(element) => this.inputPool = element} />
@@ -323,8 +322,8 @@ export default class Publish5 extends React.Component {
323
322
  <IconFeatures
324
323
  iconSource={require('./assets/images/concierge.png')}
325
324
  iconHoverSource={require('./assets/images/concierge-hover.png')}
326
- iconText={this.state.subCategoryDetails.filter(function (detail) { return detail.value == "doorman" })[0]?.label}
327
- visible={this.state.subCategoryDetails.filter(function (detail) { return detail.value == "doorman" }).length > 0}
325
+ iconText={this.state.adTypeDetails.filter(function (detail) { return detail.value == "doorman" })[0]?.label}
326
+ visible={this.state.adTypeDetails.filter(function (detail) { return detail.value == "doorman" }).length > 0}
328
327
  selected={this.props.postingAd.doorman}
329
328
  onPress={(value) => this.props.postingAd.doorman = value}
330
329
  ref={(element) => this.inputConcierge = element} />
@@ -332,8 +331,8 @@ export default class Publish5 extends React.Component {
332
331
  <IconFeatures
333
332
  iconSource={require('./assets/images/storage.png')}
334
333
  iconHoverSource={require('./assets/images/storage-hover.png')}
335
- iconText={this.state.subCategoryDetails.filter(function (detail) { return detail.value == "storageRoom" })[0]?.label}
336
- visible={this.state.subCategoryDetails.filter(function (detail) { return detail.value == "storageRoom" }).length > 0}
334
+ iconText={this.state.adTypeDetails.filter(function (detail) { return detail.value == "storageRoom" })[0]?.label}
335
+ visible={this.state.adTypeDetails.filter(function (detail) { return detail.value == "storageRoom" }).length > 0}
337
336
  selected={this.props.postingAd.storageRoom}
338
337
  onPress={(value) => this.props.postingAd.storageRoom = value}
339
338
  ref={(element) => this.inputStorageRoom = element} />
@@ -341,16 +340,16 @@ export default class Publish5 extends React.Component {
341
340
  <IconFeatures
342
341
  iconSource={require('./assets/images/furnish.png')}
343
342
  iconHoverSource={require('./assets/images/furnish-hover.png')}
344
- iconText={this.state.subCategoryDetails.filter(function (detail) { return detail.value == "furnished" })[0]?.label}
345
- visible={this.state.subCategoryDetails.filter(function (detail) { return detail.value == "furnished" }).length > 0}
343
+ iconText={this.state.adTypeDetails.filter(function (detail) { return detail.value == "furnished" })[0]?.label}
344
+ visible={this.state.adTypeDetails.filter(function (detail) { return detail.value == "furnished" }).length > 0}
346
345
  selected={this.props.postingAd.furnished}
347
346
  onPress={(value) => this.props.postingAd.furnished = value}
348
347
  ref={(element) => this.inputFurnished = element} />
349
348
  <IconFeatures
350
349
  iconSource={require('./assets/images/exteriorFacade.png')}
351
350
  iconHoverSource={require('./assets/images/exteriorFacade-hover.png')}
352
- iconText={this.state.subCategoryDetails.filter(function (detail) { return detail.value == "exteriorFacade" })[0]?.label}
353
- visible={this.state.subCategoryDetails.filter(function (detail) { return detail.value == "exteriorFacade" }).length > 0}
351
+ iconText={this.state.adTypeDetails.filter(function (detail) { return detail.value == "exteriorFacade" })[0]?.label}
352
+ visible={this.state.adTypeDetails.filter(function (detail) { return detail.value == "exteriorFacade" }).length > 0}
354
353
  selected={this.props.postingAd.exteriorFacade}
355
354
  onPress={(value) => this.props.postingAd.exteriorFacade = value}
356
355
  ref={(element) => this.inputExteriorFacade = element} />
@@ -362,8 +361,8 @@ export default class Publish5 extends React.Component {
362
361
  <IconFeatures
363
362
  iconSource={require('./assets/images/moroccan.png')}
364
363
  iconHoverSource={require('./assets/images/moroccan-hover.png')}
365
- iconText={this.state.subCategoryDetails.filter(function (detail) { return detail.value == "moroccanLounge" })[0]?.label}
366
- visible={this.state.subCategoryDetails.filter(function (detail) { return detail.value == "moroccanLounge" }).length > 0}
364
+ iconText={this.state.adTypeDetails.filter(function (detail) { return detail.value == "moroccanLounge" })[0]?.label}
365
+ visible={this.state.adTypeDetails.filter(function (detail) { return detail.value == "moroccanLounge" }).length > 0}
367
366
  selected={this.props.postingAd.moroccanLounge}
368
367
  onPress={(value) => this.props.postingAd.moroccanLounge = value}
369
368
  ref={(element) => this.inputSalonMarocain = element} />
@@ -371,8 +370,8 @@ export default class Publish5 extends React.Component {
371
370
  <IconFeatures
372
371
  iconSource={require('./assets/images/diningroom.png')}
373
372
  iconHoverSource={require('./assets/images/diningroom-hover.png')}
374
- iconText={this.state.subCategoryDetails.filter(function (detail) { return detail.value == "europeanLounge" })[0]?.label}
375
- visible={this.state.subCategoryDetails.filter(function (detail) { return detail.value == "europeanLounge" }).length > 0}
373
+ iconText={this.state.adTypeDetails.filter(function (detail) { return detail.value == "europeanLounge" })[0]?.label}
374
+ visible={this.state.adTypeDetails.filter(function (detail) { return detail.value == "europeanLounge" }).length > 0}
376
375
  selected={this.props.postingAd.europeanLounge}
377
376
  onPress={(value) => this.props.postingAd.europeanLounge = value}
378
377
  ref={(element) => this.inputSalonEuropean = element} />
@@ -380,8 +379,8 @@ export default class Publish5 extends React.Component {
380
379
  <IconFeatures
381
380
  iconSource={require('./assets/images/satellite.png')}
382
381
  iconHoverSource={require('./assets/images/satellite-hover.png')}
383
- iconText={this.state.subCategoryDetails.filter(function (detail) { return detail.value == "satellite" })[0]?.label}
384
- visible={this.state.subCategoryDetails.filter(function (detail) { return detail.value == "satellite" }).length > 0}
382
+ iconText={this.state.adTypeDetails.filter(function (detail) { return detail.value == "satellite" })[0]?.label}
383
+ visible={this.state.adTypeDetails.filter(function (detail) { return detail.value == "satellite" }).length > 0}
385
384
  selected={this.props.postingAd.satellite}
386
385
  onPress={(value) => this.props.postingAd.satellite = value}
387
386
  ref={(element) => this.inputSatellite = element} />
@@ -389,8 +388,8 @@ export default class Publish5 extends React.Component {
389
388
  <IconFeatures
390
389
  iconSource={require('./assets/images/fire.png')}
391
390
  iconHoverSource={require('./assets/images/fire-hover.png')}
392
- iconText={this.state.subCategoryDetails.filter(function (detail) { return detail.value == "fireplace" })[0]?.label}
393
- visible={this.state.subCategoryDetails.filter(function (detail) { return detail.value == "fireplace" }).length > 0}
391
+ iconText={this.state.adTypeDetails.filter(function (detail) { return detail.value == "fireplace" })[0]?.label}
392
+ visible={this.state.adTypeDetails.filter(function (detail) { return detail.value == "fireplace" }).length > 0}
394
393
  selected={this.props.postingAd.fireplace}
395
394
  onPress={(value) => this.props.postingAd.fireplace = value}
396
395
  ref={(element) => this.inputFirePlace = element} />
@@ -398,8 +397,8 @@ export default class Publish5 extends React.Component {
398
397
  <IconFeatures
399
398
  iconSource={require('./assets/images/air.png')}
400
399
  iconHoverSource={require('./assets/images/air-hover.png')}
401
- iconText={this.state.subCategoryDetails.filter(function (detail) { return detail.value == "airConditioning" })[0]?.label}
402
- visible={this.state.subCategoryDetails.filter(function (detail) { return detail.value == "airConditioning" }).length > 0}
400
+ iconText={this.state.adTypeDetails.filter(function (detail) { return detail.value == "airConditioning" })[0]?.label}
401
+ visible={this.state.adTypeDetails.filter(function (detail) { return detail.value == "airConditioning" }).length > 0}
403
402
  selected={this.props.postingAd.airConditioning}
404
403
  onPress={(value) => this.props.postingAd.airConditioning = value}
405
404
  ref={(element) => this.inputAir = element} />
@@ -407,8 +406,8 @@ export default class Publish5 extends React.Component {
407
406
  <IconFeatures
408
407
  iconSource={require('./assets/images/heating.png')}
409
408
  iconHoverSource={require('./assets/images/heating-hover.png')}
410
- iconText={this.state.subCategoryDetails.filter(function (detail) { return detail.value == "heating" })[0]?.label}
411
- visible={this.state.subCategoryDetails.filter(function (detail) { return detail.value == "heating" }).length > 0}
409
+ iconText={this.state.adTypeDetails.filter(function (detail) { return detail.value == "heating" })[0]?.label}
410
+ visible={this.state.adTypeDetails.filter(function (detail) { return detail.value == "heating" }).length > 0}
412
411
  selected={this.props.postingAd.heating}
413
412
  onPress={(value) => this.props.postingAd.heating = value}
414
413
  ref={(element) => this.inputHeating = element} />
@@ -416,8 +415,8 @@ export default class Publish5 extends React.Component {
416
415
  <IconFeatures
417
416
  iconSource={require('./assets/images/security.png')}
418
417
  iconHoverSource={require('./assets/images/security-hover.png')}
419
- iconText={this.state.subCategoryDetails.filter(function (detail) { return detail.value == "security" })[0]?.label}
420
- visible={this.state.subCategoryDetails.filter(function (detail) { return detail.value == "security" }).length > 0}
418
+ iconText={this.state.adTypeDetails.filter(function (detail) { return detail.value == "security" })[0]?.label}
419
+ visible={this.state.adTypeDetails.filter(function (detail) { return detail.value == "security" }).length > 0}
421
420
  selected={this.props.postingAd.security}
422
421
  onPress={(value) => this.props.postingAd.security = value}
423
422
  ref={(element) => this.inputSecurity = element} />
@@ -425,8 +424,8 @@ export default class Publish5 extends React.Component {
425
424
  <IconFeatures
426
425
  iconSource={require('./assets/images/glazing.png')}
427
426
  iconHoverSource={require('./assets/images/glazing-hover.png')}
428
- iconText={this.state.subCategoryDetails.filter(function (detail) { return detail.value == "doubleGlazing" })[0]?.label}
429
- visible={this.state.subCategoryDetails.filter(function (detail) { return detail.value == "doubleGlazing" }).length > 0}
427
+ iconText={this.state.adTypeDetails.filter(function (detail) { return detail.value == "doubleGlazing" })[0]?.label}
428
+ visible={this.state.adTypeDetails.filter(function (detail) { return detail.value == "doubleGlazing" }).length > 0}
430
429
  selected={this.props.postingAd.doubleGlazing}
431
430
  onPress={(value) => this.props.postingAd.doubleGlazing = value}
432
431
  ref={(element) => this.inputDoubleGlazing = element} />
@@ -434,8 +433,8 @@ export default class Publish5 extends React.Component {
434
433
  <IconFeatures
435
434
  iconSource={require('./assets/images/door.png')}
436
435
  iconHoverSource={require('./assets/images/door-hover.png')}
437
- iconText={this.state.subCategoryDetails.filter(function (detail) { return detail.value == "reinforcedDoor" })[0]?.label}
438
- visible={this.state.subCategoryDetails.filter(function (detail) { return detail.value == "reinforcedDoor" }).length > 0}
436
+ iconText={this.state.adTypeDetails.filter(function (detail) { return detail.value == "reinforcedDoor" })[0]?.label}
437
+ visible={this.state.adTypeDetails.filter(function (detail) { return detail.value == "reinforcedDoor" }).length > 0}
439
438
  selected={this.props.postingAd.reinforcedDoor}
440
439
  onPress={(value) => this.props.postingAd.reinforcedDoor = value}
441
440
  ref={(element) => this.inputReinforcedDoor = element} />
@@ -447,8 +446,8 @@ export default class Publish5 extends React.Component {
447
446
  <IconFeatures
448
447
  iconSource={require('./assets/images/kitchen.png')}
449
448
  iconHoverSource={require('./assets/images/kitchen-hover.png')}
450
- iconText={this.state.subCategoryDetails.filter(function (detail) { return detail.value == "fullKitchen" })[0]?.label}
451
- visible={this.state.subCategoryDetails.filter(function (detail) { return detail.value == "fullKitchen" }).length > 0}
449
+ iconText={this.state.adTypeDetails.filter(function (detail) { return detail.value == "fullKitchen" })[0]?.label}
450
+ visible={this.state.adTypeDetails.filter(function (detail) { return detail.value == "fullKitchen" }).length > 0}
452
451
  selected={this.props.postingAd.fullKitchen}
453
452
  onPress={(value) => this.props.postingAd.fullKitchen = value}
454
453
  ref={(element) => this.inputFullKitchen = element} />
@@ -456,8 +455,8 @@ export default class Publish5 extends React.Component {
456
455
  <IconFeatures
457
456
  iconSource={require('./assets/images/fridge.png')}
458
457
  iconHoverSource={require('./assets/images/fridge-hover.png')}
459
- iconText={this.state.subCategoryDetails.filter(function (detail) { return detail.value == "fridge" })[0]?.label}
460
- visible={this.state.subCategoryDetails.filter(function (detail) { return detail.value == "fridge" }).length > 0}
458
+ iconText={this.state.adTypeDetails.filter(function (detail) { return detail.value == "fridge" })[0]?.label}
459
+ visible={this.state.adTypeDetails.filter(function (detail) { return detail.value == "fridge" }).length > 0}
461
460
  selected={this.props.postingAd.fridge}
462
461
  onPress={(value) => this.props.postingAd.fridge = value}
463
462
  ref={(element) => this.inputFridge = element} />
@@ -465,8 +464,8 @@ export default class Publish5 extends React.Component {
465
464
  <IconFeatures
466
465
  iconSource={require('./assets/images/oven.png')}
467
466
  iconHoverSource={require('./assets/images/oven-hover.png')}
468
- iconText={this.state.subCategoryDetails.filter(function (detail) { return detail.value == "oven" })[0]?.label}
469
- visible={this.state.subCategoryDetails.filter(function (detail) { return detail.value == "oven" }).length > 0}
467
+ iconText={this.state.adTypeDetails.filter(function (detail) { return detail.value == "oven" })[0]?.label}
468
+ visible={this.state.adTypeDetails.filter(function (detail) { return detail.value == "oven" }).length > 0}
470
469
  selected={this.props.postingAd.oven}
471
470
  onPress={(value) => this.props.postingAd.oven = value}
472
471
  ref={(element) => this.inputOven = element} />
@@ -474,8 +473,8 @@ export default class Publish5 extends React.Component {
474
473
  <IconFeatures
475
474
  iconSource={require('./assets/images/tv.png')}
476
475
  iconHoverSource={require('./assets/images/tv-hover.png')}
477
- iconText={this.state.subCategoryDetails.filter(function (detail) { return detail.value == "tv" })[0]?.label}
478
- visible={this.state.subCategoryDetails.filter(function (detail) { return detail.value == "tv" }).length > 0}
476
+ iconText={this.state.adTypeDetails.filter(function (detail) { return detail.value == "tv" })[0]?.label}
477
+ visible={this.state.adTypeDetails.filter(function (detail) { return detail.value == "tv" }).length > 0}
479
478
  selected={this.props.postingAd.tv}
480
479
  onPress={(value) => this.props.postingAd.tv = value}
481
480
  ref={(element) => this.inputTv = element} />
@@ -483,8 +482,8 @@ export default class Publish5 extends React.Component {
483
482
  <IconFeatures
484
483
  iconSource={require('./assets/images/washing.png')}
485
484
  iconHoverSource={require('./assets/images/washing-hover.png')}
486
- iconText={this.state.subCategoryDetails.filter(function (detail) { return detail.value == "washer" })[0]?.label}
487
- visible={this.state.subCategoryDetails.filter(function (detail) { return detail.value == "washer" }).length > 0}
485
+ iconText={this.state.adTypeDetails.filter(function (detail) { return detail.value == "washer" })[0]?.label}
486
+ visible={this.state.adTypeDetails.filter(function (detail) { return detail.value == "washer" }).length > 0}
488
487
  selected={this.props.postingAd.washer}
489
488
  onPress={(value) => this.props.postingAd.washer = value}
490
489
  ref={(element) => this.inputWashing = element} />
@@ -492,8 +491,8 @@ export default class Publish5 extends React.Component {
492
491
  <IconFeatures
493
492
  iconSource={require('./assets/images/microwave.png')}
494
493
  iconHoverSource={require('./assets/images/microwave-hover.png')}
495
- iconText={this.state.subCategoryDetails.filter(function (detail) { return detail.value == "microwave" })[0]?.label}
496
- visible={this.state.subCategoryDetails.filter(function (detail) { return detail.value == "microwave" }).length > 0}
494
+ iconText={this.state.adTypeDetails.filter(function (detail) { return detail.value == "microwave" })[0]?.label}
495
+ visible={this.state.adTypeDetails.filter(function (detail) { return detail.value == "microwave" }).length > 0}
497
496
  selected={this.props.postingAd.microwave}
498
497
  onPress={(value) => this.props.postingAd.microwave = value}
499
498
  ref={(element) => this.inputMicrowaves = element} />
@@ -501,8 +500,8 @@ export default class Publish5 extends React.Component {
501
500
  <IconFeatures
502
501
  iconSource={require('./assets/images/internet.png')}
503
502
  iconHoverSource={require('./assets/images/internet-hover.png')}
504
- iconText={this.state.subCategoryDetails.filter(function (detail) { return detail.value == "internet" })[0]?.label}
505
- visible={this.state.subCategoryDetails.filter(function (detail) { return detail.value == "internet" }).length > 0}
503
+ iconText={this.state.adTypeDetails.filter(function (detail) { return detail.value == "internet" })[0]?.label}
504
+ visible={this.state.adTypeDetails.filter(function (detail) { return detail.value == "internet" }).length > 0}
506
505
  selected={this.props.postingAd.internet}
507
506
  onPress={(value) => this.props.postingAd.internet = value}
508
507
  ref={(element) => this.inputInternet = element} />
@@ -511,8 +510,8 @@ export default class Publish5 extends React.Component {
511
510
  <IconFeatures
512
511
  iconSource={require('./assets/images/animals.png')}
513
512
  iconHoverSource={require('./assets/images/animals-hover.png')}
514
- iconText={this.state.subCategoryDetails.filter(function (detail) { return detail.value == "animals" })[0]?.label}
515
- visible={this.state.subCategoryDetails.filter(function (detail) { return detail.value == "animals" }).length > 0}
513
+ iconText={this.state.adTypeDetails.filter(function (detail) { return detail.value == "animals" })[0]?.label}
514
+ visible={this.state.adTypeDetails.filter(function (detail) { return detail.value == "animals" }).length > 0}
516
515
  selected={this.props.postingAd.animals}
517
516
  onPress={(value) => this.props.postingAd.animals = value}
518
517
  ref={(element) => this.inputAnimals = element} />
package/Publish6.js CHANGED
@@ -76,7 +76,7 @@ export default class Publish6 extends React.Component {
76
76
  this.props.showLoading();
77
77
  const ad = { ...this.props.postingAd };
78
78
  delete ad.images;
79
- delete ad.subCategoryDetails;
79
+ delete ad.adTypeDetails;
80
80
  delete ad.languages;
81
81
  const responseJson = await this.props.request(this.props.context, GENERATE_TITLE_DESCRIPTION, ad);
82
82
 
package/locales/ar.json CHANGED
@@ -125,7 +125,7 @@
125
125
  },
126
126
  "edit": {
127
127
  "whatEditing": "ما الذي تريدون نشره؟",
128
- "category": "نوع العقار",
128
+ "transaction": "نوع العقار",
129
129
  "location": "تأجير",
130
130
  "caracteristiques": "خاصيات",
131
131
  "photos": "صور",
package/locales/en.json CHANGED
@@ -125,7 +125,7 @@
125
125
  },
126
126
  "edit": {
127
127
  "whatEditing": "What do you want to edit?",
128
- "category": "Property type",
128
+ "transaction": "Property type",
129
129
  "location": "Location",
130
130
  "caracteristiques": "Characteristics",
131
131
  "photos": "Photos",
package/locales/es.json CHANGED
@@ -125,7 +125,7 @@
125
125
  },
126
126
  "edit": {
127
127
  "whatEditing": "¿Qué deseas editar?",
128
- "category": "Tipo de propiedad",
128
+ "transaction": "Tipo de propiedad",
129
129
  "location": "Localización",
130
130
  "caracteristiques": "Datos generales",
131
131
  "photos": "Fotos",
package/locales/fr.json CHANGED
@@ -125,7 +125,7 @@
125
125
  },
126
126
  "edit": {
127
127
  "whatEditing": "Que voulez-vous modifier?",
128
- "category": "Type de bien",
128
+ "transaction": "Type de bien",
129
129
  "location": "Localisation",
130
130
  "caracteristiques": "Caractéristiques",
131
131
  "photos": "Images",
package/locales/it.json CHANGED
@@ -125,7 +125,7 @@
125
125
  },
126
126
  "edit": {
127
127
  "whatEditing": "Cosa vuoi modificare?",
128
- "category": "Tipo di proprietà",
128
+ "transaction": "Tipo di proprietà",
129
129
  "location": "Posizione",
130
130
  "caracteristiques": "Caratteristiche",
131
131
  "photos": "Foto",
package/locales/nl.json CHANGED
@@ -125,7 +125,7 @@
125
125
  },
126
126
  "edit": {
127
127
  "whatEditing": "Wat wilt u bewerken?",
128
- "category": "Vastgoedtype",
128
+ "transaction": "Vastgoedtype",
129
129
  "location": "Locatie",
130
130
  "caracteristiques": "Kenmerken",
131
131
  "photos": "Foto's",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "muba-posting",
3
- "version": "4.1.16",
3
+ "version": "4.1.19",
4
4
  "description": "Posting",
5
5
  "main": "Posting.js",
6
6
  "scripts": {