You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: contributingGuides/philosophies/ROUTING.md
+4-31Lines changed: 4 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,7 @@ Exceptions:
31
31
### - MUST convey page hierarchy
32
32
Just like breadcrumbs, the URL should reflect the path a user has taken.
33
33
34
-
Example of the paths taken to manage a workspace member
34
+
Example of the paths taken to manage a workspace member:
35
35
1.`workspaces`
36
36
1.`workspaces/:policyID/overview`
37
37
1.`workspaces/:policyID/members`
@@ -47,49 +47,22 @@ Internet routers and third-party-services can see and store any information in t
47
47
48
48
### - SHOULD NOT use query parameters
49
49
Exceptions:
50
-
- When a URL needs to be encoded and added to the path (eg. `?exitTo=URL`)
50
+
- When a URL needs to be encoded and added to the path (eg. `?backTo=URL`, `?forwardTo=URL`)
51
51
- When complex data needs to be part of the path (eg. `/search?q=QUERY`)
52
52
53
53
### - SHOULD NOT use optional parameters
54
54
If there are optional parameters, use two separate route definitions instead to be explicit.
55
55
56
-
## Object Routes
57
-
Object Routes that uniquely identify a specific data element in the product (eg, a report, a workspace, etc) should aim for brevity, as they are generally the building blocks of other routes.
58
-
59
-
### - MUST end with an ID in their path
60
-
Examples:
61
-
62
-
-`settings/wallet/card/:cardID` the route for a specific credit card
63
-
-`workspace/:policyID` the route for a specific workspace
64
-
65
56
### - SHOULD use plural nouns when there are multiple objects that can exist
66
57
Exceptions:
67
58
68
59
- When abbreviated paths are used in specific instances like `r/` (for reports) and `a/` (for accounts) then plurality does not matter
69
60
70
-
### - MUST NOT nest inside other object paths
71
-
If an object can be accessed by its own ID that doesn't depend on any other object IDs, then only use the object's ID in the URL.
72
-
61
+
### - SHOULD use only the minimal necessary information to render the page
73
62
Examples:
74
-
-`r/:threadReportID` GOOD - uses the minimum information required
63
+
-`r/:threadReportID` GOOD - `threadReportID` is all that is needed and all the rest of the page can be derived from that
75
64
-`r/:parentReportID/:threadReportID` BAD - the `parentReportID` is not necessary so it just adds cruft to the URL
76
65
77
66
Exceptions:
78
67
79
68
- When multiple IDs are **required** to render the page.
80
-
81
-
## Page Routes
82
-
Page Routes should attempt to reflect the navigational position in the UI hierarchy, ideally matching the names of the elements pressed to get there, similar to a "trail of breadcrumbs".
83
-
84
-
### - MUST end with a page name
85
-
Examples:
86
-
87
-
-`workspaces` the page to manage workspaces
88
-
-`settings/wallet` the page where you manage your settings
89
-
90
-
### - MAY contain an ID in the path
91
-
Examples:
92
-
93
-
-`r/:reportID/details` the route for the details of a specific report
94
-
-`workspace/:policyID/invite` the page where workspace invites are managed
0 commit comments