diff --git a/libs/client/ep/shell/src/lib/storefront/storefront.component.scss b/libs/client/ep/shell/src/lib/storefront/storefront.component.scss
index 05ee9b69..016a96f6 100644
--- a/libs/client/ep/shell/src/lib/storefront/storefront.component.scss
+++ b/libs/client/ep/shell/src/lib/storefront/storefront.component.scss
@@ -14,4 +14,20 @@
padding: 0.5em;
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 ;
+
}
diff --git a/libs/client/ep/shell/src/lib/storefront/storefront.component.ts b/libs/client/ep/shell/src/lib/storefront/storefront.component.ts
index 8a4d3812..da3498b7 100644
--- a/libs/client/ep/shell/src/lib/storefront/storefront.component.ts
+++ b/libs/client/ep/shell/src/lib/storefront/storefront.component.ts
@@ -19,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, take } from 'rxjs/operators';
+import { filter, skip, switchMap, tap ,take } from 'rxjs/operators';
+import { FormBuilder} from '@angular/forms';
+
type Profile = NonNullable
['exchangePartner']>;
@@ -37,13 +39,19 @@ interface State {
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class StorefrontComponent extends StatefulComponent 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(defaultProjectListingStatus, (e) =>
Validators.required(e)
),
description: new FormControl('', [Validators.maxLength(ImConfig.maxDescriptionLength)]),
+ tags: new FormControl([]),
+ spendingOptions: new FormControl('')
});
readonly listingOptions: StorefrontListingStatus[] = ['public', 'private', 'unlisted'];
@@ -55,12 +63,14 @@ export class StorefrontComponent extends StatefulComponent implements OnI
private readonly status: StatusService,
private readonly imagesViewer: ImImagesViewerModalService,
private readonly route: RouteService,
- private readonly activatedRoute: ActivatedRoute
+ private readonly activatedRoute: ActivatedRoute,
) {
super({ activeTabIndex: 0, profile: null, deepLink: null, savingState: 'saved' });
+
}
ngOnInit(): void {
+
this.activatedRoute.queryParams.pipe().subscribe(async ({ activeTab }) => {
if (!activeTab) {
return;
@@ -91,9 +101,13 @@ export class StorefrontComponent extends StatefulComponent implements OnI
if (!exchangePartner) {
return;
}
+ console.log(exchangePartner)
this.storeFrontForm.patchValue({
listStoreFront: exchangePartner.listStoreFront,
description: exchangePartner.description,
+ tags: exchangePartner.tags,
+ spendingOptions: exchangePartner.spendingOptions
+
});
}),
tap((exchangePartner) => {
@@ -107,10 +121,16 @@ export class StorefrontComponent extends StatefulComponent implements OnI
switchMap(() => this.storeFrontForm.valueChanges),
skip(1),
tap((form) => {
+ console.log(this.storeFrontForm.get('tags')?.value)
+ console.log(this.storeFrontForm.get('description')?.value)
+ console.log(form.tags)
+ console.log(form.description)
this.updateState({ savingState: 'saving' });
this.user.epProfile.dispatchers.editEpProfile({
listStoreFront: form.listStoreFront,
description: form.description,
+ tags: form.tags,
+ spendingOptions: form.spendingOptions
});
}),
@@ -150,6 +170,7 @@ export class StorefrontComponent extends StatefulComponent implements OnI
});
}
+
async viewImages(paths: string[], index: number): Promise {
await this.imagesViewer.open({ imagesFilePaths: paths, slideIndex: index });
}
@@ -158,7 +179,7 @@ export class StorefrontComponent extends StatefulComponent implements OnI
let files: File[] | undefined;
try {
files = parseMultipleFiles(event);
- } catch (error) {
+ } catch (error:any) {
this.status.presentAlert({ title: 'Error', description: error.message });
}
@@ -167,10 +188,32 @@ export class StorefrontComponent extends StatefulComponent implements OnI
this.user.epProfile.dispatchers.uploadEpImages(files);
}
+
+
deleteImage(imagesFilePathsIndex: number): void {
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['exchangePartner'],
imagesFilePathsIndex: number
diff --git a/libs/client/ep/shell/src/lib/storefront/storefront.module.ts b/libs/client/ep/shell/src/lib/storefront/storefront.module.ts
index 452bee4e..edcb4d21 100644
--- a/libs/client/ep/shell/src/lib/storefront/storefront.module.ts
+++ b/libs/client/ep/shell/src/lib/storefront/storefront.module.ts
@@ -14,6 +14,7 @@ import { ImRoutes } from '@involvemint/shared/domain';
import { IonicModule } from '@ionic/angular';
import { AutosizeModule } from 'ngx-autosize';
import { StorefrontComponent } from './storefront.component';
+import {FormsModule} from '@angular/forms';
@NgModule({
imports: [
@@ -29,6 +30,7 @@ import { StorefrontComponent } from './storefront.component';
ImStorageUrlPipeModule,
OffersModule,
RequestsModule,
+ FormsModule,
RouterModule.forChild([
{
path: '',
diff --git a/libs/client/shared/data-access/src/lib/+state/session/user-session.reducer.ts b/libs/client/shared/data-access/src/lib/+state/session/user-session.reducer.ts
index bf63ca0e..2bc5da8c 100644
--- a/libs/client/shared/data-access/src/lib/+state/session/user-session.reducer.ts
+++ b/libs/client/shared/data-access/src/lib/+state/session/user-session.reducer.ts
@@ -26,6 +26,7 @@ export interface ExchangeAdminsWithBaDownloaded extends UnArray
+
diff --git a/libs/client/shared/ui/src/lib/im-tabs/im-tab/im-tab.component.ts b/libs/client/shared/ui/src/lib/im-tabs/im-tab/im-tab.component.ts
index 238c2f11..0f4a9b06 100644
--- a/libs/client/shared/ui/src/lib/im-tabs/im-tab/im-tab.component.ts
+++ b/libs/client/shared/ui/src/lib/im-tabs/im-tab/im-tab.component.ts
@@ -8,4 +8,5 @@ import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
})
export class ImTabComponent {
@Input() label = '';
+ @Input() disabled = false;
}
diff --git a/libs/client/shared/ui/src/lib/im-tabs/im-tabs.component.html b/libs/client/shared/ui/src/lib/im-tabs/im-tabs.component.html
index 5b724e1b..21209586 100644
--- a/libs/client/shared/ui/src/lib/im-tabs/im-tabs.component.html
+++ b/libs/client/shared/ui/src/lib/im-tabs/im-tabs.component.html
@@ -5,8 +5,12 @@
[activeTabIndex]="activeTabIndex"
>
-
- {{ label }}
+
+ {{ tab.label }}
();
@@ -40,7 +41,21 @@ export class ImTabsComponent extends RxJSBaseClass implements AfterContentInit {
}
tabChangeEvent(event: Event) {
- this.tabChange.emit((event as CustomEvent).detail.index);
+ const newIndex = (event as CustomEvent).detail.index;
+ const tabArray = this.tabs.toArray();
+ if (!tabArray[newIndex]?.disabled) {
+ this.tabChange.emit(newIndex);
+ this.activeTabIndex = newIndex;
+ } else {
+ this.superTabs.selectTab(this.activeTabIndex);
+ }
+ }
+
+ selectTab(index: number) {
+ if (!this.tabs.toArray()[index]?.disabled) {
+ this.superTabs.selectTab(index);
+ this.activeTabIndex = index;
+ }
}
ngAfterContentInit() {
@@ -53,6 +68,9 @@ export class ImTabsComponent extends RxJSBaseClass implements AfterContentInit {
}
setIndex(index: number) {
- this.superTabs.selectTab(index);
+ if (!this.tabs.toArray()[index]?.disabled) {
+ this.superTabs.selectTab(index);
+ }
}
+
}
diff --git a/libs/client/shell/src/lib/market/ep-cover/ep-cover.component.html b/libs/client/shell/src/lib/market/ep-cover/ep-cover.component.html
index 16549b12..be16cf02 100644
--- a/libs/client/shell/src/lib/market/ep-cover/ep-cover.component.html
+++ b/libs/client/shell/src/lib/market/ep-cover/ep-cover.component.html
@@ -29,8 +29,13 @@
-
-
+
+
-
+
Items For Sale
No offers listed.
diff --git a/libs/client/shell/src/lib/market/ep-cover/ep-cover.component.scss b/libs/client/shell/src/lib/market/ep-cover/ep-cover.component.scss
index bf04868e..66c108f5 100644
--- a/libs/client/shell/src/lib/market/ep-cover/ep-cover.component.scss
+++ b/libs/client/shell/src/lib/market/ep-cover/ep-cover.component.scss
@@ -127,3 +127,12 @@
text-indent: 10%;
box-sizing: content-box;
}
+
+
+
+
+
+
+
+
+
diff --git a/libs/client/shell/src/lib/market/ep-cover/ep-cover.component.ts b/libs/client/shell/src/lib/market/ep-cover/ep-cover.component.ts
index 423b45df..5211153c 100644
--- a/libs/client/shell/src/lib/market/ep-cover/ep-cover.component.ts
+++ b/libs/client/shell/src/lib/market/ep-cover/ep-cover.component.ts
@@ -31,6 +31,7 @@ interface State {
})
export class EpCoverComponent extends StatefulComponent
implements OnInit {
@ViewChild('tabs') tabs!: ImTabsComponent;
+
readonly offersChecked = new Map<
string,
@@ -145,4 +146,5 @@ export class EpCoverComponent extends StatefulComponent implements OnInit
buyVoucher(exchangePartner: ExchangePartnerMarketStoreModel) {
this.user.vouchers.dispatchers.buy(exchangePartner, Array.from(this.offersChecked.values()));
}
+
}
diff --git a/libs/client/shell/src/lib/market/market.component.html b/libs/client/shell/src/lib/market/market.component.html
index a97dae4d..86c333e1 100644
--- a/libs/client/shell/src/lib/market/market.component.html
+++ b/libs/client/shell/src/lib/market/market.component.html
@@ -51,10 +51,16 @@
{{ ep!.name }}
+
+
+