diff --git a/apps/business/src/pages/AddNewProductPage.tsx b/apps/business/src/pages/AddNewProductPage.tsx
index 4a952a0..e6dde08 100644
--- a/apps/business/src/pages/AddNewProductPage.tsx
+++ b/apps/business/src/pages/AddNewProductPage.tsx
@@ -14,6 +14,7 @@ import { ApiError } from '../lib/api'
import { listProductCategories, mapProductCategoryToUi } from '../services/productCategoryService'
import { listAllBrands, mapBrandToSelectOption } from '../services/brandService'
import {
+ galleryMediaIdsAfterChange,
resolveDataUrlToMediaId,
resolveDataUrlsToMediaIds,
} from '../services/mediaService'
@@ -372,7 +373,15 @@ export function AddNewProductPage() {
diff --git a/apps/business/src/pages/AddNewWorkshopPage.tsx b/apps/business/src/pages/AddNewWorkshopPage.tsx
index 025d22f..4057916 100644
--- a/apps/business/src/pages/AddNewWorkshopPage.tsx
+++ b/apps/business/src/pages/AddNewWorkshopPage.tsx
@@ -15,6 +15,7 @@ import {
mapWorkshopCategoryToUi,
} from '../services/workshopCategoryService'
import {
+ galleryMediaIdsAfterChange,
resolveDataUrlToMediaId,
resolveDataUrlsToMediaIds,
resolveHtmlEmbeddedDataUrls,
@@ -353,7 +354,15 @@ export function AddNewWorkshopPage() {
-
+ {
+ setGalleryMediaIds(
+ galleryMediaIdsAfterChange(images, galleryMediaIds, next),
+ )
+ setImages(next)
+ }}
+ />
diff --git a/apps/business/src/pages/SettingsPage.module.css b/apps/business/src/pages/SettingsPage.module.css
index 9ae9279..86f1885 100644
--- a/apps/business/src/pages/SettingsPage.module.css
+++ b/apps/business/src/pages/SettingsPage.module.css
@@ -43,10 +43,27 @@
.credentials {
display: grid;
grid-template-columns: repeat(12, minmax(0, 1fr));
- gap: 12px 16px;
- margin-top: 18px;
- padding-top: 18px;
+ gap: 10px 12px;
+ margin-top: 14px;
+ padding-top: 14px;
border-top: 1px solid rgba(148, 163, 184, 0.2);
+ align-items: end;
+}
+
+.credentialsInline {
+ display: flex;
+ align-items: center;
+ gap: 10px 12px;
+ margin-top: 14px;
+ padding-top: 14px;
+ border-top: 1px solid rgba(148, 163, 184, 0.2);
+}
+
+.credentialsDisabled {
+ filter: blur(2px);
+ opacity: 0.55;
+ pointer-events: none;
+ user-select: none;
}
.field {
@@ -54,8 +71,38 @@
min-width: 0;
}
-.fullRow {
- grid-column: 1 / -1;
+.inlineLabel {
+ flex-shrink: 0;
+ font-size: 12px;
+ font-weight: 500;
+ color: var(--text-secondary);
+ white-space: nowrap;
+}
+
+.inlineInput {
+ flex: 1;
+ min-width: 0;
+ min-height: var(--field-height);
+ padding: var(--field-padding-y) var(--field-padding-x);
+ font-size: var(--field-font-size);
+ line-height: 1.4;
+ font-family: var(--font-ui);
+ color: var(--text-primary);
+ background-color: rgba(255, 255, 255, 0.7);
+ border: 1px solid rgba(148, 163, 184, 0.35);
+ border-radius: var(--radius-sm);
+ outline: none;
+ box-sizing: border-box;
+}
+
+.inlineInput:focus {
+ border-color: var(--primary);
+ box-shadow: 0 0 0 3px rgba(var(--primary-rgb) / 0.12);
+}
+
+.inlineInput:disabled {
+ opacity: 0.7;
+ cursor: not-allowed;
}
.hint {
@@ -90,15 +137,22 @@
border-radius: var(--radius-sm);
}
-.passwordToggle:hover {
+.passwordToggle:hover:not(:disabled) {
color: var(--text-primary);
background: rgba(148, 163, 184, 0.15);
}
-.actions {
- grid-column: 1 / -1;
+.passwordToggle:disabled {
+ cursor: not-allowed;
+ opacity: 0.6;
+}
+
+.actionsInline {
+ grid-column: span 3;
display: flex;
+ align-items: flex-end;
justify-content: flex-end;
+ min-width: 0;
}
.saveBtn {
@@ -112,6 +166,8 @@
font-weight: 600;
font-family: var(--font-ui);
cursor: pointer;
+ flex-shrink: 0;
+ white-space: nowrap;
}
.saveBtn:disabled {
@@ -143,10 +199,35 @@
grid-template-columns: 1fr;
}
- .field {
+ .field,
+ .actionsInline {
grid-column: 1 / -1;
}
+ .actionsInline {
+ justify-content: stretch;
+ }
+
+ .actionsInline .saveBtn {
+ width: 100%;
+ }
+
+ .credentialsInline {
+ flex-wrap: wrap;
+ }
+
+ .inlineLabel {
+ width: 100%;
+ }
+
+ .inlineInput {
+ flex: 1 1 100%;
+ }
+
+ .credentialsInline .saveBtn {
+ width: 100%;
+ }
+
.gatewayHeader {
flex-direction: column;
}
diff --git a/apps/business/src/pages/SettingsPage.tsx b/apps/business/src/pages/SettingsPage.tsx
index 656e130..05152a0 100644
--- a/apps/business/src/pages/SettingsPage.tsx
+++ b/apps/business/src/pages/SettingsPage.tsx
@@ -104,16 +104,22 @@ export function SettingsPage() {
try {
const payload: EPaymentSettings = {
- ...next,
+ enabled: next.enabled,
+ defaultGateway: next.defaultGateway,
gateways: {
- ...next.gateways,
mellat: {
- ...next.gateways.mellat,
+ enabled: next.gateways.mellat.enabled,
+ terminalId: next.gateways.mellat.terminalId,
+ username: next.gateways.mellat.username,
password: password ?? '',
},
+ sep: { enabled: next.gateways.sep.enabled },
+ snappay: { enabled: next.gateways.snappay.enabled },
+ digipay: { enabled: next.gateways.digipay.enabled },
zarinpal: {
- ...next.gateways.zarinpal,
+ enabled: next.gateways.zarinpal.enabled,
merchantId: next.gateways.zarinpal.merchantId.trim(),
+ sandbox: next.gateways.zarinpal.sandbox,
},
},
}
@@ -180,15 +186,6 @@ export function SettingsPage() {
return
}
- if (
- ePayment.gateways.mellat.enabled &&
- !ePayment.gateways.mellat.passwordSet &&
- !passwordDraft.trim()
- ) {
- setError(t('website.ePayment.error.passwordRequired'))
- return
- }
-
await patchEPayment(
'mellat-credentials',
{
@@ -284,12 +281,18 @@ export function SettingsPage() {
void handleMellatToggle(checked)}
/>
-