Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat(site): add template insights page #8722

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

Merged
merged 29 commits into from
Jul 26, 2023
Merged
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
1f7120f
Add insights page
BrunoQuaresma Jul 24, 2023
ed5784e
Add experiment
BrunoQuaresma Jul 24, 2023
c5efc1e
fix(site): fix error 'Reduce of empty array with no initial value'
BrunoQuaresma Jul 24, 2023
a1a9952
Merge branch 'bq/fix-js-error' into bq/insights-page
BrunoQuaresma Jul 24, 2023
fdcf23f
Show or not insights page
BrunoQuaresma Jul 24, 2023
dfd2f03
Set basic grid for the panels
BrunoQuaresma Jul 24, 2023
b40bdae
Add DAU panel
BrunoQuaresma Jul 24, 2023
6679ae3
Add avatar url into user latency insihgts
BrunoQuaresma Jul 24, 2023
e35a3b5
List latency by user
BrunoQuaresma Jul 24, 2023
544590d
Add user avatar to the list
BrunoQuaresma Jul 24, 2023
fb32677
Merge branch 'main' into bq/insights-page
BrunoQuaresma Jul 25, 2023
1a32402
Use avatar url
BrunoQuaresma Jul 25, 2023
5274733
Fix icon url
BrunoQuaresma Jul 25, 2023
864c6dd
Add apps and IDE usage
BrunoQuaresma Jul 25, 2023
7ea9a26
Fix title
BrunoQuaresma Jul 25, 2023
2aafcee
Add load and empty states
BrunoQuaresma Jul 25, 2023
941671b
Update date range
BrunoQuaresma Jul 25, 2023
37da9b1
Fix loading and not available data
BrunoQuaresma Jul 25, 2023
b8ce94a
Fix data empty
BrunoQuaresma Jul 25, 2023
06178c9
feat(site): add terminal icon
BrunoQuaresma Jul 25, 2023
117aa82
Merge branch 'main' into bq/insights-page
BrunoQuaresma Jul 25, 2023
e91ca19
Merge branch 'bq/add-terminal-icon' into bq/insights-page
BrunoQuaresma Jul 25, 2023
8be0e42
Consume DAUs from insights
BrunoQuaresma Jul 25, 2023
e2768e3
Apply minor improvements
BrunoQuaresma Jul 25, 2023
9236240
Minor improvements
BrunoQuaresma Jul 25, 2023
f147a4d
Fix deps
BrunoQuaresma Jul 25, 2023
03cb386
Merge branch 'main' into bq/insights-page
BrunoQuaresma Jul 25, 2023
8ed5ca3
Add storybook
BrunoQuaresma Jul 25, 2023
3bc6e6b
Fix deploy settings page
BrunoQuaresma Jul 26, 2023
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
Prev Previous commit
Next Next commit
Show or not insights page
  • Loading branch information
BrunoQuaresma committed Jul 24, 2023
commit fdcf23fa6cf47fd35860e82bc7c9e17e71c021c3
31 changes: 20 additions & 11 deletions site/src/components/TemplateLayout/TemplateLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
import { useQuery } from "@tanstack/react-query"
import { AuthorizationRequest } from "api/typesGenerated"
import { ErrorAlert } from "components/Alert/ErrorAlert"
import { useDashboard } from "components/Dashboard/DashboardProvider"

const templatePermissions = (
templateId: string,
Expand Down Expand Up @@ -71,6 +72,12 @@ export const TemplateLayout: FC<{ children?: JSX.Element }> = ({
queryKey: ["template", templateName],
queryFn: () => fetchTemplate(orgId, templateName),
})
const dashboard = useDashboard()
const hasInsightsEnabled =
dashboard.experiments.includes("template_insights_page") ||
process.env.NODE_ENV === "development"
const shouldShowInsights =
hasInsightsEnabled && data?.permissions?.canUpdateTemplate

if (error) {
return (
Expand Down Expand Up @@ -157,17 +164,19 @@ export const TemplateLayout: FC<{ children?: JSX.Element }> = ({
>
Embed
</NavLink>
<NavLink
to={`/templates/${templateName}/insights`}
className={({ isActive }) =>
combineClasses([
styles.tabItem,
isActive ? styles.tabItemActive : undefined,
])
}
>
Insights
</NavLink>
{shouldShowInsights && (
<NavLink
to={`/templates/${templateName}/insights`}
className={({ isActive }) =>
combineClasses([
styles.tabItem,
isActive ? styles.tabItemActive : undefined,
])
}
>
Insights
</NavLink>
)}
</Stack>
</Margins>
</div>
Expand Down