abmp-npm 2.0.10 → 2.0.12

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.
@@ -84,7 +84,7 @@ const validateCoreMemberData = inputMemberData => {
84
84
  return true;
85
85
  };
86
86
 
87
- const containsNonEnglish = str => /[^a-zA-Z0-9]/.test(str); // if it contains any non-english characters, test1 is allowed, but any others are not
87
+ const containsNonEnglish = str => /[^a-zA-Z0-9-]/.test(str); // if it contains any non-english characters or invalid URL chars, test1 is allowed, hyphens are allowed
88
88
 
89
89
  /**
90
90
  * Creates a full name from first and last name components
@@ -132,7 +132,9 @@ async function getMemberBySlug({
132
132
  }
133
133
  query = query.limit(1000);
134
134
  const searchResult = await searchAllItems(query);
135
- const membersList = searchResult.filter(item => item.url && item.url.includes(slug)); //replacement for contains
135
+ const membersList = searchResult.filter(
136
+ item => item.url && item.url.toLowerCase().includes(slug.toLowerCase())
137
+ ); //replacement for contains - case insensitive
136
138
  let matchingMembers = membersList.filter(
137
139
  item => item.url && item.url.toLowerCase() === slug.toLowerCase()
138
140
  );
@@ -89,7 +89,7 @@ const TASKS = {
89
89
  getIdentifier: () => 'SHOULD_NEVER_SKIP',
90
90
  process: updateSiteMapS3,
91
91
  shouldSkipCheck: () => false,
92
- estimatedDurationSec: 70,
92
+ estimatedDurationSec: 90,
93
93
  },
94
94
  [TASKS_NAMES.scheduleContactFormEmailMigration]: {
95
95
  name: TASKS_NAMES.scheduleContactFormEmailMigration,
@@ -1,6 +1,7 @@
1
1
  const fs = require('fs');
2
2
  const path = require('path');
3
3
 
4
+ // eslint-disable-next-line import/no-unresolved
4
5
  const csv = require('csv-parser');
5
6
 
6
7
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "abmp-npm",
3
- "version": "2.0.10",
3
+ "version": "2.0.12",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "check-cycles": "madge --circular .",
package/pages/Profile.js CHANGED
@@ -52,7 +52,7 @@ async function profileOnReady({ $w: _$w }) {
52
52
  profileData.mainAddress
53
53
  );
54
54
  } else {
55
- collapseElements(['#locationContainer', '#location1Container', '#locationContainer2']);
55
+ deleteElements(['#locationContainer', '#location1Container', '#locationContainer2']);
56
56
  }
57
57
 
58
58
  setupAdditionalAddresses();
@@ -98,7 +98,7 @@ async function profileOnReady({ $w: _$w }) {
98
98
  if (profileData.memberSince) {
99
99
  _$w('#sinceYearText').text = profileData.memberSince;
100
100
  } else {
101
- _$w('#memberSinceBox').collapse();
101
+ _$w('#memberSinceBox').delete();
102
102
  }
103
103
  }
104
104
 
@@ -106,7 +106,7 @@ async function profileOnReady({ $w: _$w }) {
106
106
  if (profileData.shouldHaveStudentBadge) {
107
107
  _$w('#studentContainer, #studentContainerMobile').expand();
108
108
  } else {
109
- _$w('#studentContainer, #studentContainerMobile').collapse();
109
+ _$w('#studentContainer, #studentContainerMobile').delete();
110
110
  }
111
111
  }
112
112
 
@@ -114,7 +114,7 @@ async function profileOnReady({ $w: _$w }) {
114
114
  if (profileData.logoImage) {
115
115
  _$w('#logoImage').src = profileData.logoImage;
116
116
  } else {
117
- _$w('#logoImage').collapse();
117
+ _$w('#logoImage').delete();
118
118
  }
119
119
 
120
120
  if (profileData.profileImage) {
@@ -131,7 +131,7 @@ async function profileOnReady({ $w: _$w }) {
131
131
  profileData.fullName
132
132
  );
133
133
  } else {
134
- collapseElements(['#fullNameText', '#fullNameText2', '#fullNameTextFoter']);
134
+ deleteElements(['#fullNameText', '#fullNameText2', '#fullNameTextFoter']);
135
135
  }
136
136
  }
137
137
 
@@ -149,7 +149,7 @@ async function profileOnReady({ $w: _$w }) {
149
149
  wixWindow.openLightbox(LIGHTBOX_NAMES.CONTACT_US, profileData)
150
150
  );
151
151
  } else {
152
- _$w('#contactButton').collapse();
152
+ _$w('#contactButton').delete();
153
153
  }
154
154
  }
155
155
 
@@ -157,7 +157,7 @@ async function profileOnReady({ $w: _$w }) {
157
157
  if (profileData.bookingUrl) {
158
158
  _$w('#bookNowButton').link = profileData.bookingUrl;
159
159
  } else {
160
- _$w('#bookNowButton').collapse();
160
+ _$w('#bookNowButton').delete();
161
161
  }
162
162
  }
163
163
 
@@ -172,7 +172,7 @@ async function profileOnReady({ $w: _$w }) {
172
172
  _$w('#phoneText').html = getPhoneHTML(_$w('#phoneText'));
173
173
  _$w('#phoneText2').html = getPhoneHTML(_$w('#phoneText2'));
174
174
  } else {
175
- collapseElements(['#phoneContainer', '#phoneContainer2']);
175
+ deleteElements(['#phoneContainer', '#phoneContainer2']);
176
176
  }
177
177
  }
178
178
 
@@ -180,7 +180,7 @@ async function profileOnReady({ $w: _$w }) {
180
180
  if (profileData.licenceNo) {
181
181
  _$w('#licenceNoText').text = profileData.licenceNo;
182
182
  } else {
183
- _$w('#licensesContainer').collapse();
183
+ _$w('#licensesContainer').delete();
184
184
  }
185
185
  }
186
186
 
@@ -194,7 +194,7 @@ async function profileOnReady({ $w: _$w }) {
194
194
  if (profileData.aboutService) {
195
195
  _$w('#aboutYouText').html = profileData.aboutService;
196
196
  } else {
197
- _$w('#aboutSection').collapse();
197
+ _$w('#aboutSection').delete();
198
198
  }
199
199
  }
200
200
 
@@ -203,7 +203,7 @@ async function profileOnReady({ $w: _$w }) {
203
203
  _$w('#businessName').text = profileData.businessName;
204
204
  _$w('#businessName').expand();
205
205
  } else {
206
- _$w('#businessName').collapse();
206
+ _$w('#businessName').delete();
207
207
  }
208
208
  }
209
209
 
@@ -213,13 +213,13 @@ async function profileOnReady({ $w: _$w }) {
213
213
  if (areasText) {
214
214
  _$w('#areaOfPracticesText').text = areasText;
215
215
  } else {
216
- _$w('#areaOfPracticesText').collapse();
216
+ _$w('#areaOfPracticesText').delete();
217
217
  }
218
218
 
219
219
  if (Array.isArray(profileData.areasOfPractices) && profileData.areasOfPractices.length > 0) {
220
220
  populateRepeater(profileData.areasOfPractices, '#areaOfPracticesRepeater', '#practiceText');
221
221
  } else {
222
- _$w('#servicesSection').collapse();
222
+ _$w('#servicesSection').delete();
223
223
  }
224
224
  }
225
225
 
@@ -229,16 +229,16 @@ async function profileOnReady({ $w: _$w }) {
229
229
  }
230
230
 
231
231
  if (!profileData.gallery?.length) {
232
- _$w('#gallerySection').collapse();
232
+ _$w('#gallerySection').delete();
233
233
  } else {
234
234
  _$w('#gallery').items = profileData.gallery;
235
- _$w('#gallerySection').expand();
235
+ _$w('#gallerySection').restore();
236
236
  }
237
237
  }
238
238
 
239
239
  function bindTestimonialsData() {
240
240
  if (!profileData.testimonials?.length) {
241
- _$w('#testimonialsSection').collapse();
241
+ _$w('#testimonialsSection').delete();
242
242
  }
243
243
  }
244
244
 
@@ -267,7 +267,7 @@ async function profileOnReady({ $w: _$w }) {
267
267
  setupTestimonialsPagination(profileData.testimonials);
268
268
  _$w('#testimonialsSection').expand();
269
269
  } else {
270
- _$w('#testimonialsSection').collapse();
270
+ _$w('#testimonialsSection').delete();
271
271
  }
272
272
  }
273
273
 
@@ -283,9 +283,9 @@ async function profileOnReady({ $w: _$w }) {
283
283
  });
284
284
  }
285
285
 
286
- function collapseElements(elementIds) {
286
+ function deleteElements(elementIds) {
287
287
  elementIds.forEach(id => {
288
- _$w(id).collapse();
288
+ _$w(id).delete();
289
289
  });
290
290
  }
291
291