Ticket #2905 (new enhancement)
Opened 20 months ago
Add dataset URL key behaviour
Reported by: | johnmartin | Owned by: | |
---|---|---|---|
Priority: | awaiting triage | Milestone: | demo phase 5 |
Component: | ckan | Keywords: | |
Cc: | Repository: | ckan | |
Theme: | none |
Description
On step 1 for adding a dataset can we add a ajax ping that checks if the URL that is generated by the JS is taken? Behaviour should be as follows:
- User types title in box (as current)
- URL key is regexed by JS (as current)
- The JS does a ajax call to check if the generated URL key is valid. The ajax callback returns a JSON dump which contains what the URL key should be (e.g. if 'test' was taken it returns 'test-1')
- If the URL key returned in the ajax is different than the one generated by the JS then:
4a. If the user hasn't clicked the edit button then: it automatically updates the URL key field with the URL key supplied in the ajax
4b. If the user has clicked the edit button then: a form error next to the input appears saying that the URL key is taken and within that error is suggests the URL key returned by the ajax as alternative (the user can click said URL key within the error to automatically choose that one)
The URL key isn't reserved by the ajax and upon form submission the usual validation should still apply.