jmix-projects / jmix-ui

DEPRECATED. Use https://github.com/jmix-framework/jmix
https://www.jmix.io
3 stars 7 forks source link

URL navigation should not show id=new parameter for editor screens #760

Closed Flaurite closed 2 years ago

Flaurite commented 2 years ago

Description

What should be done

  1. Navigation to editor without id=new should open editor to create new entity.

    http://localhost:8080/#main/1/orders/edit
  2. Navigation to editor with id=new should open editor to create new entity. http://localhost:8080/#main/1/orders/edit?id=new - opens editor and creates new entity. Parameter id is presented in UrlParamsChangedEvent

  3. Navigation to editor with serialized id=zbx4n93r8vefpnd86w051s0nn should open editor and load entity with given id:

    http://localhost:8080/#main/1/orders/edit?id=zbx4n93r8vefpnd86w051s0nn

    Do not show the id parameter for a non-persistent entity at all. The framework considers the state of non-persistent entity always as new. Id in these entities has always new value, and it is not possible to navigate to a specific entity. So editor for non-persistent should handle navigation itself.

Changes

It was decided to do not show the id=new parameter at all.

QA

Create a demo project. Create browser and editor for some entity. Define route for them (doc).

Then check the following behavior:

  1. Try to create new entity instance. Editor should be opened for creation without id=new parameter.
  2. Try to navigate to the editor by link (copy it from address bar). Editor should be opened for creation.
  3. Subscribe to UrlParamsChangedEvent in the editor screen. Try to navigate to the editor with id=new parameter in the URL. Event should be fired and id parameter should present in params of the event.
  4. Try to edit some instance of the entity. Editor should be opened for editing and id parameter should present in the URL.
kendovitskii commented 2 years ago

Verified on 1.2.0 - SNAPSHOT