From a9fca5e43ba90c1ad815cebcbe661377f96938f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Barrag=C3=A1n=20Merino?= Date: Wed, 24 Aug 2016 15:21:57 +0200 Subject: [PATCH] Epic in Admin > Project > Reports --- .../modules/admin/project-profile.coffee | 20 +++++++++++++++++++ app/coffee/modules/resources.coffee | 1 + app/coffee/modules/resources/projects.coffee | 12 +++++++---- app/locales/taiga/locale-en.json | 1 + app/partials/admin/admin-project-reports.jade | 1 + 5 files changed, 31 insertions(+), 4 deletions(-) diff --git a/app/coffee/modules/admin/project-profile.coffee b/app/coffee/modules/admin/project-profile.coffee index 4b8c247d..65eb759c 100644 --- a/app/coffee/modules/admin/project-profile.coffee +++ b/app/coffee/modules/admin/project-profile.coffee @@ -425,6 +425,10 @@ class CsvExporterController extends taiga.Controller @._generateUuid() +class CsvExporterEpicsController extends CsvExporterController + type: "epics" + + class CsvExporterUserstoriesController extends CsvExporterController type: "userstories" @@ -437,6 +441,7 @@ class CsvExporterIssuesController extends CsvExporterController type: "issues" +module.controller("CsvExporterEpicsController", CsvExporterEpicsController) module.controller("CsvExporterUserstoriesController", CsvExporterUserstoriesController) module.controller("CsvExporterTasksController", CsvExporterTasksController) module.controller("CsvExporterIssuesController", CsvExporterIssuesController) @@ -446,6 +451,21 @@ module.controller("CsvExporterIssuesController", CsvExporterIssuesController) ## CSV Directive ############################################################################# +CsvEpicDirective = ($translate) -> + link = ($scope) -> + $scope.sectionTitle = "ADMIN.CSV.SECTION_TITLE_EPIC" + + return { + controller: "CsvExporterEpicsController", + controllerAs: "ctrl", + templateUrl: "admin/project-csv.html", + link: link, + scope: true + } + +module.directive("tgCsvEpic", ["$translate", CsvEpicDirective]) + + CsvUsDirective = ($translate) -> link = ($scope) -> $scope.sectionTitle = "ADMIN.CSV.SECTION_TITLE_US" diff --git a/app/coffee/modules/resources.coffee b/app/coffee/modules/resources.coffee index df127c5e..afb7043d 100644 --- a/app/coffee/modules/resources.coffee +++ b/app/coffee/modules/resources.coffee @@ -161,6 +161,7 @@ urls = { "webhooklogs-resend": "/webhooklogs/%s/resend" # Reports - CSV + "epics-csv": "/epics/csv?uuid=%s" "userstories-csv": "/userstories/csv?uuid=%s" "tasks-csv": "/tasks/csv?uuid=%s" "issues-csv": "/issues/csv?uuid=%s" diff --git a/app/coffee/modules/resources/projects.coffee b/app/coffee/modules/resources/projects.coffee index 108012cd..dcb48a72 100644 --- a/app/coffee/modules/resources/projects.coffee +++ b/app/coffee/modules/resources/projects.coffee @@ -61,18 +61,22 @@ resourceProvider = ($config, $repo, $http, $urls, $auth, $q, $translate) -> url = $urls.resolve("bulk-update-projects-order") return $http.post(url, bulkData) + service.regenerate_epics_csv_uuid = (projectId) -> + url = "#{$urls.resolve("projects")}/#{projectId}/regenerate_epics_csv_uuid" + return $http.post(url) + service.regenerate_userstories_csv_uuid = (projectId) -> url = "#{$urls.resolve("projects")}/#{projectId}/regenerate_userstories_csv_uuid" return $http.post(url) - service.regenerate_issues_csv_uuid = (projectId) -> - url = "#{$urls.resolve("projects")}/#{projectId}/regenerate_issues_csv_uuid" - return $http.post(url) - service.regenerate_tasks_csv_uuid = (projectId) -> url = "#{$urls.resolve("projects")}/#{projectId}/regenerate_tasks_csv_uuid" return $http.post(url) + service.regenerate_issues_csv_uuid = (projectId) -> + url = "#{$urls.resolve("projects")}/#{projectId}/regenerate_issues_csv_uuid" + return $http.post(url) + service.leave = (projectId) -> url = "#{$urls.resolve("projects")}/#{projectId}/leave" return $http.post(url) diff --git a/app/locales/taiga/locale-en.json b/app/locales/taiga/locale-en.json index 2feafc66..5e8d7ed9 100644 --- a/app/locales/taiga/locale-en.json +++ b/app/locales/taiga/locale-en.json @@ -559,6 +559,7 @@ "REGENERATE_SUBTITLE": "You going to change the CSV data access url. The previous url will be disabled. Are you sure?" }, "CSV": { + "SECTION_TITLE_EPIC": "epics reports", "SECTION_TITLE_US": "user stories reports", "SECTION_TITLE_TASK": "tasks reports", "SECTION_TITLE_ISSUE": "issues reports", diff --git a/app/partials/admin/admin-project-reports.jade b/app/partials/admin/admin-project-reports.jade index 1ad4c439..a3e669b9 100644 --- a/app/partials/admin/admin-project-reports.jade +++ b/app/partials/admin/admin-project-reports.jade @@ -18,6 +18,7 @@ div.wrapper( p(translate="ADMIN.REPORTS.DESCRIPTION") + div.admin-attributes-section(tg-csv-epic) div.admin-attributes-section(tg-csv-us) div.admin-attributes-section(tg-csv-task) div.admin-attributes-section(tg-csv-issue)