Skip to content

Commit

Permalink
Merge pull request #46 from swoocn/dev
Browse files Browse the repository at this point in the history
Approved for deployment propagation.
  • Loading branch information
swoocn authored Apr 8, 2024
2 parents 5fd3f66 + 6417eeb commit 2a46e82
Show file tree
Hide file tree
Showing 19 changed files with 592 additions and 367 deletions.
7 changes: 0 additions & 7 deletions .changeset/3-30-2024.md

This file was deleted.

9 changes: 9 additions & 0 deletions .changeset/4-7-2024.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"map-of-pi/frontend/src/app/shared/language-switcher": patch
"map-of-pi/frontend/src/app/business/business-settings": patch
"map-of-pi/frontend/src/app/home/map": patch
---

Added Nigerian Hausa to Language Translation selector.
Fixed image upload issue in the Business Registration screen.
Fixed empty search queries for businesses/ products.
Original file line number Diff line number Diff line change
@@ -1,42 +1,29 @@
<main class="mb-[100px]">
<section class="menu-settings__section">
<div class="mb-3 font-bold text-base text-green-900">{{ 'BUSINESS.CONFIGURATION.LABELS.SHOP_NAME' | translate }} {{ shop.name }}</div>

<div class="menu-settings__toggle">
<label for="menu-toggle" class="menu-settings__label"
>{{ 'BUSINESS.CONFIGURATION.LABELS.MENU' | translate }} <span class="toggle-status">{{ menuStatusLabel }}</span>
<input
type="checkbox"
id="menu-toggle"
name="menu_toggle"
class="menu-settings__checkbox"
#menuToggle
(change)="onToggleChange('menu-toggle')" />
<input type="checkbox" id="menu-toggle" name="menu_toggle" class="menu-settings__checkbox" #menuToggle (change)="onToggleChange('menu-toggle')" />
<span class="menu-settings__slider"></span>
</label>
</div>

<div class="menu-settings__toggle hidden" #orderToggleDiv>
<label for="order-toggle" class="menu-settings__label"
>{{ 'BUSINESS.CONFIGURATION.LABELS.ACCEPT_ORDERS_WITHOUT_PAYMENT_MESSAGE' | translate }}
<span class="toggle-status">{{ orderStatusLabel }}</span>
<input
type="checkbox"
id="order-toggle"
name="order_toggle"
class="menu-settings__checkbox"
(change)="onToggleChange('order-toggle')" />
<input type="checkbox" id="order-toggle" name="order_toggle" class="menu-settings__checkbox" (change)="onToggleChange('order-toggle')" />
<span class="menu-settings__slider"></span>
</label>
</div>

<div class="menu-settings__toggle hidden" #paymentToggleDiv>
<label for="payment-toggle" class="menu-settings__label"
>{{ 'BUSINESS.CONFIGURATION.LABELS.ACCEPT_PI_TRANSACTIONS_MESSAGE' | translate }}
<span class="toggle-status">{{ paymentStatusLabel }}</span>
<input
type="checkbox"
id="payment-toggle"
name="payment_toggle"
class="menu-settings__checkbox"
(change)="onToggleChange('payment-toggle')" />
<input type="checkbox" id="payment-toggle" name="payment_toggle" class="menu-settings__checkbox" (change)="onToggleChange('payment-toggle')" />
<span class="menu-settings__slider"></span>
</label>
</div>
Expand All @@ -47,38 +34,24 @@
</div>

<section class="menu-setting__floating-button-section" #addItemButtonSection>
<button
class="menu-setting__floating-button hidden"
#floatingButton
(click)="showModal()">
<button class="menu-setting__floating-button hidden" #floatingButton (click)="showModal()">
<i class="fa-solid fa-circle-plus"></i>
</button>
</section>
</main>

<!-- add product to shop modal starts here -->
<div
class="modal"
#addItemModal
[style.display]="isPreviewImageVisible ? 'block' : 'none'">
<div class="modal" #addItemModal [style.display]="isPreviewImageVisible ? 'block' : 'none'">
<div class="modal__content">
<form [formGroup]="businessProductsForm">
<button
type="button"
class="modal__close-button"
aria-label="Close"
(click)="hideModal($event)">
&times;
</button>
<button type="button" class="modal__close-button" aria-label="Close" (click)="hideModal($event)">&times;</button>

<!-- Modal title -->
<h2 class="modal__title">{{ 'BUSINESS.CONFIGURATION.ADD_PRODUCT_MENU.LABELS.ADD_PRODUCT_INTO_SHOP_MESSAGE' | translate }}</h2>

