UX: admins embedding page follows admin ux guideline (#30122)

Conversion of /admin/customize/embedding page to follow admin UX guidelines.
This commit is contained in:
Krzysztof Kotlarek
2025-01-06 13:01:08 +11:00
committed by GitHub
parent 02113fc22a
commit 407fa69778
38 changed files with 870 additions and 501 deletions

View File

@ -8,11 +8,11 @@ class Admin::EmbeddingController < Admin::AdminController
end
def update
if params[:embedding][:embed_by_username].blank?
return render_json_error(I18n.t("site_settings.embed_username_required"))
end
raise InvalidAccess if !(%w[posts_and_topics crawlers].include?(params[:embedding][:type]))
Embedding.settings.each { |s| @embedding.public_send("#{s}=", params[:embedding][s]) }
Embedding
.send("#{params[:embedding][:type]}_settings")
.each { |s| @embedding.public_send("#{s}=", params[:embedding][s]) }
if @embedding.save
fetch_embedding
@ -22,6 +22,12 @@ class Admin::EmbeddingController < Admin::AdminController
end
end
def new
end
def edit
end
protected
def fetch_embedding