Skip to content

feat(favorites): add dashboard favorites - #214

Open
kevjablonski wants to merge 3 commits into
mainfrom
feat/dashboard-favorites-213
Open

feat(favorites): add dashboard favorites#214
kevjablonski wants to merge 3 commits into
mainfrom
feat/dashboard-favorites-213

Conversation

@kevjablonski

@kevjablonski kevjablonski commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

Introduces support for user favorites by adding favorite relationships for Companies and Boundaries directly to Users. Adds APIs to manage favorites, displays favorites on the dashboard for quick access, and allows users to favorite and unfavorite items throughout the application.

Changes

Added

  • Favorite relationships between Users and Companies/Boundaries.
  • APIs to:
    • Retrieve user favorites.
    • Add/remove favorite Companies.
    • Add/remove favorite Boundaries.
  • Dashboard Favorites section displaying favorited Companies and Boundaries.
  • Favorite toggle UI on Company and Boundary pages.
  • Database migration to create favorite relationship tables.

Changed

  • Associates favorites directly with Users instead of UserConfig.
  • Refactored favorite management logic into a shared utility to reduce duplicate API code.
  • Updated frontend and backend to use the new favorite relationships.

Testing

  • Verified Companies and Boundaries can be favorited and unfavorited.
  • Verified favorite state persists after page refresh.
  • Verified dashboard displays favorited Companies and Boundaries.
  • Verified navigation from dashboard favorites opens the correct Company or Boundary.

Related

Closes #213

Introduces UserConfig and favorite relationships for Companies and
Boundaries. Adds APIs to manage favorites, dashboard favorites
display, favorite indicators and toggles on Company/Boundary pages,
and navigation to favorited items. Includes migrations and seed
updates to initialize user configuration for existing and new users.

Signed-off-by: Kevin Jablonski <kevjablonski@gmail.com>
@kevjablonski kevjablonski linked an issue Jul 16, 2026 that may be closed by this pull request
@Amndeep7
Amndeep7 temporarily deployed to tir-feat-dashboard-favo-56kksp July 16, 2026 15:52 Inactive
Extracts shared favorite management into a reusable utility to reduce
duplicate API code.
@Amndeep7
Amndeep7 temporarily deployed to tir-feat-dashboard-favo-56kksp July 17, 2026 15:24 Inactive
Removes the UserConfig dependency and associates favorites directly with
Users. Updates migrations, models, APIs, and frontend to simplify
favorite management while preserving existing functionality.

Signed-off-by: Kevin Jablonski <kevjablonski@gmail.com>
@sonarqubecloud

Copy link
Copy Markdown

})),
];
} else if (error.value) {
console.error("Failed to load user config:", error.value);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update to logger

const aliasStore = useAliasStore();
const { data: config, error } = await useFetch("/api/favorites/list");
const boundaryTerm = aliasStore.BoundaryAlias;
const companyTerm = aliasStore.CompanyAlias;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getting lint errors that this isn't used.

import { useAliasStore } from "~/stores/AliasStorage";
const aliasStore = useAliasStore();
const { data: config, error } = await useFetch("/api/favorites/list");
const boundaryTerm = aliasStore.BoundaryAlias;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getting lint errors that this isn't used.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Multiword error flagging. FavoriteTable, FavoritesView maybe?

await navigateTo({
path: "/company-boundary/" + favorite.id,
});
} catch (error) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Errors not showing in UI

const user = await User.findByPk(body.id, { attributes: { exclude: ["password", "salt"] } });

if (!user) {
if (!user ) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove added space from diff


if (body.ThemeId && user.ThemeId !== body.ThemeId) {
user.ThemeId = body.ThemeId;
if (body.ThemeId && user.ThemeId !== body.ThemeId) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove added space from diff

if (body.ThemeId && user.ThemeId !== body.ThemeId) {
user.ThemeId = body.ThemeId;
if (body.ThemeId && user.ThemeId !== body.ThemeId) {
user.ThemeId = body.ThemeId;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove added space from diff

@@ -1,4 +1,4 @@
import { UserRole } from "../../../db/models";
import { UserRole} from "../../../db/models";

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace the missing space to clean up diff

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no check to see if the user is a member and allowed to favorite. You can add a favorite to a boundary you don't belong to and then get the header information from a list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Favorites Column to Dashboard

3 participants