Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Embedded dashboard fixes #2744

Merged
merged 3 commits into from
Mar 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ All notable changes to this project will be documented in this file.
- Always show direct traffic in sources reports plausible/analytics#2531
- Stop recording XX and T1 country codes plausible/analytics#2556
- Device type is now determined from the User-Agent instead of window.innerWidth plausible/analytics#2711
- Add padding by default to embedded dashboards so that shadows are not cut off plausible/analytics#2744

### Removed
- Remove Firewall plug and `IP_BLOCKLIST` environment variable
Expand Down
3 changes: 2 additions & 1 deletion assets/js/embed.host.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import iframeResize from 'iframe-resizer/js/iframeResizer'

var iframes = iframeResize({
heightCalculationMethod: 'taggedElement',
onInit: onInit
onInit: onInit,
checkOrigin: false
}, '[plausible-embed]')

function onInit() {
Expand Down
2 changes: 1 addition & 1 deletion lib/plausible_web/views/stats_view.ex
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ defmodule PlausibleWeb.StatsView do
def stats_container_class(conn) do
cond do
conn.assigns[:embedded] && conn.assigns[:width] == "manual" -> ""
conn.assigns[:embedded] -> "max-w-screen-lg mx-auto"
conn.assigns[:embedded] -> "max-w-screen-xl mx-auto px-6"
!conn.assigns[:embedded] -> "container"
end
end
Expand Down