muba-posting 4.1.28 → 4.2.0
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 +157 -147
- 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/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,
|
|
@@ -315,13 +317,6 @@ export default class Posting extends React.Component {
|
|
|
315
317
|
await this._updateCurrentScreen(view, params);
|
|
316
318
|
}
|
|
317
319
|
|
|
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
320
|
async _updateCurrentScreen(view, params) {
|
|
326
321
|
switch (view) {
|
|
327
322
|
case Views.PUBLISH_1:
|
|
@@ -331,28 +326,23 @@ export default class Posting extends React.Component {
|
|
|
331
326
|
this.setState({ currentScreen: 2 });
|
|
332
327
|
break;
|
|
333
328
|
case Views.PUBLISH_2_B:
|
|
334
|
-
await this.publish2bScreen.loadData();
|
|
335
329
|
this.setState({ currentScreen: 2 });
|
|
336
330
|
break;
|
|
337
331
|
case Views.PUBLISH_3:
|
|
338
|
-
await this.publish3Screen.refreshData();
|
|
339
332
|
this.setState({ currentScreen: 3 });
|
|
340
333
|
break;
|
|
341
334
|
case Views.PUBLISH_4:
|
|
342
335
|
this.setState({ currentScreen: 4 });
|
|
343
336
|
break;
|
|
344
337
|
case Views.PUBLISH_5:
|
|
345
|
-
await this.publish5Screen.refreshData();
|
|
346
338
|
this.setState({ currentScreen: 5 });
|
|
347
339
|
break;
|
|
348
340
|
case Views.PUBLISH_6:
|
|
349
|
-
await this.publish6Screen.generateTitleDescription();
|
|
350
|
-
await this.publish6Screen.resetSubmitClicked();
|
|
351
341
|
this.setState({ currentScreen: 6 });
|
|
352
342
|
break;
|
|
353
343
|
case Views.PREVIEW:
|
|
354
344
|
if (params) {
|
|
355
|
-
await this.
|
|
345
|
+
await this.setState({ params: params });
|
|
356
346
|
}
|
|
357
347
|
break;
|
|
358
348
|
case Views.EDIT_SELECTOR:
|
|
@@ -403,7 +393,6 @@ export default class Posting extends React.Component {
|
|
|
403
393
|
if (this.state.originView === Views.EDIT_SELECTOR) {
|
|
404
394
|
this.setState({ isLoading: true });
|
|
405
395
|
await this.loadAd();
|
|
406
|
-
this.editSelector.refresh();
|
|
407
396
|
this._goToPage(Views.EDIT_SELECTOR);
|
|
408
397
|
} else {
|
|
409
398
|
this.props.navigation.goBack();
|
|
@@ -437,11 +426,10 @@ export default class Posting extends React.Component {
|
|
|
437
426
|
}
|
|
438
427
|
|
|
439
428
|
imageBrowserCallback = async (photos) => {
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
}
|
|
429
|
+
this.setState({
|
|
430
|
+
showImageBrowser: false,
|
|
431
|
+
images: photos
|
|
432
|
+
});
|
|
445
433
|
}
|
|
446
434
|
|
|
447
435
|
getAd = async (id) => {
|
|
@@ -453,10 +441,10 @@ export default class Posting extends React.Component {
|
|
|
453
441
|
}
|
|
454
442
|
|
|
455
443
|
_savePicture = async (picture) => {
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
})
|
|
444
|
+
this.setState({
|
|
445
|
+
showImageBrowser: false,
|
|
446
|
+
images: [picture]
|
|
447
|
+
});
|
|
460
448
|
}
|
|
461
449
|
|
|
462
450
|
render() {
|
|
@@ -491,130 +479,152 @@ export default class Posting extends React.Component {
|
|
|
491
479
|
null
|
|
492
480
|
}
|
|
493
481
|
|
|
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
|
-
|
|
482
|
+
{this.state.view === Views.PUBLISH_1 ?
|
|
483
|
+
<Publish1 postingAd={this.state.postingAd}
|
|
484
|
+
baseUrl={this.props.baseUrl}
|
|
485
|
+
request={this.props.request}
|
|
486
|
+
context={this.props.context}
|
|
487
|
+
showLoading={() => this._showLoading()}
|
|
488
|
+
hideLoading={() => this._hideLoading()}
|
|
489
|
+
scroll={(ref) => this.scroll.scrollIntoView(ref)}
|
|
490
|
+
fullPosting={this.state.fullPosting}
|
|
491
|
+
goToPage={(view, editingStepOne) => this._goToPage(view, editingStepOne)}
|
|
492
|
+
saveEditAd={() => this._saveEditAd()}
|
|
493
|
+
progressBarHeight={this.state.progressBarHeight}
|
|
494
|
+
headerHeight={this.state.headerHeight} />
|
|
495
|
+
:
|
|
496
|
+
null
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
{this.state.view === Views.PUBLISH_2 ?
|
|
500
|
+
<Publish2 postingAd={this.state.postingAd}
|
|
501
|
+
scroll={(ref) => this.scroll.scrollIntoView(ref)}
|
|
502
|
+
saveEditAd={() => this._saveEditAd()}
|
|
503
|
+
goToPage={(view) => this._goToPage(view)}
|
|
504
|
+
replacePage={(view) => this._updateCurrentScreen(view)}
|
|
505
|
+
baseUrl={this.props.baseUrl}
|
|
506
|
+
request={this.props.request}
|
|
507
|
+
context={this.props.context}
|
|
508
|
+
showLoading={() => this._showLoading()}
|
|
509
|
+
hideLoading={() => this._hideLoading()}
|
|
510
|
+
hereAppId={this.props.hereAppId} hereAppCode={this.props.hereAppCode}
|
|
511
|
+
fullPosting={this.state.fullPosting}
|
|
512
|
+
progressBarHeight={this.state.progressBarHeight}
|
|
513
|
+
headerHeight={this.state.headerHeight} />
|
|
514
|
+
:
|
|
515
|
+
null
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
{this.state.view === Views.PUBLISH_2_B ?
|
|
519
|
+
<Publish2b postingAd={this.state.postingAd}
|
|
520
|
+
scroll={(ref) => this.scroll.scrollIntoView(ref)}
|
|
521
|
+
saveEditAd={() => this._saveEditAd()}
|
|
522
|
+
goToPage={(view) => this._goToPage(view)}
|
|
523
|
+
replacePage={(view) => this._updateCurrentScreen(view)}
|
|
524
|
+
request={this.props.request}
|
|
525
|
+
context={this.props.context}
|
|
526
|
+
showLoading={() => this._showLoading()}
|
|
527
|
+
hideLoading={() => this._hideLoading()}
|
|
528
|
+
fullPosting={this.state.fullPosting}
|
|
529
|
+
progressBarHeight={this.state.progressBarHeight}
|
|
530
|
+
headerHeight={this.state.headerHeight} />
|
|
531
|
+
:
|
|
532
|
+
null
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
{this.state.view === Views.PUBLISH_3 ?
|
|
536
|
+
<Publish3 postingAd={this.state.postingAd}
|
|
537
|
+
editingStepOne={this.state.editingStepOne}
|
|
538
|
+
scroll={(ref) => this.scroll.scrollIntoView(ref)}
|
|
539
|
+
saveEditAd={() => this._saveEditAd()}
|
|
540
|
+
goToPage={(view) => this._goToPage(view)}
|
|
541
|
+
goBack={() => this.goBack()}
|
|
542
|
+
request={this.props.request}
|
|
543
|
+
context={this.props.context}
|
|
544
|
+
showLoading={() => this._showLoading()}
|
|
545
|
+
hideLoading={() => this._hideLoading()}
|
|
546
|
+
fullPosting={this.state.fullPosting}
|
|
547
|
+
progressBarHeight={this.state.progressBarHeight}
|
|
548
|
+
headerHeight={this.state.headerHeight} />
|
|
549
|
+
:
|
|
550
|
+
null
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
{this.state.view === Views.PUBLISH_4 ?
|
|
554
|
+
<Publish4 postingAd={this.state.postingAd}
|
|
555
|
+
saveEditAd={() => this._saveEditAd()}
|
|
556
|
+
goToPage={(view) => this._goToPage(view)}
|
|
557
|
+
request={this.props.request}
|
|
558
|
+
context={this.props.context}
|
|
559
|
+
showLoading={() => this._showLoading()}
|
|
560
|
+
hideLoading={() => this._hideLoading()}
|
|
561
|
+
fullPosting={this.state.fullPosting}
|
|
562
|
+
progressBarHeight={this.state.progressBarHeight}
|
|
563
|
+
headerHeight={this.state.headerHeight}
|
|
564
|
+
openPictureSelector={() => this._openPictureSelector()}
|
|
565
|
+
maxPictures={this.state.maxPictures}
|
|
566
|
+
images={this.state.images} />
|
|
567
|
+
:
|
|
568
|
+
null
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
{this.state.view === Views.PUBLISH_5 ?
|
|
572
|
+
<Publish5 postingAd={this.state.postingAd}
|
|
573
|
+
scroll={(ref) => this.scroll.scrollIntoView(ref)}
|
|
574
|
+
saveEditAd={() => this._saveEditAd()}
|
|
575
|
+
goToPage={(view) => this._goToPage(view)}
|
|
576
|
+
request={this.props.request}
|
|
577
|
+
context={this.props.context}
|
|
578
|
+
showLoading={() => this._showLoading()}
|
|
579
|
+
hideLoading={() => this._hideLoading()}
|
|
580
|
+
fullPosting={this.state.fullPosting}
|
|
581
|
+
progressBarHeight={this.state.progressBarHeight}
|
|
582
|
+
headerHeight={this.state.headerHeight} />
|
|
583
|
+
:
|
|
584
|
+
null
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
{this.state.view === Views.PUBLISH_6 ?
|
|
588
|
+
<Publish6 postingAd={this.state.postingAd}
|
|
589
|
+
country={this.props.country}
|
|
590
|
+
businessId={this.state.businessId}
|
|
591
|
+
scroll={(ref) => this.scroll.scrollIntoView(ref)}
|
|
592
|
+
saveEditAd={() => this._saveEditAd()}
|
|
593
|
+
goToPage={(view, params) => this._goToPage(view, null, params)}
|
|
594
|
+
request={this.props.request}
|
|
595
|
+
context={this.props.context}
|
|
596
|
+
showLoading={() => this._showLoading()}
|
|
597
|
+
hideLoading={() => this._hideLoading()}
|
|
598
|
+
fullPosting={this.state.fullPosting}
|
|
599
|
+
progressBarHeight={this.state.progressBarHeight}
|
|
600
|
+
headerHeight={this.state.headerHeight} />
|
|
601
|
+
:
|
|
602
|
+
null
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
{this.state.view === Views.PREVIEW ?
|
|
606
|
+
<Preview postingAd={this.state.postingAd}
|
|
607
|
+
country={this.props.country}
|
|
608
|
+
goBack={() => this.goBack()}
|
|
609
|
+
showLoading={() => this._showLoading()}
|
|
610
|
+
hideLoading={() => this._hideLoading()}
|
|
611
|
+
businessId={this.state.businessId}
|
|
612
|
+
progressBarHeight={this.state.progressBarHeight}
|
|
613
|
+
request={this.props.request}
|
|
614
|
+
headerHeight={this.state.headerHeight}
|
|
615
|
+
highlight={() => this._goToPage(Views.PAYMENT_ONLINE)}
|
|
616
|
+
params={this.state.params} />
|
|
617
|
+
:
|
|
618
|
+
null
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
{this.state.view === Views.EDIT_SELECTOR ?
|
|
622
|
+
<PostingEdit postingAd={this.state.postingAd}
|
|
623
|
+
topBar={this.props.topBar}
|
|
624
|
+
goToPage={(view) => this._goToPage(view)} />
|
|
625
|
+
:
|
|
626
|
+
null
|
|
627
|
+
}
|
|
618
628
|
|
|
619
629
|
{this.state.view === Views.PAYMENT_ONLINE ?
|
|
620
630
|
<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>
|