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

Saved insight fixes 2 #6674

Merged
merged 19 commits into from
Oct 28, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions frontend/src/scenes/funnels/FunnelBarGraph.scss
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ $funnel_canvas_background: #fafafa;

.funnel-step {
width: 30%;
min-width: 200px;
display: flex;
flex-direction: column;

Expand Down
22 changes: 17 additions & 5 deletions frontend/src/scenes/insights/EmptyStates/EmptyStates.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -256,15 +256,15 @@ export function FunnelInvalidExclusionFiltersEmptyState(): JSX.Element {

const SAVED_INSIGHTS_COPY = {
[`${SavedInsightsTabs.All}`]: {
title: 'There are no insights for this project',
title: 'There are no insights $CONDITION.',
description: 'Once you create an insight, it will show up here.',
},
[`${SavedInsightsTabs.Yours}`]: {
title: "You haven't created insights for this project",
title: "You haven't created insights $CONDITION.",
description: 'Once you create an insight, it will show up here.',
},
[`${SavedInsightsTabs.Favorites}`]: {
title: 'There are no favorited insights for this project',
title: 'There are no favorited insights $CONDITION.',
description: 'Once you favorite an insight, it will show up here.',
},
}
Expand All @@ -273,16 +273,28 @@ export function SavedInsightsEmptyState(): JSX.Element {
const { addGraph } = useActions(savedInsightsLogic)
const {
filters: { tab },
insights,
usingFilters,
} = useValues(savedInsightsLogic)

// show the search string that was used to make the results, not what it currently is
const searchString = insights.filters?.search || null
const { title, description } = SAVED_INSIGHTS_COPY[tab]

return (
<div className="saved-insight-empty-state">
<div className="insight-empty-state__wrapper">
<div className="illustration-main">
<IconTrendUp />
</div>
<h2 className="empty-state__title">{SAVED_INSIGHTS_COPY[tab].title}</h2>
<p className="empty-state__description">{SAVED_INSIGHTS_COPY[tab].description}</p>
<h2 className="empty-state__title">
{usingFilters
? searchString
? title.replace('$CONDITION', `matching "${searchString}"`)
: title.replace('$CONDITION', `matching these filters`)
: title.replace('$CONDITION', 'for this project')}
</h2>
<p className="empty-state__description">{description}</p>
{tab !== SavedInsightsTabs.Favorites && (
<Button
size="large"
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/scenes/insights/Insights.scss
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ $funnel_canvas_background: #fafafa;

.insights-tab-actions {
margin-left: auto;
padding: 0 1rem;
padding-left: 1rem;
display: flex;
flex-wrap: nowrap;

Expand Down
32 changes: 32 additions & 0 deletions frontend/src/scenes/saved-insights/SavedInsights.scss
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,19 @@
border: 1px solid $border;
border-radius: 4px;
padding: 8px;

.icon-column {
width: 32px;
padding-right: 0;
svg {
display: block;
}
}
.options-column {
width: 24px;
padding-left: 0;
padding-right: 10px;
}
}

.ant-tabs-nav-wrap {
Expand Down Expand Up @@ -180,3 +193,22 @@
line-height: 21px;
}
}

.insight-type-icon-dropdown {
vertical-align: middle;
}
.insight-type-icon-wrapper {
display: flex;
align-items: center;
.icon-container {
height: 22px;
width: 22px;
margin-right: 8px;
position: relative;
.icon-container-inner {
position: absolute;
top: -6px;
left: -5px;
}
}
}