Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3488627
D3335.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D3335.diff
View Options
diff --git a/lib/utils/url-utils.js b/lib/utils/url-utils.js
--- a/lib/utils/url-utils.js
+++ b/lib/utils/url-utils.js
@@ -3,13 +3,14 @@
import urlParseLax from 'url-parse-lax';
export type URLInfo = {
- year?: number,
- month?: number, // 1-indexed
- verify?: string,
- calendar?: boolean,
- chat?: boolean,
- apps?: boolean,
- thread?: string,
+ +year?: number,
+ +month?: number, // 1-indexed
+ +verify?: string,
+ +calendar?: boolean,
+ +chat?: boolean,
+ +apps?: boolean,
+ +thread?: string,
+ +settings?: 'account',
...
};
@@ -20,6 +21,7 @@
const calendarRegex = new RegExp('(/|^)calendar(/|$)', 'i');
const chatRegex = new RegExp('(/|^)chat(/|$)', 'i');
const appsRegex = new RegExp('(/|^)apps(/|$)', 'i');
+const accountSettingsRegex = new RegExp('(/|^)settings/account(/|$)', 'i');
function infoFromURL(url: string): URLInfo {
const yearMatches = yearRegex.exec(url);
@@ -29,6 +31,7 @@
const calendarTest = calendarRegex.test(url);
const chatTest = chatRegex.test(url);
const appsTest = appsRegex.test(url);
+ const accountSettingsTest = accountSettingsRegex.test(url);
const returnObj = {};
if (yearMatches) {
returnObj.year = parseInt(yearMatches[2], 10);
@@ -52,6 +55,8 @@
returnObj.chat = true;
} else if (appsTest) {
returnObj.apps = true;
+ } else if (accountSettingsTest) {
+ returnObj.settings = 'account';
}
return returnObj;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Dec 19, 10:53 AM (21 h, 4 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2676814
Default Alt Text
D3335.diff (1 KB)
Attached To
Mode
D3335: [web] Add navigation path for account settings
Attached
Detach File
Event Timeline
Log In to Comment