@spree/dashboard-core 0.12.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/src/components/preferences-form.tsx +14 -0
- package/src/lib/permissions.ts +1 -0
- package/src/locales/ar.json +2 -1
- package/src/locales/de.json +2 -1
- package/src/locales/en.json +2 -1
- package/src/locales/fr.json +2 -1
- package/src/locales/pl.json +2 -1
- package/src/locales/zh-CN.json +2 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spree/dashboard-core",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.13.0",
|
|
5
5
|
"description": "Spree Dashboard framework — registries (table, nav, slot, settings-nav), providers (auth, permission, store), admin SDK client, generic infra hooks, and the defineDashboardPlugin extension API. Developer Preview.",
|
|
6
6
|
"author": "Vendo Connect Inc.",
|
|
7
7
|
"homepage": "https://spreecommerce.org",
|
|
@@ -79,8 +79,8 @@
|
|
|
79
79
|
"typescript": "~6.0.3",
|
|
80
80
|
"vite": "^8.0.16",
|
|
81
81
|
"vitest": "^4.1.5",
|
|
82
|
-
"@spree/admin-sdk": "^0.
|
|
83
|
-
"@spree/dashboard-ui": "^0.
|
|
82
|
+
"@spree/admin-sdk": "^0.8.0",
|
|
83
|
+
"@spree/dashboard-ui": "^0.13.0"
|
|
84
84
|
},
|
|
85
85
|
"scripts": {
|
|
86
86
|
"lint": "biome check src",
|
|
@@ -173,6 +173,11 @@ export function PreferenceField({
|
|
|
173
173
|
id={id}
|
|
174
174
|
type="number"
|
|
175
175
|
step={field.type === 'integer' ? 1 : 'any'}
|
|
176
|
+
// An empty upper-bound field means "no limit" — surface that
|
|
177
|
+
// rather than leaving it looking like a required blank.
|
|
178
|
+
placeholder={
|
|
179
|
+
isMaxKey(field.key) ? t('admin.components.preferences_form.unlimited') : undefined
|
|
180
|
+
}
|
|
176
181
|
value={value === null || value === undefined ? '' : String(value)}
|
|
177
182
|
onChange={(e) => {
|
|
178
183
|
const raw = e.target.value
|
|
@@ -247,6 +252,15 @@ function isCurrencyKey(key: string): boolean {
|
|
|
247
252
|
return key === 'currency' || key.endsWith('_currency')
|
|
248
253
|
}
|
|
249
254
|
|
|
255
|
+
// Upper-bound preferences (`max_quantity`, `max_uses`, `usage_max`,
|
|
256
|
+
// `maximum_amount`, …) read "Unlimited" when left blank. Matched on the key
|
|
257
|
+
// name because the wire schema doesn't carry a nullable flag — safe since the
|
|
258
|
+
// placeholder only shows for an empty value, and an empty max legitimately
|
|
259
|
+
// means no ceiling.
|
|
260
|
+
function isMaxKey(key: string): boolean {
|
|
261
|
+
return /(?:^|_)max(?:imum)?(?:_|$)/.test(key)
|
|
262
|
+
}
|
|
263
|
+
|
|
250
264
|
interface TierRowState {
|
|
251
265
|
/** Stable across edits — used for React keys so input focus survives reorder. */
|
|
252
266
|
uid: string
|
package/src/lib/permissions.ts
CHANGED
|
@@ -16,6 +16,7 @@ export const Subject = {
|
|
|
16
16
|
AllowedOrigin: 'Spree::AllowedOrigin',
|
|
17
17
|
Store: 'Spree::Store',
|
|
18
18
|
Channel: 'Spree::Channel',
|
|
19
|
+
OrderRoutingRule: 'Spree::OrderRoutingRule',
|
|
19
20
|
// Categories are Spree::Category < Spree::Taxon; abilities are published under
|
|
20
21
|
// the Spree::Taxon subject, so the value stays 'Spree::Taxon' while the key
|
|
21
22
|
// reads as the user-facing resource name.
|
package/src/locales/ar.json
CHANGED
package/src/locales/de.json
CHANGED
|
@@ -406,7 +406,8 @@
|
|
|
406
406
|
"empty": "Noch keine Stufen. Der Basissatz gilt, bis Sie eine Stufe hinzufügen.",
|
|
407
407
|
"add_tier": "Stufe hinzufügen",
|
|
408
408
|
"remove_tier": "Stufe entfernen"
|
|
409
|
-
}
|
|
409
|
+
},
|
|
410
|
+
"unlimited": "Unbegrenzt"
|
|
410
411
|
},
|
|
411
412
|
"confirm_dialog": {
|
|
412
413
|
"title": "Sind Sie sicher?"
|
package/src/locales/en.json
CHANGED
package/src/locales/fr.json
CHANGED
|
@@ -406,7 +406,8 @@
|
|
|
406
406
|
"empty": "Aucun palier pour le moment. Le taux de base s’applique jusqu’à l’ajout d’un palier.",
|
|
407
407
|
"add_tier": "Ajouter un palier",
|
|
408
408
|
"remove_tier": "Supprimer le palier"
|
|
409
|
-
}
|
|
409
|
+
},
|
|
410
|
+
"unlimited": "Illimité"
|
|
410
411
|
},
|
|
411
412
|
"confirm_dialog": {
|
|
412
413
|
"title": "Êtes-vous sûr ?"
|
package/src/locales/pl.json
CHANGED