muba-posting 4.1.27 → 4.1.29
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 +159 -148
- package/PostingEdit.js +8 -2
- package/Preview.js +128 -136
- package/Publish1.js +53 -71
- package/Publish2.js +13 -31
- package/Publish2b.js +68 -82
- package/Publish3.js +165 -198
- package/Publish4.js +77 -90
- package/Publish5.js +344 -353
- package/Publish6.js +119 -134
- package/package.json +1 -1
- package/utils/Views.js +2 -1
package/Posting.js
CHANGED
|
@@ -65,6 +65,8 @@ export default class Posting extends React.Component {
|
|
|
65
65
|
countryPhone: '',
|
|
66
66
|
businessId: this.props.businessId,
|
|
67
67
|
picturesUploaded: 0,
|
|
68
|
+
images: [],
|
|
69
|
+
params: null,
|
|
68
70
|
postingAd: {
|
|
69
71
|
transaction: null,
|
|
70
72
|
adType: null,
|
|
@@ -298,8 +300,9 @@ export default class Posting extends React.Component {
|
|
|
298
300
|
|
|
299
301
|
prevViews.unshift(this.state.view);
|
|
300
302
|
|
|
301
|
-
if (this.state.fullPosting && this.state.postingAd.town && Views.PUBLISH_6 !== this.state.view) {
|
|
303
|
+
if (this.state.fullPosting && this.state.postingAd.town && Views.PUBLISH_6 !== this.state.view && Views.PAYMENT_ONLINE !== view) {
|
|
302
304
|
const ad = { ...this.state.postingAd };
|
|
305
|
+
console.log(ad)
|
|
303
306
|
if (Views.PUBLISH_4 !== this.state.view) {
|
|
304
307
|
delete ad.images;
|
|
305
308
|
}
|
|
@@ -315,13 +318,6 @@ export default class Posting extends React.Component {
|
|
|
315
318
|
await this._updateCurrentScreen(view, params);
|
|
316
319
|
}
|
|
317
320
|
|
|
318
|
-
async _replacePage(view) {
|
|
319
|
-
if (view === Views.PUBLISH_2_B) {
|
|
320
|
-
await this.publish2bScreen.loadData();
|
|
321
|
-
}
|
|
322
|
-
await this._updateCurrentScreen(view);
|
|
323
|
-
}
|
|
324
|
-
|
|
325
321
|
async _updateCurrentScreen(view, params) {
|
|
326
322
|
switch (view) {
|
|
327
323
|
case Views.PUBLISH_1:
|
|
@@ -331,28 +327,23 @@ export default class Posting extends React.Component {
|
|
|
331
327
|
this.setState({ currentScreen: 2 });
|
|
332
328
|
break;
|
|
333
329
|
case Views.PUBLISH_2_B:
|
|
334
|
-
await this.publish2bScreen.loadData();
|
|
335
330
|
this.setState({ currentScreen: 2 });
|
|
336
331
|
break;
|
|
337
332
|
case Views.PUBLISH_3:
|
|
338
|
-
await this.publish3Screen.refreshData();
|
|
339
333
|
this.setState({ currentScreen: 3 });
|
|
340
334
|
break;
|
|
341
335
|
case Views.PUBLISH_4:
|
|
342
336
|
this.setState({ currentScreen: 4 });
|
|
343
337
|
break;
|
|
344
338
|
case Views.PUBLISH_5:
|
|
345
|
-
await this.publish5Screen.refreshData();
|
|
346
339
|
this.setState({ currentScreen: 5 });
|
|
347
340
|
break;
|
|
348
341
|
case Views.PUBLISH_6:
|
|
349
|
-
await this.publish6Screen.generateTitleDescription();
|
|
350
|
-
await this.publish6Screen.resetSubmitClicked();
|
|
351
342
|
this.setState({ currentScreen: 6 });
|
|
352
343
|
break;
|
|
353
344
|
case Views.PREVIEW:
|
|
354
345
|
if (params) {
|
|
355
|
-
await this.
|
|
346
|
+
await this.setState({ params: params });
|
|
356
347
|
}
|
|
357
348
|
break;
|
|
358
349
|
case Views.EDIT_SELECTOR:
|
|
@@ -403,7 +394,6 @@ export default class Posting extends React.Component {
|
|
|
403
394
|
if (this.state.originView === Views.EDIT_SELECTOR) {
|
|
404
395
|
this.setState({ isLoading: true });
|
|
405
396
|
await this.loadAd();
|
|
406
|
-
this.editSelector.refresh();
|
|
407
397
|
this._goToPage(Views.EDIT_SELECTOR);
|
|
408
398
|
} else {
|
|
409
399
|
this.props.navigation.goBack();
|
|
@@ -437,11 +427,10 @@ export default class Posting extends React.Component {
|
|
|
437
427
|
}
|
|
438
428
|
|
|
439
429
|
imageBrowserCallback = async (photos) => {
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
}
|
|
430
|
+
this.setState({
|
|
431
|
+
showImageBrowser: false,
|
|
432
|
+
images: photos
|
|
433
|
+
});
|
|
445
434
|
}
|
|
446
435
|
|
|
447
436
|
getAd = async (id) => {
|
|
@@ -453,10 +442,10 @@ export default class Posting extends React.Component {
|
|
|
453
442
|
}
|
|
454
443
|
|
|
455
444
|
_savePicture = async (picture) => {
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
})
|
|
445
|
+
this.setState({
|
|
446
|
+
showImageBrowser: false,
|
|
447
|
+
images: [picture]
|
|
448
|
+
});
|
|
460
449
|
}
|
|
461
450
|
|
|
462
451
|
render() {
|
|
@@ -491,130 +480,152 @@ export default class Posting extends React.Component {
|
|
|
491
480
|
null
|
|
492
481
|
}
|
|
493
482
|
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
483
|
+
{this.state.view === Views.PUBLISH_1 ?
|
|
484
|
+
<Publish1 postingAd={this.state.postingAd}
|
|
485
|
+
baseUrl={this.props.baseUrl}
|
|
486
|
+
request={this.props.request}
|
|
487
|
+
context={this.props.context}
|
|
488
|
+
showLoading={() => this._showLoading()}
|
|
489
|
+
hideLoading={() => this._hideLoading()}
|
|
490
|
+
scroll={(ref) => this.scroll.scrollIntoView(ref)}
|
|
491
|
+
fullPosting={this.state.fullPosting}
|
|
492
|
+
goToPage={(view, editingStepOne) => this._goToPage(view, editingStepOne)}
|
|
493
|
+
saveEditAd={() => this._saveEditAd()}
|
|
494
|
+
progressBarHeight={this.state.progressBarHeight}
|
|
495
|
+
headerHeight={this.state.headerHeight} />
|
|
496
|
+
:
|
|
497
|
+
null
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
{this.state.view === Views.PUBLISH_2 ?
|
|
501
|
+
<Publish2 postingAd={this.state.postingAd}
|
|
502
|
+
scroll={(ref) => this.scroll.scrollIntoView(ref)}
|
|
503
|
+
saveEditAd={() => this._saveEditAd()}
|
|
504
|
+
goToPage={(view) => this._goToPage(view)}
|
|
505
|
+
replacePage={(view) => this._updateCurrentScreen(view)}
|
|
506
|
+
baseUrl={this.props.baseUrl}
|
|
507
|
+
request={this.props.request}
|
|
508
|
+
context={this.props.context}
|
|
509
|
+
showLoading={() => this._showLoading()}
|
|
510
|
+
hideLoading={() => this._hideLoading()}
|
|
511
|
+
hereAppId={this.props.hereAppId} hereAppCode={this.props.hereAppCode}
|
|
512
|
+
fullPosting={this.state.fullPosting}
|
|
513
|
+
progressBarHeight={this.state.progressBarHeight}
|
|
514
|
+
headerHeight={this.state.headerHeight} />
|
|
515
|
+
:
|
|
516
|
+
null
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
{this.state.view === Views.PUBLISH_2_B ?
|
|
520
|
+
<Publish2b postingAd={this.state.postingAd}
|
|
521
|
+
scroll={(ref) => this.scroll.scrollIntoView(ref)}
|
|
522
|
+
saveEditAd={() => this._saveEditAd()}
|
|
523
|
+
goToPage={(view) => this._goToPage(view)}
|
|
524
|
+
replacePage={(view) => this._updateCurrentScreen(view)}
|
|
525
|
+
request={this.props.request}
|
|
526
|
+
context={this.props.context}
|
|
527
|
+
showLoading={() => this._showLoading()}
|
|
528
|
+
hideLoading={() => this._hideLoading()}
|
|
529
|
+
fullPosting={this.state.fullPosting}
|
|
530
|
+
progressBarHeight={this.state.progressBarHeight}
|
|
531
|
+
headerHeight={this.state.headerHeight} />
|
|
532
|
+
:
|
|
533
|
+
null
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
{this.state.view === Views.PUBLISH_3 ?
|
|
537
|
+
<Publish3 postingAd={this.state.postingAd}
|
|
538
|
+
editingStepOne={this.state.editingStepOne}
|
|
539
|
+
scroll={(ref) => this.scroll.scrollIntoView(ref)}
|
|
540
|
+
saveEditAd={() => this._saveEditAd()}
|
|
541
|
+
goToPage={(view) => this._goToPage(view)}
|
|
542
|
+
goBack={() => this.goBack()}
|
|
543
|
+
request={this.props.request}
|
|
544
|
+
context={this.props.context}
|
|
545
|
+
showLoading={() => this._showLoading()}
|
|
546
|
+
hideLoading={() => this._hideLoading()}
|
|
547
|
+
fullPosting={this.state.fullPosting}
|
|
548
|
+
progressBarHeight={this.state.progressBarHeight}
|
|
549
|
+
headerHeight={this.state.headerHeight} />
|
|
550
|
+
:
|
|
551
|
+
null
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
{this.state.view === Views.PUBLISH_4 ?
|
|
555
|
+
<Publish4 postingAd={this.state.postingAd}
|
|
556
|
+
saveEditAd={() => this._saveEditAd()}
|
|
557
|
+
goToPage={(view) => this._goToPage(view)}
|
|
558
|
+
request={this.props.request}
|
|
559
|
+
context={this.props.context}
|
|
560
|
+
showLoading={() => this._showLoading()}
|
|
561
|
+
hideLoading={() => this._hideLoading()}
|
|
562
|
+
fullPosting={this.state.fullPosting}
|
|
563
|
+
progressBarHeight={this.state.progressBarHeight}
|
|
564
|
+
headerHeight={this.state.headerHeight}
|
|
565
|
+
openPictureSelector={() => this._openPictureSelector()}
|
|
566
|
+
maxPictures={this.state.maxPictures}
|
|
567
|
+
images={this.state.images} />
|
|
568
|
+
:
|
|
569
|
+
null
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
{this.state.view === Views.PUBLISH_5 ?
|
|
573
|
+
<Publish5 postingAd={this.state.postingAd}
|
|
574
|
+
scroll={(ref) => this.scroll.scrollIntoView(ref)}
|
|
575
|
+
saveEditAd={() => this._saveEditAd()}
|
|
576
|
+
goToPage={(view) => this._goToPage(view)}
|
|
577
|
+
request={this.props.request}
|
|
578
|
+
context={this.props.context}
|
|
579
|
+
showLoading={() => this._showLoading()}
|
|
580
|
+
hideLoading={() => this._hideLoading()}
|
|
581
|
+
fullPosting={this.state.fullPosting}
|
|
582
|
+
progressBarHeight={this.state.progressBarHeight}
|
|
583
|
+
headerHeight={this.state.headerHeight} />
|
|
584
|
+
:
|
|
585
|
+
null
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
{this.state.view === Views.PUBLISH_6 ?
|
|
589
|
+
<Publish6 postingAd={this.state.postingAd}
|
|
590
|
+
country={this.props.country}
|
|
591
|
+
businessId={this.state.businessId}
|
|
592
|
+
scroll={(ref) => this.scroll.scrollIntoView(ref)}
|
|
593
|
+
saveEditAd={() => this._saveEditAd()}
|
|
594
|
+
goToPage={(view, params) => this._goToPage(view, null, params)}
|
|
595
|
+
request={this.props.request}
|
|
596
|
+
context={this.props.context}
|
|
597
|
+
showLoading={() => this._showLoading()}
|
|
598
|
+
hideLoading={() => this._hideLoading()}
|
|
599
|
+
fullPosting={this.state.fullPosting}
|
|
600
|
+
progressBarHeight={this.state.progressBarHeight}
|
|
601
|
+
headerHeight={this.state.headerHeight} />
|
|
602
|
+
:
|
|
603
|
+
null
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
{this.state.view === Views.PREVIEW ?
|
|
607
|
+
<Preview postingAd={this.state.postingAd}
|
|
608
|
+
country={this.props.country}
|
|
609
|
+
goBack={() => this.goBack()}
|
|
610
|
+
showLoading={() => this._showLoading()}
|
|
611
|
+
hideLoading={() => this._hideLoading()}
|
|
612
|
+
businessId={this.state.businessId}
|
|
613
|
+
progressBarHeight={this.state.progressBarHeight}
|
|
614
|
+
request={this.props.request}
|
|
615
|
+
headerHeight={this.state.headerHeight}
|
|
616
|
+
highlight={() => this._goToPage(Views.PAYMENT_ONLINE)}
|
|
617
|
+
params={this.state.params} />
|
|
618
|
+
:
|
|
619
|
+
null
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
{this.state.view === Views.EDIT_SELECTOR ?
|
|
623
|
+
<PostingEdit postingAd={this.state.postingAd}
|
|
624
|
+
topBar={this.props.topBar}
|
|
625
|
+
goToPage={(view) => this._goToPage(view)} />
|
|
626
|
+
:
|
|
627
|
+
null
|
|
628
|
+
}
|
|
618
629
|
|
|
619
630
|
{this.state.view === Views.PAYMENT_ONLINE ?
|
|
620
631
|
<PaymentOnlinePopup
|
package/PostingEdit.js
CHANGED
|
@@ -14,8 +14,14 @@ export default class PostingEdit extends React.Component {
|
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
componentDidMount = () => {
|
|
18
|
+
this.refresh();
|
|
19
|
+
}
|
|
20
|
+
|
|
17
21
|
componentDidUpdate = (prevProps) => {
|
|
18
|
-
if (
|
|
22
|
+
if (this.props.postingAd.images[0].id !== prevProps.postingAd.images[0].id
|
|
23
|
+
|| this.props.postingAd.languages.filter(item => this.props.postingAd.languageId === item.language)[0].title !== prevProps.postingAd.languages.filter(item => prevProps.postingAd.languageId === item.language)[0].title
|
|
24
|
+
|| this.props.postingAd.adTypeDetails.filter(detail => detail.value == "floorType").length !== prevProps.postingAd.adTypeDetails.filter(detail => detail.value == "floorType").length) {
|
|
19
25
|
this.refresh();
|
|
20
26
|
}
|
|
21
27
|
}
|
|
@@ -37,7 +43,7 @@ export default class PostingEdit extends React.Component {
|
|
|
37
43
|
render() {
|
|
38
44
|
return (
|
|
39
45
|
this.state.showFunctionalities != null ?
|
|
40
|
-
<View style={
|
|
46
|
+
<View style={commonStyles.body}>
|
|
41
47
|
<View style={[commonStyles.row]}>
|
|
42
48
|
<Icon style={[commonStyles.h2, commonStyles.homeContentH2, commonStyles.titleIcon]} name="edit" />
|
|
43
49
|
<Text style={[commonStyles.h2, commonStyles.homeContentH2]}>{strings('edit.whatEditing')}</Text>
|