FEATURE: admin/user exports are compressed using the zip format (#7784)

* FEATURE: admin/user exports are compressed using the zip format

* Update translations. Theme exporter now exports .zip file. Theme importer supports .zip and .gz files

* Fix controller test, updated locale and skip saving the csv export to disk
This commit is contained in:
Roman Rizzi
2019-07-10 11:13:03 -03:00
committed by GitHub
parent f0fea5991f
commit 8b2580e20f
14 changed files with 89 additions and 30 deletions

View File

@ -88,7 +88,7 @@ class Admin::ThemesController < Admin::AdminController
rescue RemoteTheme::ImportError => e
render_json_error e.message
end
elsif params[:bundle] || (params[:theme] && ["application/x-gzip", "application/gzip"].include?(params[:theme].content_type))
elsif params[:bundle] || (params[:theme] && ["application/x-gzip", "application/gzip", "application/zip"].include?(params[:theme].content_type))
# params[:bundle] used by theme CLI. params[:theme] used by admin UI
bundle = params[:bundle] || params[:theme]
theme_id = params[:theme_id]
@ -252,6 +252,7 @@ class Admin::ThemesController < Admin::AdminController
exporter = ThemeStore::TgzExporter.new(@theme)
file_path = exporter.package_filename
headers['Content-Length'] = File.size(file_path).to_s
send_data File.read(file_path),
filename: File.basename(file_path),