Fix errors of tag directive in lightboxes
parent
c8ce1ad9e0
commit
47fa97917e
|
@ -234,10 +234,10 @@ module.directive("tgBlockingMessageInput", ["$log", BlockingMessageInputDirectiv
|
||||||
|
|
||||||
CreateEditUserstoryDirective = ($repo, $model, $rs, $rootScope, lightboxService, $loading) ->
|
CreateEditUserstoryDirective = ($repo, $model, $rs, $rootScope, lightboxService, $loading) ->
|
||||||
link = ($scope, $el, attrs) ->
|
link = ($scope, $el, attrs) ->
|
||||||
isNew = true
|
$scope.isNew = true
|
||||||
|
|
||||||
$scope.$on "usform:new", (ctx, projectId, status, statusList) ->
|
$scope.$on "usform:new", (ctx, projectId, status, statusList) ->
|
||||||
isNew = true
|
$scope.isNew = true
|
||||||
$scope.usStatusList = statusList
|
$scope.usStatusList = statusList
|
||||||
|
|
||||||
$scope.us = {
|
$scope.us = {
|
||||||
|
@ -261,7 +261,7 @@ CreateEditUserstoryDirective = ($repo, $model, $rs, $rootScope, lightboxService,
|
||||||
|
|
||||||
$scope.$on "usform:edit", (ctx, us) ->
|
$scope.$on "usform:edit", (ctx, us) ->
|
||||||
$scope.us = us
|
$scope.us = us
|
||||||
isNew = false
|
$scope.isNew = false
|
||||||
|
|
||||||
# Update texts for edition
|
# Update texts for edition
|
||||||
$el.find(".button-green span").html("Save") #TODO: i18n
|
$el.find(".button-green span").html("Save") #TODO: i18n
|
||||||
|
@ -296,7 +296,7 @@ CreateEditUserstoryDirective = ($repo, $model, $rs, $rootScope, lightboxService,
|
||||||
|
|
||||||
$loading.start(target)
|
$loading.start(target)
|
||||||
|
|
||||||
if isNew
|
if $scope.isNew
|
||||||
promise = $repo.create("userstories", $scope.us)
|
promise = $repo.create("userstories", $scope.us)
|
||||||
broadcastEvent = "usform:new:success"
|
broadcastEvent = "usform:new:success"
|
||||||
else
|
else
|
||||||
|
|
|
@ -167,12 +167,16 @@ TagLineDirective = ($rootscope, $log, $rs, $tgrepo, $confirm) ->
|
||||||
|
|
||||||
bindOnce $scope, "project", (project) ->
|
bindOnce $scope, "project", (project) ->
|
||||||
# If not editable, no tags preloading is needed.
|
# If not editable, no tags preloading is needed.
|
||||||
editable = $attrs.editable == "true" and project.my_permissions.indexOf($attrs.requiredPerm) != -1
|
editable = project.my_permissions.indexOf($attrs.requiredPerm) != -1
|
||||||
|
|
||||||
|
if not $scope.$eval($attrs.autosaveModel)?
|
||||||
|
$el.find("a.save").remove()
|
||||||
|
|
||||||
if not editable
|
if not editable
|
||||||
$el.find("input").remove()
|
$el.find("input").remove()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
positioningFunction = (position, elements) ->
|
positioningFunction = (position, elements) ->
|
||||||
menu = elements.element.element
|
menu = elements.element.element
|
||||||
menu.css("width", elements.target.width)
|
menu.css("width", elements.target.width)
|
||||||
|
|
|
@ -25,7 +25,7 @@ debounce = @.taiga.debounce
|
||||||
|
|
||||||
CreateEditTaskDirective = ($repo, $model, $rs, $rootscope, lightboxService) ->
|
CreateEditTaskDirective = ($repo, $model, $rs, $rootscope, lightboxService) ->
|
||||||
link = ($scope, $el, attrs) ->
|
link = ($scope, $el, attrs) ->
|
||||||
isNew = true
|
$scope.isNew = true
|
||||||
|
|
||||||
$scope.$on "taskform:new", (ctx, sprintId, usId) ->
|
$scope.$on "taskform:new", (ctx, sprintId, usId) ->
|
||||||
$scope.task = {
|
$scope.task = {
|
||||||
|
@ -37,7 +37,7 @@ CreateEditTaskDirective = ($repo, $model, $rs, $rootscope, lightboxService) ->
|
||||||
assigned_to: null
|
assigned_to: null
|
||||||
tags: []
|
tags: []
|
||||||
}
|
}
|
||||||
isNew = true
|
$scope.isNew = true
|
||||||
|
|
||||||
# Update texts for creation
|
# Update texts for creation
|
||||||
$el.find(".button-green span").html("Create") #TODO: i18n
|
$el.find(".button-green span").html("Create") #TODO: i18n
|
||||||
|
@ -46,7 +46,7 @@ CreateEditTaskDirective = ($repo, $model, $rs, $rootscope, lightboxService) ->
|
||||||
|
|
||||||
$scope.$on "taskform:edit", (ctx, task) ->
|
$scope.$on "taskform:edit", (ctx, task) ->
|
||||||
$scope.task = task
|
$scope.task = task
|
||||||
isNew = false
|
$scope.isNew = false
|
||||||
|
|
||||||
# Update texts for edition
|
# Update texts for edition
|
||||||
$el.find(".button-green span").html("Save") #TODO: i18n
|
$el.find(".button-green span").html("Save") #TODO: i18n
|
||||||
|
@ -60,7 +60,7 @@ CreateEditTaskDirective = ($repo, $model, $rs, $rootscope, lightboxService) ->
|
||||||
if not form.validate()
|
if not form.validate()
|
||||||
return
|
return
|
||||||
|
|
||||||
if isNew
|
if $scope.isNew
|
||||||
promise = $repo.create("tasks", $scope.task)
|
promise = $repo.create("tasks", $scope.task)
|
||||||
broadcastEvent = "taskform:new:success"
|
broadcastEvent = "taskform:new:success"
|
||||||
else
|
else
|
||||||
|
|
|
@ -31,7 +31,7 @@ block content
|
||||||
a.icon.icon-arrow-left(ng-show="previousUrl", tg-bo-href="previousUrl", title="previous issue")
|
a.icon.icon-arrow-left(ng-show="previousUrl", tg-bo-href="previousUrl", title="previous issue")
|
||||||
a.icon.icon-arrow-right(ng-show="nextUrl", tg-bo-href="nextUrl", title="next issue")
|
a.icon.icon-arrow-right(ng-show="nextUrl", tg-bo-href="nextUrl", title="next issue")
|
||||||
|
|
||||||
div(tg-tag-line, editable="true", autosave-model="issue", ng-model="issue.tags", required-perm="modify_issue")
|
div(tg-tag-line, autosave-model="issue", ng-model="issue.tags", required-perm="modify_issue")
|
||||||
|
|
||||||
section.duty-content.wysiwyg(tg-editable-description, ng-model="issue", required-perm="modify_issue")
|
section.duty-content.wysiwyg(tg-editable-description, ng-model="issue", required-perm="modify_issue")
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ block content
|
||||||
a.icon.icon-arrow-left(ng-show="previousUrl", tg-bo-href="previousUrl", title="previous task")
|
a.icon.icon-arrow-left(ng-show="previousUrl", tg-bo-href="previousUrl", title="previous task")
|
||||||
a.icon.icon-arrow-right(ng-show="nextUrl", tg-bo-href="nextUrl", title="next task")
|
a.icon.icon-arrow-right(ng-show="nextUrl", tg-bo-href="nextUrl", title="next task")
|
||||||
|
|
||||||
div(tg-tag-line, editable="true", autosave-model="task", ng-model="task.tags", required-perm="modify_task")
|
div(tg-tag-line, autosave-model="task", ng-model="task.tags", required-perm="modify_task")
|
||||||
|
|
||||||
section.duty-content.wysiwyg(tg-editable-description, ng-model="task", required-perm="modify_task")
|
section.duty-content.wysiwyg(tg-editable-description, ng-model="task", required-perm="modify_task")
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ block content
|
||||||
title="previous user story")
|
title="previous user story")
|
||||||
a.icon.icon-arrow-right(ng-show="nextUrl", tg-bo-href="nextUrl", title="next user story")
|
a.icon.icon-arrow-right(ng-show="nextUrl", tg-bo-href="nextUrl", title="next user story")
|
||||||
|
|
||||||
div(tg-tag-line, editable="true", autosave-model="us", ng-model="us.tags", required-perm="modify_us")
|
div(tg-tag-line, autosave-model="us", ng-model="us.tags", required-perm="modify_us")
|
||||||
|
|
||||||
section.duty-content.wysiwyg(tg-editable-description, ng-model="us", required-perm="modify_us")
|
section.duty-content.wysiwyg(tg-editable-description, ng-model="us", required-perm="modify_us")
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ form
|
||||||
select.severity(ng-model="issue.severity", ng-options="s.id as s.name for s in severityList")
|
select.severity(ng-model="issue.severity", ng-options="s.id as s.name for s in severityList")
|
||||||
|
|
||||||
fieldset
|
fieldset
|
||||||
div(tg-tag-line, editable="true", ng-model="issue.tags")
|
div(tg-tag-line, ng-model="issue.tags", required-perm="add_issue")
|
||||||
|
|
||||||
fieldset
|
fieldset
|
||||||
textarea.description(placeholder="Description", ng-model="issue.description")
|
textarea.description(placeholder="Description", ng-model="issue.description")
|
||||||
|
|
|
@ -15,8 +15,9 @@ form
|
||||||
placeholder="Assigned to")
|
placeholder="Assigned to")
|
||||||
option(value="") Unassigned
|
option(value="") Unassigned
|
||||||
|
|
||||||
fieldset
|
fieldset(ng-switch="isNew")
|
||||||
div(tg-tag-line, editable="true", ng-model="task.tags")
|
div(ng-switch-when="true", tg-tag-line, ng-model="task.tags", required-perm="add_task")
|
||||||
|
div(ng-switch-default, tg-tag-line, ng-model="task.tags", required-perm="modify_task")
|
||||||
|
|
||||||
fieldset
|
fieldset
|
||||||
textarea.description(placeholder="Type a short description", ng-model="task.description")
|
textarea.description(placeholder="Type a short description", ng-model="task.description")
|
||||||
|
|
|
@ -8,14 +8,14 @@ form
|
||||||
|
|
||||||
fieldset.estimation
|
fieldset.estimation
|
||||||
tg-us-estimation(ng-model="us")
|
tg-us-estimation(ng-model="us")
|
||||||
//- Render by tg-lb-create-edit-userstory
|
|
||||||
|
|
||||||
fieldset
|
fieldset
|
||||||
select(name="status", ng-model="us.status", ng-options="s.id as s.name for s in usStatusList",
|
select(name="status", ng-model="us.status", ng-options="s.id as s.name for s in usStatusList",
|
||||||
tr="placeholder:common.status")
|
tr="placeholder:common.status")
|
||||||
|
|
||||||
fieldset
|
fieldset(ng-switch="isNew")
|
||||||
div(tg-tag-line, editable="true", ng-model="us.tags")
|
div(ng-switch-when="true", tg-tag-line, ng-model="us.tags", required-perm="add_us")
|
||||||
|
div(ng-switch-default, tg-tag-line, ng-model="us.tags", required-perm="modify_us")
|
||||||
|
|
||||||
fieldset
|
fieldset
|
||||||
textarea.description(name="description", ng-model="us.description",
|
textarea.description(name="description", ng-model="us.description",
|
||||||
|
|
Loading…
Reference in New Issue