diff --git a/static/app/views/dashboards/manage/dashboardGrid.tsx b/static/app/views/dashboards/manage/dashboardGrid.tsx index d937a0bf1fc988..d4a135554a8844 100644 --- a/static/app/views/dashboards/manage/dashboardGrid.tsx +++ b/static/app/views/dashboards/manage/dashboardGrid.tsx @@ -105,6 +105,7 @@ function DashboardGrid({ async function handleFavorite(dashboard: DashboardListItem, isFavorited: boolean) { try { await updateDashboardFavorite(api, organization.slug, dashboard.id, isFavorited); + onDashboardsChange(); } catch (error) { throw error; } diff --git a/static/app/views/dashboards/manage/dashboardTable.tsx b/static/app/views/dashboards/manage/dashboardTable.tsx index 436f91984d5b39..a88dd3242cdf94 100644 --- a/static/app/views/dashboards/manage/dashboardTable.tsx +++ b/static/app/views/dashboards/manage/dashboardTable.tsx @@ -60,6 +60,7 @@ type FavoriteButtonProps = { api: Client; dashboardId: string; isFavorited: boolean; + onDashboardsChange: () => void; organization: Organization; }; @@ -68,6 +69,7 @@ function FavoriteButton({ api, organization, dashboardId, + onDashboardsChange, }: FavoriteButtonProps) { const [favorited, setFavorited] = useState(isFavorited); return ( @@ -93,6 +95,7 @@ function FavoriteButton({ dashboardId, !favorited ); + onDashboardsChange(); } catch (error) { // If the api call fails, revert the state setFavorited(favorited); @@ -177,6 +180,8 @@ function DashboardTable({ api={api} organization={organization} dashboardId={dataRow.id} + onDashboardsChange={onDashboardsChange} + key={dataRow.id} /> ); } diff --git a/static/app/views/dashboards/manage/index.tsx b/static/app/views/dashboards/manage/index.tsx index f34d53614be4a6..3da5da508983a7 100644 --- a/static/app/views/dashboards/manage/index.tsx +++ b/static/app/views/dashboards/manage/index.tsx @@ -120,6 +120,9 @@ function ManageDashboards() { query: { ...pick(location.query, ['cursor', 'query']), sort: getActiveSort().value, + ...(organization.features.includes('dashboards-favourite') + ? {pin: 'favorites'} + : {}), per_page: dashboardsLayout === GRID ? rowCount * columnCount : DASHBOARD_TABLE_NUM_ROWS, },