From fbfde871e2992cc64c371a5490e9d597dccede4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Barrag=C3=A1n=20Merino?= Date: Wed, 24 Aug 2016 17:04:43 +0200 Subject: [PATCH] Epic in Admin > Attributes > Custom Fields --- app/coffee/modules/resources.coffee | 6 ++++-- .../modules/resources/custom-attributes-values.coffee | 3 +++ app/coffee/modules/resources/custom-attributes.coffee | 3 +++ app/locales/taiga/locale-en.json | 2 ++ app/partials/admin/admin-project-values-custom-fields.jade | 7 +++++++ 5 files changed, 19 insertions(+), 2 deletions(-) diff --git a/app/coffee/modules/resources.coffee b/app/coffee/modules/resources.coffee index ae917665..9085f7da 100644 --- a/app/coffee/modules/resources.coffee +++ b/app/coffee/modules/resources.coffee @@ -146,14 +146,16 @@ urls = { "attachments/wiki_page": "/wiki/attachments" # Custom Attributess + "custom-attributes/epic": "/epic-custom-attributes" "custom-attributes/userstory": "/userstory-custom-attributes" - "custom-attributes/issue": "/issue-custom-attributes" "custom-attributes/task": "/task-custom-attributes" + "custom-attributes/issue": "/issue-custom-attributes" # Custom Attributess - Values + "custom-attributes-values/epic": "/epics/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" + "custom-attributes-values/issue": "/issues/custom-attributes-values" # Webhooks "webhooks": "/webhooks" diff --git a/app/coffee/modules/resources/custom-attributes-values.coffee b/app/coffee/modules/resources/custom-attributes-values.coffee index f5a38b2c..904d506e 100644 --- a/app/coffee/modules/resources/custom-attributes-values.coffee +++ b/app/coffee/modules/resources/custom-attributes-values.coffee @@ -29,6 +29,9 @@ resourceProvider = ($repo) -> return $repo.queryOne(resource, objectId) service = { + epic: { + get: (objectId) -> _get(objectId, "custom-attributes-values/epic") + } userstory: { get: (objectId) -> _get(objectId, "custom-attributes-values/userstory") } diff --git a/app/coffee/modules/resources/custom-attributes.coffee b/app/coffee/modules/resources/custom-attributes.coffee index 520ec2d2..88ae4872 100644 --- a/app/coffee/modules/resources/custom-attributes.coffee +++ b/app/coffee/modules/resources/custom-attributes.coffee @@ -32,6 +32,9 @@ resourceProvider = ($repo) -> return $repo.queryMany(resource, {project: projectId}) service = { + epic:{ + list: (projectId) -> _list(projectId, "custom-attributes/epic") + } userstory:{ list: (projectId) -> _list(projectId, "custom-attributes/userstory") } diff --git a/app/locales/taiga/locale-en.json b/app/locales/taiga/locale-en.json index 7fa886c2..298d93a3 100644 --- a/app/locales/taiga/locale-en.json +++ b/app/locales/taiga/locale-en.json @@ -572,6 +572,8 @@ "CUSTOM_FIELDS": { "TITLE": "Custom Fields", "SUBTITLE": "Specify the custom fields for your user stories, tasks and issues", + "EPIC_DESCRIPTION": "Epics custom fields", + "EPIC_ADD": "Add a custom field in epics", "US_DESCRIPTION": "User stories custom fields", "US_ADD": "Add a custom field in user stories", "TASK_DESCRIPTION": "Tasks custom fields", diff --git a/app/partials/admin/admin-project-values-custom-fields.jade b/app/partials/admin/admin-project-values-custom-fields.jade index 691079b5..19cb292b 100644 --- a/app/partials/admin/admin-project-values-custom-fields.jade +++ b/app/partials/admin/admin-project-values-custom-fields.jade @@ -17,6 +17,13 @@ div.wrapper( include ../includes/components/mainTitle p.admin-subtitle(translate="ADMIN.CUSTOM_FIELDS.SUBTITLE") + div.admin-attributes-section( + tg-project-custom-attributes, + ng-controller="ProjectCustomAttributesController as ctrl", + ng-init="type='epic'; customFieldSectionTitle='ADMIN.CUSTOM_FIELDS.EPIC_DESCRIPTION'; customFieldButtonTitle='ADMIN.CUSTOM_FIELDS.EPIC_ADD'" + ) + include ../includes/modules/admin/admin-custom-attributes + div.admin-attributes-section( tg-project-custom-attributes, ng-controller="ProjectCustomAttributesController as ctrl",