<!-- product name-->
<div class="flex flex-col gap-0 w-full mb-2">
<label for="item-name" class="modal__label font-bold"
>{{ 'BUSINESS.CONFIGURATION.ADD_PRODUCT_MENU.LABELS.PRODUCT_NAME' | translate }}</label
>
<label for="item-name" class="modal__label font-bold">{{ 'BUSINESS.CONFIGURATION.ADD_PRODUCT_MENU.LABELS.PRODUCT_NAME' | translate }}</label>
<input
type="text"
id="item-name"
Expand All @@ -88,35 +61,20 @@ <h2 class="modal__title">{{ 'BUSINESS.CONFIGURATION.ADD_PRODUCT_MENU.LABELS.ADD_

<!-- product images -->
<div class="flex flex-col gap-1 w-full mb-3">
<label for="item-name" class="modal__label font-bold"
>{{ 'BUSINESS.CONFIGURATION.ADD_PRODUCT_MENU.LABELS.PRODUCT_IMAGES' | translate }}</label
>
<input
type="file"
id="item-image-upload"
class="modal__input-file hidden"
accept="image/*"
(change)="handleImageUpload($event)" />
<label for="item-name" class="modal__label font-bold">{{ 'BUSINESS.CONFIGURATION.ADD_PRODUCT_MENU.LABELS.PRODUCT_IMAGES' | translate }}</label>
<input type="file" id="item-image-upload" class="modal__input-file hidden" accept="image/*" (change)="handleImageUpload($event)" />
<label
for="item-image-upload"
class="modal__add-button bg-blue-500 hover:bg-blue-600 text-white font-semibold py-2 px-4 rounded-md cursor-pointer flex items-center justify-center"
aria-label="Add item">
<img
[src]="
previewImageSrc
? previewImageSrc
: '../../../../assets/images/business/add-item-button.png'
"
[src]="previewImageSrc ? previewImageSrc : '../../../../assets/images/business/add-item-button.png'"
alt="Add item button"
class="w-6 h-6 mr-2" />
{{ 'BUSINESS.CONFIGURATION.ADD_PRODUCT_MENU.LABELS.ADD_IMAGE' | translate }}
{{ 'BUSINESS.CONFIGURATION.ADD_PRODUCT_MENU.LABELS.ADD_IMAGE' | translate }}
</label>
<div id="image-preview" class="modal__image-preview">
<img
[src]="previewImageSrc"
alt="Image Preview"
*ngIf="isPreviewImageVisible"
class="w-full h-auto" />
<img [src]="previewImageSrc" alt="Image Preview" *ngIf="isPreviewImageVisible" class="w-full h-auto" />
<span
class="image-preview__close absolute top-2 right-2 text-white bg-red-500 rounded-full w-6 h-6 flex items-center justify-center cursor-pointer"
(click)="clearPreviewImage()"
Expand All @@ -136,10 +94,7 @@ <h2 class="modal__title">{{ 'BUSINESS.CONFIGURATION.ADD_PRODUCT_MENU.LABELS.ADD_
id="item-price"
class="border border-gray-300 w-full rounded-md px-3 py-2 focus:outline-none focus:border-green-500"
formControlName="itemPrice" />
<span
class="absolute inset-y-0 right-0 flex items-center px-2 text-gray-500">
PI
</span>
<span class="absolute inset-y-0 right-0 flex items-center px-2 text-gray-500"> PI </span>
</div>
<!-- <div class="modal__item-icon">
<img
Expand All @@ -163,9 +118,7 @@ <h2 class="modal__title">{{ 'BUSINESS.CONFIGURATION.ADD_PRODUCT_MENU.LABELS.ADD_

<!-- Description input group -->
<div class="modal__description">
<label for="description" class="modal__label font-bold"
>{{ 'BUSINESS.CONFIGURATION.ADD_PRODUCT_MENU.LABELS.DESCRIPTION' | translate }}</label
>
<label for="description" class="modal__label font-bold">{{ 'BUSINESS.CONFIGURATION.ADD_PRODUCT_MENU.LABELS.DESCRIPTION' | translate }}</label>
<textarea
id="description"
class="border border-gray-300 rounded-md w-full px-3 py-2 focus:outline-none focus:border-green-500 resize-none"
Expand All @@ -176,10 +129,7 @@ <h2 class="modal__title">{{ 'BUSINESS.CONFIGURATION.ADD_PRODUCT_MENU.LABELS.ADD_

<!-- Confirm button -->
<div class="modal__confirm">
<button
type="button"
class="modal__confirm-btn"
(click)="addProductToShop()">
<button type="button" class="modal__confirm-btn" (click)="addProductToShop()">
@if (isLoading) {
{{ 'BUSINESS.CONFIGURATION.ADD_PRODUCT_MENU.BUTTONS.LOADING' | translate }}
} @else {
Expand Down
Loading

0 comments on commit 2a46e82

Please sign in to comment.