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

fix(buttons): correct icon slots #759

Merged
merged 2 commits into from
Aug 17, 2024

Conversation

antoinezanardi
Copy link
Owner

@antoinezanardi antoinezanardi commented Aug 17, 2024

Summary by CodeRabbit

  • New Features

    • Enhanced button flexibility with new slot structure for icons and labels across multiple components.
    • Improved localization support by binding button labels directly to props.
  • Bug Fixes

    • Adjusted button icon rendering to ensure consistent visual feedback and usability.
  • Tests

    • Updated test cases to validate button properties rather than static text to improve robustness and maintainability.

@antoinezanardi antoinezanardi added the 🐛 bug Something isn't working label Aug 17, 2024
@antoinezanardi antoinezanardi self-assigned this Aug 17, 2024
Copy link

coderabbitai bot commented Aug 17, 2024

Important

Review skipped

Review was skipped due to path filters

Files ignored due to path filters (49)
  • tests/acceptance/screenshots/linux/About Page.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Accursed Wolf-Father infects Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Actor chooses card Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Big Bad Wolf eats Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Charmed people meet each other Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Cupid charms Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Defender protects Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Fox sniffs Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Game Lobby Additional Cards Manager with 5 cards.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Game Lobby Additional Cards Manager without cards.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Game Lobby Options Hub on Composition tab.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Game Lobby Options Hub on Roles tab.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Game Lobby Options Hub on Votes tab.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Game Lobby Page with 40 players.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Game Lobby Page without players.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Game Lobby Role Picker with picked role.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Game Lobby Role Picker without picked role.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Game Phase Event.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Game Playground without targets.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Game Starts Event.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Game canceled.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Game not found.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Game won by Angel.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Game won by Lovers and Cupid.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Game won by Lovers.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Game won by Pied Piper.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Game won by Villagers.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Game won by Werewolves.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Game won by White Werewolf.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Game won by nobody.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Hunter shoots Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Lovers meet each other Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Pied Piper charms Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Scandalmonger marks Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Seer looks Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Sheriff delegates Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Sheriff settles votes Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Stuttering Judge Requests Another Vote Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Survivors elect Sheriff Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Thief chooses card Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Three Brothers meet each other Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Two Sisters meet each other Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Werewolves eat Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/White Werewolf eats Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Wild Child chooses model Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Witch out of potions Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Witch uses death potion Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Witch uses life potion Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Wolf-Hound chooses side Playground.png is excluded by !**/*.png

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

Walkthrough

The recent changes involve a restructuring of button components across various Vue files to enhance their flexibility and maintainability. By using Vue's slot mechanism for icon rendering and directly binding button labels as props, the updated components promote better practices and facilitate future customizations. These modifications retain the original functionality while improving the overall clarity and organization of the code.

Changes

Files Change Summary
.../ParametersMenu.vue, .../RecipientRoleAdditionalCardsMultiSelect.vue, .../GameLobbyRandomCompositionButton.vue, .../GameLobbyStartGameButton.vue Restructured buttons to use <template #icon> slots for icons instead of direct embedding, improving flexibility and extensibility without altering functionality.
.../GameLobbyStartGameConfirmDialogFooter.vue, .../GameLobbyHeaderOptionsButton.vue, .../GameLobbyHeaderPositionCoordinatorButton.vue, .../GameLobbyPlayerInput.vue, .../GameLobbyPlayerCard.vue Updated buttons to bind labels directly as props to PrimeVueButton, enhancing maintainability and localization support while using slot for icons for clearer separation of concerns.
.../GameOverActions.vue, .../GameOverCreateNewGameButton.vue, .../GamePlaygroundFooterMakePlayButton.vue Modified button templates to use props for labels and slots for icons, refining structure and ensuring consistent functionality with improved clarity.
.../GameLobbyStartGameConfirmDialogFooter.nuxt.spec.ts, .../GameOverCreateNewGameButton.nuxt.spec.ts Tests revised to validate button properties by checking the label prop instead of rendered text, promoting a more component-centric testing approach.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant ParentComponent
    participant ButtonComponent
    participant IconComponent

    User->>ParentComponent: Clicks Button
    ParentComponent->>ButtonComponent: Handles Click Event
    ButtonComponent->>IconComponent: Renders Icon in Slot
    ButtonComponent-->>User: Displays Button with Icon and Label
Loading

🐰 In a patch so grand, with buttons anew,
Icons in slots, how clever, it’s true!
Labels now bound, so clear and so bright,
Clicks and joy, oh what a delight!
Hopping through code with a cheerful little dance,
A rabbit’s wish—give these changes a chance! 🐇✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 as 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.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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.

Copy link

@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: 0

Outside diff range, codebase verification and nitpick comments (1)
app/components/pages/game-lobby/GameLobbyHeader/GameLobbyHeaderSetupButtons/GameLobbyHeaderPositionCoordinatorButton/GameLobbyHeaderPositionCoordinatorButton.vue (1)

4-4: Translation Key Missing in Localization Files

The translation key 'components.GameLobbyHeaderPositionCoordinatorButton.positionCoordinator' is not defined in the localization files. Please ensure that it is added to the appropriate localization files to support proper localization functionality.

  • Verify that the key is added to the relevant JSON or YAML files within your localization directories (locales, i18n, etc.).
Analysis chain

LGTM! Verify the label prop usage.

The direct binding of the label using $t enhances localization support. Ensure that the translation key 'components.GameLobbyHeaderPositionCoordinatorButton.positionCoordinator' is correctly defined in your localization files.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the existence of the translation key for the label prop.

# Test: Search for the translation key in localization files. Expect: The key should be defined.
rg --type json --type yaml 'components.GameLobbyHeaderPositionCoordinatorButton.positionCoordinator'

Length of output: 1225


Script:

#!/bin/bash
# Description: Search for the translation key in known localization directories.

# Test: Search for the translation key in common localization directories.
rg --type json --type yaml 'components.GameLobbyHeaderPositionCoordinatorButton.positionCoordinator' --glob '**/locales/**' --glob '**/i18n/**'

Length of output: 143

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between df3bf86 and e76d464.

Files ignored due to path filters (113)
  • tests/acceptance/screenshots/darwin/About Page.png is excluded by !**/*.png
  • tests/acceptance/screenshots/darwin/Accursed Wolf-Father infects Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/darwin/Actor chooses card Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/darwin/Big Bad Wolf eats Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/darwin/Charmed people meet each other Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/darwin/Cupid charms Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/darwin/Defender protects Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/darwin/Fox sniffs Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/darwin/Game Lobby Additional Cards Manager with 5 cards.png is excluded by !**/*.png
  • tests/acceptance/screenshots/darwin/Game Lobby Additional Cards Manager without cards.png is excluded by !**/*.png
  • tests/acceptance/screenshots/darwin/Game Lobby Options Hub on Composition tab.png is excluded by !**/*.png
  • tests/acceptance/screenshots/darwin/Game Lobby Options Hub on Roles tab.png is excluded by !**/*.png
  • tests/acceptance/screenshots/darwin/Game Lobby Options Hub on Votes tab.png is excluded by !**/*.png
  • tests/acceptance/screenshots/darwin/Game Lobby Page with 40 players.png is excluded by !**/*.png
  • tests/acceptance/screenshots/darwin/Game Lobby Page without players.png is excluded by !**/*.png
  • tests/acceptance/screenshots/darwin/Game Lobby Role Picker with picked role.png is excluded by !**/*.png
  • tests/acceptance/screenshots/darwin/Game Lobby Role Picker without picked role.png is excluded by !**/*.png
  • tests/acceptance/screenshots/darwin/Game Phase Event.png is excluded by !**/*.png
  • tests/acceptance/screenshots/darwin/Game Playground without targets.png is excluded by !**/*.png
  • tests/acceptance/screenshots/darwin/Game Starts Event.png is excluded by !**/*.png
  • tests/acceptance/screenshots/darwin/Game canceled.png is excluded by !**/*.png
  • tests/acceptance/screenshots/darwin/Game not found.png is excluded by !**/*.png
  • tests/acceptance/screenshots/darwin/Game won by Angel.png is excluded by !**/*.png
  • tests/acceptance/screenshots/darwin/Game won by Lovers and Cupid.png is excluded by !**/*.png
  • tests/acceptance/screenshots/darwin/Game won by Lovers.png is excluded by !**/*.png
  • tests/acceptance/screenshots/darwin/Game won by Pied Piper.png is excluded by !**/*.png
  • tests/acceptance/screenshots/darwin/Game won by Villagers.png is excluded by !**/*.png
  • tests/acceptance/screenshots/darwin/Game won by Werewolves.png is excluded by !**/*.png
  • tests/acceptance/screenshots/darwin/Game won by White Werewolf.png is excluded by !**/*.png
  • tests/acceptance/screenshots/darwin/Game won by nobody.png is excluded by !**/*.png
  • tests/acceptance/screenshots/darwin/Hunter shoots Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/darwin/Lovers meet each other Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/darwin/Pied Piper charms Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/darwin/Scandalmonger marks Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/darwin/Seer looks Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/darwin/Sheriff delegates Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/darwin/Sheriff settles votes Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/darwin/Stuttering Judge Requests Another Vote Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/darwin/Survivors elect Sheriff Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/darwin/Thief chooses card Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/darwin/Three Brothers meet each other Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/darwin/Two Sisters meet each other Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/darwin/Werewolves eat Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/darwin/White Werewolf eats Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/darwin/Wild Child chooses model Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/darwin/Witch out of potions Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/darwin/Witch uses death potion Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/darwin/Witch uses life potion Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/darwin/Wolf-Hound chooses side Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/About Page.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Accursed Wolf-Father infects Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Actor chooses card Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Big Bad Wolf eats Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Charmed people meet each other Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Cupid charms Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Defender protects Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Fox sniffs Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Game Lobby Additional Cards Manager with 5 cards.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Game Lobby Additional Cards Manager without cards.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Game Lobby Options Hub on Composition tab.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Game Lobby Options Hub on Roles tab.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Game Lobby Options Hub on Votes tab.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Game Lobby Page with 40 players.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Game Lobby Page without players.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Game Lobby Role Picker with picked role.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Game Lobby Role Picker without picked role.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Game Phase Event.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Game Playground without targets.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Game Starts Event.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Game canceled.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Game not found.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Game won by Angel.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Game won by Lovers and Cupid.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Game won by Lovers.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Game won by Pied Piper.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Game won by Villagers.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Game won by Werewolves.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Game won by White Werewolf.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Game won by nobody.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Home Page.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Hunter shoots Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Lovers meet each other Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Page not found.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Pied Piper charms Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Scandalmonger marks Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Seer looks Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Sheriff delegates Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Sheriff settles votes Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Stuttering Judge Requests Another Vote Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Survivors elect Sheriff Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Thief chooses card Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Three Brothers meet each other Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Two Sisters meet each other Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Werewolves eat Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/White Werewolf eats Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Wild Child chooses model Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Witch out of potions Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Witch uses death potion Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Witch uses life potion Playground.png is excluded by !**/*.png
  • tests/acceptance/screenshots/linux/Wolf-Hound chooses side Playground.png is excluded by !**/*.png
  • tests/unit/specs/__snapshots__/app.nuxt.spec.ts.snap is excluded by !**/*.snap
  • tests/unit/specs/components/pages/game-lobby/GameLobbyAdditionalCardsManager/GameLobbyAdditionalCardsManagerContent/RecipientRoleAdditionalCardsManager/RecipientRoleAdditionalCardsMultiSelect/__snapshots__/RecipientRoleAdditionalCardsMultiSelect.nuxt.spec.ts.snap is excluded by !**/*.snap
  • tests/unit/specs/components/pages/game-lobby/GameLobbyFooter/GameLobbyRandomCompositionButton/__snapshots__/GameLobbyRandomCompositionButton.nuxt.spec.ts.snap is excluded by !**/*.snap
  • tests/unit/specs/components/pages/game-lobby/GameLobbyFooter/GameLobbyStartGameButton/GameLobbyStartGameConfirmDialog/GameLobbyStartGameConfirmDialogContainer/GameLobbyStartGameConfirmDialogFooter/__snapshots__/GameLobbyStartGameConfirmDialogFooter.nuxt.spec.ts.snap is excluded by !**/*.snap
  • tests/unit/specs/components/pages/game-lobby/GameLobbyFooter/GameLobbyStartGameButton/__snapshots__/GameLobbyStartGameButton.nuxt.spec.ts.snap is excluded by !**/*.snap
  • tests/unit/specs/components/pages/game-lobby/GameLobbyHeader/GameLobbyHeaderSetupButtons/GameLobbyHeaderAdditionalCardsManagerButton/__snapshots__/GameLobbyHeaderAdditionalCardsManagerButton.nuxt.spec.ts.snap is excluded by !**/*.snap
  • tests/unit/specs/components/pages/game-lobby/GameLobbyHeader/GameLobbyHeaderSetupButtons/GameLobbyHeaderOptionsButton/__snapshots__/GameLobbyHeaderOptionsButton.nuxt.spec.ts.snap is excluded by !**/*.snap
  • tests/unit/specs/components/pages/game-lobby/GameLobbyHeader/GameLobbyHeaderSetupButtons/GameLobbyHeaderPositionCoordinatorButton/__snapshots__/GameLobbyHeaderPositionCoordinatorButton.nuxt.spec.ts.snap is excluded by !**/*.snap
  • tests/unit/specs/components/pages/game-lobby/GameLobbyHeader/GameLobbyPlayerInput/__snapshots__/GameLobbyPlayerInput.nuxt.spec.ts.snap is excluded by !**/*.snap
  • tests/unit/specs/components/pages/game-lobby/GameLobbyPlayersParty/GameLobbyPlayerCard/__snapshots__/GameLobbyPlayerCard.nuxt.spec.ts.snap is excluded by !**/*.snap
  • tests/unit/specs/components/pages/game/GameOver/GameOverActions/GameOverCreateNewGameButton/__snapshots__/GameOverCreateNewGameButton.nuxt.spec.ts.snap is excluded by !**/*.snap
  • tests/unit/specs/components/pages/game/GameOver/GameOverActions/__snapshots__/GameOverActions.nuxt.spec.ts.snap is excluded by !**/*.snap
  • tests/unit/specs/components/pages/game/GamePlaying/GamePlayground/GamePlaygroundFooter/GamePlaygroundFooterMakePlayButton/__snapshots__/GamePlaygroundFooterMakePlayButton.nuxt.spec.ts.snap is excluded by !**/*.snap
Files selected for processing (15)
  • app/components/layouts/default/NavBar/ParametersMenu/ParametersMenu.vue (1 hunks)
  • app/components/pages/game-lobby/GameLobbyAdditionalCardsManager/GameLobbyAdditionalCardsManagerContent/RecipientRoleAdditionalCardsManager/RecipientRoleAdditionalCardsMultiSelect/RecipientRoleAdditionalCardsMultiSelect.vue (1 hunks)
  • app/components/pages/game-lobby/GameLobbyFooter/GameLobbyRandomCompositionButton/GameLobbyRandomCompositionButton.vue (1 hunks)
  • app/components/pages/game-lobby/GameLobbyFooter/GameLobbyStartGameButton/GameLobbyStartGameButton.vue (1 hunks)
  • app/components/pages/game-lobby/GameLobbyFooter/GameLobbyStartGameButton/GameLobbyStartGameConfirmDialog/GameLobbyStartGameConfirmDialogContainer/GameLobbyStartGameConfirmDialogFooter/GameLobbyStartGameConfirmDialogFooter.vue (1 hunks)
  • app/components/pages/game-lobby/GameLobbyHeader/GameLobbyHeaderSetupButtons/GameLobbyHeaderAdditionalCardsManagerButton/GameLobbyHeaderAdditionalCardsManagerButton.vue (1 hunks)
  • app/components/pages/game-lobby/GameLobbyHeader/GameLobbyHeaderSetupButtons/GameLobbyHeaderOptionsButton/GameLobbyHeaderOptionsButton.vue (1 hunks)
  • app/components/pages/game-lobby/GameLobbyHeader/GameLobbyHeaderSetupButtons/GameLobbyHeaderPositionCoordinatorButton/GameLobbyHeaderPositionCoordinatorButton.vue (1 hunks)
  • app/components/pages/game-lobby/GameLobbyHeader/GameLobbyPlayerInput/GameLobbyPlayerInput.vue (1 hunks)
  • app/components/pages/game-lobby/GameLobbyPlayersParty/GameLobbyPlayerCard/GameLobbyPlayerCard.vue (1 hunks)
  • app/components/pages/game/GameOver/GameOverActions/GameOverActions.vue (1 hunks)
  • app/components/pages/game/GameOver/GameOverActions/GameOverCreateNewGameButton/GameOverCreateNewGameButton.vue (1 hunks)
  • app/components/pages/game/GamePlaying/GamePlayground/GamePlaygroundFooter/GamePlaygroundFooterMakePlayButton/GamePlaygroundFooterMakePlayButton.vue (1 hunks)
  • tests/unit/specs/components/pages/game-lobby/GameLobbyFooter/GameLobbyStartGameButton/GameLobbyStartGameConfirmDialog/GameLobbyStartGameConfirmDialogContainer/GameLobbyStartGameConfirmDialogFooter/GameLobbyStartGameConfirmDialogFooter.nuxt.spec.ts (4 hunks)
  • tests/unit/specs/components/pages/game/GameOver/GameOverActions/GameOverCreateNewGameButton/GameOverCreateNewGameButton.nuxt.spec.ts (2 hunks)
Files skipped from review due to trivial changes (3)
  • app/components/layouts/default/NavBar/ParametersMenu/ParametersMenu.vue
  • app/components/pages/game-lobby/GameLobbyHeader/GameLobbyHeaderSetupButtons/GameLobbyHeaderOptionsButton/GameLobbyHeaderOptionsButton.vue
  • app/components/pages/game/GameOver/GameOverActions/GameOverActions.vue
Additional comments not posted (18)
app/components/pages/game-lobby/GameLobbyHeader/GameLobbyHeaderSetupButtons/GameLobbyHeaderPositionCoordinatorButton/GameLobbyHeaderPositionCoordinatorButton.vue (1)

10-15: LGTM! The use of slots for the icon is a good practice.

Encapsulating the icon rendering within a slot improves the component's structure and maintainability.

app/components/pages/game-lobby/GameLobbyHeader/GameLobbyHeaderSetupButtons/GameLobbyHeaderAdditionalCardsManagerButton/GameLobbyHeaderAdditionalCardsManagerButton.vue (1)

21-21: LGTM! Verify the condition logic for the beat property.

The conditional beat property enhances visual feedback when additional cards are not set. Ensure that the logic for areAdditionalCardsSetForAdditionalCardsDependantRoles is correctly implemented and tested.

Verification successful

Verification Successful: Logic for areAdditionalCardsSetForAdditionalCardsDependantRoles is Correct

The condition logic for the beat property, which relies on areAdditionalCardsSetForAdditionalCardsDependantRoles, is correctly implemented. The logic ensures that additional cards are set for roles that require them, such as the actor, if present. The tests in useCreateGameDtoValidation.spec.ts should adequately cover these scenarios.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the logic for `areAdditionalCardsSetForAdditionalCardsDependantRoles`.

# Test: Search for the definition and usage of `areAdditionalCardsSetForAdditionalCardsDependantRoles`. Expect: Correct logic implementation.
rg --type ts 'areAdditionalCardsSetForAdditionalCardsDependantRoles'

Length of output: 1007


Script:

#!/bin/bash
# Extract the implementation details of `areAdditionalCardsSetForAdditionalCardsDependantRoles` and its dependencies.
ast-grep --lang typescript --pattern 'const areAdditionalCardsSetForAdditionalCardsDependantRoles = computed<boolean>(() => $_)' app/composables/api/game/useCreateGameDtoValidation.ts
ast-grep --lang typescript --pattern 'const areAdditionalCardsSetForActorIfPresent = $_' app/composables/api/game/useCreateGameDtoValidation.ts

Length of output: 1503

app/components/pages/game/GameOver/GameOverActions/GameOverCreateNewGameButton/GameOverCreateNewGameButton.vue (2)

33-37: LGTM! The use of slots for icons improves clarity.

Utilizing slots for icons enhances the maintainability and clarity of the component's template.


30-30: LGTM! Verify the label prop usage.

The introduction of the label prop streamlines the button's text rendering. Ensure that the translation key 'components.GameOverActions.createAnotherGame' is correctly defined in your localization files.

app/components/pages/game-lobby/GameLobbyPlayersParty/GameLobbyPlayerCard/GameLobbyPlayerCard.vue (1)

16-21: Good use of slots for icon customization.

The implementation of the named slot #icon for the FontAwesomeIcon within the PrimeVueButton is a good practice. It enhances the flexibility and modularity of the component, allowing for easier customization of the icon without altering the button's core functionality.

app/components/pages/game-lobby/GameLobbyFooter/GameLobbyStartGameButton/GameLobbyStartGameConfirmDialog/GameLobbyStartGameConfirmDialogContainer/GameLobbyStartGameConfirmDialogFooter/GameLobbyStartGameConfirmDialogFooter.vue (4)

8-8: Direct label binding improves maintainability.

Binding the label prop directly to a translation key simplifies text management and enhances localization support. This change improves maintainability by centralizing text definitions.


13-18: Effective use of slots for icon rendering.

The use of the #icon slot for rendering FontAwesomeIcon within the PrimeVueButton streamlines the button's markup and aligns with best practices for Vue component design. This approach enhances the flexibility and readability of the component.


25-25: Direct label binding for confirm button enhances clarity.

Binding the label prop for the confirm button directly to the confirmButtonText computed property improves clarity and maintainability. This change ensures that the button text is managed consistently.


30-36: Consistent use of slots for icon customization.

The implementation of the #icon slot for the confirm button maintains consistency with the cancel button, promoting a uniform design pattern across the component. This enhances the component's modularity and flexibility.

app/components/pages/game-lobby/GameLobbyFooter/GameLobbyRandomCompositionButton/GameLobbyRandomCompositionButton.vue (2)

9-9: Prop binding for button label enhances configurability.

Passing the buttonLabel as a prop to the PrimeVueButton improves the configurability of the component. This change allows for dynamic label updates and aligns with best practices for component design.


17-21: Slot usage for icon rendering improves flexibility.

Encapsulating the FontAwesomeIcon within a #icon slot enhances the flexibility of the button component. This approach allows for easy customization of the icon, promoting better separation of concerns.

app/components/pages/game-lobby/GameLobbyHeader/GameLobbyPlayerInput/GameLobbyPlayerInput.vue (1)

27-33: LGTM!

The use of the :label prop and the <template #icon> slot enhances maintainability and readability.

app/components/pages/game/GamePlaying/GamePlayground/GamePlaygroundFooter/GamePlaygroundFooterMakePlayButton/GamePlaygroundFooterMakePlayButton.vue (1)

11-22: LGTM!

The use of the :label prop and the <template #icon> slot enhances maintainability and readability.

app/components/pages/game-lobby/GameLobbyFooter/GameLobbyStartGameButton/GameLobbyStartGameButton.vue (1)

11-22: LGTM!

The use of the :label prop and the <template #icon> slot enhances maintainability and readability.

tests/unit/specs/components/pages/game/GameOver/GameOverActions/GameOverCreateNewGameButton/GameOverCreateNewGameButton.nuxt.spec.ts (1)

65-68: Good practice: Testing component props.

The test now correctly verifies the label prop of the button component, aligning with best practices for Vue component testing.

app/components/pages/game-lobby/GameLobbyAdditionalCardsManager/GameLobbyAdditionalCardsManagerContent/RecipientRoleAdditionalCardsManager/RecipientRoleAdditionalCardsMultiSelect/RecipientRoleAdditionalCardsMultiSelect.vue (1)

54-56: Improvement: Use of named slots for icons.

The use of the #icon slot for the button icon enhances the component's flexibility and maintainability.

tests/unit/specs/components/pages/game-lobby/GameLobbyFooter/GameLobbyStartGameButton/GameLobbyStartGameConfirmDialog/GameLobbyStartGameConfirmDialogContainer/GameLobbyStartGameConfirmDialogFooter/GameLobbyStartGameConfirmDialogFooter.nuxt.spec.ts (2)

44-47: Good practice: Testing button props.

The test now correctly verifies the label prop of the cancel button component, ensuring alignment with Vue component testing best practices.


78-81: Good practice: Testing confirm button props.

The test cases correctly verify the label prop of the confirm button component for different states, enhancing test robustness.

Also applies to: 129-132

Copy link

sonarcloud bot commented Aug 17, 2024

@antoinezanardi antoinezanardi merged commit 3bfbab9 into develop Aug 17, 2024
14 checks passed
@antoinezanardi antoinezanardi deleted the fix/correct-prime-vue-button-slot branch August 17, 2024 19:02
antoinezanardi pushed a commit that referenced this pull request Aug 20, 2024
## [1.29.0](v1.28.0...v1.29.0) (2024-08-20)

### 🚀 Features

* **actor:** actor playground and events ([#747](#747)) ([6c9a034](6c9a034))
* **game-lobby:** thief and actor cards confirm steps ([#760](#760)) ([11a9bd5](11a9bd5))

### 🐛 Bug Fixes

* **buttons:** correct icon slots ([#759](#759)) ([3bfbab9](3bfbab9))
* **docker:** correct docker composes for prod and preprod ([#768](#768)) ([89175cd](89175cd))

### 📖 Docs

* **docker:** explain dockers tags created ([#767](#767)) ([334cc80](334cc80))

### 🔁 CI

* **docker:** push multiple prebuilt images ([32838b1](32838b1))

### 🧹 Chore

* **deps:** update dependency @eslint/config-inspector to ^0.5.3 ([#750](#750)) ([d99ea7c](d99ea7c))
* **deps:** update dependency @eslint/config-inspector to ^0.5.4 ([#761](#761)) ([0196025](0196025))
* **deps:** update dependency @nuxtjs/i18n to ^8.4.0 ([#753](#753)) ([84a86f8](84a86f8))
* **deps:** update dependency @stylistic/eslint-plugin to ^2.6.4 ([#751](#751)) ([8899923](8899923))
* **deps:** update dependency @vueuse/core to ^11.0.1 ([#762](#762)) ([be4784d](be4784d))
* **deps:** update dependency @vueuse/core to v11 ([#754](#754)) ([b1c25df](b1c25df))
* **deps:** update dependency @vueuse/nuxt to ^11.0.1 ([#763](#763)) ([c66613f](c66613f))
* **deps:** update dependency @vueuse/nuxt to v11 ([#755](#755)) ([b3abc86](b3abc86))
* **deps:** update dependency pinia to ^2.2.2 ([#752](#752)) ([96d7032](96d7032))
* **deps:** update dependency semantic-release to ^24.1.0 ([#758](#758)) ([b109f4f](b109f4f))
* **deps:** update dependency type-fest to ^4.25.0 ([#757](#757)) ([c64b715](c64b715))
* **deps:** update dependency vue to ^3.4.38 ([#749](#749)) ([9ceb602](9ceb602))
* **deps:** update playwright monorepo to ^1.46.1 ([#756](#756)) ([df3bf86](df3bf86))
* **deps:** update pnpm to v9.7.1 ([#746](#746)) ([6803a0d](6803a0d))
* **deps:** update typescript-eslint monorepo to ^8.2.0 ([#766](#766)) ([211953e](211953e))
@antoinezanardi
Copy link
Owner Author

🎉 This PR is included in version 1.29.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant