Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge Dfg/sum24-involvemint into Develop #362

Open
wants to merge 18 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
4e1553b
Win24 involvemint (#307) (#308)
QuinnNTonic Jun 3, 2024
6879def
disable the delete offer button when the offer quantity is 0 or less …
fogunsan Jun 5, 2024
f7c54a7
complete task #270: Photo aspect ratios are off (#314)
b3nkang Jun 7, 2024
d1c1f86
Change 'Posted By' to 'Seller Info' in EP Storefront (#315)
hamede-abdulgafur Jun 9, 2024
9beb31f
288 negative credits (#316)
samanthap88 Jun 9, 2024
40076c5
fixed bug to allow uppercase into emails when signing up (#310)
justpenguins Jun 9, 2024
6b6a0a2
Feat 282: the password on the sign up needs the option to be visible…
fogunsan Jun 15, 2024
2d401be
Fix feat #160: New user first time login required popup can be closed…
b3nkang Jun 23, 2024
aabab62
Feat 313 (#341)
fogunsan Jul 13, 2024
8d1d65a
#212 added i icon next to CM and EP name in wallet (#344)
samanthap88 Jul 14, 2024
f5dbe90
add 321 additional button html
b3nkang Jul 14, 2024
ead7a44
add 321 additional button scss
b3nkang Jul 14, 2024
79f54ba
tickets 277 and 274 copied over to this branch (#353)
samanthap88 Aug 18, 2024
3ed10e4
Fix escrow decimal formatting issue #143 (#354)
hamede-abdulgafur Aug 18, 2024
414dfe2
#180: Prompt to enable location services during registration (#355)
b3nkang Aug 18, 2024
c2bb2ac
feat-165: Projects are still visible long after their expiration date…
fogunsan Aug 18, 2024
c0850aa
#284 - As a user purchasing an offer from an EP, I want to the number…
b3nkang Aug 18, 2024
e2eed9b
Merge branch 'develop' into dfg/sum24-involvemint
b3nkang Aug 18, 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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ azure-pipelines.yml

# dependencies
/node_modules
package-lock.json

# IDEs and editors
/.idea
Expand Down Expand Up @@ -48,4 +49,4 @@ gcp-service-key-prod.json
gcp-api-key-prod.json

reports/*
!reports/readme.md
!reports/readme.md
1 change: 1 addition & 0 deletions apps/migrate/src/app/app.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ export class AppService {
sendingTransactions: [],
sendingVouchers: [],
view: null,
tags: ep.tags
};
})
.filter((u) => !!u)
Expand Down
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,3 @@ services:
- .docker/firebase-emulators/.firebaserc:/.firebaserc
command: >
sh -c "firebase emulators:start --import=firebase-local-data --export-on-exit=firebase-local-data"

15 changes: 15 additions & 0 deletions libs/client/ep/shell/src/lib/storefront/storefront.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,21 @@
</im-error>
</im-item>

<im-item [touched]="true" label="Add Tags">
<ion-item>
<ion-select (ionChange)="onTagSelected($event)" placeholder="Select a tag">
<ion-select-option *ngFor="let tag of availableTags" [value]="tag">{{ tag }}</ion-select-option>
</ion-select>
</ion-item>
</im-item>

<div style="margin-bottom: 20px;" class="tags" *ngIf="storeFrontForm.get('tags')?.value.length > 0">
<div class="tag" *ngFor="let tag of storeFrontForm.get('tags')?.value; let i = index">
<span >{{ tag }}</span>
<ion-icon name="close-circle" (click)="removeTag(i)"></ion-icon>
</div>
</div>

<div>
<div class="im-primary-text">Storefront Images:</div>
<div class="images-cont">
Expand Down
30 changes: 30 additions & 0 deletions libs/client/ep/shell/src/lib/storefront/storefront.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,33 @@
color: black;
}
}

.tags {
display:flex ;
gap: 10px ;
}
.tag {
background-color: var(--ion-color-primary) ;
padding: 4px 8px ;
border-radius: 8px ;
color:white ;
display:flex ;
align-items: center;
gap: 2px ;

}

.tags {
display:flex ;
gap: 10px ;
}
.tag {
background-color: var(--ion-color-primary) ;
padding: 4px 8px ;
border-radius: 8px ;
color:white ;
display:flex ;
align-items: center;
gap: 2px ;
}

66 changes: 59 additions & 7 deletions libs/client/ep/shell/src/lib/storefront/storefront.component.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { ChangeDetectionStrategy, Component, OnInit, ViewChild } from '@angular/core';
import { Validators } from '@angular/forms';
import { ActivatedRoute } from '@angular/router';


import {
ImImagesViewerModalService,
UserFacade,
Expand All @@ -17,7 +19,9 @@ import {
} from '@involvemint/shared/domain';
import { tapOnce, UnArray } from '@involvemint/shared/util';
import { FormControl, FormGroup } from '@ngneat/reactive-forms';
import { filter, skip, switchMap, tap } from 'rxjs/operators';
import { filter, skip, switchMap, tap, take } from 'rxjs/operators';

import { FormBuilder} from '@angular/forms';

type Profile = NonNullable<UnArray<UserStoreModel['exchangeAdmins']>['exchangePartner']>;

Expand All @@ -36,12 +40,14 @@ interface State {
})
export class StorefrontComponent extends StatefulComponent<State> implements OnInit {
@ViewChild('tabs') tabs!: ImTabsComponent;
availableTags: string[] = ['Essentials', 'Arts & Entertainment', 'Professional Services', 'Trades', 'Rentals', 'Farming/Land', 'Food & Food Services', 'Health & Wellness', 'Transportation', 'Home Services', 'Youth', 'Seniors', 'Education/Training', 'Retail', 'Media & Print', 'Free'];

readonly storeFrontForm = new FormGroup({
listStoreFront: new FormControl<StorefrontListingStatus>(defaultProjectListingStatus, (e) =>
Validators.required(e)
),
description: new FormControl('', [Validators.maxLength(ImConfig.maxDescriptionLength)]),
tags: new FormControl<string[]>([])
});

readonly listingOptions: StorefrontListingStatus[] = ['public', 'private', 'unlisted'];
Expand All @@ -63,7 +69,7 @@ export class StorefrontComponent extends StatefulComponent<State> implements OnI
if (!activeTab) {
return;
}
// re-route to same route to remove queryParams (activeTab)

this.route.to.ep.storefront.ROOT({
queryParams: {
activeTab: undefined,
Expand All @@ -76,10 +82,10 @@ export class StorefrontComponent extends StatefulComponent<State> implements OnI
activeTab === 'storefront'
? this.tabs.setIndex(0)
: activeTab === 'offers'
? this.tabs.setIndex(1)
: activeTab === 'requests'
? this.tabs.setIndex(2)
: this.tabs.setIndex(0);
? this.tabs.setIndex(1)
: activeTab === 'requests'
? this.tabs.setIndex(2)
: this.tabs.setIndex(0);
});

this.effect(() =>
Expand All @@ -92,6 +98,7 @@ export class StorefrontComponent extends StatefulComponent<State> implements OnI
this.storeFrontForm.patchValue({
listStoreFront: exchangePartner.listStoreFront,
description: exchangePartner.description,
tags: exchangePartner.tags
});
}),
tap((exchangePartner) => {
Expand All @@ -109,12 +116,37 @@ export class StorefrontComponent extends StatefulComponent<State> implements OnI
this.user.epProfile.dispatchers.editEpProfile({
listStoreFront: form.listStoreFront,
description: form.description,
tags: form.tags,
});
}),

tap((form) => {

if (form.listStoreFront === 'private' || form.listStoreFront === 'unlisted') {
this.user.offers.selectors.offers$.pipe(
take(1),
tap(({ offers }) => {
offers.forEach(offer => {
this.user.offers.dispatchers.update({
offerId: offer.id,
changes: {
listingStatus: form.listStoreFront,
name: offer.name,
description: offer.description,
price: offer.price
},
});

});
})
).subscribe();
}
})
)
);
}


tabChangeEvent(event: number) {
if (typeof event !== 'number') {
return;
Expand All @@ -132,7 +164,7 @@ export class StorefrontComponent extends StatefulComponent<State> implements OnI
let files: File[] | undefined;
try {
files = parseMultipleFiles(event);
} catch (error) {
} catch (error:any) {
this.status.presentAlert({ title: 'Error', description: error.message });
}

Expand All @@ -145,6 +177,26 @@ export class StorefrontComponent extends StatefulComponent<State> implements OnI
this.user.epProfile.dispatchers.deleteEpImage(imagesFilePathsIndex);
}

addTag(tag: string) {
console.log("we are hereeeeee")
const currentTags = this.storeFrontForm.get('tags')?.value || [];
if (tag && !currentTags.includes(tag)) {
this.storeFrontForm.get('tags')?.patchValue([...currentTags, tag]);
console.log('Updated Tags:', this.storeFrontForm.get('tags')?.value);
}
}

onTagSelected(event: any) {
const selectedTag = event.detail.value;
this.addTag(selectedTag);
}

removeTag(index: number): void {
const currentTags = [...this.storeFrontForm.get('tags')?.value]; // Make a copy of the array
currentTags.splice(index, 1);
this.storeFrontForm.get('tags')?.patchValue([...currentTags]);
}

makeCoverPhoto(
ep: UnArray<UserStoreModel['exchangeAdmins']>['exchangePartner'],
imagesFilePathsIndex: number
Expand Down
16 changes: 9 additions & 7 deletions libs/client/login/src/lib/login-page/login-page.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,20 @@
</im-item>
<im-item [touched]="true">
<ion-icon slot="start" name="lock-closed"></ion-icon>
<input formControlName="password" name="password" type="password" placeholder="Password" />

<input formControlName="password" name="password" type="password" placeholder="Password"
[type]="isPasswordVisible ? 'text' : 'password'" />
<a class="type-toggle" (click)="togglePasswordVisibility()">
<ion-icon class="show-option" [hidden]="isPasswordVisible" name="eye-off-outline"></ion-icon>
<ion-icon class="hide-option" [hidden]="!isPasswordVisible" name="eye-outline"></ion-icon>
</a>
<im-error *ngIf="!loginForm.controls.password.valid && loginForm.controls.password.touched">
Please enter your password.
</im-error>
</im-item>

<!-- Implicit button for form when pressing enter button -->
<button
style="display: none"
[disabled]="!loginForm.valid"
test-attr="login-submit-implicit-button"
></button>
<button style="display: none" [disabled]="!loginForm.valid" test-attr="login-submit-implicit-button"></button>
</form>
<ion-button [disabled]="!loginForm.valid" (click)="submit()" test-attr="login-submit-button">
Log In
Expand All @@ -49,4 +51,4 @@
</span>
</div>
</ion-content>
</ng-container>
</ng-container>
5 changes: 5 additions & 0 deletions libs/client/login/src/lib/login-page/login-page.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ interface State {
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class LoginPageComponent extends StatefulComponent<State> implements OnInit {
isPasswordVisible = false;
readonly loginForm = new FormGroup({
email: new FormControl('', [(c) => Validators.required(c), Validators.pattern(ImConfig.regex.email)]),
password: new FormControl('', (c) => Validators.required(c)),
Expand Down Expand Up @@ -69,4 +70,8 @@ export class LoginPageComponent extends StatefulComponent<State> implements OnIn
async forgotPassword() {
return this.route.to.forgotPassword.ROOT({ animation: 'back' });
}

togglePasswordVisibility(): void {
this.isPasswordVisible = !this.isPasswordVisible;
}
}
33 changes: 19 additions & 14 deletions libs/client/login/src/lib/sign-up/sign-up.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,28 @@
</im-item>
<im-item [touched]="true">
<ion-icon slot="start" name="lock-closed"></ion-icon>
<input formControlName="password" placeholder="Password" name="password" type="password" />

<input formControlName="password" placeholder="Password" name="password"
[type]="isPasswordVisible ? 'text' : 'password'" />

<a class="type-toggle" (click)="togglePasswordVisibility()">
<ion-icon class="show-option" [hidden]="isPasswordVisible" name="eye-off-outline"></ion-icon>
<ion-icon class="hide-option" [hidden]="!isPasswordVisible" name="eye-outline"></ion-icon>
</a>

<im-error *ngIf="!signUpForm.controls.password.valid && signUpForm.controls.password.touched">
{{ pwdValidationText }}
</im-error>
</im-item>
<im-item [touched]="true">
<ion-icon slot="start" name="lock-closed"></ion-icon>
<input
formControlName="confirmPassword"
placeholder="Confirm Password"
name="password"
type="password"
/>

<input formControlName="confirmPassword" placeholder="Confirm Password" name="password"
[type]="isConfirmPasswordVisible ? 'text' : 'password'" />
<a class="type-toggle" (click)="toggleConfirmPasswordVisibility()">
<ion-icon class="show-option" [hidden]="isConfirmPasswordVisible" name="eye-off-outline"></ion-icon>
<ion-icon class="hide-option" [hidden]="!isConfirmPasswordVisible" name="eye-outline"></ion-icon>
</a>
<im-error *ngIf="signUpForm.controls.password.touched && signUpForm.getError('notSame')">
Your passwords do not match.
</im-error>
Expand All @@ -51,12 +60,8 @@
<!-- Implicit button for form when pressing enter button -->
<button style="display: none" [disabled]="!signUpForm.valid"></button>
</form>
<ion-button
[style.margin-top]="'var(--im-padding)'"
[disabled]="!signUpForm.valid"
test-attr="sign-up-submit-button"
(click)="submit()"
>
<ion-button [style.margin-top]="'var(--im-padding)'" [disabled]="!signUpForm.valid"
test-attr="sign-up-submit-button" (click)="submit()">
Sign Up
</ion-button>
<span [style.margin-top]="'var(--im-padding)'">
Expand All @@ -65,4 +70,4 @@
</span>
</div>
</ion-content>
</ng-container>
</ng-container>
15 changes: 14 additions & 1 deletion libs/client/login/src/lib/sign-up/sign-up.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core';
import { ChangeDetectionStrategy, Component, ContentChild, OnInit } from '@angular/core';
import { ValidationErrors, Validators } from '@angular/forms';
import { ActivatedRoute } from '@angular/router';
import { ImLegalModalInputs, ImLegalModalService, UserFacade } from '@involvemint/client/shared/data-access';
Expand All @@ -20,8 +20,11 @@ interface State {
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class SignUpComponent extends StatefulComponent<State> implements OnInit {
isPasswordVisible = false;
isConfirmPasswordVisible = false;
readonly signUpForm = new FormGroup(
{

email: new FormControl(
'',
Validators.compose([(c) => Validators.required(c), Validators.pattern(ImConfig.regex.email)])
Expand All @@ -48,6 +51,7 @@ export class SignUpComponent extends StatefulComponent<State> implements OnInit
private readonly uf: UserFacade,
private readonly activatedRoute: ActivatedRoute,
private readonly legalModal: ImLegalModalService

) {
super({ errorStatus: '' });
}
Expand Down Expand Up @@ -98,7 +102,16 @@ export class SignUpComponent extends StatefulComponent<State> implements OnInit
this.updateState({ errorStatus: '' });
}

togglePasswordVisibility(): void {
this.isPasswordVisible = !this.isPasswordVisible;
}

toggleConfirmPasswordVisibility(): void {
this.isConfirmPasswordVisible = !this.isConfirmPasswordVisible;
}
// doGoogleLogin(): void {
// this.uf.session.dispatchers.googleSignIn(environment.authPersistance);
// }
}


Loading