Merge pull request #522 from taigaio/issue/2855/save-project-with-tags
issue 2855 fix the save the project description when the project has …stable
commit
11c7b4d2de
|
@ -90,13 +90,8 @@ class ProjectProfileController extends mixOf(taiga.Controller, taiga.PageMixin)
|
||||||
@scope.$emit('project:loaded', project)
|
@scope.$emit('project:loaded', project)
|
||||||
return project
|
return project
|
||||||
|
|
||||||
loadTagsColors: ->
|
|
||||||
return @rs.projects.tagsColors(@scope.projectId).then (tags_colors) =>
|
|
||||||
@scope.project.tags_colors = tags_colors
|
|
||||||
|
|
||||||
loadInitialData: ->
|
loadInitialData: ->
|
||||||
promise = @.loadProject()
|
promise = @.loadProject()
|
||||||
promise.then => @.loadTagsColors()
|
|
||||||
return promise
|
return promise
|
||||||
|
|
||||||
openDeleteLightbox: ->
|
openDeleteLightbox: ->
|
||||||
|
@ -111,6 +106,8 @@ module.controller("ProjectProfileController", ProjectProfileController)
|
||||||
|
|
||||||
ProjectProfileDirective = ($repo, $confirm, $loading, $navurls, $location, projectService) ->
|
ProjectProfileDirective = ($repo, $confirm, $loading, $navurls, $location, projectService) ->
|
||||||
link = ($scope, $el, $attrs) ->
|
link = ($scope, $el, $attrs) ->
|
||||||
|
$ctrl = $el.controller()
|
||||||
|
|
||||||
form = $el.find("form").checksley({"onlyOneErrorElement": true})
|
form = $el.find("form").checksley({"onlyOneErrorElement": true})
|
||||||
submit = debounce 2000, (event) =>
|
submit = debounce 2000, (event) =>
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
|
@ -118,6 +115,7 @@ ProjectProfileDirective = ($repo, $confirm, $loading, $navurls, $location, proje
|
||||||
return if not form.validate()
|
return if not form.validate()
|
||||||
|
|
||||||
$loading.start(submitButton)
|
$loading.start(submitButton)
|
||||||
|
|
||||||
promise = $repo.save($scope.project)
|
promise = $repo.save($scope.project)
|
||||||
promise.then ->
|
promise.then ->
|
||||||
$loading.finish(submitButton)
|
$loading.finish(submitButton)
|
||||||
|
@ -126,7 +124,8 @@ ProjectProfileDirective = ($repo, $confirm, $loading, $navurls, $location, proje
|
||||||
project: $scope.project.slug
|
project: $scope.project.slug
|
||||||
})
|
})
|
||||||
$location.path(newUrl)
|
$location.path(newUrl)
|
||||||
$scope.$emit("project:loaded", $scope.project)
|
|
||||||
|
$ctrl.loadInitialData()
|
||||||
|
|
||||||
projectService.fetchProject()
|
projectService.fetchProject()
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ div.wrapper(tg-project-profile, ng-controller="ProjectProfileController as ctrl"
|
||||||
|
|
||||||
fieldset
|
fieldset
|
||||||
label(for="tags", translate="ADMIN.PROJECT_PROFILE.TAGS")
|
label(for="tags", translate="ADMIN.PROJECT_PROFILE.TAGS")
|
||||||
div.tags-block(tg-lb-tag-line, ng-model="project.tags")
|
div.tags-block(ng-if="project.id", tg-lb-tag-line, ng-model="project.tags")
|
||||||
|
|
||||||
fieldset
|
fieldset
|
||||||
label(for="project-description", translate="ADMIN.PROJECT_PROFILE.DESCRIPTION")
|
label(for="project-description", translate="ADMIN.PROJECT_PROFILE.DESCRIPTION")
|
||||||
|
|
Loading…
Reference in New Issue