From 3bbe8c8c7adc760b51b87aa8650e0eae68ce7fb1 Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Tue, 1 Oct 2024 18:16:23 +0100 Subject: [PATCH] Fixed bugs in post's change-access context menu flow (#21173) ref https://github.com/TryGhost/Ghost/commit/86d61304b11218c4a9786bd7afbd65675ddf0b2e ref https://linear.app/tryghost/issue/ONC-323 - added `tracked()` to our proxy model object properties - fixes default data always showing when opening the modal - fixed data push after completing modal - `post.tiers` is set up as an attribute in Admin rather than a relationship - fixes incorrect tiers list showing when the change access modal is opened again after changing access before the post is re-fetched from the API - fixed flash of failure button state when saving modal changes - expanded tests to cover tiers selection --- .../components/posts-list/context-menu.hbs | 22 ++-- .../app/components/posts-list/context-menu.js | 12 +- .../posts-list/modals/edit-posts-access.js | 7 +- ghost/admin/mirage/config/posts.js | 26 ++++- ghost/admin/mirage/models/post.js | 3 +- ghost/admin/mirage/serializers/post.js | 1 + ghost/admin/tests/acceptance/content-test.js | 110 ++++++++++++++---- 7 files changed, 133 insertions(+), 48 deletions(-) diff --git a/ghost/admin/app/components/posts-list/context-menu.hbs b/ghost/admin/app/components/posts-list/context-menu.hbs index 6646408e0a..cb60862df8 100644 --- a/ghost/admin/app/components/posts-list/context-menu.hbs +++ b/ghost/admin/app/components/posts-list/context-menu.hbs @@ -1,29 +1,29 @@ -