syndesisio / syndesis-ui-style-guide

Style guide for Syndesis UI development
https://syndesisio.github.io/syndesis-ui-style-guide/
Apache License 2.0
1 stars 1 forks source link

should we use a URI like '-/create' for the create URL? #1

Open jstrachan opened 7 years ago

jstrachan commented 7 years ago

I added the Create page in the funktion fork of ipaas-client and found that it was easier in the code use the create page inside the same part of the navigation model as the list/view/edit pages. As a kinda hack I used the '-' token for the id https://github.com/jstrachan/ipaas-client/blob/funktion/src/app/functions/functions.module.ts#L27

which kept the code nice and simple:

const routes: Routes = [
  { path: '', component: FunctionsListPage, pathMatch: 'full' },
  { path: ':id', component: FunctionViewPage, pathMatch: 'full' },
  { path: ':id/edit', component: FunctionEditPage, pathMatch: 'full' },
  { path: '-/create', component: FunctionCreatePage, pathMatch: 'full' },
];

though its a little bit of a hack adding the '-' token.

What do folks think? On the plus side the edit and create URIs are kinda similar - on the down side its a slight mis-use of the :id path ;)

jimmidyson commented 7 years ago

Don't really like it. Routes are matched top down AFAIK so how about just moving 'create' route before ':id' route?

jstrachan commented 7 years ago

though that means you can't use 'create' as an ID in your model right? Which isn't awesome

jstrachan commented 7 years ago

though it is a nicer URL :)

jimmidyson commented 7 years ago

Personally totally happy to not have an ID of create/new - we should probably use numeric IDs anyway so that descriptive names are mutable.

jstrachan commented 7 years ago

thats fine for ipaas; but not for kubernetes/openshift/devex though - would be nice to have a convention that works for all models & apps