Skip to content

Frontend: publication status badge and admin controls on recipe detail page #1138

Open

Description

@dgee2

Goal

Surface publication status on the recipe detail page and give admins a one-click Publish/Unpublish action.

Spec reference

docs/specs/recipe-creation-target-architecture.md — §"Access and publication model – Admin publication control"

Implementation notes

  • "Published" badge on RecipeDetailPage.vue when recipe has an active RecipePublication
  • Admin-only "Publish" / "Unpublish" action button — visible only if the authenticated user has the recipe:publish Auth0 permission claim
  • usePublicationManagement(recipeId) composable wrapping PUT /api/recipe/{recipeId}/publication
  • Co-located Storybook story for the publication badge component

Acceptance criteria

  • Badge shown/hidden based on publication state
  • Publish/Unpublish button visible only to admins
  • Action calls correct API endpoint and invalidates recipe detail cache

Testing

  • Vitest: usePublicationManagement composable
  • Vitest: badge renders when isPublished=true, hidden otherwise

Part of#1103

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestjavascriptPull requests that update Javascript code

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions