FEATURE: add branch option to remote theme import

* FEATURE: add branch option to remote theme import

* FIX: Add missing variable in params

* FIX: Add missing param for import_theme method

* SPEC: Add test methods for branch support in git import

* FIX: Add missing space to scss style

* Do not assume default branch as master

* Change branch field placeholder

* FIX: add missing div start tag
This commit is contained in:
Erin Kosewic
2018-10-08 23:01:08 -07:00
committed by Sam
parent acba7d2a5d
commit 51aba32651
9 changed files with 99 additions and 18 deletions

View File

@@ -76,7 +76,8 @@ class Admin::ThemesController < Admin::AdminController
end
elsif params[:remote]
begin
@theme = RemoteTheme.import_theme(params[:remote], current_user, private_key: params[:private_key])
branch = params[:branch] ? params[:branch] : nil
@theme = RemoteTheme.import_theme(params[:remote], current_user, private_key: params[:private_key], branch: branch)
render json: @theme, status: :created
rescue RuntimeError => e
Discourse.warn_exception(e, message: "Error importing theme")