FEATURE: Show diff of local changes before updating remote theme (#7443)

This commit is contained in:
Penar Musaraj
2019-05-02 21:43:54 -04:00
committed by GitHub
parent 413a54e7be
commit b948d97c8f
10 changed files with 115 additions and 8 deletions

View File

@ -250,6 +250,15 @@ class Admin::ThemesController < Admin::AdminController
exporter.cleanup!
end
def diff_local_changes
theme = Theme.find_by(id: params[:id])
raise Discourse::InvalidParameters.new(:id) unless theme
changes = theme.remote_theme&.diff_local_changes
respond_to do |format|
format.json { render json: changes || {} }
end
end
private
def update_default_theme