muba-posting 7.0.4 → 7.0.6
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 +23 -2
- package/PostingEdit.js +3 -3
- package/Preview.js +2 -2
- package/Publish1.js +38 -16
- package/Publish2.js +13 -7
- package/Publish2b.js +21 -16
- package/Publish3.js +57 -25
- package/Publish4.js +1 -0
- package/Publish5.js +34 -1
- package/Publish6.js +6 -1
- package/locales/ar.json +4 -2
- package/locales/en.json +4 -2
- package/locales/es.json +4 -2
- package/locales/fr.json +4 -2
- package/locales/it.json +4 -2
- package/locales/nl.json +4 -2
- package/package.json +1 -1
- package/shared/InputNumber.js +2 -2
package/Posting.js
CHANGED
|
@@ -35,6 +35,7 @@ const COUNTRY_PHONE = { method: 'GET', url: '/controller/countries/{countryCode}
|
|
|
35
35
|
const LOAD_PENDING_CREATED = { method: 'GET', url: '/controller/ads/pending-created/posting' };
|
|
36
36
|
const PAYMENT_ONLINE_ACTIVE = { method: 'GET', url: '/controller/payments-online/{countryCode}/active' };
|
|
37
37
|
const LOAD_LOCATIONS = { method: 'GET', url: '/controller/countries/{countryCode}/locations' };
|
|
38
|
+
const ALLOWED_TO_MODIFY = { method: 'GET', url: '/controller/posting/allowed-to-modify' };
|
|
38
39
|
const UPLOADED_FILES_KEY = 'uploadedFiles';
|
|
39
40
|
|
|
40
41
|
export default class Posting extends React.Component {
|
|
@@ -67,6 +68,7 @@ export default class Posting extends React.Component {
|
|
|
67
68
|
locationList: [],
|
|
68
69
|
showRatePopup: false,
|
|
69
70
|
originalAd: null,
|
|
71
|
+
allowedToModify: {},
|
|
70
72
|
postingAd: {
|
|
71
73
|
transaction: null,
|
|
72
74
|
adType: null,
|
|
@@ -237,6 +239,7 @@ export default class Posting extends React.Component {
|
|
|
237
239
|
}
|
|
238
240
|
}
|
|
239
241
|
}
|
|
242
|
+
this.getAllowedToModifyFields();
|
|
240
243
|
|
|
241
244
|
this._hideLoading()
|
|
242
245
|
BackHandler.addEventListener('hardwareBackPress', this.goBack);
|
|
@@ -289,6 +292,16 @@ export default class Posting extends React.Component {
|
|
|
289
292
|
}
|
|
290
293
|
}
|
|
291
294
|
|
|
295
|
+
async getAllowedToModifyFields() {
|
|
296
|
+
const responseJson = await this.props.request(this.props.context, ALLOWED_TO_MODIFY, { adId: this.state.postingAd.id });
|
|
297
|
+
if (responseJson.httpStatus === 200) {
|
|
298
|
+
delete responseJson.httpStatus
|
|
299
|
+
this.setState({
|
|
300
|
+
allowedToModify: { ...responseJson }
|
|
301
|
+
})
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
|
|
292
305
|
async loadAd() {
|
|
293
306
|
const bddAd = await this.getAd(this.state.adId);
|
|
294
307
|
delete bddAd.phones;
|
|
@@ -456,8 +469,8 @@ export default class Posting extends React.Component {
|
|
|
456
469
|
}
|
|
457
470
|
|
|
458
471
|
async checkPaymentOnline() {
|
|
459
|
-
const paymentOnlineActive = await this.props.request(this.props.context, PAYMENT_ONLINE_ACTIVE, { regionId: this.state.postingAd.region });
|
|
460
|
-
if (
|
|
472
|
+
const paymentOnlineActive = await this.props.request(this.props.context, PAYMENT_ONLINE_ACTIVE, { regionId: this.state.postingAd.region, adId: this.state.postingAd.id });
|
|
473
|
+
if (paymentOnlineActive.value === 'true') {
|
|
461
474
|
this._goToPage(Views.PAYMENT_ONLINE);
|
|
462
475
|
}
|
|
463
476
|
}
|
|
@@ -525,6 +538,7 @@ export default class Posting extends React.Component {
|
|
|
525
538
|
saveEditAd={() => this._saveEditAd()}
|
|
526
539
|
realEstateDeveloper={this.state.realEstateDeveloper}
|
|
527
540
|
businessId={this.state.businessId}
|
|
541
|
+
allowedToModify={this.state.allowedToModify}
|
|
528
542
|
showNoPromotions={() => this.popupNoPromotions.show()} />
|
|
529
543
|
:
|
|
530
544
|
null
|
|
@@ -543,6 +557,7 @@ export default class Posting extends React.Component {
|
|
|
543
557
|
hideLoading={() => this._hideLoading()}
|
|
544
558
|
hereApiKey={this.props.hereApiKey}
|
|
545
559
|
fullPosting={this.state.fullPosting}
|
|
560
|
+
allowedToModify={this.state.allowedToModify}
|
|
546
561
|
businessId={this.state.businessId} />
|
|
547
562
|
:
|
|
548
563
|
null
|
|
@@ -561,6 +576,7 @@ export default class Posting extends React.Component {
|
|
|
561
576
|
loadLocations={this.loadLocations}
|
|
562
577
|
fullPosting={this.state.fullPosting}
|
|
563
578
|
businessId={this.state.businessId}
|
|
579
|
+
allowedToModify={this.state.allowedToModify}
|
|
564
580
|
locationList={this.state.locationList} />
|
|
565
581
|
:
|
|
566
582
|
null
|
|
@@ -577,6 +593,7 @@ export default class Posting extends React.Component {
|
|
|
577
593
|
context={this.props.context}
|
|
578
594
|
showLoading={() => this._showLoading()}
|
|
579
595
|
hideLoading={() => this._hideLoading()}
|
|
596
|
+
allowedToModify={this.state.allowedToModify}
|
|
580
597
|
fullPosting={this.state.fullPosting} />
|
|
581
598
|
:
|
|
582
599
|
null
|
|
@@ -592,6 +609,7 @@ export default class Posting extends React.Component {
|
|
|
592
609
|
showLoading={() => this._showLoading()}
|
|
593
610
|
hideLoading={() => this._hideLoading()}
|
|
594
611
|
fullPosting={this.state.fullPosting}
|
|
612
|
+
allowedToModify={this.state.allowedToModify}
|
|
595
613
|
maxPictures={this.state.maxPictures} />
|
|
596
614
|
:
|
|
597
615
|
null
|
|
@@ -607,6 +625,7 @@ export default class Posting extends React.Component {
|
|
|
607
625
|
context={this.props.context}
|
|
608
626
|
showLoading={() => this._showLoading()}
|
|
609
627
|
hideLoading={() => this._hideLoading()}
|
|
628
|
+
allowedToModify={this.state.allowedToModify}
|
|
610
629
|
fullPosting={this.state.fullPosting} />
|
|
611
630
|
:
|
|
612
631
|
null
|
|
@@ -623,6 +642,7 @@ export default class Posting extends React.Component {
|
|
|
623
642
|
context={this.props.context}
|
|
624
643
|
showLoading={() => this._showLoading()}
|
|
625
644
|
hideLoading={() => this._hideLoading()}
|
|
645
|
+
allowedToModify={this.state.allowedToModify}
|
|
626
646
|
fullPosting={this.state.fullPosting} />
|
|
627
647
|
:
|
|
628
648
|
null
|
|
@@ -660,6 +680,7 @@ export default class Posting extends React.Component {
|
|
|
660
680
|
showTopBar={() => this.props.showTopBar()}
|
|
661
681
|
hideTopBar={() => this.props.hideTopBar()}
|
|
662
682
|
close={this.goBack}
|
|
683
|
+
showFree={true}
|
|
663
684
|
goBack={() => this.goBack()} />
|
|
664
685
|
:
|
|
665
686
|
null
|
package/PostingEdit.js
CHANGED
|
@@ -57,15 +57,15 @@ export default class PostingEdit extends React.Component {
|
|
|
57
57
|
</View>
|
|
58
58
|
<Text style={commonStyles.editIconText}>{strings('edit.transaction')}</Text>
|
|
59
59
|
</TouchableOpacity>
|
|
60
|
-
{this.props.postingAd.promotionId ?
|
|
60
|
+
{this.props.postingAd.promotionId ?
|
|
61
61
|
null
|
|
62
|
-
|
|
62
|
+
:
|
|
63
63
|
<TouchableOpacity style={[commonStyles.col, commonStyles.col4, commonStyles.homeLinkBox]} activeOpacity={0.5} onPress={() => this.navigateToPublish2()}>
|
|
64
64
|
<View style={commonStyles.homeIcon} >
|
|
65
65
|
<Image source={require('./assets/images/location.png')} style={commonStyles.homeIconImage} />
|
|
66
66
|
</View>
|
|
67
67
|
<Text style={commonStyles.editIconText}>{strings('edit.location')}</Text>
|
|
68
|
-
</TouchableOpacity>
|
|
68
|
+
</TouchableOpacity>
|
|
69
69
|
}
|
|
70
70
|
<TouchableOpacity style={[commonStyles.col, commonStyles.col4, commonStyles.homeLinkBox]} activeOpacity={0.5} onPress={() => this.props.goToPage(Views.PUBLISH_3)}>
|
|
71
71
|
<View style={commonStyles.homeIcon} >
|
package/Preview.js
CHANGED
|
@@ -91,7 +91,7 @@ export default class Preview extends React.Component {
|
|
|
91
91
|
</View>
|
|
92
92
|
: null}
|
|
93
93
|
|
|
94
|
-
{this.props.businessId ?
|
|
94
|
+
{this.props.businessId && !this.state.showPaymentOnline ?
|
|
95
95
|
<View style={commonStyles.promoBox}>
|
|
96
96
|
<View style={commonStyles.row}>
|
|
97
97
|
<View style={this.state.superPremiumActive ? [commonStyles.col, commonStyles.col6, commonStyles.promoColPremium, commonStyles.disabled] : [commonStyles.col, commonStyles.col6, commonStyles.promoColPremium]}>
|
|
@@ -181,7 +181,7 @@ export default class Preview extends React.Component {
|
|
|
181
181
|
</View>
|
|
182
182
|
</View>
|
|
183
183
|
}
|
|
184
|
-
{
|
|
184
|
+
{this.state.showPaymentOnline ?
|
|
185
185
|
<View style={commonStyles.previewHighlightContainer}>
|
|
186
186
|
<TouchableOpacity style={[commonStyles.previewHighlightButton, commonStyles.alignCenter]} activeOpacity={0.5} onPress={() => this.props.highlight()}>
|
|
187
187
|
<Image style={commonStyles.previewHighlightImage} source={require('./assets/images/sparks.png')} />
|
package/Publish1.js
CHANGED
|
@@ -4,9 +4,14 @@ import { strings } from 'muba-i18n';
|
|
|
4
4
|
import commonStyles from './commonStyles';
|
|
5
5
|
import RadioButtonGroup from 'muba-radio-button-group';
|
|
6
6
|
import { Views } from './utils/Views';
|
|
7
|
+
import PopupAdvice from 'muba-popup-advice';
|
|
8
|
+
import { createIconSetFromFontello } from 'react-native-vector-icons';
|
|
9
|
+
import fontelloConfig from './fonts/config.json';
|
|
10
|
+
const FontAwesomeIcon = createIconSetFromFontello(fontelloConfig);
|
|
7
11
|
|
|
8
12
|
const PROMOTION_LOCATION = { method: 'GET', url: '/controller/businesses/{businessId}/promotion-location' };
|
|
9
13
|
const GET_TRANSACTIONS = { method: 'GET', url: '/controller/transactions' };
|
|
14
|
+
const GET_CHECK_TRANSACTION = { method: 'GET', url: '/controller/posting/check-transaction' };
|
|
10
15
|
|
|
11
16
|
export default class Publish1 extends React.Component {
|
|
12
17
|
constructor(props) {
|
|
@@ -106,25 +111,35 @@ export default class Publish1 extends React.Component {
|
|
|
106
111
|
|
|
107
112
|
async nextStep() {
|
|
108
113
|
if (this.validateForm()) {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
114
|
+
const responseCheckTransaction = await this.props.request(this.props.context, GET_CHECK_TRANSACTION, {
|
|
115
|
+
adId: this.props.postingAd.id,
|
|
116
|
+
businessId: this.props.businessId,
|
|
117
|
+
transactionId: this.props.postingAd.transaction
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
if (responseCheckTransaction.value === 'true') {
|
|
121
|
+
for (var i = 0; i < this.state.typeBienOptions.elements.length; i++) {
|
|
122
|
+
if (this.state.typeBienOptions.elements[i].value == this.state.typeBienOptions.selectedItem) {
|
|
123
|
+
this.props.postingAd.adTypeDetails = this.state.typeBienOptions.elements[i].subList;
|
|
124
|
+
break;
|
|
125
|
+
}
|
|
113
126
|
}
|
|
114
|
-
}
|
|
115
127
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
128
|
+
if (this.props.postingAd.id == null || this.props.fullPosting) {
|
|
129
|
+
if (this.props.postingAd.exactlyLocated && this.props.postingAd.promotionId == null) {
|
|
130
|
+
this.props.goToPage(Views.PUBLISH_2);
|
|
131
|
+
} else {
|
|
132
|
+
this.props.goToPage(Views.PUBLISH_2_B);
|
|
133
|
+
}
|
|
119
134
|
} else {
|
|
120
|
-
this.
|
|
135
|
+
if (this.oldTransaction != this.state.transactionOptions.selectedItem || this.oldAdType != this.state.typeBienOptions.selectedItem) {
|
|
136
|
+
this.props.goToPage(Views.PUBLISH_3, true);
|
|
137
|
+
} else {
|
|
138
|
+
this.props.saveEditAd();
|
|
139
|
+
}
|
|
121
140
|
}
|
|
122
141
|
} else {
|
|
123
|
-
|
|
124
|
-
this.props.goToPage(Views.PUBLISH_3, true);
|
|
125
|
-
} else {
|
|
126
|
-
this.props.saveEditAd();
|
|
127
|
-
}
|
|
142
|
+
this.popupNoTransaction.show();
|
|
128
143
|
}
|
|
129
144
|
}
|
|
130
145
|
}
|
|
@@ -148,7 +163,8 @@ export default class Publish1 extends React.Component {
|
|
|
148
163
|
titleStyle={commonStyles.progressbarField}
|
|
149
164
|
radioButtonStyle={commonStyles.radioButton}
|
|
150
165
|
options={this.state.transactionOptions}
|
|
151
|
-
onClick={(value) => this.changeTransaction(value)}
|
|
166
|
+
onClick={(value) => this.changeTransaction(value)}
|
|
167
|
+
disabled={!this.props.allowedToModify.transaction} />
|
|
152
168
|
|
|
153
169
|
<RadioButtonGroup
|
|
154
170
|
style={commonStyles.progressbarFieldContainer}
|
|
@@ -159,7 +175,8 @@ export default class Publish1 extends React.Component {
|
|
|
159
175
|
radioButtonStyle={commonStyles.radioButton}
|
|
160
176
|
options={this.state.typeBienOptions}
|
|
161
177
|
onClick={(value) => this.changeAdType(value)}
|
|
162
|
-
ref={(element) => this.radioButtonAdType = element}
|
|
178
|
+
ref={(element) => this.radioButtonAdType = element}
|
|
179
|
+
disabled={!this.props.allowedToModify.adType} />
|
|
163
180
|
</View>
|
|
164
181
|
</View>
|
|
165
182
|
<View style={commonStyles.buttomButton}>
|
|
@@ -172,6 +189,11 @@ export default class Publish1 extends React.Component {
|
|
|
172
189
|
</Text>
|
|
173
190
|
</TouchableHighlight>
|
|
174
191
|
</View>
|
|
192
|
+
|
|
193
|
+
<PopupAdvice dialogStyle={commonStyles.popupBox} ref={popupNoTransaction => this.popupNoTransaction = popupNoTransaction}
|
|
194
|
+
title={strings('setup.cantPostTransaction')} icon={<FontAwesomeIcon name='block' />}>
|
|
195
|
+
<Text style={commonStyles.popupText}></Text>
|
|
196
|
+
</PopupAdvice>
|
|
175
197
|
</View>
|
|
176
198
|
);
|
|
177
199
|
}
|
package/Publish2.js
CHANGED
|
@@ -22,7 +22,8 @@ export default class Publish2 extends React.Component {
|
|
|
22
22
|
latitude: props.postingAd.latitude,
|
|
23
23
|
longitude: props.postingAd.longitude,
|
|
24
24
|
zoom: props.postingAd.latitude != null && props.postingAd.longitude != null ? 15 : 9,
|
|
25
|
-
mapHeight: window.height - 276
|
|
25
|
+
mapHeight: window.height - 276,
|
|
26
|
+
errorCity: true
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
29
|
|
|
@@ -35,17 +36,22 @@ export default class Publish2 extends React.Component {
|
|
|
35
36
|
async nextStep() {
|
|
36
37
|
if ((this.props.postingAd.exactlyLocated && !this.state.movedMapPointer) || await this.validateLocation()) {
|
|
37
38
|
const responseCheckZone = await this.props.request(this.props.context, GET_CHECK_ZONE, {
|
|
39
|
+
adId: this.props.postingAd.id,
|
|
38
40
|
businessId: this.props.businessId,
|
|
39
|
-
cityId: this.props.postingAd.city
|
|
41
|
+
cityId: this.props.postingAd.city,
|
|
42
|
+
townId: this.props.postingAd.town
|
|
40
43
|
});
|
|
41
44
|
|
|
42
|
-
if (responseCheckZone.
|
|
45
|
+
if (responseCheckZone.correctCity && responseCheckZone.correctTown) {
|
|
43
46
|
if (this.props.postingAd.id == null || this.props.fullPosting) {
|
|
44
47
|
this.props.goToPage(Views.PUBLISH_3);
|
|
45
48
|
} else {
|
|
46
49
|
this.props.saveEditAd()
|
|
47
50
|
}
|
|
48
51
|
} else {
|
|
52
|
+
this.setState({
|
|
53
|
+
errorCity: !responseCheckZone.correctCity
|
|
54
|
+
})
|
|
49
55
|
this.popupNoZone.show();
|
|
50
56
|
}
|
|
51
57
|
} else {
|
|
@@ -117,7 +123,7 @@ export default class Publish2 extends React.Component {
|
|
|
117
123
|
containerStyle={{ height: this.state.mapHeight }}
|
|
118
124
|
showPopupPermissions={true}
|
|
119
125
|
location={{ latitude: this.state.latitude, longitude: this.state.longitude, zoom: this.state.zoom }}
|
|
120
|
-
editLocation={
|
|
126
|
+
editLocation={this.props.allowedToModify.location}
|
|
121
127
|
approximated={true}
|
|
122
128
|
showLoading={false}
|
|
123
129
|
ref={(element) => this.map = element}
|
|
@@ -134,12 +140,12 @@ export default class Publish2 extends React.Component {
|
|
|
134
140
|
<Text style={[commonStyles.carteNote, commonStyles.carteNoteMap]}>{strings('setup.notUseMap')}</Text>
|
|
135
141
|
</TouchableHighlight>
|
|
136
142
|
</View>
|
|
137
|
-
<PopupAdvice dialogStyle={commonStyles.popupBox} ref={
|
|
143
|
+
<PopupAdvice dialogStyle={commonStyles.popupBox} ref={popupShowAdvice => this.popupNoLocation = popupShowAdvice}
|
|
138
144
|
onClose={() => this.props.replacePage(Views.PUBLISH_2_B)} title={strings('setup.titleLocationNotFound')} onSubmit={() => { this.props.replacePage(Views.PUBLISH_2_B); return true; }} icon={<FontAwesomeIcon name='block' />}>
|
|
139
145
|
<Text style={commonStyles.popupText}>{strings('setup.locationNotFound')}</Text>
|
|
140
146
|
</PopupAdvice>
|
|
141
|
-
<PopupAdvice dialogStyle={commonStyles.popupBox} ref={
|
|
142
|
-
title={strings('setup.
|
|
147
|
+
<PopupAdvice dialogStyle={commonStyles.popupBox} ref={popupNoZone => this.popupNoZone = popupNoZone}
|
|
148
|
+
title={this.state.errorCity ? strings('setup.adCantPostCity') : strings('setup.adCantPostTown')} icon={<FontAwesomeIcon name='block' />}>
|
|
143
149
|
<Text style={commonStyles.popupText}></Text>
|
|
144
150
|
</PopupAdvice>
|
|
145
151
|
</View>
|
package/Publish2b.js
CHANGED
|
@@ -11,7 +11,6 @@ import fontelloConfig from './fonts/config.json';
|
|
|
11
11
|
const FontAwesomeIcon = createIconSetFromFontello(fontelloConfig);
|
|
12
12
|
|
|
13
13
|
const GET_CHECK_ZONE = { method: 'GET', url: '/controller/posting/check-zone' };
|
|
14
|
-
const LOAD_LOCATIONS = { method: 'GET', url: '/controller/countries/{countryCode}/locations' };
|
|
15
14
|
|
|
16
15
|
export default class Publish2b extends React.Component {
|
|
17
16
|
constructor(props) {
|
|
@@ -39,7 +38,8 @@ export default class Publish2b extends React.Component {
|
|
|
39
38
|
originalRegion: this.props.postingAd.region,
|
|
40
39
|
originalCity: this.props.postingAd.city,
|
|
41
40
|
originalDistrict: this.props.postingAd.district,
|
|
42
|
-
originalTown: this.props.postingAd.town
|
|
41
|
+
originalTown: this.props.postingAd.town,
|
|
42
|
+
errorCity: true
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
45
|
|
|
@@ -156,17 +156,22 @@ export default class Publish2b extends React.Component {
|
|
|
156
156
|
async nextStep() {
|
|
157
157
|
if (await this.validateForm()) {
|
|
158
158
|
const responseCheckZone = await this.props.request(this.props.context, GET_CHECK_ZONE, {
|
|
159
|
+
adId: this.props.postingAd.id,
|
|
159
160
|
businessId: this.props.businessId,
|
|
160
|
-
cityId: this.props.postingAd.city
|
|
161
|
+
cityId: this.props.postingAd.city,
|
|
162
|
+
townId: this.props.postingAd.town
|
|
161
163
|
});
|
|
162
164
|
|
|
163
|
-
if (responseCheckZone.
|
|
165
|
+
if (responseCheckZone.correctCity && responseCheckZone.correctTown) {
|
|
164
166
|
if (this.props.postingAd.id == null || this.props.fullPosting) {
|
|
165
167
|
this.props.goToPage(Views.PUBLISH_3);
|
|
166
168
|
} else {
|
|
167
169
|
this.props.saveEditAd();
|
|
168
170
|
}
|
|
169
171
|
} else {
|
|
172
|
+
this.setState({
|
|
173
|
+
errorCity: !responseCheckZone.correctCity
|
|
174
|
+
})
|
|
170
175
|
this.popupNoZone.show();
|
|
171
176
|
}
|
|
172
177
|
}
|
|
@@ -212,7 +217,7 @@ export default class Publish2b extends React.Component {
|
|
|
212
217
|
required={false}
|
|
213
218
|
onChangeText={(text) => this.onChangeAddress(text)}
|
|
214
219
|
textContainerStyle={commonStyles.inputContainer}
|
|
215
|
-
disabled={this.props.postingAd.promotionId != null}
|
|
220
|
+
disabled={!this.props.allowedToModify.address || this.props.postingAd.promotionId != null}
|
|
216
221
|
style={commonStyles.input} />
|
|
217
222
|
<InputSelect
|
|
218
223
|
label={strings('setup.region')}
|
|
@@ -223,7 +228,7 @@ export default class Publish2b extends React.Component {
|
|
|
223
228
|
options={this.state.regionOptions}
|
|
224
229
|
onChange={(value) => this.loadCities(value)}
|
|
225
230
|
ref={(element) => this.inputSelectRegion = element}
|
|
226
|
-
disabled={this.props.postingAd.promotionId != null}
|
|
231
|
+
disabled={!this.props.allowedToModify.region || this.props.postingAd.promotionId != null}
|
|
227
232
|
selectStyle={commonStyles.inputSelect} />
|
|
228
233
|
<InputSelect
|
|
229
234
|
label={strings('setup.city')}
|
|
@@ -234,7 +239,7 @@ export default class Publish2b extends React.Component {
|
|
|
234
239
|
options={this.state.cityOptions}
|
|
235
240
|
onChange={(value) => this.loadDistricts(value)}
|
|
236
241
|
ref={(element) => this.inputSelecCity = element}
|
|
237
|
-
disabled={this.state.cityOptions.elements.length === 1 || this.props.postingAd.promotionId != null}
|
|
242
|
+
disabled={!this.props.allowedToModify.city || this.state.cityOptions.elements.length === 1 || this.props.postingAd.promotionId != null}
|
|
238
243
|
selectStyle={commonStyles.inputSelect} />
|
|
239
244
|
<InputSelect
|
|
240
245
|
label={strings('setup.district')}
|
|
@@ -245,7 +250,7 @@ export default class Publish2b extends React.Component {
|
|
|
245
250
|
options={this.state.districtOptions}
|
|
246
251
|
onChange={(value) => this.loadTowns(value)}
|
|
247
252
|
ref={(element) => this.inputSelectDistrict = element}
|
|
248
|
-
disabled={this.state.districtOptions.elements.length === 1 || this.props.postingAd.promotionId != null}
|
|
253
|
+
disabled={!this.props.allowedToModify.district || this.state.districtOptions.elements.length === 1 || this.props.postingAd.promotionId != null}
|
|
249
254
|
visible={this.state.districtOptions.elements.length !== 2}
|
|
250
255
|
selectStyle={commonStyles.inputSelect} />
|
|
251
256
|
<InputSelect
|
|
@@ -257,7 +262,7 @@ export default class Publish2b extends React.Component {
|
|
|
257
262
|
options={this.state.townOptions}
|
|
258
263
|
onChange={(value) => this.props.postingAd.town = value}
|
|
259
264
|
ref={(element) => this.inputSelectTown = element}
|
|
260
|
-
disabled={this.state.townOptions.elements.length === 1 || this.props.postingAd.promotionId != null}
|
|
265
|
+
disabled={!this.props.allowedToModify.town || this.state.townOptions.elements.length === 1 || this.props.postingAd.promotionId != null}
|
|
261
266
|
visible={this.state.townOptions.elements.length !== 2}
|
|
262
267
|
selectStyle={commonStyles.inputSelect} />
|
|
263
268
|
</View>
|
|
@@ -266,16 +271,16 @@ export default class Publish2b extends React.Component {
|
|
|
266
271
|
<TouchableHighlight style={commonStyles.actionButton} underlayColor="#ff5d00" onPress={() => this.nextStep()}>
|
|
267
272
|
<Text style={commonStyles.actionButtonText}>{this.props.postingAd.id == null || this.props.fullPosting ? strings('setup.next').toUpperCase() : strings('setup.enregistrer').toUpperCase()}</Text>
|
|
268
273
|
</TouchableHighlight>
|
|
269
|
-
{this.props.postingAd.promotionId ?
|
|
270
|
-
|
|
271
|
-
:
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
274
|
+
{this.props.postingAd.promotionId ?
|
|
275
|
+
null
|
|
276
|
+
:
|
|
277
|
+
<TouchableHighlight underlayColor="rgba(0,0,0,0)" onPress={() => { this.props.postingAd.exactlyLocated = true; this.props.replacePage(Views.PUBLISH_2) }}>
|
|
278
|
+
<Text style={[commonStyles.carteNote, commonStyles.carteNoteMap]}>{strings('setup.useMap')}</Text>
|
|
279
|
+
</TouchableHighlight>
|
|
275
280
|
}
|
|
276
281
|
</View>
|
|
277
282
|
<PopupAdvice dialogStyle={commonStyles.popupBox} ref={(popupNoZone) => { this.popupNoZone = popupNoZone; }}
|
|
278
|
-
title={strings('setup.
|
|
283
|
+
title={this.state.errorCity ? strings('setup.adCantPostCity') : strings('setup.adCantPostTown')} icon={<FontAwesomeIcon name='block' />}>
|
|
279
284
|
<Text style={commonStyles.popupText}></Text>
|
|
280
285
|
</PopupAdvice>
|
|
281
286
|
</View>
|
package/Publish3.js
CHANGED
|
@@ -7,8 +7,13 @@ import InputNumber from './shared/InputNumber.js';
|
|
|
7
7
|
import InputSelect from 'muba-input-select';
|
|
8
8
|
import InputText from 'muba-input-text';
|
|
9
9
|
import { Views } from './utils/Views';
|
|
10
|
+
import PopupAdvice from 'muba-popup-advice';
|
|
11
|
+
import { createIconSetFromFontello } from 'react-native-vector-icons';
|
|
12
|
+
import fontelloConfig from './fonts/config.json';
|
|
13
|
+
const FontAwesomeIcon = createIconSetFromFontello(fontelloConfig);
|
|
10
14
|
|
|
11
15
|
const GET_CURRENCIES = { method: 'GET', url: '/controller/countries/{countryCode}/currencies' };
|
|
16
|
+
const GET_CHECK_PRICE = { method: 'GET', url: '/controller/posting/check-price' };
|
|
12
17
|
|
|
13
18
|
export default class Publish3 extends React.Component {
|
|
14
19
|
constructor(props) {
|
|
@@ -54,7 +59,8 @@ export default class Publish3 extends React.Component {
|
|
|
54
59
|
surface: this.props.postingAd.surface,
|
|
55
60
|
price: this.props.postingAd.price,
|
|
56
61
|
adType: this.props.postingAd.adType,
|
|
57
|
-
requiredErrorCondition: false
|
|
62
|
+
requiredErrorCondition: false,
|
|
63
|
+
priceError: null
|
|
58
64
|
};
|
|
59
65
|
}
|
|
60
66
|
|
|
@@ -98,38 +104,50 @@ export default class Publish3 extends React.Component {
|
|
|
98
104
|
|
|
99
105
|
async nextStep() {
|
|
100
106
|
if (this.validateForm()) {
|
|
101
|
-
|
|
102
|
-
this.props.postingAd.
|
|
103
|
-
|
|
107
|
+
const responseCheckPrice = await this.props.request(this.props.context, GET_CHECK_PRICE, {
|
|
108
|
+
adId: this.props.postingAd.id,
|
|
109
|
+
businessId: this.props.businessId,
|
|
110
|
+
price: this.props.postingAd.price,
|
|
111
|
+
currency: this.props.postingAd.currency
|
|
112
|
+
});
|
|
104
113
|
|
|
105
|
-
if (
|
|
106
|
-
this.
|
|
107
|
-
|
|
114
|
+
if (responseCheckPrice.value == null) {
|
|
115
|
+
if (!this.state.pieces.length > 0) {
|
|
116
|
+
this.props.postingAd.pieces = 0;
|
|
117
|
+
}
|
|
108
118
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
119
|
+
if (!this.state.rooms.length > 0) {
|
|
120
|
+
this.props.postingAd.rooms = 0;
|
|
121
|
+
}
|
|
112
122
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
123
|
+
if (!this.state.baths.length > 0) {
|
|
124
|
+
this.props.postingAd.bathrooms = 0;
|
|
125
|
+
}
|
|
116
126
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
127
|
+
if (!this.state.pax.length > 0) {
|
|
128
|
+
this.props.postingAd.pax = 0;
|
|
129
|
+
}
|
|
120
130
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
131
|
+
if (!this.state.minNights.length > 0) {
|
|
132
|
+
this.props.postingAd.minNights = 0;
|
|
133
|
+
}
|
|
124
134
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
135
|
+
if (!this.state.pricePeriod.length > 0) {
|
|
136
|
+
this.props.postingAd.pricePeriod = null;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
if (this.props.postingAd.id == null || this.props.fullPosting) {
|
|
140
|
+
this.props.goToPage(Views.PUBLISH_4);
|
|
130
141
|
} else {
|
|
131
|
-
this.props.
|
|
142
|
+
if (this.props.editingStepOne && this.props.postingAd.adTypeDetails.filter(function (detail) { return detail.value == "floorType" }).length > 0) {
|
|
143
|
+
this.props.goToPage(Views.PUBLISH_5, true);
|
|
144
|
+
} else {
|
|
145
|
+
this.props.saveEditAd();
|
|
146
|
+
}
|
|
132
147
|
}
|
|
148
|
+
} else {
|
|
149
|
+
this.setState({ priceError: responseCheckPrice.value.substring(1, responseCheckPrice.value.length - 1) })
|
|
150
|
+
this.invalidPrice.show();
|
|
133
151
|
}
|
|
134
152
|
}
|
|
135
153
|
}
|
|
@@ -205,6 +223,7 @@ export default class Publish3 extends React.Component {
|
|
|
205
223
|
onlyNumbers={true}
|
|
206
224
|
required={true}
|
|
207
225
|
maxValue={999999}
|
|
226
|
+
disabled={!this.props.allowedToModify.surface}
|
|
208
227
|
onChangeText={(text) => this.onChangeArea(text)}
|
|
209
228
|
onSubmitEditing={(event) => { this.inputTextPrice.focus(); }}
|
|
210
229
|
scroll={(ref) => this.props.scroll(ref)}
|
|
@@ -233,6 +252,7 @@ export default class Publish3 extends React.Component {
|
|
|
233
252
|
onlyNumbers={true}
|
|
234
253
|
required={true}
|
|
235
254
|
maxValue={999999999999999}
|
|
255
|
+
disabled={!this.props.allowedToModify.price}
|
|
236
256
|
onChangeText={(text) => this.onChangePrice(text)}
|
|
237
257
|
scroll={(ref) => this.props.scroll(ref)}
|
|
238
258
|
ref={(element) => this.inputTextPrice = element} />
|
|
@@ -243,6 +263,7 @@ export default class Publish3 extends React.Component {
|
|
|
243
263
|
selectStyle={commonStyles.inputSelect}
|
|
244
264
|
options={this.state.priceOptions}
|
|
245
265
|
placeholder={strings('setup.select')}
|
|
266
|
+
disabled={!this.props.allowedToModify.currency}
|
|
246
267
|
onChange={(value) => this.props.postingAd.currency = value} />
|
|
247
268
|
</View>
|
|
248
269
|
</View>
|
|
@@ -253,6 +274,7 @@ export default class Publish3 extends React.Component {
|
|
|
253
274
|
selectStyle={commonStyles.inputSelect}
|
|
254
275
|
options={this.state.pricePeriodOptions}
|
|
255
276
|
placeholder={strings('setup.select')}
|
|
277
|
+
disabled={!this.props.allowedToModify.pricePeriod}
|
|
256
278
|
onChange={(value) => this.props.postingAd.pricePeriod = value}
|
|
257
279
|
required={true} />
|
|
258
280
|
</View>
|
|
@@ -270,6 +292,7 @@ export default class Publish3 extends React.Component {
|
|
|
270
292
|
titleStyle={commonStyles.progressbarField}
|
|
271
293
|
radioButtonStyle={commonStyles.radioButton}
|
|
272
294
|
options={this.state.conditionOptions}
|
|
295
|
+
disabled={!this.props.allowedToModify.conservation}
|
|
273
296
|
onClick={(value) => this.onChangeCondition(value)}
|
|
274
297
|
ref={(element) => this.radioButtonCondition = element} />
|
|
275
298
|
:
|
|
@@ -284,6 +307,7 @@ export default class Publish3 extends React.Component {
|
|
|
284
307
|
minValue={1}
|
|
285
308
|
maxValue={99}
|
|
286
309
|
required={true}
|
|
310
|
+
disabled={!this.props.allowedToModify.pieces}
|
|
287
311
|
scroll={(ref) => this.props.scroll(ref)}
|
|
288
312
|
onChange={(value) => this.props.postingAd.pieces = value}
|
|
289
313
|
ref={(element) => this.inputNumberPieces = element} />
|
|
@@ -297,6 +321,7 @@ export default class Publish3 extends React.Component {
|
|
|
297
321
|
minValue={1}
|
|
298
322
|
maxValue={99}
|
|
299
323
|
required={true}
|
|
324
|
+
disabled={!this.props.allowedToModify.rooms}
|
|
300
325
|
scroll={(ref) => this.props.scroll(ref)}
|
|
301
326
|
onChange={(value) => this.props.postingAd.rooms = value}
|
|
302
327
|
ref={(element) => this.inputNumberRooms = element} />
|
|
@@ -310,6 +335,7 @@ export default class Publish3 extends React.Component {
|
|
|
310
335
|
minValue={1}
|
|
311
336
|
maxValue={99}
|
|
312
337
|
required={true}
|
|
338
|
+
disabled={!this.props.allowedToModify.baths}
|
|
313
339
|
scroll={(ref) => this.props.scroll(ref)}
|
|
314
340
|
onChange={(value) => this.props.postingAd.bathrooms = value}
|
|
315
341
|
ref={(element) => this.inputNumberBathrooms = element} />
|
|
@@ -323,6 +349,7 @@ export default class Publish3 extends React.Component {
|
|
|
323
349
|
minValue={1}
|
|
324
350
|
maxValue={99}
|
|
325
351
|
required={true}
|
|
352
|
+
disabled={!this.props.allowedToModify.pax}
|
|
326
353
|
scroll={(ref) => this.props.scroll(ref)}
|
|
327
354
|
onChange={(value) => this.props.postingAd.pax = value}
|
|
328
355
|
ref={(element) => this.inputNumberPax = element} />
|
|
@@ -336,6 +363,7 @@ export default class Publish3 extends React.Component {
|
|
|
336
363
|
minValue={1}
|
|
337
364
|
maxValue={99}
|
|
338
365
|
required={true}
|
|
366
|
+
disabled={!this.props.allowedToModify.minNights}
|
|
339
367
|
scroll={(ref) => this.props.scroll(ref)}
|
|
340
368
|
onChange={(value) => this.props.postingAd.minNights = value}
|
|
341
369
|
ref={(element) => this.inputNumberMinNights = element} />
|
|
@@ -355,6 +383,10 @@ export default class Publish3 extends React.Component {
|
|
|
355
383
|
</Text>
|
|
356
384
|
</TouchableHighlight>
|
|
357
385
|
</View>
|
|
386
|
+
<PopupAdvice dialogStyle={commonStyles.popupBox} ref={invalidPrice => this.invalidPrice = invalidPrice}
|
|
387
|
+
title={this.state.priceError} icon={<FontAwesomeIcon name='block' />}>
|
|
388
|
+
<Text style={commonStyles.popupText}></Text>
|
|
389
|
+
</PopupAdvice>
|
|
358
390
|
</View>
|
|
359
391
|
);
|
|
360
392
|
}
|
package/Publish4.js
CHANGED
|
@@ -49,6 +49,7 @@ export default class Publish4 extends React.Component {
|
|
|
49
49
|
referenceId={this.props.postingAd.id}
|
|
50
50
|
referenceType='AD'
|
|
51
51
|
required={true}
|
|
52
|
+
editable={this.props.allowedToModify.pictures}
|
|
52
53
|
maxPictures={this.props.maxPictures}
|
|
53
54
|
images={this.props.postingAd.images}
|
|
54
55
|
video={this.state.video}
|
package/Publish5.js
CHANGED
|
@@ -179,6 +179,7 @@ export default class Publish5 extends React.Component {
|
|
|
179
179
|
label={this.state.age[0].label}
|
|
180
180
|
labelStyle={commonStyles.progressbarField}
|
|
181
181
|
selectStyle={commonStyles.inputSelect}
|
|
182
|
+
disabled={!this.props.allowedToModify.age}
|
|
182
183
|
onChange={(value) => this.props.postingAd.age = value}
|
|
183
184
|
ref={(element) => this.inputSelectAge = element} />
|
|
184
185
|
</View>
|
|
@@ -195,6 +196,7 @@ export default class Publish5 extends React.Component {
|
|
|
195
196
|
label={this.state.floorType[0].label}
|
|
196
197
|
labelStyle={commonStyles.progressbarField}
|
|
197
198
|
selectStyle={commonStyles.inputSelect}
|
|
199
|
+
disabled={!this.props.allowedToModify.floorType}
|
|
198
200
|
onChange={(value) => this.props.postingAd.floorType = value}
|
|
199
201
|
ref={(element) => this.inputSelectFloorType = element} />
|
|
200
202
|
</View>
|
|
@@ -213,6 +215,7 @@ export default class Publish5 extends React.Component {
|
|
|
213
215
|
label={this.state.floorNumber[0].label}
|
|
214
216
|
labelStyle={commonStyles.progressbarField}
|
|
215
217
|
selectStyle={commonStyles.inputSelect}
|
|
218
|
+
disabled={!this.props.allowedToModify.floorNumber}
|
|
216
219
|
onChange={(value) => this.props.postingAd.floorNumber = value}
|
|
217
220
|
ref={(element) => this.inputSelectFloorNumber = element} />
|
|
218
221
|
</View>
|
|
@@ -229,6 +232,7 @@ export default class Publish5 extends React.Component {
|
|
|
229
232
|
label={this.state.orientation[0].label}
|
|
230
233
|
labelStyle={commonStyles.progressbarField}
|
|
231
234
|
selectStyle={commonStyles.inputSelect}
|
|
235
|
+
disabled={!this.props.allowedToModify.orientation}
|
|
232
236
|
onChange={(value) => this.props.postingAd.orientation = value}
|
|
233
237
|
ref={(element) => this.inputSelectOrientation = element} />
|
|
234
238
|
</View>
|
|
@@ -248,6 +252,7 @@ export default class Publish5 extends React.Component {
|
|
|
248
252
|
iconText={this.state.adTypeDetails?.filter(function (detail) { return detail.value == "garden" })[0]?.label}
|
|
249
253
|
visible={this.state.adTypeDetails?.filter(function (detail) { return detail.value == "garden" }).length > 0}
|
|
250
254
|
selected={this.props.postingAd.garden}
|
|
255
|
+
disabled={!this.props.allowedToModify.features}
|
|
251
256
|
onPress={(value) => this.props.postingAd.garden = value}
|
|
252
257
|
ref={(element) => this.inputGarden = element} />
|
|
253
258
|
|
|
@@ -257,6 +262,7 @@ export default class Publish5 extends React.Component {
|
|
|
257
262
|
iconText={this.state.adTypeDetails?.filter(function (detail) { return detail.value == "terrace" })[0]?.label}
|
|
258
263
|
visible={this.state.adTypeDetails?.filter(function (detail) { return detail.value == "terrace" }).length > 0}
|
|
259
264
|
selected={this.props.postingAd.terrace}
|
|
265
|
+
disabled={!this.props.allowedToModify.features}
|
|
260
266
|
onPress={(value) => this.props.postingAd.terrace = value}
|
|
261
267
|
ref={(element) => this.inputTerrace = element} />
|
|
262
268
|
|
|
@@ -266,6 +272,7 @@ export default class Publish5 extends React.Component {
|
|
|
266
272
|
iconText={this.state.adTypeDetails?.filter(function (detail) { return detail.value == "garage" })[0]?.label}
|
|
267
273
|
visible={this.state.adTypeDetails?.filter(function (detail) { return detail.value == "garage" }).length > 0}
|
|
268
274
|
selected={this.props.postingAd.garage}
|
|
275
|
+
disabled={!this.props.allowedToModify.features}
|
|
269
276
|
onPress={(value) => this.props.postingAd.garage = value}
|
|
270
277
|
ref={(element) => this.inputGarage = element} />
|
|
271
278
|
|
|
@@ -275,6 +282,7 @@ export default class Publish5 extends React.Component {
|
|
|
275
282
|
iconText={this.state.adTypeDetails?.filter(function (detail) { return detail.value == "elevator" })[0]?.label}
|
|
276
283
|
visible={this.state.adTypeDetails?.filter(function (detail) { return detail.value == "elevator" }).length > 0}
|
|
277
284
|
selected={this.props.postingAd.elevator}
|
|
285
|
+
disabled={!this.props.allowedToModify.features}
|
|
278
286
|
onPress={(value) => this.props.postingAd.elevator = value}
|
|
279
287
|
ref={(element) => this.inputElevator = element} />
|
|
280
288
|
|
|
@@ -284,6 +292,7 @@ export default class Publish5 extends React.Component {
|
|
|
284
292
|
iconText={this.state.adTypeDetails?.filter(function (detail) { return detail.value == "seaViews" })[0]?.label}
|
|
285
293
|
visible={this.state.adTypeDetails?.filter(function (detail) { return detail.value == "seaViews" }).length > 0}
|
|
286
294
|
selected={this.props.postingAd.seaViews}
|
|
295
|
+
disabled={!this.props.allowedToModify.features}
|
|
287
296
|
onPress={(value) => this.props.postingAd.seaViews = value}
|
|
288
297
|
ref={(element) => this.inputSeaViews = element} />
|
|
289
298
|
|
|
@@ -293,6 +302,7 @@ export default class Publish5 extends React.Component {
|
|
|
293
302
|
iconText={this.state.adTypeDetails?.filter(function (detail) { return detail.value == "mountainsViews" })[0]?.label}
|
|
294
303
|
visible={this.state.adTypeDetails?.filter(function (detail) { return detail.value == "mountainsViews" }).length > 0}
|
|
295
304
|
selected={this.props.postingAd.mountainsViews}
|
|
305
|
+
disabled={!this.props.allowedToModify.features}
|
|
296
306
|
onPress={(value) => this.props.postingAd.mountainsViews = value}
|
|
297
307
|
ref={(element) => this.inputMountainViews = element} />
|
|
298
308
|
|
|
@@ -302,6 +312,7 @@ export default class Publish5 extends React.Component {
|
|
|
302
312
|
iconText={this.state.adTypeDetails?.filter(function (detail) { return detail.value == "pool" })[0]?.label}
|
|
303
313
|
visible={this.state.adTypeDetails?.filter(function (detail) { return detail.value == "pool" }).length > 0}
|
|
304
314
|
selected={this.props.postingAd.pool}
|
|
315
|
+
disabled={!this.props.allowedToModify.features}
|
|
305
316
|
onPress={(value) => this.props.postingAd.pool = value}
|
|
306
317
|
ref={(element) => this.inputPool = element} />
|
|
307
318
|
|
|
@@ -311,6 +322,7 @@ export default class Publish5 extends React.Component {
|
|
|
311
322
|
iconText={this.state.adTypeDetails?.filter(function (detail) { return detail.value == "doorman" })[0]?.label}
|
|
312
323
|
visible={this.state.adTypeDetails?.filter(function (detail) { return detail.value == "doorman" }).length > 0}
|
|
313
324
|
selected={this.props.postingAd.doorman}
|
|
325
|
+
disabled={!this.props.allowedToModify.features}
|
|
314
326
|
onPress={(value) => this.props.postingAd.doorman = value}
|
|
315
327
|
ref={(element) => this.inputConcierge = element} />
|
|
316
328
|
|
|
@@ -320,6 +332,7 @@ export default class Publish5 extends React.Component {
|
|
|
320
332
|
iconText={this.state.adTypeDetails?.filter(function (detail) { return detail.value == "storageRoom" })[0]?.label}
|
|
321
333
|
visible={this.state.adTypeDetails?.filter(function (detail) { return detail.value == "storageRoom" }).length > 0}
|
|
322
334
|
selected={this.props.postingAd.storageRoom}
|
|
335
|
+
disabled={!this.props.allowedToModify.features}
|
|
323
336
|
onPress={(value) => this.props.postingAd.storageRoom = value}
|
|
324
337
|
ref={(element) => this.inputStorageRoom = element} />
|
|
325
338
|
|
|
@@ -329,6 +342,7 @@ export default class Publish5 extends React.Component {
|
|
|
329
342
|
iconText={this.state.adTypeDetails?.filter(function (detail) { return detail.value == "furnished" })[0]?.label}
|
|
330
343
|
visible={this.state.adTypeDetails?.filter(function (detail) { return detail.value == "furnished" }).length > 0}
|
|
331
344
|
selected={this.props.postingAd.furnished}
|
|
345
|
+
disabled={!this.props.allowedToModify.features}
|
|
332
346
|
onPress={(value) => this.props.postingAd.furnished = value}
|
|
333
347
|
ref={(element) => this.inputFurnished = element} />
|
|
334
348
|
<IconFeatures
|
|
@@ -337,6 +351,7 @@ export default class Publish5 extends React.Component {
|
|
|
337
351
|
iconText={this.state.adTypeDetails?.filter(function (detail) { return detail.value == "exteriorFacade" })[0]?.label}
|
|
338
352
|
visible={this.state.adTypeDetails?.filter(function (detail) { return detail.value == "exteriorFacade" }).length > 0}
|
|
339
353
|
selected={this.props.postingAd.exteriorFacade}
|
|
354
|
+
disabled={!this.props.allowedToModify.features}
|
|
340
355
|
onPress={(value) => this.props.postingAd.exteriorFacade = value}
|
|
341
356
|
ref={(element) => this.inputExteriorFacade = element} />
|
|
342
357
|
</View>
|
|
@@ -350,6 +365,7 @@ export default class Publish5 extends React.Component {
|
|
|
350
365
|
iconText={this.state.adTypeDetails?.filter(function (detail) { return detail.value == "moroccanLounge" })[0]?.label}
|
|
351
366
|
visible={this.state.adTypeDetails?.filter(function (detail) { return detail.value == "moroccanLounge" }).length > 0}
|
|
352
367
|
selected={this.props.postingAd.moroccanLounge}
|
|
368
|
+
disabled={!this.props.allowedToModify.features}
|
|
353
369
|
onPress={(value) => this.props.postingAd.moroccanLounge = value}
|
|
354
370
|
ref={(element) => this.inputSalonMarocain = element} />
|
|
355
371
|
|
|
@@ -359,6 +375,7 @@ export default class Publish5 extends React.Component {
|
|
|
359
375
|
iconText={this.state.adTypeDetails?.filter(function (detail) { return detail.value == "europeanLounge" })[0]?.label}
|
|
360
376
|
visible={this.state.adTypeDetails?.filter(function (detail) { return detail.value == "europeanLounge" }).length > 0}
|
|
361
377
|
selected={this.props.postingAd.europeanLounge}
|
|
378
|
+
disabled={!this.props.allowedToModify.features}
|
|
362
379
|
onPress={(value) => this.props.postingAd.europeanLounge = value}
|
|
363
380
|
ref={(element) => this.inputSalonEuropean = element} />
|
|
364
381
|
|
|
@@ -368,6 +385,7 @@ export default class Publish5 extends React.Component {
|
|
|
368
385
|
iconText={this.state.adTypeDetails?.filter(function (detail) { return detail.value == "satellite" })[0]?.label}
|
|
369
386
|
visible={this.state.adTypeDetails?.filter(function (detail) { return detail.value == "satellite" }).length > 0}
|
|
370
387
|
selected={this.props.postingAd.satellite}
|
|
388
|
+
disabled={!this.props.allowedToModify.features}
|
|
371
389
|
onPress={(value) => this.props.postingAd.satellite = value}
|
|
372
390
|
ref={(element) => this.inputSatellite = element} />
|
|
373
391
|
|
|
@@ -377,6 +395,7 @@ export default class Publish5 extends React.Component {
|
|
|
377
395
|
iconText={this.state.adTypeDetails?.filter(function (detail) { return detail.value == "fireplace" })[0]?.label}
|
|
378
396
|
visible={this.state.adTypeDetails?.filter(function (detail) { return detail.value == "fireplace" }).length > 0}
|
|
379
397
|
selected={this.props.postingAd.fireplace}
|
|
398
|
+
disabled={!this.props.allowedToModify.features}
|
|
380
399
|
onPress={(value) => this.props.postingAd.fireplace = value}
|
|
381
400
|
ref={(element) => this.inputFirePlace = element} />
|
|
382
401
|
|
|
@@ -386,6 +405,7 @@ export default class Publish5 extends React.Component {
|
|
|
386
405
|
iconText={this.state.adTypeDetails?.filter(function (detail) { return detail.value == "airConditioning" })[0]?.label}
|
|
387
406
|
visible={this.state.adTypeDetails?.filter(function (detail) { return detail.value == "airConditioning" }).length > 0}
|
|
388
407
|
selected={this.props.postingAd.airConditioning}
|
|
408
|
+
disabled={!this.props.allowedToModify.features}
|
|
389
409
|
onPress={(value) => this.props.postingAd.airConditioning = value}
|
|
390
410
|
ref={(element) => this.inputAir = element} />
|
|
391
411
|
|
|
@@ -395,6 +415,7 @@ export default class Publish5 extends React.Component {
|
|
|
395
415
|
iconText={this.state.adTypeDetails?.filter(function (detail) { return detail.value == "heating" })[0]?.label}
|
|
396
416
|
visible={this.state.adTypeDetails?.filter(function (detail) { return detail.value == "heating" }).length > 0}
|
|
397
417
|
selected={this.props.postingAd.heating}
|
|
418
|
+
disabled={!this.props.allowedToModify.features}
|
|
398
419
|
onPress={(value) => this.props.postingAd.heating = value}
|
|
399
420
|
ref={(element) => this.inputHeating = element} />
|
|
400
421
|
|
|
@@ -404,6 +425,7 @@ export default class Publish5 extends React.Component {
|
|
|
404
425
|
iconText={this.state.adTypeDetails?.filter(function (detail) { return detail.value == "security" })[0]?.label}
|
|
405
426
|
visible={this.state.adTypeDetails?.filter(function (detail) { return detail.value == "security" }).length > 0}
|
|
406
427
|
selected={this.props.postingAd.security}
|
|
428
|
+
disabled={!this.props.allowedToModify.features}
|
|
407
429
|
onPress={(value) => this.props.postingAd.security = value}
|
|
408
430
|
ref={(element) => this.inputSecurity = element} />
|
|
409
431
|
|
|
@@ -413,6 +435,7 @@ export default class Publish5 extends React.Component {
|
|
|
413
435
|
iconText={this.state.adTypeDetails?.filter(function (detail) { return detail.value == "doubleGlazing" })[0]?.label}
|
|
414
436
|
visible={this.state.adTypeDetails?.filter(function (detail) { return detail.value == "doubleGlazing" }).length > 0}
|
|
415
437
|
selected={this.props.postingAd.doubleGlazing}
|
|
438
|
+
disabled={!this.props.allowedToModify.features}
|
|
416
439
|
onPress={(value) => this.props.postingAd.doubleGlazing = value}
|
|
417
440
|
ref={(element) => this.inputDoubleGlazing = element} />
|
|
418
441
|
|
|
@@ -422,6 +445,7 @@ export default class Publish5 extends React.Component {
|
|
|
422
445
|
iconText={this.state.adTypeDetails?.filter(function (detail) { return detail.value == "reinforcedDoor" })[0]?.label}
|
|
423
446
|
visible={this.state.adTypeDetails?.filter(function (detail) { return detail.value == "reinforcedDoor" }).length > 0}
|
|
424
447
|
selected={this.props.postingAd.reinforcedDoor}
|
|
448
|
+
disabled={!this.props.allowedToModify.features}
|
|
425
449
|
onPress={(value) => this.props.postingAd.reinforcedDoor = value}
|
|
426
450
|
ref={(element) => this.inputReinforcedDoor = element} />
|
|
427
451
|
</View>
|
|
@@ -435,6 +459,7 @@ export default class Publish5 extends React.Component {
|
|
|
435
459
|
iconText={this.state.adTypeDetails?.filter(function (detail) { return detail.value == "fullKitchen" })[0]?.label}
|
|
436
460
|
visible={this.state.adTypeDetails?.filter(function (detail) { return detail.value == "fullKitchen" }).length > 0}
|
|
437
461
|
selected={this.props.postingAd.fullKitchen}
|
|
462
|
+
disabled={!this.props.allowedToModify.features}
|
|
438
463
|
onPress={(value) => this.props.postingAd.fullKitchen = value}
|
|
439
464
|
ref={(element) => this.inputFullKitchen = element} />
|
|
440
465
|
|
|
@@ -444,6 +469,7 @@ export default class Publish5 extends React.Component {
|
|
|
444
469
|
iconText={this.state.adTypeDetails?.filter(function (detail) { return detail.value == "fridge" })[0]?.label}
|
|
445
470
|
visible={this.state.adTypeDetails?.filter(function (detail) { return detail.value == "fridge" }).length > 0}
|
|
446
471
|
selected={this.props.postingAd.fridge}
|
|
472
|
+
disabled={!this.props.allowedToModify.features}
|
|
447
473
|
onPress={(value) => this.props.postingAd.fridge = value}
|
|
448
474
|
ref={(element) => this.inputFridge = element} />
|
|
449
475
|
|
|
@@ -453,6 +479,7 @@ export default class Publish5 extends React.Component {
|
|
|
453
479
|
iconText={this.state.adTypeDetails?.filter(function (detail) { return detail.value == "oven" })[0]?.label}
|
|
454
480
|
visible={this.state.adTypeDetails?.filter(function (detail) { return detail.value == "oven" }).length > 0}
|
|
455
481
|
selected={this.props.postingAd.oven}
|
|
482
|
+
disabled={!this.props.allowedToModify.features}
|
|
456
483
|
onPress={(value) => this.props.postingAd.oven = value}
|
|
457
484
|
ref={(element) => this.inputOven = element} />
|
|
458
485
|
|
|
@@ -462,6 +489,7 @@ export default class Publish5 extends React.Component {
|
|
|
462
489
|
iconText={this.state.adTypeDetails?.filter(function (detail) { return detail.value == "tv" })[0]?.label}
|
|
463
490
|
visible={this.state.adTypeDetails?.filter(function (detail) { return detail.value == "tv" }).length > 0}
|
|
464
491
|
selected={this.props.postingAd.tv}
|
|
492
|
+
disabled={!this.props.allowedToModify.features}
|
|
465
493
|
onPress={(value) => this.props.postingAd.tv = value}
|
|
466
494
|
ref={(element) => this.inputTv = element} />
|
|
467
495
|
|
|
@@ -471,6 +499,7 @@ export default class Publish5 extends React.Component {
|
|
|
471
499
|
iconText={this.state.adTypeDetails?.filter(function (detail) { return detail.value == "washer" })[0]?.label}
|
|
472
500
|
visible={this.state.adTypeDetails?.filter(function (detail) { return detail.value == "washer" }).length > 0}
|
|
473
501
|
selected={this.props.postingAd.washer}
|
|
502
|
+
disabled={!this.props.allowedToModify.features}
|
|
474
503
|
onPress={(value) => this.props.postingAd.washer = value}
|
|
475
504
|
ref={(element) => this.inputWashing = element} />
|
|
476
505
|
|
|
@@ -480,6 +509,7 @@ export default class Publish5 extends React.Component {
|
|
|
480
509
|
iconText={this.state.adTypeDetails?.filter(function (detail) { return detail.value == "microwave" })[0]?.label}
|
|
481
510
|
visible={this.state.adTypeDetails?.filter(function (detail) { return detail.value == "microwave" }).length > 0}
|
|
482
511
|
selected={this.props.postingAd.microwave}
|
|
512
|
+
disabled={!this.props.allowedToModify.features}
|
|
483
513
|
onPress={(value) => this.props.postingAd.microwave = value}
|
|
484
514
|
ref={(element) => this.inputMicrowaves = element} />
|
|
485
515
|
|
|
@@ -489,6 +519,7 @@ export default class Publish5 extends React.Component {
|
|
|
489
519
|
iconText={this.state.adTypeDetails?.filter(function (detail) { return detail.value == "internet" })[0]?.label}
|
|
490
520
|
visible={this.state.adTypeDetails?.filter(function (detail) { return detail.value == "internet" }).length > 0}
|
|
491
521
|
selected={this.props.postingAd.internet}
|
|
522
|
+
disabled={!this.props.allowedToModify.features}
|
|
492
523
|
onPress={(value) => this.props.postingAd.internet = value}
|
|
493
524
|
ref={(element) => this.inputInternet = element} />
|
|
494
525
|
|
|
@@ -499,6 +530,7 @@ export default class Publish5 extends React.Component {
|
|
|
499
530
|
iconText={this.state.adTypeDetails?.filter(function (detail) { return detail.value == "animals" })[0]?.label}
|
|
500
531
|
visible={this.state.adTypeDetails?.filter(function (detail) { return detail.value == "animals" }).length > 0}
|
|
501
532
|
selected={this.props.postingAd.animals}
|
|
533
|
+
disabled={!this.props.allowedToModify.features}
|
|
502
534
|
onPress={(value) => this.props.postingAd.animals = value}
|
|
503
535
|
ref={(element) => this.inputAnimals = element} />
|
|
504
536
|
</View>
|
|
@@ -534,7 +566,8 @@ class IconFeatures extends React.Component {
|
|
|
534
566
|
return (
|
|
535
567
|
this.props.visible ?
|
|
536
568
|
<View style={[commonStyles.characLinkBox, commonStyles.col, commonStyles.col3]}>
|
|
537
|
-
<TouchableOpacity activeOpacity={1} style={this.state.selected ?
|
|
569
|
+
<TouchableOpacity activeOpacity={1} style={[commonStyles.characIcon, this.state.selected ? commonStyles.characIconSelected : commonStyles.characIcon, this.props.disabled ? commonStyles.disabled : null]} onPress={() => this.onPressIcon()}
|
|
570
|
+
disabled={this.props.disabled}>
|
|
538
571
|
<Image style={commonStyles.characImage} source={this.state.selected ? this.props.iconHoverSource : this.props.iconSource} />
|
|
539
572
|
</TouchableOpacity>
|
|
540
573
|
<Text style={commonStyles.characIconText}>{this.props.iconText}</Text>
|
package/Publish6.js
CHANGED
|
@@ -168,6 +168,8 @@ export default class Publish6 extends React.Component {
|
|
|
168
168
|
{this.state.titleDescriptionLoaded ?
|
|
169
169
|
this.state.languages.map((item, index) =>
|
|
170
170
|
<LanguageItem languageItem={item} mainLanguage={this.props.postingAd.languageId}
|
|
171
|
+
disabledTitle={!this.props.allowedToModify.title}
|
|
172
|
+
disabledDescription={!this.props.allowedToModify.description}
|
|
171
173
|
isMultiLanguage={this.state.languages.length > 1}
|
|
172
174
|
scroll={(ref) => this.props.scroll(ref)}
|
|
173
175
|
ref={(element) => this.languageItem[index] = element}
|
|
@@ -189,6 +191,7 @@ export default class Publish6 extends React.Component {
|
|
|
189
191
|
textContainerStyle={{ marginTop: 10 }}
|
|
190
192
|
returnKeyType={"next"}
|
|
191
193
|
maxLength={50}
|
|
194
|
+
disabled={!this.props.allowedToModify.clientRef}
|
|
192
195
|
onSubmitEditing={(event) => { this.refs.phoneGroup.focus(); }} />
|
|
193
196
|
</View>
|
|
194
197
|
|
|
@@ -207,7 +210,7 @@ export default class Publish6 extends React.Component {
|
|
|
207
210
|
country={this.props.country}
|
|
208
211
|
maxPhones={3}
|
|
209
212
|
required={true}
|
|
210
|
-
disabled={
|
|
213
|
+
disabled={!this.props.allowedToModify.phone}
|
|
211
214
|
returnKeyType={"next"}
|
|
212
215
|
context={this.props.context}
|
|
213
216
|
request={this.props.request}
|
|
@@ -350,6 +353,7 @@ class LanguageItem extends React.Component {
|
|
|
350
353
|
textContainerStyle={commonStyles.inputContainer}
|
|
351
354
|
style={commonStyles.progressBarInputGrey}
|
|
352
355
|
language={this.state.languageItem.language}
|
|
356
|
+
disabled={this.props.disabledTitle}
|
|
353
357
|
ref={(element) => this.inputTextTitle = element} />
|
|
354
358
|
<InputText label={strings('setup.description')}
|
|
355
359
|
placeholder={strings('setup.description')}
|
|
@@ -361,6 +365,7 @@ class LanguageItem extends React.Component {
|
|
|
361
365
|
textContainerStyle={commonStyles.inputContainer}
|
|
362
366
|
style={[commonStyles.progressBarInputMulti, commonStyles.progressBarInputGrey]}
|
|
363
367
|
language={this.state.languageItem.language}
|
|
368
|
+
disabled={this.props.disabledDescription}
|
|
364
369
|
ref={(element) => this.inputTextDescription = element} />
|
|
365
370
|
</View>
|
|
366
371
|
</View>
|
package/locales/ar.json
CHANGED
|
@@ -110,10 +110,12 @@
|
|
|
110
110
|
"west": "الغرب",
|
|
111
111
|
"est": "شرق",
|
|
112
112
|
"highlight": "رفع قيمة",
|
|
113
|
-
"
|
|
113
|
+
"adCantPostCity": "لا يمكنك النشر في هذه المدينة",
|
|
114
|
+
"adCantPostTown": "لا يمكنك النشر في هذا الحي",
|
|
114
115
|
"noPromotionTitle": "أنت بحاجة إلى ترقية",
|
|
115
116
|
"noPromotionText": "لإنشاء إعلان جديد، أنت بحاجة إلى ترويج",
|
|
116
|
-
"login": "
|
|
117
|
+
"login": "الهاتف ملكي، قم بتغيير الحساب",
|
|
118
|
+
"cantPostTransaction": "لا يمكنك التبديل إلى هذه الفئة"
|
|
117
119
|
},
|
|
118
120
|
"product": {
|
|
119
121
|
"LISTING": "قوائم",
|
package/locales/en.json
CHANGED
|
@@ -110,10 +110,12 @@
|
|
|
110
110
|
"west": "West",
|
|
111
111
|
"est": "Est",
|
|
112
112
|
"highlight": "Highlight",
|
|
113
|
-
"
|
|
113
|
+
"adCantPostCity": "You can't post in this city",
|
|
114
|
+
"adCantPostTown": "You cannot publish in this neighborhood",
|
|
114
115
|
"noPromotionTitle": "You need a promotion",
|
|
115
116
|
"noPromotionText": "To create a new ad, you need a promotion",
|
|
116
|
-
"login": "
|
|
117
|
+
"login": "The phone is mine, change account",
|
|
118
|
+
"cantPostTransaction": "You cannot change to this category"
|
|
117
119
|
},
|
|
118
120
|
"product": {
|
|
119
121
|
"LISTING": "Listing",
|
package/locales/es.json
CHANGED
|
@@ -110,10 +110,12 @@
|
|
|
110
110
|
"west": "Oeste",
|
|
111
111
|
"est": "Este",
|
|
112
112
|
"highlight": "Destacar",
|
|
113
|
-
"
|
|
113
|
+
"adCantPostCity": "No puedes publicar en esta ciudad",
|
|
114
|
+
"adCantPostTown": "No puedes publicar en este barrio",
|
|
114
115
|
"noPromotionTitle": "Necesitas una promoción",
|
|
115
116
|
"noPromotionText": "Para crear un nuevo anuncio, necesitas una promoción",
|
|
116
|
-
"login": "
|
|
117
|
+
"login": "El teléfono es mío, cambiar de cuenta",
|
|
118
|
+
"cantPostTransaction": "No puedes cambiar a esta categoría"
|
|
117
119
|
},
|
|
118
120
|
"product": {
|
|
119
121
|
"LISTING": "Listing",
|
package/locales/fr.json
CHANGED
|
@@ -110,10 +110,12 @@
|
|
|
110
110
|
"west": "Ouest",
|
|
111
111
|
"est": "Est",
|
|
112
112
|
"highlight": "Mettre en valeur",
|
|
113
|
-
"
|
|
113
|
+
"adCantPostCity": "Vous ne pouvez pas poster dans cette ville",
|
|
114
|
+
"adCantPostTown": "Vous ne pouvez pas publier dans ce quartier",
|
|
114
115
|
"noPromotionTitle": "Vous avez besoin d'une promotion",
|
|
115
116
|
"noPromotionText": "Pour créer une nouvelle annonce, vous avez besoin d'une promotion",
|
|
116
|
-
"login": "
|
|
117
|
+
"login": "Le téléphone est à moi, changer de compte",
|
|
118
|
+
"cantPostTransaction": "Vous ne pouvez pas passer à cette catégorie"
|
|
117
119
|
},
|
|
118
120
|
"product": {
|
|
119
121
|
"LISTING": "Liste",
|
package/locales/it.json
CHANGED
|
@@ -110,10 +110,12 @@
|
|
|
110
110
|
"west": "Ovest",
|
|
111
111
|
"est": "Est",
|
|
112
112
|
"highlight": "Evidenziare",
|
|
113
|
-
"
|
|
113
|
+
"adCantPostCity": "Non puoi postare in questa città",
|
|
114
|
+
"adCantPostTown": "Non è possibile pubblicare in questo quartiere",
|
|
114
115
|
"noPromotionTitle": "Hai bisogno di una promozione",
|
|
115
116
|
"noPromotionText": "Per creare un nuovo annuncio, è necessaria una promozione",
|
|
116
|
-
"login": "
|
|
117
|
+
"login": "Il telefono è mio, cambia account",
|
|
118
|
+
"cantPostTransaction": "Non è possibile passare a questa categoria"
|
|
117
119
|
},
|
|
118
120
|
"product": {
|
|
119
121
|
"LISTING": "Inserzioni",
|
package/locales/nl.json
CHANGED
|
@@ -110,10 +110,12 @@
|
|
|
110
110
|
"west": "Oost",
|
|
111
111
|
"est": "North",
|
|
112
112
|
"highlight": "Highlighting",
|
|
113
|
-
"
|
|
113
|
+
"adCantPostCity": "In deze stad mag je niet posten",
|
|
114
|
+
"adCantPostTown": "U kunt niet publiceren in deze buurt",
|
|
114
115
|
"noPromotionTitle": "Je hebt een promotie nodig",
|
|
115
116
|
"noPromotionText": "Om een nieuwe advertentie te maken, heb je een promotie nodig",
|
|
116
|
-
"login": "
|
|
117
|
+
"login": "De telefoon is van mij, account wijzigen",
|
|
118
|
+
"cantPostTransaction": "U kunt niet overschakelen naar deze categorie"
|
|
117
119
|
},
|
|
118
120
|
"product": {
|
|
119
121
|
"LISTING": "Advertenties",
|
package/package.json
CHANGED
package/shared/InputNumber.js
CHANGED
|
@@ -60,13 +60,13 @@ export default class InputNumber extends React.Component {
|
|
|
60
60
|
{this.state.minValueError ? <Text style={[commonStyles.subNote, commonStyles.red]}> {strings('setup.requiredField')}</Text> : null}
|
|
61
61
|
</View>
|
|
62
62
|
<View style={commonStyles.row}>
|
|
63
|
-
<TouchableHighlight style={[commonStyles.numberBtnSpan]} underlayColor="#666" onPress={() => this.subtract(this.state.numberValue)}>
|
|
63
|
+
<TouchableHighlight style={[commonStyles.numberBtnSpan, this.props.disabled ? commonStyles.disabled : null]} underlayColor="#666" onPress={() => this.subtract(this.state.numberValue)} disabled={this.props.disabled}>
|
|
64
64
|
<Text style={commonStyles.numberBtnSpanText}>–</Text>
|
|
65
65
|
</TouchableHighlight>
|
|
66
66
|
<View style={commonStyles.numberInput}>
|
|
67
67
|
<Text style={commonStyles.numberInputText}>{this.state.numberValue ? this.state.numberValue : 0}</Text>
|
|
68
68
|
</View>
|
|
69
|
-
<TouchableHighlight style={[commonStyles.numberBtnSpan]} underlayColor="#666" onPress={() => this.add(this.state.numberValue)}>
|
|
69
|
+
<TouchableHighlight style={[commonStyles.numberBtnSpan, this.props.disabled ? commonStyles.disabled : null]} underlayColor="#666" onPress={() => this.add(this.state.numberValue)} disabled={this.props.disabled}>
|
|
70
70
|
<Text style={commonStyles.numberBtnSpanText}>+</Text>
|
|
71
71
|
</TouchableHighlight>
|
|
72
72
|
</View>
|