[Windowing] urlService

urlService added to the edit action
bundle.json in addition to being
implemented, however 2nd time edit
bug still occurring. Also fixed urlService
test suite. WTD 23.
This commit is contained in:
Shivam Dave
2015-06-25 13:16:15 -07:00
parent fd6459394a
commit 6d28add055
7 changed files with 41 additions and 13 deletions

View File

@@ -51,8 +51,7 @@ define(
// into the service, followed by ids in the url
// joined by '/', and lastly the view path from
// the current location
path = "/" + mode + "/" +
ids.slice(1).join("/");
path = mode + "/" + ids.slice(1).join("/");
return path;
}
@@ -61,11 +60,27 @@ define(
// includes the view and the index path
function urlForNewTab(mode, domainObject) {
var viewPath = "?view=" + $location.search().view,
newTabPath = "index.html#" +
urlForLocation(mode, domainObject) + viewPath;
newTabPath =
"index.html#" + urlForLocation(mode, domainObject) + viewPath;
return newTabPath;
}
function urlForEdit(mode, domainObject) {
var context = domainObject &&
domainObject.getCapability('context'),
objectPath = context ? context.getPath() : [],
ids = objectPath.map(function (domainObject) {
return domainObject.getId();
}),
// Parses the path together. Starts with the
// default index.html file, then the mode passed
// into the service, followed by ids in the url
// joined by '/', and lastly the view path from
// the current location
path = mode + "/";
return path;
}
return {
/**
* Returns the Url path for a specific domain object
@@ -85,7 +100,9 @@ define(
* @param {DomainObject} value of the domain object
* to get the path of
*/
urlForLocation: urlForLocation
urlForLocation: urlForLocation,
urlForEdit: urlForEdit
};
}

View File

@@ -13,5 +13,6 @@
"directives/MCTDrag",
"directives/MCTResize",
"directives/MCTScroll",
"services/UrlService",
"StyleSheetLoader"
]