@reldens/cms 0.84.0 → 0.85.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.
|
@@ -379,6 +379,33 @@ Admin UI builder that:
|
|
|
379
379
|
- Form field generation
|
|
380
380
|
- Branding and styling
|
|
381
381
|
|
|
382
|
+
### Delete Relations Warning
|
|
383
|
+
|
|
384
|
+
**File:** `lib/admin-manager/delete-relations-warning.js`
|
|
385
|
+
|
|
386
|
+
Builds the sentences appended to the delete confirmation dialog, so the admin states what actually happens to the
|
|
387
|
+
records that reference the one being deleted. `ContentsBuilder` owns an instance as `this.relationsWarning` and
|
|
388
|
+
calls `buildReverseRelationsMap()` once per admin contents build, then `fetchWarning(entityId, reverseRelations)`
|
|
389
|
+
per entity.
|
|
390
|
+
|
|
391
|
+
`buildReverseRelationsMap()` walks every resource and, for each `type: 'reference'` property, files the child
|
|
392
|
+
entity label under the referenced entity, grouped by what the foreign key does on delete. The group comes from
|
|
393
|
+
`fetchRelationGroup(property.onDelete)`, where `onDelete` is generated by `@reldens/storage` from the live
|
|
394
|
+
`information_schema` delete rule:
|
|
395
|
+
|
|
396
|
+
- `cascade` goes to `deleted`, rendered with `messages.confirmDeleteRelations`.
|
|
397
|
+
- `setNull` and `setDefault` go to `unlinked`, rendered with `messages.confirmUnlinkRelations`.
|
|
398
|
+
- Everything else, including `restrict`, `noAction` and a missing value, goes to `blocking`, rendered with
|
|
399
|
+
`messages.confirmBlockingRelations`.
|
|
400
|
+
|
|
401
|
+
There is deliberately no default claim: `restrict` and `noAction` neither delete nor unlink, they make the delete
|
|
402
|
+
fail, and a missing `onDelete` means the consumer's entities predate the generated attribute. Reporting either of
|
|
403
|
+
those as "will be deleted" was the original bug this grouping replaced.
|
|
404
|
+
|
|
405
|
+
Only the three sentences are produced here. The cms itself never deletes related rows: `RouterContents`
|
|
406
|
+
`processDeleteEntities()` deletes the entity row alone and the database referential actions do the rest, which is
|
|
407
|
+
exactly why the wording has to follow the foreign keys.
|
|
408
|
+
|
|
382
409
|
### Admin Filters Manager
|
|
383
410
|
|
|
384
411
|
**File:** `lib/admin-manager/admin-filters-manager.js`
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reldens/cms",
|
|
3
3
|
"scope": "@reldens",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.85.0",
|
|
5
5
|
"description": "Reldens - CMS",
|
|
6
6
|
"author": "Damian A. Pastorini",
|
|
7
7
|
"license": "MIT",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@reldens/server-utils": "^0.56.0",
|
|
38
|
-
"@reldens/storage": "^0.
|
|
38
|
+
"@reldens/storage": "^0.112.0",
|
|
39
39
|
"@reldens/utils": "^0.57.0",
|
|
40
40
|
"dotenv": "17.4.2",
|
|
41
41
|
"mustache": "4.2.0"
|