abmp-npm 1.6.3 → 1.6.5

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.
@@ -1,10 +1,11 @@
1
- const { auth } = require('@wix/essentials');
1
+ const { crm } = require('@wix/crm');
2
2
  const { items } = require('@wix/data');
3
+ const { auth } = require('@wix/essentials');
3
4
  const { members: membersSDK, authentication } = require('@wix/members');
4
- const { crm } = require('@wix/crm');
5
5
  const { encode } = require('ngeohash');
6
6
 
7
7
  const { COLLECTIONS } = require('../public/consts');
8
+
8
9
  const { wixData } = require('./elevated-modules');
9
10
  const { findMemberByWixDataId } = require('./members-data-methods');
10
11
  const { retrieveAllItems } = require('./utils');
@@ -51,8 +52,7 @@ function hasStudentMembership(member, checkAssociation = false) {
51
52
 
52
53
  return memberships.some(membership => {
53
54
  const isStudent = membership.membertype === MEMBERSHIPS_TYPES.STUDENT;
54
- const hasCorrectAssociation =
55
- !checkAssociation || membership.association === SITE_ASSOCIATION;
55
+ const hasCorrectAssociation = !checkAssociation || membership.association === SITE_ASSOCIATION;
56
56
  return isStudent && hasCorrectAssociation;
57
57
  });
58
58
  }
@@ -96,7 +96,12 @@ const getInterestAll = async () => {
96
96
  * @param {string} options.memberId - Member ID to exclude
97
97
  * @returns {Promise<Object|null>} Member data or null
98
98
  */
99
- async function getMemberBySlug({ slug, excludeDropped = true, excludeSearchedMember = false, memberId = null }) {
99
+ async function getMemberBySlug({
100
+ slug,
101
+ excludeDropped = true,
102
+ excludeSearchedMember = false,
103
+ memberId = null,
104
+ }) {
100
105
  if (!slug) return null;
101
106
 
102
107
  try {
@@ -392,4 +397,3 @@ module.exports = {
392
397
  checkUrlUniqueness,
393
398
  saveRegistrationData,
394
399
  };
395
-
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "abmp-npm",
3
- "version": "1.6.3",
3
+ "version": "1.6.5",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",
@@ -131,7 +131,7 @@ async function personalDetailsFormOnReady({
131
131
  $w('#loginButton2').hide();
132
132
  $w('#goBackButton').show();
133
133
 
134
- $w('#goBackButton').onClick(async () => {
134
+ $w('#goBackButton').onClick(() => {
135
135
  try {
136
136
  const isFormHasUnsavedChanges = Object.values(formHasUnsavedChanges).some(Boolean);
137
137
  if (isFormHasUnsavedChanges) {
@@ -505,10 +505,10 @@ async function personalDetailsFormOnReady({
505
505
  }
506
506
  const $saveDataButton = $w(buttonSelector);
507
507
 
508
- let isUrlValid = true,
509
- isEmailValid = true,
510
- isNameValid = true,
511
- isSlugValid = true;
508
+ let isUrlValid = true;
509
+ let isEmailValid = true;
510
+ let isNameValid = true;
511
+
512
512
  if (formDataType === FORM_SECTION_HANDLER_MAP.CONTACT_BOOKING.section) {
513
513
  isEmailValid = $w('#contactFormEmailInput').valid;
514
514
  isUrlValid =
@@ -819,9 +819,34 @@ async function personalDetailsFormOnReady({
819
819
  }
820
820
  }
821
821
 
822
- async function setupServiceSelection() {
822
+ async function filterInterests(searchValue) {
823
+ const container = $w('#containerRepeaterInterest');
824
+ const repeater = $w('#repeaterInterest');
825
+
826
+ const allInterests = await getInterestAll();
827
+ const filtered = allInterests
828
+ .filter(val => val.toLowerCase().includes(searchValue))
829
+ .map(val => ({ _id: generateId(), value: val }));
830
+
831
+ if (filtered.length > 0) {
832
+ repeater.data = filtered;
833
+ container.expand();
834
+ } else {
835
+ repeater.data = [];
836
+ container.collapse();
837
+ }
838
+
839
+ return filtered;
840
+ }
841
+
842
+ const debounce_fun = _.debounce(async () => {
843
+ const searchValue = $w('#intrestInput').value.trim().toLowerCase();
844
+ await filterInterests(searchValue);
845
+ }, 250);
846
+
847
+ function setupServiceSelection() {
823
848
  const intrestInput = $w('#intrestInput');
824
- intrestInput.onClick(async () => {
849
+ intrestInput.onClick(() => {
825
850
  if (intrestInput.value) {
826
851
  intrestInput.onClick(async () => {
827
852
  await filterInterests(intrestInput.value);
@@ -832,13 +857,6 @@ async function personalDetailsFormOnReady({
832
857
  $w('#containerRepeaterInterest').expand();
833
858
  });
834
859
 
835
- // intrestInput.onBlur(() => {
836
- // // Give time to allow click on repeater item before collapsing
837
- // setTimeout(() => {
838
- // $w('#containerRepeaterInterest').collapse();
839
- // }, 150);
840
- // });
841
-
842
860
  intrestInput.onKeyPress(event => {
843
861
  debounce_fun();
844
862
 
@@ -1983,32 +2001,6 @@ async function personalDetailsFormOnReady({
1983
2001
  const ext = fullName.slice(dotIndex);
1984
2002
  return `${name.slice(0, maxBaseLength)}...${ext}`;
1985
2003
  }
1986
-
1987
- async function filterInterests(searchValue) {
1988
- const container = $w('#containerRepeaterInterest');
1989
- const repeater = $w('#repeaterInterest');
1990
-
1991
- const allInterests = await getInterestAll();
1992
- const filtered = allInterests
1993
- .filter(val => val.toLowerCase().includes(searchValue))
1994
- .map(val => ({ _id: generateId(), value: val }));
1995
-
1996
- if (filtered.length > 0) {
1997
- repeater.data = filtered;
1998
- container.expand();
1999
- } else {
2000
- repeater.data = [];
2001
- container.collapse();
2002
- }
2003
-
2004
- return filtered;
2005
- }
2006
-
2007
- // Declare debounce_fun - uses filterInterests above
2008
- const debounce_fun = _.debounce(async () => {
2009
- const searchValue = $w('#intrestInput').value.trim().toLowerCase();
2010
- await filterInterests(searchValue);
2011
- }, 250);
2012
2004
  }
2013
2005
 
2014
2006
  module.exports = {
@@ -30,4 +30,3 @@ module.exports = {
30
30
  handleOnCustomValidation,
31
31
  isNotValidUrl,
32
32
  };
33
-