muba-posting 7.0.2 → 7.0.3

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/Publish6.js CHANGED
@@ -7,6 +7,8 @@ import PhoneGroup from 'muba-phone-group';
7
7
  import PopupAdvice from 'muba-popup-advice';
8
8
  import { createIconSetFromFontello } from 'react-native-vector-icons';
9
9
  import fontelloConfig from './fonts/config.json';
10
+ import { navigate } from '../../app/utils/Common';
11
+ import { Views } from '../../app/utils/Views';
10
12
  const FontAwesomeIcon = createIconSetFromFontello(fontelloConfig);
11
13
 
12
14
  const GENERATE_TITLE_DESCRIPTION = { method: 'GET', url: '/controller/posting/generate-title-description' };
@@ -24,11 +26,12 @@ export default class Publish6 extends React.Component {
24
26
  this.state = {
25
27
  hideSave: false,
26
28
  requiredPhoneError: false,
27
- existingPhoneError: false,
28
29
  titleDescriptionLoaded: false,
29
30
  languages: this.props.postingAd.languages,
30
31
  picturesUploaded: 0,
31
- reference: this.props.postingAd.reference
32
+ reference: this.props.postingAd.reference,
33
+ showResetPassword: false,
34
+ showLogin: false
32
35
  }
33
36
 
34
37
  this.resetSubmitClicked();
@@ -37,6 +40,10 @@ export default class Publish6 extends React.Component {
37
40
  componentDidMount = () => {
38
41
  this.generateTitleDescription();
39
42
  this.resetSubmitClicked();
43
+
44
+ this.props.context.props.navigation.addListener('focus', async () => {
45
+ this.nextStep();
46
+ });
40
47
  }
41
48
 
42
49
  isSameList = (firstList, secondList) => {
@@ -117,8 +124,11 @@ export default class Publish6 extends React.Component {
117
124
  this.setState({ loading: true });
118
125
 
119
126
  const responseJson = await this.props.request(this.props.context, PHONE_REGISTERED, body);
120
- validate = responseJson.value === 'true' && validate;
121
- this.setState({ existingPhoneError: responseJson.value !== 'true' });
127
+ validate = responseJson.message == null && validate;
128
+ if (responseJson.message != null) {
129
+ this.setState({ phoneMessage: responseJson.message, allowRecover: responseJson.allowRecover });
130
+ this.popupPhoneRegistered.show();
131
+ }
122
132
 
123
133
  this.languageItem.forEach(element => validate = element.validateLanguageItem() && validate);
124
134
  }
@@ -143,6 +153,11 @@ export default class Publish6 extends React.Component {
143
153
  this.setState({ reference: text });
144
154
  }
145
155
 
156
+ recoverPassword() {
157
+ this.popupPhoneRegistered.hide();
158
+ navigate(this.props.context, Views.LOGIN, { RedirectTo: 'back', view: 'lostPassword', disableChangeView: true, loadLeadData: false })
159
+ }
160
+
146
161
  render() {
147
162
  return (
148
163
  <View style={{ flex: 1 }}>
@@ -184,10 +199,6 @@ export default class Publish6 extends React.Component {
184
199
  <Text style={commonStyles.subNote}> {strings('setup.maxPhones')}</Text>
185
200
  </View>
186
201
 
187
- <View style={commonStyles.row}>
188
- <Text style={commonStyles.red}> {this.state.existingPhoneError ? strings('setup.existingPhone') : null}</Text>
189
- </View>
190
-
191
202
  <PhoneGroup
192
203
  ref='phoneGroup'
193
204
  inputStyle={commonStyles.input}
@@ -265,6 +276,24 @@ export default class Publish6 extends React.Component {
265
276
  {strings('setup.posting_tip_description_10')}
266
277
  </Text>
267
278
  </PopupAdvice>
279
+
280
+ <PopupAdvice width={0.9} dialogStyle={commonStyles.popupBox} ref={popupPhoneRegistered => this.popupPhoneRegistered = popupPhoneRegistered}
281
+ title={strings('setup.existingPhone')} icon={<FontAwesomeIcon name='exclamation-circle' />}>
282
+ <Text style={[commonStyles.popupText, commonStyles.black, commonStyles.textCenter]}>
283
+ {this.state.phoneMessage}
284
+ </Text>
285
+
286
+ {this.props.businessId || !this.state.allowRecover ?
287
+ null
288
+ :
289
+ <View>
290
+ <View style={commonStyles.minDivider} />
291
+ <TouchableOpacity onPress={() => this.recoverPassword()}>
292
+ <Text style={[commonStyles.blue, commonStyles.textCenter, commonStyles.fSize15]}>{strings('setup.resetPassword')}</Text>
293
+ </TouchableOpacity>
294
+ </View>
295
+ }
296
+ </PopupAdvice>
268
297
  </View>
269
298
  );
270
299
  }
package/commonStyles.js CHANGED
@@ -1348,6 +1348,15 @@ export default StyleSheet.create({
1348
1348
  fontFamily: 'PostingSemiBold',
1349
1349
  textTransform: 'uppercase',
1350
1350
  color: 'rgb(15, 179, 166)'
1351
+ },
1352
+
1353
+ minDivider: {
1354
+ width: '100%',
1355
+ height: 20
1356
+ },
1357
+
1358
+ fSize15: {
1359
+ fontSize: 15
1351
1360
  }
1352
1361
 
1353
1362
  });
package/locales/ar.json CHANGED
@@ -112,7 +112,8 @@
112
112
  "highlight": "رفع قيمة",
113
113
  "ad_cant_post_zone": "لا يمكنك النشر في هذه المدينة",
114
114
  "noPromotionTitle": "أنت بحاجة إلى ترقية",
115
- "noPromotionText": "لإنشاء إعلان جديد، أنت بحاجة إلى ترويج"
115
+ "noPromotionText": "لإنشاء إعلان جديد، أنت بحاجة إلى ترويج",
116
+ "resetPassword": "إعادة تعيين كلمة المرور"
116
117
  },
117
118
  "product": {
118
119
  "LISTING": "قوائم",
package/locales/en.json CHANGED
@@ -112,7 +112,8 @@
112
112
  "highlight": "Highlight",
113
113
  "ad_cant_post_zone": "You can't post in this city",
114
114
  "noPromotionTitle": "You need a promotion",
115
- "noPromotionText": "To create a new ad, you need a promotion"
115
+ "noPromotionText": "To create a new ad, you need a promotion",
116
+ "resetPassword": "Recover password"
116
117
  },
117
118
  "product": {
118
119
  "LISTING": "Listing",
package/locales/es.json CHANGED
@@ -112,7 +112,8 @@
112
112
  "highlight": "Destacar",
113
113
  "ad_cant_post_zone": "No puedes publicar en esta ciudad",
114
114
  "noPromotionTitle": "Necesitas una promoción",
115
- "noPromotionText": "Para crear un nuevo anuncio, necesitas una promoción"
115
+ "noPromotionText": "Para crear un nuevo anuncio, necesitas una promoción",
116
+ "resetPassword": "Recuperar contraseña"
116
117
  },
117
118
  "product": {
118
119
  "LISTING": "Listing",
package/locales/fr.json CHANGED
@@ -112,7 +112,8 @@
112
112
  "highlight": "Mettre en valeur",
113
113
  "ad_cant_post_zone": "Vous ne pouvez pas poster dans cette ville",
114
114
  "noPromotionTitle": "Vous avez besoin d'une promotion",
115
- "noPromotionText": "Pour créer une nouvelle annonce, vous avez besoin d'une promotion"
115
+ "noPromotionText": "Pour créer une nouvelle annonce, vous avez besoin d'une promotion",
116
+ "resetPassword": "Récupérer le mot de passe"
116
117
  },
117
118
  "product": {
118
119
  "LISTING": "Liste",
package/locales/it.json CHANGED
@@ -112,7 +112,8 @@
112
112
  "highlight": "Evidenziare",
113
113
  "ad_cant_post_zone": "Non puoi postare in questa città",
114
114
  "noPromotionTitle": "Hai bisogno di una promozione",
115
- "noPromotionText": "Per creare un nuovo annuncio, è necessaria una promozione"
115
+ "noPromotionText": "Per creare un nuovo annuncio, è necessaria una promozione",
116
+ "resetPassword": "Recupero della password"
116
117
  },
117
118
  "product": {
118
119
  "LISTING": "Inserzioni",
package/locales/nl.json CHANGED
@@ -112,7 +112,8 @@
112
112
  "highlight": "Highlighting",
113
113
  "ad_cant_post_zone": "In deze stad mag je niet posten",
114
114
  "noPromotionTitle": "Je hebt een promotie nodig",
115
- "noPromotionText": "Om een nieuwe advertentie te maken, heb je een promotie nodig"
115
+ "noPromotionText": "Om een nieuwe advertentie te maken, heb je een promotie nodig",
116
+ "resetPassword": "Wachtwoord herstellen"
116
117
  },
117
118
  "product": {
118
119
  "LISTING": "Advertenties",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "muba-posting",
3
- "version": "7.0.2",
3
+ "version": "7.0.3",
4
4
  "description": "Posting",
5
5
  "main": "Posting.js",
6
6
  "scripts": {