Skip to content
This repository has been archived by the owner on Dec 9, 2024. It is now read-only.

Add simple progressive reg components and routes #811

Draft
wants to merge 23 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
f8aded6
Add progresive components and routes
B77Mills Oct 16, 2023
7c5dc27
remove change email from progressive
B77Mills Oct 20, 2023
62cfb12
Update CTA
B77Mills Oct 20, 2023
d85273a
update verbiage
B77Mills Oct 20, 2023
3f12a10
remove concent & submit redirect logic
B77Mills Oct 20, 2023
1991c20
use active user vs user to prevent state changes
B77Mills Oct 20, 2023
80cd3c6
Add profileLastUpdated customAttr on progressive submit
B77Mills Oct 20, 2023
960d4ef
start setting up example of progressive reg
B77Mills Oct 20, 2023
6a1dee0
Add logic to account for address display dependencies
B77Mills Oct 20, 2023
fc9344d
use config to set delay by hours
B77Mills Oct 20, 2023
2a48524
Update field required/visibility logic
B77Mills Oct 24, 2023
6276a6a
fix setting of current question to ask validation
B77Mills Oct 25, 2023
f8b6ce1
Add server side requiresPUI validation check
B77Mills Oct 25, 2023
d831719
force page reload on progressive submit
B77Mills Oct 25, 2023
198fe46
fix error
B77Mills Oct 25, 2023
36276e0
remove un needed key value in additional event data
B77Mills Dec 13, 2023
e9decf4
Configure progressive reg on content page
B77Mills Dec 13, 2023
132fb64
Enable comments on example site
solocommand Feb 20, 2024
c03125e
Add progresive components and routes
B77Mills Oct 16, 2023
6cf084d
use config to set delay by hours
B77Mills Oct 20, 2023
721b29e
Configure progressive reg on content page
B77Mills Dec 13, 2023
b73d9b8
Example website config to point at Cogs & Widgets idx
B77Mills Jun 19, 2024
d0245f2
remove env log
B77Mills Jun 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 30 additions & 1 deletion packages/marko-web-identity-x/browser/form/consent.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div>
<div v-if="visible">
<div v-if="emailConsentRequest" class="row mt-3">
<div class="col-12">
<receive-email
Expand Down Expand Up @@ -66,6 +66,21 @@ export default {
type: String,
default: null,
},
hideWhenAnswered: {
type: Boolean,
default: false,
},
},

/**
*
*/
data() {
return {
currentUser: {
...this.user,
},
};
},

/**
Expand All @@ -83,6 +98,20 @@ export default {
return countryCodes.includes(countryCode);
});
},
/**
*
*/
visible() {
const { hideWhenAnswered } = this;
if (!hideWhenAnswered) return true;
if (!this.currentUser.receiveEmail) return true;
if (this.regionalPolicyFields.length) {
if (this.regionalPolicyFields.reduce(
(policy) => this.getRegionalPolicyAnswerValue(policy.id),
).length) return true;
}
return false;
},
},

/**
Expand Down
7 changes: 7 additions & 0 deletions packages/marko-web-identity-x/browser/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const Download = () => import(/* webpackChunkName: "identity-x-download" */ './d
const Logout = () => import(/* webpackChunkName: "identity-x-logout" */ './logout.vue');
const Login = () => import(/* webpackChunkName: "identity-x-login" */ './login.vue');
const Profile = () => import(/* webpackChunkName: "identity-x-profile" */ './profile.vue');
const Progressive = () => import(/* webpackChunkName: "identity-x-progressive" */ './progressive.vue');
const CommentStream = () => import(/* webpackChunkName: "identity-x-comment-stream" */ './comments/stream.vue');

const $graphql = createGraphqlClient({ uri: '/__graphql' });
Expand All @@ -25,6 +26,7 @@ export default (Browser, {
CustomLoginComponent,
CustomLogoutComponent,
CustomProfileComponent,
CustomProgressiveComponent,
} = {}) => {
const AccessComponent = CustomAccessComponent || Access;
const AuthenticateComponent = CustomAuthenticateComponent || Authenticate;
Expand All @@ -35,6 +37,7 @@ export default (Browser, {
const LoginComponent = CustomLoginComponent || Login;
const LogoutComponent = CustomLogoutComponent || Logout;
const ProfileComponent = CustomProfileComponent || Profile;
const ProgressiveComponent = CustomProgressiveComponent || Progressive;

window.IdentityX = new IdentityX();

Expand All @@ -48,6 +51,7 @@ export default (Browser, {
Browser.register('IdentityXLogin', LoginComponent, { provide: { EventBus } });
Browser.register('IdentityXLogout', LogoutComponent, { provide: { EventBus } });
Browser.register('IdentityXProfile', ProfileComponent, { provide: { EventBus } });
Browser.register('IdentityXProgressive', ProgressiveComponent, { provide: { EventBus } });

// Ensure the client-side IdX context is refreshed when the authentication event occurs
EventBus.$on('identity-x-authenticated', () => window.IdentityX.refreshContext());
Expand All @@ -66,6 +70,7 @@ export default (Browser, {
'identity-x-login-mounted',
'identity-x-logout-mounted',
'identity-x-profile-mounted',
'identity-x-progressive-mounted',
// Actions/submissions
'identity-x-access-submitted',
'identity-x-authenticated',
Expand All @@ -79,6 +84,7 @@ export default (Browser, {
'identity-x-login-link-sent',
'identity-x-logout',
'identity-x-profile-updated',
'identity-x-progressive-updated',
// Errors
'identity-x-access-errored',
'identity-x-authenticate-errored',
Expand All @@ -90,6 +96,7 @@ export default (Browser, {
'identity-x-login-errored',
'identity-x-logout-errored',
'identity-x-profile-errored',
'identity-x-progressive-errored',
].forEach((event) => {
EventBus.$on(event, (args) => {
if (!window.IdentityX) return;
Expand Down
Loading
Loading