Bug#2409 CSV regenerate popup only showed when you are overwriting the previous url

stable
Jesús Espino 2015-03-11 12:28:45 +01:00 committed by David Barragán Merino
parent 3a94af6df0
commit 3108df4553
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"