Skip to content

Page renderer: rows of an index page without register and schema link to an unrelated detail page #2192

Open

Description

@SudoThijn

Description

On an index page that has no register and schema of its own (a named source such as search or endpoint), every row links to the first detail page that also has no register and schema, whatever the rows are. In Dossiq that is the task page, so clicking a result on the search page opens /tasks/cases:<id> and shows "Not found". Found while comparing Dossiq's search page with the design board DqZoekresultaten, where a result opens the case, object or document it names.

Steps to reproduce

  1. In Dossiq, open /apps/dossiq/search?q=<a word from a case title> (nothing in the app links to this page yet, see Search page: nothing in the app leads to it dossiq#6605).
  2. Click the title of a case in the results.

Expected behaviour

The case opens: the search source gives each result its own address (href, here /apps/dossiq/cases/{id} from the page's kinds config) and rowTarget returns it.

Actual behaviour

The browser goes to /index.php/apps/dossiq/tasks/cases:cb15428e-fd19-4638-9042-76683ef4f89a?_from=SearchResults&q=Kerkstraat, the task page asks GET /apps/openregister/api/flow-tasks/cases%3A… (404) and shows "Not found. This item does not exist or has been deleted." The row's link (a.cn-table-row__link) carries that same address, so opening it in a new tab fails the same way.

Dossiq's Postvak page shows the same thing: its row links to /apps/dossiq/tasks/<id>, and that id is no task either (the flow-task endpoint answers 404).

Cause

src/components/CnPageRenderer/CnPageRenderer.vue:

  • :1050-1066 detailPageByRegisterSchema indexes detail pages by `${cfg.register} ${cfg.schema}`. A detail page without either (Dossiq's TaskDetail, entitySource: "tasks") is stored under "undefined undefined".
  • :1391 an index page without register and schema builds the same key, finds that page, and so sets rowClickToView and viewTo.
  • :2083 rowOpenTarget then takes that detail page as the row's target, before the named source's own rowTarget / openRow get a say.

Every named-source index page in an app that also has a schema-less detail page is affected. A fix could skip the lookup when the index page has no register or schema, so the source's own rowTarget / openRow / detailRoute decide.

Acceptance criteria

  • On Dossiq's search page, a case result's title link and row click open /apps/dossiq/cases/{id}
  • Dossiq's Postvak rows no longer link to the task page
  • An index page with register and schema still opens its matching detail page
  • A test covers an index page without register and schema next to a schema-less detail page
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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions