Merge pull request #108 from taigaio/bug/1372/update-url-when-editing-project-slug
Updating url when editing project slugstable
commit
98a04dfd8c
|
@ -96,7 +96,7 @@ module.controller("ProjectProfileController", ProjectProfileController)
|
||||||
## Project Profile Directive
|
## Project Profile Directive
|
||||||
#############################################################################
|
#############################################################################
|
||||||
|
|
||||||
ProjectProfileDirective = ($repo, $confirm, $loading) ->
|
ProjectProfileDirective = ($repo, $confirm, $loading, $navurls, $location) ->
|
||||||
link = ($scope, $el, $attrs) ->
|
link = ($scope, $el, $attrs) ->
|
||||||
form = $el.find("form").checksley({"onlyOneErrorElement": true})
|
form = $el.find("form").checksley({"onlyOneErrorElement": true})
|
||||||
submit = (target) =>
|
submit = (target) =>
|
||||||
|
@ -108,6 +108,8 @@ ProjectProfileDirective = ($repo, $confirm, $loading) ->
|
||||||
promise.then ->
|
promise.then ->
|
||||||
$loading.finish(target)
|
$loading.finish(target)
|
||||||
$confirm.notify("success")
|
$confirm.notify("success")
|
||||||
|
newUrl = $navurls.resolve("project-admin-project-profile-details", {project: $scope.project.slug})
|
||||||
|
$location.path(newUrl)
|
||||||
$scope.$emit("project:loaded", $scope.project)
|
$scope.$emit("project:loaded", $scope.project)
|
||||||
|
|
||||||
promise.then null, (data) ->
|
promise.then null, (data) ->
|
||||||
|
@ -132,7 +134,7 @@ ProjectProfileDirective = ($repo, $confirm, $loading) ->
|
||||||
|
|
||||||
return {link:link}
|
return {link:link}
|
||||||
|
|
||||||
module.directive("tgProjectProfile", ["$tgRepo", "$tgConfirm", "$tgLoading", ProjectProfileDirective])
|
module.directive("tgProjectProfile", ["$tgRepo", "$tgConfirm", "$tgLoading", "$tgNavUrls", "$tgLocation", ProjectProfileDirective])
|
||||||
|
|
||||||
|
|
||||||
#############################################################################
|
#############################################################################
|
||||||
|
|
Loading…
Reference in New Issue