Add pinned & order to import/export - #1592
Conversation
|
Thanks for this - the change itself looks good and the round-trip tests are a nice addition. One test fails though: "pinned" => 1,
- "pinned_order" => 0,
"title" => "Item Title",
"url" => "http://gorczany.com/nihil-rerum-distinctio-voluptate-assumenda-accusantium-exercitationem"
];
+ // The DB column is "order"; it is exported under the "pinned_order" key.
Item::factory()
- ->create($exampleItem);
+ ->create($exampleItem + ["order" => 0]);
$response = $this->get('api/item');
- $response->assertExactJson([$exampleItem + ["tags" => []]]);
+ $response->assertExactJson([$exampleItem + ["pinned_order" => 0, "tags" => []]]); |
|
Updated @KodeStar! Thank you for the review! |
There was a problem hiding this comment.
Pull request overview
Extends the item import/export flow to preserve “pinned” status and the item ordering value so backups can round-trip more completely.
Changes:
- Export
pinnedand export DB columnorderunder thepinned_orderkey. - Import now consumes
pinned/pinned_orderand maps them into the API payload (pinned/order). - Adds feature tests covering import persistence and export round-tripping of pinned/order.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Feature/ItemImportTest.php | Adds import and round-trip assertions for pinned and order/pinned_order. |
| tests/Feature/ItemExportTest.php | Updates/extends export assertions to include pinned and pinned_order. |
| resources/assets/js/itemImport.js | Maps imported JSON’s pinned + pinned_order into API payload fields. |
| public/js/app.js | Updates built bundle to match itemImport.js import mapping. |
| app/Http/Controllers/ItemRestController.php | Adds pinned + pinned_order to the exported item JSON. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
As the title says, so backing up heimdall is a little more complete.
Added some new tests