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

[UC17#148#149] Added functionality for users to add their own custom decks #164

Merged
merged 3 commits into from
Feb 6, 2023

Conversation

alessioarcara
Copy link
Owner

This PR implements #148, #149 and adds a new method createCustomDeck in the DecksActivity to make an RPC call and add a custom deck. Once the custom deck is successfully created, it is added to the list of decks on the page.
Tests for the new method were also added.

alessioarcara added 3 commits February 6, 2023 09:21
…arent to child widgets for removing physical cards from decks. Improved User feedback and tests added
…nd add a custom deck. Once added, the deck is added to the page to provide user feedback.
@@ -18,9 +21,12 @@

public class DecksViewImpl extends Composite implements DecksView, ImperativeHandleDeck {
private static final DecksViewImpl.DecksViewImplUIBinder uiBinder = GWT.create(DecksViewImpl.DecksViewImplUIBinder.class);
private static final String DEFAULT_CUSTOM_DECK_TEXT = "Write here name for your custom deck";
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd only make a minimal change in the default placeholder, It seems to be a little longer and i'd prefer somehing shorter and clearer... Maybe "Name the deck to create", but it's obviously a minor fixing with no importance relative to the code!!!

@Override
public void onSuccess(Boolean result) {
if (result) {
view.displayAddedCustomDeck(deckName);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice attention to details, no need of reloading is a better UX

view.displayAlert("Invalid deck name");
return;
}
if (pCard == null) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Great to have the error distintion!!!

Copy link
Collaborator

@Matte0Sacc0 Matte0Sacc0 left a comment

Choose a reason for hiding this comment

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

You've made a good job, i've really appreciated the attention to details even in simple and quick adjutments for a better UX such as differenciating the errors given by the deletion of a card and the fact tha no page reloading is needed to update the decks list after adding a new one.

public void testRemovePhysicalCardFromDeckForInvalidDeckName(String input) {
mockDecksView.displayAlert(anyString());
ctrl.replay();
decksActivity.removePhysicalCardFromDeck(input, new PhysicalCard(Game.MAGIC, 111, Status.Good, "This is a valid description"), (Boolean bool) -> {
Copy link
Collaborator

@dstops dstops Feb 6, 2023

Choose a reason for hiding this comment

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

This is a minor note, but to improve variety and thus test coverage, I suggest you use if it's possible the random status and game generation method, Status.randomStatus() and Game.randomGame()

@Matte0Sacc0 Matte0Sacc0 merged commit e340180 into development Feb 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
3 participants