Merge pull request #383 from taigaio/bug/2409/csv-regenerate-popup-only-when-needed

Bug#2409 CSV regenerate popup only showed when you are overwriting the p...
stable
David Barragán Merino 2015-03-11 16:06:41 +01:00
commit 52d720a8f4
1 changed files with 17 additions and 12 deletions

View File

@ -647,9 +647,7 @@ class CsvExporterController extends taiga.Controller
setCsvUuid: => setCsvUuid: =>
@scope.csvUuid = @scope.project["#{@.type}_csv_uuid"] @scope.csvUuid = @scope.project["#{@.type}_csv_uuid"]
regenerateUuid: -> _generateUuid: (finish) =>
#TODO: i18n
@confirm.ask("Change URL", "You going to change the CSV data access url. The previous url will be disabled. Are you sure?").then (finish) =>
promise = @rs.projects["regenerate_#{@.type}_csv_uuid"](@scope.projectId) promise = @rs.projects["regenerate_#{@.type}_csv_uuid"](@scope.projectId)
promise.then (data) => promise.then (data) =>
@ -662,6 +660,13 @@ class CsvExporterController extends taiga.Controller
finish() finish()
return promise return promise
regenerateUuid: ->
#TODO: i18n
if @scope.csvUuid
@confirm.ask("Change URL", "You going to change the CSV data access url. The previous url will be disabled. Are you sure?").then @._generateUuid
else
@._generateUuid(_.identity)
class CsvExporterUserstoriesController extends CsvExporterController class CsvExporterUserstoriesController extends CsvExporterController
type: "userstories" type: "userstories"