feat(manager): Media page, photo field for products and categories (platform-v2 step 5.2)
- Management → Media (src/pages/media/): every picture and video, search, pictures / videos, batch upload (many files or drop on the page) with a result per file, details (preview, display name, kind, resolution, length, file size, uploaded file, when / who, the sizes made, what uses it, delete off while used). - MediaField: upload on the spot (into the library and set at once), pick from the library (MediaPicker, which can also upload), remove; after an upload on the spot "Name it after the product / category" renames it in Latin letters. Used by the product editor and the category dialog. - nav: `anyPerm` (any of the keys that manage pictures); the route guard uses the same rule. Product rows have test ids. - @xenia/i18n: latin() (Greek to Latin, the way venues write it) + tests. - tests: manager media.test.mjs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import { test } from 'node:test'
|
||||
import assert from 'node:assert/strict'
|
||||
import { latin } from '../src/latin.js'
|
||||
|
||||
test('Greek names in plain Latin letters, the way venues write them', () => {
|
||||
assert.equal(latin('Γύρος χοιρινός'), 'Gyros xoirinos')
|
||||
assert.equal(latin('Χυμός βύσσινο'), 'Xymos vyssino')
|
||||
assert.equal(latin('Ούζο Πλωμαρίου'), 'Ouzo Plomariou')
|
||||
assert.equal(latin('Σουβλάκι κοτόπουλο'), 'Souvlaki kotopoulo')
|
||||
assert.equal(latin('Ψητά'), 'Psita')
|
||||
assert.equal(latin('Φρέντο εσπρέσο'), 'Frento espreso')
|
||||
assert.equal(latin('Ταξίδι'), 'Taksidi')
|
||||
assert.equal(latin('Ευχή'), 'Evxi')
|
||||
assert.equal(latin('Θεά'), 'Thea')
|
||||
})
|
||||
|
||||
test('all caps stay all caps; Latin, digits and signs pass through', () => {
|
||||
assert.equal(latin('ΘΕΑ'), 'THEA')
|
||||
assert.equal(latin('ΜΠΥΡΑ 500ml'), 'MPYRA 500ml')
|
||||
assert.equal(latin('Coca-Cola 330ml'), 'Coca-Cola 330ml')
|
||||
assert.equal(latin('Café crème'), 'Cafe creme')
|
||||
assert.equal(latin(' Pita 🌯 gyros '), 'Pita gyros')
|
||||
assert.equal(latin(null), '')
|
||||
})
|
||||
Reference in New Issue
Block a user