Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,22 @@ import './DashboardChartView.css';
import { getDataDates } from 'connectors/utils';

export function DashboardChartView({
data, dataFlag
data, dataFlag,
}) {
const formatter = useDateFormatter({ dateStyle: 'short' });

if (data.length > 0) {
let totalPageViews = 0;
data.forEach((pageview) => {
totalPageViews += parseInt(pageview.pageviews, 10);
})
});

const {start, end} = getDataDates();
const { start, end } = getDataDates();
const currStart = start ? parseDate(start) : null;
const currEnd = end ? parseDate(end) : null;
const urlParameters = new URLSearchParams(location.search)
const urlParameters = new URLSearchParams(location.search);
const url = urlParameters.get('url').replace('https://', '');


return start && end && (
<Grid
areas={[
Expand All @@ -36,7 +35,7 @@ export function DashboardChartView({
>
<View gridArea="title" width="100%">
<h2 style={{ textAlign: 'center' }}>
{<a href={'https://'+url}>{url}</a>} registered <Badge margin="auto" width="fit-content" UNSAFE_style={{ fontSize: '15px' }} alignSelf='center' variant='info'>{parseInt(totalPageViews, 10).toLocaleString('en-US')}</Badge>{` visits between ${formatter.formatRange(
{<a href={`https://${url}`}>{url}</a>} registered <Badge margin="auto" width="fit-content" UNSAFE_style={{ fontSize: '15px' }} alignSelf='center' variant='info'>{parseInt(totalPageViews, 10).toLocaleString('en-US')}</Badge>{` page views between ${formatter.formatRange(
currStart.toDate(),
currEnd.toDate(),
)}`}
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/DashboardRUMView/RumDashboardMain.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export function RumDashboardMain() {

const columns = ['url', 'avglcp', 'avgcls', 'avginp', 'pageviews'];
const columnHeadings = {
pageviews: ['Pageviews', `Total visits to a url in date range chosen. Choosing date range 1/1/2023 - 1/2/2023
pageviews: ['Pageviews', `Total page views for a url in date range chosen. Choosing date range 1/1/2023 - 1/2/2023
will provide you data from 12AM 1/1/2023 through to end of day of 1/2/2023`],
avgcls: ['Cumulative Layout Shift', `CLS measures the sum total of all individual layout shift scores for every
unexpected layout shift that occurs during the entire lifespan of the page. The score is zero to any positive
Expand Down
2 changes: 1 addition & 1 deletion static/js/main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion static/js/main.js.map

Large diffs are not rendered by default.