rdmorganiser / rdmo

A tool to support the planning, implementation, and organization of research data management.
https://rdmorganiser.github.io
Apache License 2.0
105 stars 49 forks source link

Add uri_path to factories #1026

Closed jochenklar closed 4 months ago

jochenklar commented 5 months ago

I just had the idea that, if you create a question, the uri_path of the page is already in the form. This PR adds this. I am not sure, if we should add the / to the path already. If we don't just creating the element without editing will give a validation error (which is good I think), but then we always need to add the slash.

Zack-83 commented 5 months ago

I have no strong opinion. Just for comparison: uri_prefix is defined without slash.

jochenklar commented 5 months ago

Clarification: The inserted uri_path is the path of the parent, e.g. page catalog/section/page. The idea is that I only need to add "question" to get catalog/section/page/question as uri_path for the question. If we insert catalog/section/page/ people just need "question", but if they just hit save a question with catalog/section/page/ will be saved (which the user does not want). If we insert catalog/section/page people need to type an addtional /, but when they just hit save, there will be a validation error since catalog/section/page is already the uri_path of the page.

Zack-83 commented 5 months ago

Clarification: The inserted uri_path is the path of the parent, e.g. page catalog/section/page. The idea is that I only need to add "question" to get catalog/section/page/question as uri_path for the question. If we insert catalog/section/page/ people just need "question", but if they just hit save a question with catalog/section/page/ will be saved (which the user does not want). If we insert catalog/section/page people need to type an addtional /, but when they just hit save, there will be a validation error since catalog/section/page is already the uri_path of the page.

This argument supports the uri_path without /.