muba-posting 7.0.6 → 7.0.7
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/Publish1.js +42 -14
- package/commonStyles.js +4 -0
- package/locales/ar.json +4 -1
- package/locales/en.json +4 -1
- package/locales/es.json +4 -1
- package/locales/fr.json +4 -1
- package/locales/it.json +4 -1
- package/locales/nl.json +4 -1
- package/package.json +1 -1
package/Publish1.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Text, View, TouchableHighlight } from 'react-native';
|
|
2
|
+
import { Text, View, TouchableHighlight, TouchableOpacity } from 'react-native';
|
|
3
3
|
import { strings } from 'muba-i18n';
|
|
4
4
|
import commonStyles from './commonStyles';
|
|
5
5
|
import RadioButtonGroup from 'muba-radio-button-group';
|
|
@@ -12,6 +12,7 @@ const FontAwesomeIcon = createIconSetFromFontello(fontelloConfig);
|
|
|
12
12
|
const PROMOTION_LOCATION = { method: 'GET', url: '/controller/businesses/{businessId}/promotion-location' };
|
|
13
13
|
const GET_TRANSACTIONS = { method: 'GET', url: '/controller/transactions' };
|
|
14
14
|
const GET_CHECK_TRANSACTION = { method: 'GET', url: '/controller/posting/check-transaction' };
|
|
15
|
+
const GET_CHANGED_AD_TYPE = { method: 'GET', url: '/controller/posting/changed-ad-type' };
|
|
15
16
|
|
|
16
17
|
export default class Publish1 extends React.Component {
|
|
17
18
|
constructor(props) {
|
|
@@ -109,13 +110,18 @@ export default class Publish1 extends React.Component {
|
|
|
109
110
|
}
|
|
110
111
|
}
|
|
111
112
|
|
|
112
|
-
async
|
|
113
|
+
async validate() {
|
|
113
114
|
if (this.validateForm()) {
|
|
114
115
|
const responseCheckTransaction = await this.props.request(this.props.context, GET_CHECK_TRANSACTION, {
|
|
115
116
|
adId: this.props.postingAd.id,
|
|
116
117
|
businessId: this.props.businessId,
|
|
117
118
|
transactionId: this.props.postingAd.transaction
|
|
118
119
|
});
|
|
120
|
+
const responseChangedAdType = await this.props.request(this.props.context, GET_CHANGED_AD_TYPE, {
|
|
121
|
+
adId: this.props.postingAd.id,
|
|
122
|
+
businessId: this.props.businessId,
|
|
123
|
+
adTypeId: this.props.postingAd.adType
|
|
124
|
+
});
|
|
119
125
|
|
|
120
126
|
if (responseCheckTransaction.value === 'true') {
|
|
121
127
|
for (var i = 0; i < this.state.typeBienOptions.elements.length; i++) {
|
|
@@ -125,25 +131,35 @@ export default class Publish1 extends React.Component {
|
|
|
125
131
|
}
|
|
126
132
|
}
|
|
127
133
|
|
|
128
|
-
if (
|
|
129
|
-
|
|
130
|
-
this.props.goToPage(Views.PUBLISH_2);
|
|
131
|
-
} else {
|
|
132
|
-
this.props.goToPage(Views.PUBLISH_2_B);
|
|
133
|
-
}
|
|
134
|
+
if (responseChangedAdType.value === 'false') {
|
|
135
|
+
this.nextStep();
|
|
134
136
|
} else {
|
|
135
|
-
|
|
136
|
-
this.props.goToPage(Views.PUBLISH_3, true);
|
|
137
|
-
} else {
|
|
138
|
-
this.props.saveEditAd();
|
|
139
|
-
}
|
|
137
|
+
this.popupAdTypeChanged.show();
|
|
140
138
|
}
|
|
139
|
+
|
|
141
140
|
} else {
|
|
142
141
|
this.popupNoTransaction.show();
|
|
143
142
|
}
|
|
144
143
|
}
|
|
145
144
|
}
|
|
146
145
|
|
|
146
|
+
async nextStep() {
|
|
147
|
+
this.popupAdTypeChanged?.hide();
|
|
148
|
+
if (this.props.postingAd.id == null || this.props.fullPosting) {
|
|
149
|
+
if (this.props.postingAd.exactlyLocated && this.props.postingAd.promotionId == null) {
|
|
150
|
+
this.props.goToPage(Views.PUBLISH_2);
|
|
151
|
+
} else {
|
|
152
|
+
this.props.goToPage(Views.PUBLISH_2_B);
|
|
153
|
+
}
|
|
154
|
+
} else {
|
|
155
|
+
if (this.oldTransaction != this.state.transactionOptions.selectedItem || this.oldAdType != this.state.typeBienOptions.selectedItem) {
|
|
156
|
+
this.props.goToPage(Views.PUBLISH_3, true);
|
|
157
|
+
} else {
|
|
158
|
+
this.props.saveEditAd();
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
147
163
|
validateForm() {
|
|
148
164
|
return this.radioButtonAdType.onSubmitValidate();
|
|
149
165
|
}
|
|
@@ -180,7 +196,7 @@ export default class Publish1 extends React.Component {
|
|
|
180
196
|
</View>
|
|
181
197
|
</View>
|
|
182
198
|
<View style={commonStyles.buttomButton}>
|
|
183
|
-
<TouchableHighlight style={commonStyles.actionButton} underlayColor="#ff5d00" onPress={() => this.
|
|
199
|
+
<TouchableHighlight style={commonStyles.actionButton} underlayColor="#ff5d00" onPress={() => this.validate()}>
|
|
184
200
|
<Text style={commonStyles.actionButtonText}>
|
|
185
201
|
{this.props.postingAd.id == null || this.props.fullPosting || this.oldTransaction != this.state.transactionOptions.selectedItem || this.oldAdType != this.state.typeBienOptions.selectedItem ?
|
|
186
202
|
strings('setup.next').toUpperCase()
|
|
@@ -194,6 +210,18 @@ export default class Publish1 extends React.Component {
|
|
|
194
210
|
title={strings('setup.cantPostTransaction')} icon={<FontAwesomeIcon name='block' />}>
|
|
195
211
|
<Text style={commonStyles.popupText}></Text>
|
|
196
212
|
</PopupAdvice>
|
|
213
|
+
|
|
214
|
+
<PopupAdvice dialogStyle={commonStyles.popupBox} ref={popupAdTypeChanged => this.popupAdTypeChanged = popupAdTypeChanged}
|
|
215
|
+
title={strings('setup.adTypeChanged')} icon={<FontAwesomeIcon name='block' />} hideButton={true}>
|
|
216
|
+
<Text style={commonStyles.popupText}>{strings('setup.willValidateAgain')}</Text>
|
|
217
|
+
|
|
218
|
+
<TouchableOpacity style={[commonStyles.okBtnBoxPopup, commonStyles.okBtnPopup]} onPress={() => this.popupAdTypeChanged.hide()} >
|
|
219
|
+
<Text style={commonStyles.okBtnTextPopup}>{strings('setup.adviceOK')}</Text>
|
|
220
|
+
</TouchableOpacity>
|
|
221
|
+
<TouchableOpacity style={[commonStyles.okBtnBoxPopup, commonStyles.okBtnPopup, commonStyles.redBtnPopup]} onPress={() => this.nextStep()} >
|
|
222
|
+
<Text style={commonStyles.okBtnTextPopup}>{strings('setup.continue')}</Text>
|
|
223
|
+
</TouchableOpacity>
|
|
224
|
+
</PopupAdvice>
|
|
197
225
|
</View>
|
|
198
226
|
);
|
|
199
227
|
}
|
package/commonStyles.js
CHANGED
package/locales/ar.json
CHANGED
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
"adviceText1": " الحد الأقصى لحجم الصورة 5 ميغابايت ويجب ألا يتجاوز 3456 × 3456 بكسل. يجب تنزيل الصور بحجم .jpg أو .gif أو .png.",
|
|
36
36
|
"adviceText2": "المنشورات التي تتضمن صورة تتلقى ما يصل إلى 3 مرات أكثر من الزيارات. اختر كصورة غلاف تلك التي تمثل أفضل ميزات العقار.",
|
|
37
37
|
"adviceOK": "حسنا شكرا",
|
|
38
|
+
"continue": "متابعة",
|
|
38
39
|
"features": "الخصائص",
|
|
39
40
|
"mainFeatures": "خصائص عامة",
|
|
40
41
|
"inside": "الداخل",
|
|
@@ -115,7 +116,9 @@
|
|
|
115
116
|
"noPromotionTitle": "أنت بحاجة إلى ترقية",
|
|
116
117
|
"noPromotionText": "لإنشاء إعلان جديد، أنت بحاجة إلى ترويج",
|
|
117
118
|
"login": "الهاتف ملكي، قم بتغيير الحساب",
|
|
118
|
-
"cantPostTransaction": "لا يمكنك التبديل إلى هذه الفئة"
|
|
119
|
+
"cantPostTransaction": "لا يمكنك التبديل إلى هذه الفئة",
|
|
120
|
+
"adTypeChanged": "تم تعديل نوع الخاصية",
|
|
121
|
+
"willValidateAgain": "تم اكتشاف أن نوع الخاصية قد تم تعديله، لذلك سيتم إلغاء تنشيط الإعلان وسيخضع لعملية التحقق من الصحة مرة أخرى"
|
|
119
122
|
},
|
|
120
123
|
"product": {
|
|
121
124
|
"LISTING": "قوائم",
|
package/locales/en.json
CHANGED
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
"adviceText1": "The size of the image has a maximum of 5 MB and must not exceed 3456 x 3456 pixels. Images must be downloaded in .jpg, .gif or .png format.",
|
|
36
36
|
"adviceText2": "Publications including a photo receive up to 3 times more visits. Choose as a cover photo which best represents the most important features of the property",
|
|
37
37
|
"adviceOK": "Close",
|
|
38
|
+
"continue": "Continue",
|
|
38
39
|
"features": "Features",
|
|
39
40
|
"mainFeatures": "Main Features",
|
|
40
41
|
"inside": "inside",
|
|
@@ -115,7 +116,9 @@
|
|
|
115
116
|
"noPromotionTitle": "You need a promotion",
|
|
116
117
|
"noPromotionText": "To create a new ad, you need a promotion",
|
|
117
118
|
"login": "The phone is mine, change account",
|
|
118
|
-
"cantPostTransaction": "You cannot change to this category"
|
|
119
|
+
"cantPostTransaction": "You cannot change to this category",
|
|
120
|
+
"adTypeChanged": "Property type modified",
|
|
121
|
+
"willValidateAgain": "It has been detected that the property type has been modified, so the ad will be deactivated and will go through the validation process again"
|
|
119
122
|
},
|
|
120
123
|
"product": {
|
|
121
124
|
"LISTING": "Listing",
|
package/locales/es.json
CHANGED
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
"adviceText1": "El tamaño de la imagen tiene un máximo de 20 MB y no debe exceder los 3456 x 3456 píxeles. Las imágenes deben descargarse en formato .jpg, .gif o .png.",
|
|
36
36
|
"adviceText2": "Las anuncios que incluyan fotos reciben hasta 3 veces más de visitas. Elija como foto de portada la que mejor represente las características más importantes de la propiedad.",
|
|
37
37
|
"adviceOK": "Cerrar",
|
|
38
|
+
"continue": "Continuar",
|
|
38
39
|
"features": "Características",
|
|
39
40
|
"mainFeatures": "Características generales",
|
|
40
41
|
"inside": "Interior",
|
|
@@ -115,7 +116,9 @@
|
|
|
115
116
|
"noPromotionTitle": "Necesitas una promoción",
|
|
116
117
|
"noPromotionText": "Para crear un nuevo anuncio, necesitas una promoción",
|
|
117
118
|
"login": "El teléfono es mío, cambiar de cuenta",
|
|
118
|
-
"cantPostTransaction": "No puedes cambiar a esta categoría"
|
|
119
|
+
"cantPostTransaction": "No puedes cambiar a esta categoría",
|
|
120
|
+
"adTypeChanged": "Tipo de propiedad modificado",
|
|
121
|
+
"willValidateAgain": "Se ha detectado que se ha modificado el tipo de propiedad, así que el anuncio se desactivará y volverá a pasar por el proceso de validación"
|
|
119
122
|
},
|
|
120
123
|
"product": {
|
|
121
124
|
"LISTING": "Listing",
|
package/locales/fr.json
CHANGED
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
"adviceText1": "La taille de l'image a un maximum de 5 Mo et ne doit pas dépasser 3456 x 3456 pixels. Les images doivent être téléchargées au format .jpg, .gif ou .png.",
|
|
36
36
|
"adviceText2": "Les publications incluant une photo reçoivent jusqu'à 3 fois plus de visites. Choisissez comme photo de couverture celle qui représente le mieux les caractéristiques les plus importantes du bien",
|
|
37
37
|
"adviceOK": "Fermer",
|
|
38
|
+
"continue": "Continuer",
|
|
38
39
|
"features": "Fonctionnalités",
|
|
39
40
|
"mainFeatures": "Caractéristiques générales",
|
|
40
41
|
"inside": "Intérieur",
|
|
@@ -115,7 +116,9 @@
|
|
|
115
116
|
"noPromotionTitle": "Vous avez besoin d'une promotion",
|
|
116
117
|
"noPromotionText": "Pour créer une nouvelle annonce, vous avez besoin d'une promotion",
|
|
117
118
|
"login": "Le téléphone est à moi, changer de compte",
|
|
118
|
-
"cantPostTransaction": "Vous ne pouvez pas passer à cette catégorie"
|
|
119
|
+
"cantPostTransaction": "Vous ne pouvez pas passer à cette catégorie",
|
|
120
|
+
"adTypeChanged": "Type de bien modifié",
|
|
121
|
+
"willValidateAgain": "Il a été détecté que le type de bien a été modifié, l'annonce sera donc désactivée et repassera par le processus de validation"
|
|
119
122
|
},
|
|
120
123
|
"product": {
|
|
121
124
|
"LISTING": "Liste",
|
package/locales/it.json
CHANGED
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
"adviceText1": "La dimensione massima dell’immagine è di 20 MB e non può superare i 3456 x 3456 pixel. Le immagini devono essere scaricate in .jpg, .gif o .png.",
|
|
36
36
|
"adviceText2": "Le pubblicazioni con foto ricevono fino a 3 volte più visualizzazioni. Scegli l’immagine di copertina che meglio rappresenta la caratteristica principale dell’immobile",
|
|
37
37
|
"adviceOK": "Chiudi",
|
|
38
|
+
"continue": "Continua",
|
|
38
39
|
"features": "Caratteristiche",
|
|
39
40
|
"mainFeatures": "Caratteristiche generali ",
|
|
40
41
|
"inside": "Interno",
|
|
@@ -115,7 +116,9 @@
|
|
|
115
116
|
"noPromotionTitle": "Hai bisogno di una promozione",
|
|
116
117
|
"noPromotionText": "Per creare un nuovo annuncio, è necessaria una promozione",
|
|
117
118
|
"login": "Il telefono è mio, cambia account",
|
|
118
|
-
"cantPostTransaction": "Non è possibile passare a questa categoria"
|
|
119
|
+
"cantPostTransaction": "Non è possibile passare a questa categoria",
|
|
120
|
+
"adTypeChanged": "Tipo di immobile modificato",
|
|
121
|
+
"willValidateAgain": "È stato rilevato che il tipo di proprietà è stato modificato, pertanto l'inserzione verrà disattivata e passerà nuovamente attraverso il processo di convalida"
|
|
119
122
|
},
|
|
120
123
|
"product": {
|
|
121
124
|
"LISTING": "Inserzioni",
|
package/locales/nl.json
CHANGED
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
"adviceText1": "De afbeelding mag maximaal 20 MG zijn en mag niet meer dan 3456 x 3456 pixels zijn. Afbeeldingen moeten worden gedownload als .jpg, .gif of .png.",
|
|
36
36
|
"adviceText2": "Publicaties met een foto worden drie keer zo vaak bezocht. Kies een omslagfoto die de belangrijkste kenmerken van het pand het beste benadrukken",
|
|
37
37
|
"adviceOK": "Sluiten",
|
|
38
|
+
"continue": "Verdergaan",
|
|
38
39
|
"features": "Kenmerken",
|
|
39
40
|
"mainFeatures": "Algemene kenmerken",
|
|
40
41
|
"inside": "Interieur",
|
|
@@ -115,7 +116,9 @@
|
|
|
115
116
|
"noPromotionTitle": "Je hebt een promotie nodig",
|
|
116
117
|
"noPromotionText": "Om een nieuwe advertentie te maken, heb je een promotie nodig",
|
|
117
118
|
"login": "De telefoon is van mij, account wijzigen",
|
|
118
|
-
"cantPostTransaction": "U kunt niet overschakelen naar deze categorie"
|
|
119
|
+
"cantPostTransaction": "U kunt niet overschakelen naar deze categorie",
|
|
120
|
+
"adTypeChanged": "Eigenschapstype gewijzigd",
|
|
121
|
+
"willValidateAgain": "Er is gedetecteerd dat het type eigenschap is gewijzigd, dus de advertentie wordt gedeactiveerd en doorloopt het validatieproces opnieuw"
|
|
119
122
|
},
|
|
120
123
|
"product": {
|
|
121
124
|
"LISTING": "Advertenties",
|