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

Yeti Object Starring System #1007

Open
udgover opened this issue Feb 5, 2024 · 3 comments
Open

Yeti Object Starring System #1007

udgover opened this issue Feb 5, 2024 · 3 comments

Comments

@udgover
Copy link
Collaborator

udgover commented Feb 5, 2024

I would like to be able to start some objects in Yeti, from observable to campaign in order to easily retrieve them. This would imply both backend and frontend implementation and we need to ideate the potential UI / UX.

@tomchop
Copy link
Collaborator

tomchop commented Feb 5, 2024

This is a big change, but I can see how it could be useful. I'm assuming the idea behind this is to be able to have a dashboard of "more interesting" objects... but going down that path, I can also imagine that if we want to create a single dashboard of starred items, we might also want to be able to have different dashboards with different combinations? So why not use tags for this?

The difference with stars is that they exist per-user, whereas tags are universal. Implementing a per-user tagging system sounds a bit like overkill. Maybe a combination of both? WDYT?

@udgover
Copy link
Collaborator Author

udgover commented Oct 28, 2024

Going back to this discussion after a while :)

To handle this feature per-user we need to:

  • Add new api endpoints:

    • GET api/v2/favorites : returns a list of ids (observable/, entities/)
    • POST api/v2/favorites: add favorite(s) from a provided list of ids (observable/, entities/)
    • DELETE api/v2/favorites: remove favorite(s) based on list of ids (observable/, entities/)
    • POST api/v2/favorites/search: search favorites based on object types (url, campaign, ...)
  • Add new favorite schema:

class Favorite(YetiModel, database_arango.ArangoYetiConnector):
    _collection_name: ClassVar[str] = "favorites"
    _type_filter: ClassVar[str | None] = None
    _root_type: Literal["favorite"] = "favorite"

    user: User
    created: datetime.datetime = Field(default_factory=now)
    annotation: str = ""

Then in database, we need a new fav_graph graph to link with other collections:

            self.graph("fav_graph"),
            {
                "edge_collection": "favorites_links",
                "from_vertex_collections": ["observables", "entities", "indicators"],
                "to_vertex_collections": ["favorites"],
            },

Then in UI, there are several ways to manage favorites:

  • In list views, add a star column (sortable?) to fav / unfav.
  • In details views, add a clickable star
  • Add a new dedicated favorites view to display starred objects.

@tomchop
Copy link
Collaborator

tomchop commented Oct 28, 2024

Do we really need a new schema for this? What if we just used a link from the User model to any of those entities, and encode the annotation / timestamp in the Link?

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

No branches or pull requests

2 participants