Fix userstory custom attributes values
parent
c8ad480846
commit
08f0a2262a
|
@ -47,7 +47,7 @@ class CustomAttributesValuesController extends taiga.Controller
|
|||
|
||||
loadCustomAttributesValues: ->
|
||||
return @.customAttributesValues if not @.objectId
|
||||
return @rs.customAttributesValues.get(@.type, @.objectId).then (customAttributesValues) =>
|
||||
return @rs.customAttributesValues[@.type].get(@.objectId).then (customAttributesValues) =>
|
||||
@.customAttributes = @.project["#{@.type}_custom_attributes"]
|
||||
@.customAttributesValues = customAttributesValues
|
||||
return customAttributesValues
|
||||
|
@ -70,6 +70,7 @@ class CustomAttributesValuesController extends taiga.Controller
|
|||
@.customAttributesValues.id = @.objectId
|
||||
return @repo.save(@.customAttributesValues).then(onSuccess, onError)
|
||||
|
||||
|
||||
CustomAttributesValuesDirective = ($templates, $storage) ->
|
||||
template = $templates.get("custom-attributes/custom-attributes-values.html", true)
|
||||
collapsedHash = (type) ->
|
||||
|
|
|
@ -103,12 +103,12 @@ urls = {
|
|||
"attachments/wiki_page": "/wiki/attachments"
|
||||
|
||||
# Custom Attributess
|
||||
"custom-attributes/us": "/userstory-custom-attributes"
|
||||
"custom-attributes/userstory": "/userstory-custom-attributes"
|
||||
"custom-attributes/issue": "/issue-custom-attributes"
|
||||
"custom-attributes/task": "/task-custom-attributes"
|
||||
|
||||
# Custom field values
|
||||
"custom-attributes-values/us": "/userstories/custom-attributes-values"
|
||||
"custom-attributes-values/userstory": "/userstories/custom-attributes-values"
|
||||
"custom-attributes-values/issue": "/issues/custom-attributes-values"
|
||||
"custom-attributes-values/task": "/tasks/custom-attributes-values"
|
||||
|
||||
|
|
|
@ -21,15 +21,24 @@
|
|||
|
||||
taiga = @.taiga
|
||||
|
||||
resourceProvider = ($rootScope, $config, $urls, $model, $repo, $auth, $q) ->
|
||||
service = {}
|
||||
resourceProvider = ($repo) ->
|
||||
_get = (objectId, resource) ->
|
||||
return $repo.queryOne(resource, objectId)
|
||||
|
||||
service.get = (type, objectId) ->
|
||||
return $repo.queryOne("custom-attributes-values/#{type}", objectId)
|
||||
service = {
|
||||
userstory: {
|
||||
get: (objectId) -> _get(objectId, "custom-attributes-values/userstory")
|
||||
}
|
||||
task: {
|
||||
get: (objectId) -> _get(objectId, "custom-attributes-values/task")
|
||||
}
|
||||
issue: {
|
||||
get: (objectId) -> _get(objectId, "custom-attributes-values/issue")
|
||||
}
|
||||
}
|
||||
|
||||
return (instance) ->
|
||||
instance.customAttributesValues = service
|
||||
|
||||
module = angular.module("taigaResources")
|
||||
module.factory("$tgCustomAttributesValuesResourcesProvider", ["$rootScope", "$tgConfig", "$tgUrls", "$tgModel", "$tgRepo",
|
||||
"$tgAuth", "$q", resourceProvider])
|
||||
module.factory("$tgCustomAttributesValuesResourcesProvider", ["$tgRepo", resourceProvider])
|
||||
|
|
|
@ -29,8 +29,8 @@ resourceProvider = ($repo) ->
|
|||
return $repo.queryMany(resource, {project: projectId})
|
||||
|
||||
service = {
|
||||
us:{
|
||||
list: (projectId) -> _list(projectId, "custom-attributes/us")
|
||||
userstory:{
|
||||
list: (projectId) -> _list(projectId, "custom-attributes/userstory")
|
||||
}
|
||||
task:{
|
||||
list: (projectId) -> _list(projectId, "custom-attributes/task")
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
div.wrapper(tg-project-custom-attributes, ng-controller="ProjectCustomAttributesController as ctrl",
|
||||
ng-init="section='admin'; type='us'; sectionName='US extra'")
|
||||
ng-init="section='admin'; type='userstory'; sectionName='US extra'")
|
||||
sidebar.menu-secondary.sidebar(tg-admin-navigation="project-values")
|
||||
include ../includes/modules/admin-menu
|
||||
|
||||
|
|
Loading…
Reference in New Issue