Adding message on admin when there is no role that can estimate and disabling edition in backlog when needed
parent
5d8e429771
commit
ffd9038801
|
@ -51,6 +51,7 @@ class RolesController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.Fil
|
|||
|
||||
@scope.sectionName = "Permissions" #i18n
|
||||
@scope.project = {}
|
||||
@scope.anyComputableRole = true
|
||||
|
||||
promise = @.loadInitialData()
|
||||
|
||||
|
@ -67,6 +68,8 @@ class RolesController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.Fil
|
|||
return @rs.projects.get(@scope.projectId).then (project) =>
|
||||
@scope.project = project
|
||||
@scope.$emit('project:loaded', project)
|
||||
@scope.anyComputableRole = _.some(_.map(project.roles, (point) -> point.computable))
|
||||
|
||||
return project
|
||||
|
||||
loadRoles: ->
|
||||
|
@ -104,6 +107,7 @@ class RolesController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.Fil
|
|||
return @confirm.askChoice(title, subtitle, choices).then (response) =>
|
||||
promise = @repo.remove(@scope.role, {moveTo: response.selected})
|
||||
promise.then =>
|
||||
@.loadProject()
|
||||
@.loadRoles().finally ->
|
||||
response.finish()
|
||||
promise.then null, =>
|
||||
|
@ -112,6 +116,7 @@ class RolesController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.Fil
|
|||
setComputable: debounce 2000, ->
|
||||
onSuccess = =>
|
||||
@confirm.notify("success")
|
||||
@.loadProject()
|
||||
|
||||
onError = =>
|
||||
@confirm.notify("error")
|
||||
|
@ -168,6 +173,7 @@ NewRoleDirective = ($tgrepo, $confirm) ->
|
|||
$scope.roles.push(role)
|
||||
$ctrl.setRole(role)
|
||||
$el.find(".add-button").show()
|
||||
$ctrl.loadProject()
|
||||
|
||||
onError = ->
|
||||
$confirm.notify("error")
|
||||
|
@ -326,6 +332,7 @@ RolePermissionsDirective = ($rootscope, $repo, $confirm) ->
|
|||
renderResume(target.parents(".category-config"), categories[categoryId])
|
||||
$rootscope.$broadcast("projects:reload")
|
||||
$confirm.notify("success")
|
||||
$ctrl.loadProject()
|
||||
|
||||
onError = ->
|
||||
$confirm.notify("error")
|
||||
|
|
|
@ -771,6 +771,20 @@ UsPointsDirective = ($repo) ->
|
|||
if numberOfRoles == 1
|
||||
selectedRoleId = _.keys(us.points)[0]
|
||||
|
||||
computableRoles = _.filter($scope.project.roles, "computable")
|
||||
|
||||
roles = _.map computableRoles, (role) ->
|
||||
pointId = us.points[role.id]
|
||||
pointObj = $scope.pointsById[pointId]
|
||||
|
||||
role = _.clone(role, true)
|
||||
role.points = if pointObj.value? then pointObj.value else "?"
|
||||
return role
|
||||
|
||||
if roles.length == 0
|
||||
$el.find(".icon-arrow-bottom").remove()
|
||||
$el.find("a.us-points").addClass("not-clickable")
|
||||
|
||||
renderPointsSelector = (us, roleId) ->
|
||||
# Prepare data for rendering
|
||||
points = _.map $scope.project.points, (point) ->
|
||||
|
@ -794,17 +808,6 @@ UsPointsDirective = ($repo) ->
|
|||
$el.find(".pop-points-open").popover().open()
|
||||
|
||||
renderRolesSelector = (us) ->
|
||||
# Prepare data for rendering
|
||||
computableRoles = _.filter($scope.project.roles, "computable")
|
||||
|
||||
roles = _.map computableRoles, (role) ->
|
||||
pointId = us.points[role.id]
|
||||
pointObj = $scope.pointsById[pointId]
|
||||
|
||||
role = _.clone(role, true)
|
||||
role.points = if pointObj.value? then pointObj.value else "?"
|
||||
return role
|
||||
|
||||
html = rolesTemplate({"roles": roles})
|
||||
|
||||
# Render into DOM and show the new created element
|
||||
|
@ -845,6 +848,7 @@ UsPointsDirective = ($repo) ->
|
|||
renderPoints(us, null)
|
||||
selectedRoleId = null
|
||||
|
||||
if roles.length > 0
|
||||
$el.on "click", "a.us-points span", (event) ->
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
|
|
|
@ -21,6 +21,8 @@ block content
|
|||
| {{ role.name }}
|
||||
span ({{ role.members_count }} members with this role)
|
||||
|
||||
div(ng-hide="anyComputableRole") Be careful, no role in your project have can affect the user story estimation points.
|
||||
|
||||
div.general-category
|
||||
| When enabled, members assigned to this role will be able to estimate the point value for user stories
|
||||
div.check
|
||||
|
|
Loading…
Reference in New Issue