@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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@spree/dashboard-core",
3
3
  "license": "MIT",
4
- "version": "0.12.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.7.0",
83
- "@spree/dashboard-ui": "^0.12.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
@@ -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.
@@ -406,7 +406,8 @@
406
406
  "empty": "لا توجد مستويات بعد. ينطبق السعر الأساسي حتى تضيف مستوى.",
407
407
  "add_tier": "إضافة مستوى",
408
408
  "remove_tier": "إزالة المستوى"
409
- }
409
+ },
410
+ "unlimited": "غير محدود"
410
411
  },
411
412
  "confirm_dialog": {
412
413
  "title": "هل أنت متأكد؟"
@@ -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?"
@@ -406,7 +406,8 @@
406
406
  "empty": "No tiers yet. The base rate applies until you add a tier.",
407
407
  "add_tier": "Add tier",
408
408
  "remove_tier": "Remove tier"
409
- }
409
+ },
410
+ "unlimited": "Unlimited"
410
411
  },
411
412
  "confirm_dialog": {
412
413
  "title": "Are you sure?"
@@ -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 ?"
@@ -406,7 +406,8 @@
406
406
  "empty": "Brak progów. Do momentu dodania progu obowiązuje stawka podstawowa.",
407
407
  "add_tier": "Dodaj próg",
408
408
  "remove_tier": "Usuń próg"
409
- }
409
+ },
410
+ "unlimited": "Bez limitu"
410
411
  },
411
412
  "confirm_dialog": {
412
413
  "title": "Czy na pewno?"
@@ -406,7 +406,8 @@
406
406
  "empty": "暂无层级。在添加层级之前,将应用基础费率。",
407
407
  "add_tier": "添加层级",
408
408
  "remove_tier": "移除层级"
409
- }
409
+ },
410
+ "unlimited": "无限制"
410
411
  },
411
412
  "confirm_dialog": {
412
413
  "title": "确定吗?"