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

915 ein store für benachrichtigungen an den user ist vorhanden #1057

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from

Conversation

DanielOber
Copy link
Contributor

@DanielOber DanielOber commented Mar 15, 2025

Beschreibung:

  • userNotificationStore hinzugefügt
  • Types für UserNotification und UserNotificationCategory erstellt
  • tests für userNotificationStore
  • added UUID depdency for notification IDs.

Definition of Done (DoD):

Frontend

Referenzen1:

Verwandt mit Issue #

Closes #915

Summary by CodeRabbit

  • New Features

    • Introduced a notification system that enables managing user messages with options to display and dismiss alerts.
    • Added clear definitions to categorize notifications (e.g., success, warning, error).
    • Implemented a new store for handling user notifications, allowing for easy addition and removal of notifications.
  • Tests

    • Implemented tests to verify the notification system handles adding and removing messages correctly.

Footnotes

  1. Nicht zutreffende Referenzen vor dem Speichern entfernen

@DanielOber DanielOber linked an issue Mar 15, 2025 that may be closed by this pull request
5 tasks
Copy link
Contributor

coderabbitai bot commented Mar 15, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

The changes introduce a new module for managing user notifications within the application. A store has been created using Pinia that maintains an array of notification objects. Two actions are defined: one for adding notifications, which generates a unique identifier and constructs a notification with a message and category, and one for removing notifications based on their identifier. Additionally, a TypeScript interface has been added to define the structure of a notification object, including properties such as id, message, and category. An enumeration has been introduced to represent distinct notification types, with defined string constants. A new test suite utilizing Vitest confirms that the notification store correctly handles the addition and removal of notifications. Furthermore, a new dependency for the UUID library has been added to facilitate the generation of unique identifiers.


Note

🎁 Summarized by CodeRabbit Free

Your organization has reached its limit of developer seats under the Pro Plan. For new users, CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please add seats to your subscription by visiting https://app.coderabbit.ai/login.If you believe this is a mistake and have available seats, please assign one to the pull request author through the subscription management page using the link above.

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary or `` to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or `` anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added the wls-gui-wahllokalsystem frontend related issues for Wahllokalsystem label Mar 15, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3ea37c4 and b277e9a.

📒 Files selected for processing (4)
  • wls-gui-wahllokalsystem/src/stores/useUserNotificationStore.ts (1 hunks)
  • wls-gui-wahllokalsystem/src/types/wlsTypes/UserNotification.ts (1 hunks)
  • wls-gui-wahllokalsystem/src/types/wlsTypes/UserNotificationTypeEnum.ts (1 hunks)
  • wls-gui-wahllokalsystem/tests/stores/userNotificationStore.spec.ts (1 hunks)
🔇 Additional comments (6)
wls-gui-wahllokalsystem/src/types/wlsTypes/UserNotificationTypeEnum.ts (1)

1-6: Well-structured enum for notification types

This enum is clearly defined with appropriate values for success, warning, and error notification types. The German names align with the project's language conventions as seen in the PR title.

wls-gui-wahllokalsystem/src/types/wlsTypes/UserNotification.ts (1)

1-7: Clean interface definition for user notifications

The UserNotification interface is well-structured with appropriate properties for id, message, and category. This provides a clear type definition for notification objects used throughout the application.

wls-gui-wahllokalsystem/src/stores/useUserNotificationStore.ts (1)

8-30: Well-implemented Pinia store for notifications

The store implementation follows Pinia best practices with a clear state definition and well-structured actions for adding and removing notifications. The strong typing with the UserNotification interface ensures type safety.

wls-gui-wahllokalsystem/tests/stores/userNotificationStore.spec.ts (3)

7-14: Good test setup with proper Pinia initialization

The test setup correctly initializes Pinia before each test and creates a fresh instance of the store, ensuring test isolation.


15-32: Thorough test for addNotification action

This test validates that the addNotification action works correctly by:

  1. Checking the initial empty state
  2. Adding a notification
  3. Verifying the notification was added with correct properties

The test uses appropriate assertions and matchers.


34-60: Comprehensive test for removeNotification action

This test thoroughly validates the removeNotification functionality by:

  1. Adding multiple notifications
  2. Removing one by ID
  3. Verifying both the array length and that the specific notification was removed

It's a well-structured test with clear assertions.

@DanielOber DanielOber self-assigned this Mar 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wls-gui-wahllokalsystem frontend related issues for Wahllokalsystem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ein Store für Benachrichtigungen an den User ist vorhanden
1 participant