Skip to content

Commit 4631ba1

Browse files
author
Michael Nomitch
committed
set proper account in preview iframe
fixes CNVS-23657 test plan: - make a parent theme and appluy - make a subaccount theme and apply - go back to the editor for the parent - it starts off with its current theme - go back to the editor for the subaccount - it starts off with its current theme - changes to both apply correctly Change-Id: I77d306be0fe34e0fcb6305bd799240ebb45072f0 Reviewed-on: https://gerrit.instructure.com/64032 Tested-by: Jenkins Reviewed-by: Jacob Fugal <jacob@instructure.com> QA-Review: August Thornton <august@instructure.com> Product-Review: Jacob Fugal <jacob@instructure.com>
1 parent 0eda147 commit 4631ba1

3 files changed

Lines changed: 7 additions & 2 deletions

File tree

app/controllers/info_controller.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,9 @@ def browserconfig
5555
expires_in 10.minutes, public: true
5656
end
5757

58+
def theme_preview
59+
if params[:account_id]
60+
@account = Account.find_cached(params[:account_id])
61+
end
62+
end
5863
end

app/jsx/theme_editor/ThemeEditor.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ define([
436436
</button>
437437
</div>
438438
: null }
439-
<iframe id="previewIframe" ref="previewIframe" src="/theme-preview/?editing_brand_config=1" />
439+
<iframe id="previewIframe" ref="previewIframe" src={"/accounts/"+this.props.accountID+"/theme-preview/?editing_brand_config=1"} />
440440
</div>
441441

442442
</div>

config/routes.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@
745745
get 'dashboard-sidebar' => 'users#dashboard_sidebar', as: :dashboard_sidebar
746746
post 'users/toggle_recent_activity_dashboard' => 'users#toggle_recent_activity_dashboard'
747747
get 'styleguide' => 'info#styleguide'
748-
get 'theme-preview' => 'info#theme_preview'
748+
get 'accounts/:account_id/theme-preview' => 'info#theme_preview'
749749
get 'old_styleguide' => 'info#old_styleguide'
750750
root to: 'users#user_dashboard', as: 'root', via: :get
751751
# backwards compatibility with the old /dashboard url

0 commit comments

Comments
 (0)