diff --git a/libs/client/shell/src/lib/applications/create-cm-profile/create-cm-profile.component.scss b/libs/client/shell/src/lib/applications/create-cm-profile/create-cm-profile.component.scss
index 106a9836..20e9804a 100644
--- a/libs/client/shell/src/lib/applications/create-cm-profile/create-cm-profile.component.scss
+++ b/libs/client/shell/src/lib/applications/create-cm-profile/create-cm-profile.component.scss
@@ -44,5 +44,12 @@
gap: var(--im-padding);
padding: var(--im-padding);
}
+
+ .center-content {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ height: 100%;
+ }
}
}
diff --git a/libs/client/shell/src/lib/applications/create-cm-profile/create-cm-profile.component.ts b/libs/client/shell/src/lib/applications/create-cm-profile/create-cm-profile.component.ts
index d1ce164e..c1f14667 100644
--- a/libs/client/shell/src/lib/applications/create-cm-profile/create-cm-profile.component.ts
+++ b/libs/client/shell/src/lib/applications/create-cm-profile/create-cm-profile.component.ts
@@ -1,12 +1,8 @@
import { AfterViewInit, ChangeDetectionStrategy, Component, OnInit, ViewChild } from '@angular/core';
import { Validators } from '@angular/forms';
import { ActivatedRoute } from '@angular/router';
-import {
- HandleRestClient,
- UserFacade,
- verifyHandleUniqueness,
-} from '@involvemint/client/shared/data-access';
-import { StatefulComponent } from '@involvemint/client/shared/util';
+import { HandleRestClient, UserFacade, verifyHandleUniqueness } from '@involvemint/client/shared/data-access';
+import { StatefulComponent, GeolocationService } from '@involvemint/client/shared/util';
import { CmOnboardingState, ImConfig } from '@involvemint/shared/domain';
import { DeepReadonly, STATES } from '@involvemint/shared/util';
import { IonSlides } from '@ionic/angular';
@@ -26,6 +22,7 @@ export interface CreateCmProfileFormData {
interface State {
verifyingHandle: boolean;
+ locationEnabled: boolean;
}
@Component({
@@ -58,9 +55,10 @@ export class CreateCmProfileComponent extends StatefulComponent implement
constructor(
private readonly uf: UserFacade,
private readonly handleRestClient: HandleRestClient,
- private readonly route: ActivatedRoute
+ private readonly route: ActivatedRoute,
+ private readonly geolocationService: GeolocationService
) {
- super({ verifyingHandle: false });
+ super({ verifyingHandle: false, locationEnabled: false });
}
ngOnInit(): void {
@@ -93,6 +91,23 @@ export class CreateCmProfileComponent extends StatefulComponent implement
this.slides.lockSwipes(true);
}
+ enableLocation() {
+ this.geolocationService
+ .getPosition()
+ .then((position) => {
+ console.log('Location retrieved:', position);
+ // store somewhere, tbd, TODO
+ this.updateState({ locationEnabled: true });
+ // this.next();
+ })
+ .catch((error) => {
+ console.error('Error retrieving location:', error);
+ if (error.code === error.PERMISSION_DENIED) {
+ alert('Please enable location services to use this feature.');
+ }
+ });
+ }
+
submit(): void {
this.uf.session.dispatchers.createCmProfile({
...this.createProfileForm.value,
diff --git a/libs/client/shell/src/lib/applications/ep-application/ep-application.component.html b/libs/client/shell/src/lib/applications/ep-application/ep-application.component.html
index 69e7b0ad..7b7b541e 100644
--- a/libs/client/shell/src/lib/applications/ep-application/ep-application.component.html
+++ b/libs/client/shell/src/lib/applications/ep-application/ep-application.component.html
@@ -190,7 +190,18 @@
-
+
+ Enable Location Services
+
+
{{ baAdmin ? (applyFor === 'business' ? 'Submit for Business' : 'Submit for Yourself') : 'Submit' }}
diff --git a/libs/client/shell/src/lib/applications/ep-application/ep-application.component.ts b/libs/client/shell/src/lib/applications/ep-application/ep-application.component.ts
index 7147ee43..2f44706e 100644
--- a/libs/client/shell/src/lib/applications/ep-application/ep-application.component.ts
+++ b/libs/client/shell/src/lib/applications/ep-application/ep-application.component.ts
@@ -7,7 +7,11 @@ import {
verifyHandleUniqueness,
verifyUserEmailUniqueness,
} from '@involvemint/client/shared/data-access';
-import { ConfirmDeactivationGuard, StatefulComponent } from '@involvemint/client/shared/util';
+import {
+ ConfirmDeactivationGuard,
+ StatefulComponent,
+ GeolocationService,
+} from '@involvemint/client/shared/util';
import { ImConfig, SubmitEpApplicationDto } from '@involvemint/shared/domain';
import { STATES } from '@involvemint/shared/util';
import { FormControl, FormGroup } from '@ngneat/reactive-forms';
@@ -20,6 +24,7 @@ interface EpForm extends Omit
{
interface State {
verifyingUserEmail: boolean;
verifyingHandle: boolean;
+ locationEnabled: boolean;
}
@Component({
@@ -59,9 +64,10 @@ export class EpApplicationComponent
constructor(
private readonly user: UserFacade,
private readonly userClient: UserRestClient,
- private readonly handleRestClient: HandleRestClient
+ private readonly handleRestClient: HandleRestClient,
+ private readonly geolocationService: GeolocationService
) {
- super({ verifyingUserEmail: false, verifyingHandle: false });
+ super({ verifyingUserEmail: false, verifyingHandle: false, locationEnabled: false });
}
@HostListener('window:beforeunload', ['$event'])
@@ -110,4 +116,19 @@ export class EpApplicationComponent
this.applyFor = 'yourself';
}
}
+
+ enableLocation() {
+ this.geolocationService
+ .getPosition()
+ .then((position) => {
+ console.log('Location retrieved:', position);
+ this.updateState({ locationEnabled: true });
+ })
+ .catch((error) => {
+ console.error('Error retrieving location:', error);
+ if (error.code === error.PERMISSION_DENIED) {
+ alert('Please enable location services to use this feature.');
+ }
+ });
+ }
}
diff --git a/libs/client/shell/src/lib/applications/sp-application/sp-application.component.html b/libs/client/shell/src/lib/applications/sp-application/sp-application.component.html
index 18244d65..724ae7b5 100644
--- a/libs/client/shell/src/lib/applications/sp-application/sp-application.component.html
+++ b/libs/client/shell/src/lib/applications/sp-application/sp-application.component.html
@@ -132,7 +132,18 @@