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

chore: Post 3000 LemonButtton cleanup #19540

Merged
merged 17 commits into from
Jan 2, 2024
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified frontend/__snapshots__/lemon-ui-lemon-button--active--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified frontend/__snapshots__/lemon-ui-lemon-button--sizes--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified frontend/__snapshots__/lemon-ui-lemon-button--sizes--light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ export function MinimalNavigation(): JSX.Element {
>
<LemonButton
type="tertiary"
status="muted"
icon={<Lettermark name={currentTeam?.name} />}
onClick={toggleProjectSwitcher}
>
Expand All @@ -50,7 +49,6 @@ export function MinimalNavigation(): JSX.Element {
>
<LemonButton
type="tertiary"
status="muted"
icon={<ProfilePicture user={user} size="md" />}
onClick={toggleSitePopover}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export const NavbarButton: FunctionComponent<NavbarButtonProps> = React.forwardR
className={clsx('NavbarButton', isUsingNewNav && here && 'NavbarButton--here')}
fullWidth
type="secondary"
stealth={true}
status="alt"
{...buttonProps}
>
{content}
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/layout/navigation-3000/sidepanel/SidePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export function SidePanel(): JSX.Element | null {
data-attr={`sidepanel-tab-${tab}`}
active={activeTab === tab}
type="secondary"
stealth={true}
status="alt"
>
{label}
</LemonButton>
Expand All @@ -162,7 +162,7 @@ export function SidePanel(): JSX.Element | null {
{menuOptions ? (
<div className="shrink-0 flex items-center m-2">
<LemonMenu items={menuOptions}>
<LemonButton size="small" status="stealth" icon={<IconEllipsis />} />
<LemonButton size="small" icon={<IconEllipsis />} />
</LemonMenu>
</div>
) : null}
Expand Down
2 changes: 0 additions & 2 deletions frontend/src/layout/navigation/OrganizationSwitcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ export function OtherOrganizationButton({
<LemonButton
onClick={() => updateCurrentOrganization(organization.id)}
icon={<Lettermark index={index} name={organization.name} />}
status="stealth"
title={`Switch to organization ${organization.name}`}
fullWidth
>
Expand Down Expand Up @@ -87,7 +86,6 @@ export function OrganizationSwitcherOverlay(): JSX.Element {
{currentOrganization && (
<LemonButton
icon={<Lettermark name={currentOrganization.name} />}
status="stealth"
title={`Switch to organization ${currentOrganization.name}`}
fullWidth
>
Expand Down
2 changes: 0 additions & 2 deletions frontend/src/layout/navigation/ProjectSwitcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ function CurrentProjectButton({ onClickInside }: { onClickInside?: () => void })
},
}}
title={`Switch to project ${currentTeam.name}`}
status="stealth"
fullWidth
>
<ProjectName team={currentTeam} />
Expand All @@ -105,7 +104,6 @@ function OtherProjectButton({ team, onClickInside }: { team: TeamBasicType; onCl
},
}}
title={`Switch to project ${team.name}`}
status="stealth"
fullWidth
>
<ProjectName team={team} />
Expand Down
3 changes: 0 additions & 3 deletions frontend/src/layout/navigation/SideBar/PageButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ export function PageButton({ title, sideAction, identifier, highlight, ...button
? activeScene === identifier || sceneBreadcrumbKeys.includes(identifier)
: activeScene === Scene.Dashboard && identifier === lastDashboardId)

const buttonStatus = isActive ? 'primary' : 'stealth'
title = title || sceneConfigurations[identifier]?.name || identifier

return (
Expand All @@ -41,7 +40,6 @@ export function PageButton({ title, sideAction, identifier, highlight, ...button
{sideAction ? (
<LemonButton
fullWidth
status={buttonStatus}
active={isActive}
onClick={hideSideBarMobile}
sideAction={{
Expand All @@ -58,7 +56,6 @@ export function PageButton({ title, sideAction, identifier, highlight, ...button
) : (
<LemonButton
fullWidth
status={buttonStatus}
active={isActive}
data-attr={`menu-item-${identifier.toString().toLowerCase()}`}
onClick={hideSideBarMobile}
Expand Down
2 changes: 0 additions & 2 deletions frontend/src/layout/navigation/SideBar/SideBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,6 @@ function AppUrls({ setIsToolbarLaunchShown }: { setIsToolbarLaunchShown: (state:
{authorizedUrls.map((appUrl, index) => (
<LemonButton
className="LaunchToolbarButton"
status="stealth"
fullWidth
key={index}
onClick={() => setIsToolbarLaunchShown(false)}
Expand All @@ -330,7 +329,6 @@ function AppUrls({ setIsToolbarLaunchShown }: { setIsToolbarLaunchShown: (state:
</LemonButton>
))}
<LemonButton
status="stealth"
data-attr="sidebar-launch-toolbar-add-new-url"
fullWidth
to={`${urls.toolbarLaunch()}?addNew=true`}
Expand Down
6 changes: 1 addition & 5 deletions frontend/src/layout/navigation/SideBar/SideBarApps.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,7 @@ export function SideBarApps(): JSX.Element {
hideSideBarMobile()
},
overlay: (
<LemonButton
status="stealth"
onClick={() => openAppSourceEditor(id, pluginId)}
fullWidth
>
<LemonButton onClick={() => openAppSourceEditor(id, pluginId)} fullWidth>
Edit source code
</LemonButton>
),
Expand Down
4 changes: 1 addition & 3 deletions frontend/src/layout/navigation/TopBar/SitePopover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ function AccountInfo(): JSX.Element {
to={urls.settings('user')}
onClick={closeSitePopover}
data-attr="top-menu-item-me"
status="stealth"
fullWidth
tooltip="Account settings"
tooltipPlacement="left"
Expand All @@ -93,7 +92,6 @@ function CurrentOrganization({ organization }: { organization: OrganizationBasic
data-attr="top-menu-item-org-settings"
icon={<Lettermark name={organization.name} />}
sideIcon={<IconSettings />}
status="stealth"
fullWidth
to={urls.settings('organization')}
onClick={closeSitePopover}
Expand Down Expand Up @@ -229,7 +227,7 @@ function SignOutButton(): JSX.Element {
const { logout } = useActions(userLogic)

return (
<LemonButton onClick={logout} icon={<IconLogout />} status="stealth" fullWidth data-attr="top-menu-item-logout">
<LemonButton onClick={logout} icon={<IconLogout />} fullWidth data-attr="top-menu-item-logout">
Sign out
</LemonButton>
)
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/layout/navigation/TopBar/YearInHogButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export function YearInHogButton({ url }: { url: string | null }): JSX.Element |
<div className={'absolute top-0 left-0 w-full h-full YearInHog__mask'} />
<LemonButton
icon={<XmasTree />}
type={'secondary'}
type="secondary"
to={url}
targetBlank={true}
size={'small'}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ export const ActivationTask = ({
fullWidth: true,
type: 'secondary',
icon: completed ? <IconCheckmark /> : skipped ? <IconClose /> : null,
status: completed ? 'primary-alt' : skipped ? 'muted' : undefined,
tooltip: name,
}
if (url) {
Expand All @@ -58,7 +57,6 @@ export const ActivationTask = ({
icon: <IconClose />,
tooltip: 'Skip task',
onClick: () => skipTask(id),
status: 'muted',
}}
>
{content}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const DashboardRelationRow = ({
<span className="grow" />
<LemonButton
type="secondary"
status={isAlreadyOnDashboard ? 'danger' : 'primary'}
status={isAlreadyOnDashboard ? 'danger' : 'default'}
loading={dashboardWithActiveAPICall === dashboard.id}
disabledReason={
!canEditInsight
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,14 +243,12 @@ function AnnotationCard({ annotation }: { annotation: AnnotationType }): JSX.Ele
<LemonButton
size="small"
icon={<IconEdit />}
status="muted"
tooltip="Edit this annotation"
onClick={() => openModalToEditAnnotation(annotation, insightId)}
/>
<LemonButton
size="small"
icon={<IconDelete />}
status="muted"
tooltip="Delete this annotation"
onClick={() => deleteAnnotation(annotation)}
/>
Expand Down
2 changes: 0 additions & 2 deletions frontend/src/lib/components/Cards/CardMeta.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ export function CardMeta({
<LemonButton
icon={!areDetailsShown ? <IconSubtitles /> : <IconSubtitlesOff />}
onClick={() => setAreDetailsShown((state) => !state)}
type="tertiary"
status="muted"
size="small"
>
{showDetailsButtonLabel && `${!areDetailsShown ? 'Show' : 'Hide'} details`}
Expand Down
12 changes: 3 additions & 9 deletions frontend/src/lib/components/Cards/InsightCard/InsightMeta.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,11 @@
<>
{allInteractionsAllowed && (
<>
<LemonButton status="stealth" to={urls.insightView(short_id)} fullWidth>
<LemonButton to={urls.insightView(short_id)} fullWidth>
View
</LemonButton>
{refresh && (
<LemonButton
status="stealth"
onClick={() => {
refresh()
reportDashboardItemRefreshed(insight)
Expand All @@ -135,14 +134,12 @@
</>
)}
{editable && updateColor && (
<LemonButtonWithDropdown

Check warning on line 137 in frontend/src/lib/components/Cards/InsightCard/InsightMeta.tsx

View workflow job for this annotation

GitHub Actions / Code quality checks

<LemonButtonWithDropdown> is forbidden, use <LemonMenu> with a <LemonButton> child instead
status="stealth"
dropdown={{
overlay: Object.values(InsightColor).map((availableColor) => (
<LemonButton
key={availableColor}
active={availableColor === (ribbonColor || InsightColor.White)}
status="stealth"
onClick={() => updateColor(availableColor)}
icon={
availableColor !== InsightColor.White ? (
Expand All @@ -167,13 +164,11 @@
</LemonButtonWithDropdown>
)}
{editable && moveToDashboard && otherDashboards.length > 0 && (
<LemonButtonWithDropdown

Check warning on line 167 in frontend/src/lib/components/Cards/InsightCard/InsightMeta.tsx

View workflow job for this annotation

GitHub Actions / Code quality checks

<LemonButtonWithDropdown> is forbidden, use <LemonMenu> with a <LemonButton> child instead
status="stealth"
dropdown={{
overlay: otherDashboards.map((otherDashboard) => (
<LemonButton
key={otherDashboard.id}
status="stealth"
onClick={() => {
moveToDashboard(otherDashboard)
}}
Expand All @@ -194,17 +189,16 @@
)}
<LemonDivider />
{editable && allInteractionsAllowed && (
<LemonButton status="stealth" to={urls.insightEdit(short_id)} fullWidth>
<LemonButton to={urls.insightEdit(short_id)} fullWidth>
Edit
</LemonButton>
)}
{editable && (
<LemonButton status="stealth" onClick={rename} fullWidth>
<LemonButton onClick={rename} fullWidth>
Rename
</LemonButton>
)}
<LemonButton
status="stealth"
onClick={duplicate}
fullWidth
data-attr={
Expand Down
10 changes: 1 addition & 9 deletions frontend/src/lib/components/Cards/TextCard/TextCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@
overlay={
<>
<LemonButton
status="stealth"
fullWidth
onClick={() =>
dashboardId && push(urls.dashboardTextTile(dashboardId, textTile.id))
Expand All @@ -90,13 +89,11 @@
</LemonButton>

{moveToDashboard && otherDashboards.length > 0 && (
<LemonButtonWithDropdown

Check warning on line 92 in frontend/src/lib/components/Cards/TextCard/TextCard.tsx

View workflow job for this annotation

GitHub Actions / Code quality checks

<LemonButtonWithDropdown> is forbidden, use <LemonMenu> with a <LemonButton> child instead
status="stealth"
dropdown={{
overlay: otherDashboards.map((otherDashboard) => (
<LemonButton
key={otherDashboard.id}
status="stealth"
onClick={() => {
moveToDashboard(otherDashboard)
}}
Expand All @@ -115,12 +112,7 @@
Move to
</LemonButtonWithDropdown>
)}
<LemonButton
status="stealth"
onClick={duplicate}
fullWidth
data-attr={'duplicate-text-from-dashboard'}
>
<LemonButton onClick={duplicate} fullWidth data-attr={'duplicate-text-from-dashboard'}>
Duplicate
</LemonButton>
{moreButtons && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export function CompactList_({ loading }: { loading: boolean }): JSX.Element {
{ properties: { name: 'Person 8' } },
]}
renderRow={(person, index) => (
<LemonButton key={index} fullWidth onClick={() => {}}>
<LemonButton key={index} fullWidth>
<PersonDisplay withIcon person={person} />
</LemonButton>
)}
Expand All @@ -58,7 +58,7 @@ export function CompactList_({ loading }: { loading: boolean }): JSX.Element {
}}
items={[]}
renderRow={(person, index) => (
<LemonButton key={index} fullWidth onClick={() => {}}>
<LemonButton key={index} fullWidth>
<PersonDisplay withIcon person={person} />
</LemonButton>
)}
Expand Down
8 changes: 3 additions & 5 deletions frontend/src/lib/components/DateFilter/DateFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@
key={key}
onClick={() => setDate(values[0] || null, values[1] || null)}
active={isActive}
status="stealth"
fullWidth
>
{key === CUSTOM_OPTION_KEY ? CUSTOM_OPTION_VALUE : key}
Expand All @@ -143,25 +142,24 @@
/>
)}
<LemonDivider />
<LemonButton onClick={openDateToNow} active={isDateToNow} status="stealth" fullWidth>
<LemonButton onClick={openDateToNow} active={isDateToNow} fullWidth>
From custom date until now…
</LemonButton>
<LemonButton onClick={openFixedRange} active={isFixedRange} status="stealth" fullWidth>
<LemonButton onClick={openFixedRange} active={isFixedRange} fullWidth>
Custom fixed date range…
</LemonButton>
</div>
)

return (
<LemonButtonWithDropdown

Check warning on line 155 in frontend/src/lib/components/DateFilter/DateFilter.tsx

View workflow job for this annotation

GitHub Actions / Code quality checks

<LemonButtonWithDropdown> is forbidden, use <LemonMenu> with a <LemonButton> child instead
data-attr="date-filter"
id="daterange_selector"
onClick={isVisible ? close : open}
disabled={disabled}
className={className}
size={size ?? 'small'}
type={'secondary'}
status="stealth"
type="secondary"
dropdown={{
onClickOutside: close,
visible: isVisible,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import './RollingDateRangeFilter.scss'

import { LemonButton, LemonInput, LemonSelect, LemonSelectOptions } from '@posthog/lemon-ui'
import clsx from 'clsx'
import { useActions, useValues } from 'kea'
import { dayjs } from 'lib/dayjs'
import { Tooltip } from 'lib/lemon-ui/Tooltip'
Expand Down Expand Up @@ -42,10 +41,9 @@ export function RollingDateRangeFilter({
return (
<Tooltip title={makeLabel ? makeLabel(formattedDate) : undefined}>
<LemonButton
className={clsx('RollingDateRangeFilter')}
className="RollingDateRangeFilter"
data-attr="rolling-date-range-filter"
onClick={select}
status="stealth"
active={selected}
>
<p className="RollingDateRangeFilter__label">In the last</p>
Expand Down
8 changes: 1 addition & 7 deletions frontend/src/lib/components/DebugNotice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,7 @@ export function DebugNotice(): JSX.Element | null {
<div className="bg-bg-light cursor-pointer border-t" onClick={() => setNoticeHidden(true)}>
<div className="p-2 border-l-4 border-primary text-primary-3000 truncate flex justify-between">
<b>DEBUG mode</b>
<LemonButton
status="primary-alt"
icon={<IconClose />}
size="small"
noPadding
onClick={() => setNoticeHidden(true)}
/>
<LemonButton icon={<IconClose />} size="small" noPadding onClick={() => setNoticeHidden(true)} />
</div>
<div className="p-2 border-l-4 border-danger text-danger-dark truncate">
Branch: <b>{debugInfo.branch}</b>
Expand Down
Loading
Loading