PhoenixKitCatalogue.Paths (PhoenixKitCatalogue v0.19.1)

Copy Markdown View Source

Centralized path helpers for the Catalogue module.

All paths go through PhoenixKit.Utils.Routes.path/1 for prefix/locale handling.

Summary

Functions

Returns the download URL for a catalogue export.

Raw (unprefixed) item edit path for phoenix_kit_comments back-links. The comments module applies the URL prefix/locale itself when rendering the resource chip, so this must NOT be prefixed (else the link double-prefixes). tab: lands on one of the form's tabs ("sourcing" for suppliers).

Signed URL under which the raw PDF binary is served. Resolves via core's Storage.URLSigner — the host app already routes /file/:file_uuid/:variant/:token through core's FileController.

Returns the PDF.js viewer URL with the file pre-bound and the optional page fragment set. The viewer assets are vendored under priv/static/pdfjs/ and served at /_pdfjs/ by the host endpoint's Plug.Static mount.

Functions

attribute_group_edit(uuid)

attribute_group_new()

attribute_groups()

attribute_set_edit(uuid)

attribute_set_new()

catalogue_detail(uuid)

catalogue_edit(uuid)

catalogue_new()

category_browse(catalogue_uuid, category_uuid)

category_edit(uuid)

category_new(catalogue_uuid)

events()

export()

export_download(params)

@spec export_download(map()) :: String.t()

Returns the download URL for a catalogue export.

params is a map with required keys :destination, :format, and :catalogue_uuids (a list of UUID strings). All scalar values are strings or atoms. The catalogue_uuids list is encoded as repeated catalogue_uuids[] query parameters.

import()

index()

item_edit(uuid)

item_edit_raw(uuid, opts \\ [])

@spec item_edit_raw(
  String.t(),
  keyword()
) :: String.t()

Raw (unprefixed) item edit path for phoenix_kit_comments back-links. The comments module applies the URL prefix/locale itself when rendering the resource chip, so this must NOT be prefixed (else the link double-prefixes). tab: lands on one of the form's tabs ("sourcing" for suppliers).

item_new(catalogue_uuid)

pdf_detail(uuid)

@spec pdf_detail(Ecto.UUID.t()) :: String.t()

pdf_detail(uuid, page)

@spec pdf_detail(Ecto.UUID.t(), pos_integer()) :: String.t()

pdf_file(map)

@spec pdf_file(map()) :: String.t()

Signed URL under which the raw PDF binary is served. Resolves via core's Storage.URLSigner — the host app already routes /file/:file_uuid/:variant/:token through core's FileController.

pdf_viewer(pdf)

@spec pdf_viewer(map()) :: String.t()

pdf_viewer(pdf, page)

@spec pdf_viewer(map(), pos_integer()) :: String.t()

Returns the PDF.js viewer URL with the file pre-bound and the optional page fragment set. The viewer assets are vendored under priv/static/pdfjs/ and served at /_pdfjs/ by the host endpoint's Plug.Static mount.

The signed file URL is encoded via URI.encode_www_form/1 so reserved characters in the underlying URL (?, &, =, #, spaces) become percent-escaped query-param-safe bytes — URI.encode/1 alone does NOT escape those, which would corrupt the viewer's own #page=N fragment if the file URL ever carries them.

pdfs()

@spec pdfs() :: String.t()

uncategorized_browse(catalogue_uuid)