From 6ce462a77d2698b0f4d990166cf2052c18bbde9c Mon Sep 17 00:00:00 2001 From: Drew Haven Date: Sat, 28 Jun 2025 17:48:56 -0700 Subject: [PATCH] Fixes the copy on new sessions, some additional styling work --- .../1751082553_extract_document_types.js | 1 - .../1751155422_updated_relationships.js | 42 ++++++++++++++ pb_migrations/1751155435_updated_documents.js | 34 +++++++++++ .../1751156191_updated_relationships.js | 40 +++++++++++++ src/components/AutoSaveTextarea.tsx | 2 +- src/components/DocumentList.tsx | 9 +-- src/components/RelationshipList.tsx | 58 ++++++++++++++----- src/components/documents/BasicRow.tsx | 6 +- .../documents/NewRelatedDocumentForm.tsx | 14 ++--- .../documents/location/LocationPrintRow.tsx | 4 +- .../documents/monsters/MonsterPrintRow.tsx | 2 +- src/components/documents/npc/NpcPrintRow.tsx | 4 +- .../documents/scene/NewSceneForm.tsx | 40 ++++++------- .../documents/scene/ScenePrintRow.tsx | 2 +- .../documents/treasure/TreasurePrintRow.tsx | 4 +- src/components/form/BaseForm.tsx | 32 ++++++++++ src/components/form/MultiLineInput.tsx | 22 +++++++ .../_authenticated/campaigns.$campaignId.tsx | 15 ++--- .../_authenticated/document.$documentId.tsx | 7 ++- src/styles.css | 21 +++---- 20 files changed, 268 insertions(+), 91 deletions(-) create mode 100644 pb_migrations/1751155422_updated_relationships.js create mode 100644 pb_migrations/1751155435_updated_documents.js create mode 100644 pb_migrations/1751156191_updated_relationships.js create mode 100644 src/components/form/BaseForm.tsx create mode 100644 src/components/form/MultiLineInput.tsx diff --git a/pb_migrations/1751082553_extract_document_types.js b/pb_migrations/1751082553_extract_document_types.js index d4dd101..80003e0 100644 --- a/pb_migrations/1751082553_extract_document_types.js +++ b/pb_migrations/1751082553_extract_document_types.js @@ -39,7 +39,6 @@ migrate( continue documents; } } - throw new Error(`Unrecognized data: ${JSON.stringify(data)}`); } }, (app) => { diff --git a/pb_migrations/1751155422_updated_relationships.js b/pb_migrations/1751155422_updated_relationships.js new file mode 100644 index 0000000..1296cbd --- /dev/null +++ b/pb_migrations/1751155422_updated_relationships.js @@ -0,0 +1,42 @@ +/// +migrate((app) => { + const collection = app.findCollectionByNameOrId("pbc_617371094") + + // update field + collection.fields.addAt(0, new Field({ + "autogeneratePattern": "[a-z0-9]{15}", + "hidden": false, + "id": "text3208210256", + "max": 15, + "min": 15, + "name": "id", + "pattern": "^[a-z0-9]+$", + "presentable": true, + "primaryKey": true, + "required": true, + "system": true, + "type": "text" + })) + + return app.save(collection) +}, (app) => { + const collection = app.findCollectionByNameOrId("pbc_617371094") + + // update field + collection.fields.addAt(0, new Field({ + "autogeneratePattern": "[a-z0-9]{15}", + "hidden": false, + "id": "text3208210256", + "max": 15, + "min": 15, + "name": "id", + "pattern": "^[a-z0-9]+$", + "presentable": false, + "primaryKey": true, + "required": true, + "system": true, + "type": "text" + })) + + return app.save(collection) +}) diff --git a/pb_migrations/1751155435_updated_documents.js b/pb_migrations/1751155435_updated_documents.js new file mode 100644 index 0000000..389ee3f --- /dev/null +++ b/pb_migrations/1751155435_updated_documents.js @@ -0,0 +1,34 @@ +/// +migrate((app) => { + const collection = app.findCollectionByNameOrId("pbc_3332084752") + + // update field + collection.fields.addAt(2, new Field({ + "hidden": false, + "id": "json2918445923", + "maxSize": 0, + "name": "data", + "presentable": false, + "required": false, + "system": false, + "type": "json" + })) + + return app.save(collection) +}, (app) => { + const collection = app.findCollectionByNameOrId("pbc_3332084752") + + // update field + collection.fields.addAt(2, new Field({ + "hidden": false, + "id": "json2918445923", + "maxSize": 0, + "name": "data", + "presentable": true, + "required": false, + "system": false, + "type": "json" + })) + + return app.save(collection) +}) diff --git a/pb_migrations/1751156191_updated_relationships.js b/pb_migrations/1751156191_updated_relationships.js new file mode 100644 index 0000000..cb1888f --- /dev/null +++ b/pb_migrations/1751156191_updated_relationships.js @@ -0,0 +1,40 @@ +/// +migrate((app) => { + const collection = app.findCollectionByNameOrId("pbc_617371094") + + // update field + collection.fields.addAt(1, new Field({ + "cascadeDelete": true, + "collectionId": "pbc_3332084752", + "hidden": false, + "id": "relation390457990", + "maxSelect": 1, + "minSelect": 0, + "name": "primary", + "presentable": false, + "required": false, + "system": false, + "type": "relation" + })) + + return app.save(collection) +}, (app) => { + const collection = app.findCollectionByNameOrId("pbc_617371094") + + // update field + collection.fields.addAt(1, new Field({ + "cascadeDelete": false, + "collectionId": "pbc_3332084752", + "hidden": false, + "id": "relation390457990", + "maxSelect": 1, + "minSelect": 0, + "name": "primary", + "presentable": false, + "required": false, + "system": false, + "type": "relation" + })) + + return app.save(collection) +}) diff --git a/src/components/AutoSaveTextarea.tsx b/src/components/AutoSaveTextarea.tsx index e1c7c1c..76043be 100644 --- a/src/components/AutoSaveTextarea.tsx +++ b/src/components/AutoSaveTextarea.tsx @@ -63,7 +63,7 @@ export function AutoSaveTextarea({