Skip to content

Add pinned & order to import/export - #1592

Merged
KodeStar merged 6 commits into
linuxserver:2.xfrom
kushagharahi:add-order-pinned-import-export
Sep 2, 2026
Merged

Add pinned & order to import/export#1592
KodeStar merged 6 commits into
linuxserver:2.xfrom
kushagharahi:add-order-pinned-import-export

Conversation

@kushagharahi

Copy link
Copy Markdown
Contributor

As the title says, so backing up heimdall is a little more complete.

Added some new tests

@KodeStar

KodeStar commented Aug 27, 2026

Copy link
Copy Markdown
Member

Thanks for this - the change itself looks good and the round-trip tests are a nice addition.

One test fails though: test_returns_exactly_the_defined_fields passes pinned_order into Item::factory()->create(), but the DB column is order (pinned_order is only the export key), so the insert blows up with table items has no column named pinned_order. Everything else in the suite is green with this fix:

             "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" => []]]);

@kushagharahi

kushagharahi commented Aug 27, 2026

Copy link
Copy Markdown
Contributor Author

Updated @KodeStar! Thank you for the review!

@KodeStar KodeStar self-assigned this Aug 28, 2026
@KodeStar
KodeStar requested a lite review from Copilot August 28, 2026 13:52
@KodeStar
KodeStar self-requested a review August 28, 2026 13:52
@LinuxServer-CI LinuxServer-CI moved this from PRs to PRs Ready For Team Review in Issue & PR Tracker Aug 28, 2026

@KodeStar KodeStar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM other than the items copilot flagged

@github-project-automation github-project-automation Bot moved this from PRs Ready For Team Review to PRs Approved in Issue & PR Tracker Aug 28, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 pinned and export DB column order under the pinned_order key.
  • Import now consumes pinned / pinned_order and 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.

Comment thread resources/assets/js/itemImport.js
Comment thread public/js/app.js
Comment thread tests/Feature/ItemExportTest.php
@KodeStar
KodeStar merged commit 808cc90 into linuxserver:2.x Sep 2, 2026
4 checks passed
@LinuxServer-CI LinuxServer-CI moved this from PRs Approved to Done in Issue & PR Tracker Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

4 participants