Skip to content

move books into subkey of block #1628

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 23, 2025
Merged

move books into subkey of block #1628

merged 4 commits into from
May 23, 2025

Conversation

TomWoodward
Copy link
Member

@TomWoodward TomWoodward commented May 21, 2025

@mwvolo i forget how to do this, do i need to run a script to create an auto generated migration file?

making this change to move the book list into a subkey of the block value so that we can add other fields (like config) later if we need to

fe pr https://github.com/openstax/os-webview/pull/2736/files

https://openstax.atlassian.net/browse/CORE-900

@TomWoodward TomWoodward requested a review from mwvolo May 21, 2025 12:59
books/models.py Outdated
@@ -74,6 +74,7 @@ def get_book_data(book):
'has_faculty_resources': has_faculty_resources,
'has_student_resources': has_student_resources,
'assignable_book': book.assignable_book,
'promote_snippet': book.promote_snippet,
Copy link
Member Author

@TomWoodward TomWoodward May 21, 2025

Choose a reason for hiding this comment

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

will this naturally come through in the format defined below? its expected to be

   {
        id: number;
        name: string;
        description: string;
        image: string;
    }

Copy link
Member

Choose a reason for hiding this comment

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

hmm, there is a promote snippet on calc 1, which I added to the landing page - it's not even showing up 👀
https://dev.openstax.org/apps/cms/api/v2/pages/562/ (last book)

Copy link
Member

Choose a reason for hiding this comment

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

two books on there are marked as retired. not sure if you want to hide books that are retired like the rest of the site does
i'll leave them there

Copy link
Member Author

Choose a reason for hiding this comment

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

for the snippet, if you look at the calc response directly https://dev.openstax.org/apps/cms/api/v2/pages/74/ it definitely shows it. is in this context is book.promote_snippet maybe not loaded?

Copy link
Member Author

Choose a reason for hiding this comment

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

for retired books, since we're explicitly choosing them i think we should leave them until they're unselected

@TomWoodward TomWoodward merged commit 9b3242f into main May 23, 2025
6 of 7 checks passed
@TomWoodward TomWoodward deleted the move-books-block branch May 23, 2025 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants