abmp-npm 1.6.4 → 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 {
|
|
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({
|
|
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
|
@@ -131,7 +131,7 @@ async function personalDetailsFormOnReady({
|
|
|
131
131
|
$w('#loginButton2').hide();
|
|
132
132
|
$w('#goBackButton').show();
|
|
133
133
|
|
|
134
|
-
$w('#goBackButton').onClick(
|
|
134
|
+
$w('#goBackButton').onClick(() => {
|
|
135
135
|
try {
|
|
136
136
|
const isFormHasUnsavedChanges = Object.values(formHasUnsavedChanges).some(Boolean);
|
|
137
137
|
if (isFormHasUnsavedChanges) {
|
|
@@ -508,7 +508,6 @@ async function personalDetailsFormOnReady({
|
|
|
508
508
|
let isUrlValid = true;
|
|
509
509
|
let isEmailValid = true;
|
|
510
510
|
let isNameValid = true;
|
|
511
|
-
// Use the outer isSlugValid variable (declared at function scope)
|
|
512
511
|
|
|
513
512
|
if (formDataType === FORM_SECTION_HANDLER_MAP.CONTACT_BOOKING.section) {
|
|
514
513
|
isEmailValid = $w('#contactFormEmailInput').valid;
|
|
@@ -820,9 +819,34 @@ async function personalDetailsFormOnReady({
|
|
|
820
819
|
}
|
|
821
820
|
}
|
|
822
821
|
|
|
823
|
-
async function
|
|
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() {
|
|
824
848
|
const intrestInput = $w('#intrestInput');
|
|
825
|
-
intrestInput.onClick(
|
|
849
|
+
intrestInput.onClick(() => {
|
|
826
850
|
if (intrestInput.value) {
|
|
827
851
|
intrestInput.onClick(async () => {
|
|
828
852
|
await filterInterests(intrestInput.value);
|
|
@@ -833,13 +857,6 @@ async function personalDetailsFormOnReady({
|
|
|
833
857
|
$w('#containerRepeaterInterest').expand();
|
|
834
858
|
});
|
|
835
859
|
|
|
836
|
-
// intrestInput.onBlur(() => {
|
|
837
|
-
// // Give time to allow click on repeater item before collapsing
|
|
838
|
-
// setTimeout(() => {
|
|
839
|
-
// $w('#containerRepeaterInterest').collapse();
|
|
840
|
-
// }, 150);
|
|
841
|
-
// });
|
|
842
|
-
|
|
843
860
|
intrestInput.onKeyPress(event => {
|
|
844
861
|
debounce_fun();
|
|
845
862
|
|
|
@@ -1984,32 +2001,6 @@ async function personalDetailsFormOnReady({
|
|
|
1984
2001
|
const ext = fullName.slice(dotIndex);
|
|
1985
2002
|
return `${name.slice(0, maxBaseLength)}...${ext}`;
|
|
1986
2003
|
}
|
|
1987
|
-
|
|
1988
|
-
async function filterInterests(searchValue) {
|
|
1989
|
-
const container = $w('#containerRepeaterInterest');
|
|
1990
|
-
const repeater = $w('#repeaterInterest');
|
|
1991
|
-
|
|
1992
|
-
const allInterests = await getInterestAll();
|
|
1993
|
-
const filtered = allInterests
|
|
1994
|
-
.filter(val => val.toLowerCase().includes(searchValue))
|
|
1995
|
-
.map(val => ({ _id: generateId(), value: val }));
|
|
1996
|
-
|
|
1997
|
-
if (filtered.length > 0) {
|
|
1998
|
-
repeater.data = filtered;
|
|
1999
|
-
container.expand();
|
|
2000
|
-
} else {
|
|
2001
|
-
repeater.data = [];
|
|
2002
|
-
container.collapse();
|
|
2003
|
-
}
|
|
2004
|
-
|
|
2005
|
-
return filtered;
|
|
2006
|
-
}
|
|
2007
|
-
|
|
2008
|
-
// Declare debounce_fun - uses filterInterests above
|
|
2009
|
-
const debounce_fun = _.debounce(async () => {
|
|
2010
|
-
const searchValue = $w('#intrestInput').value.trim().toLowerCase();
|
|
2011
|
-
await filterInterests(searchValue);
|
|
2012
|
-
}, 250);
|
|
2013
2004
|
}
|
|
2014
2005
|
|
|
2015
2006
|
module.exports = {
|