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

feat: Delete ticket recipient #4656

Merged
merged 4 commits into from
Aug 13, 2024
Merged

feat: Delete ticket recipient #4656

merged 4 commits into from
Aug 13, 2024

Conversation

gorandalum
Copy link
Member

@gorandalum gorandalum commented Aug 9, 2024

Recording showing deletion, with the first delete-attempt failing (on purpose):

delete_recipient

Copy link
Contributor

@marius-at-atb marius-at-atb left a comment

Choose a reason for hiding this comment

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

Looks good! Just a couple of suggestions in the comments you can consider.

keyExtractor={(i) => i.name}
selected={recipient}
onSelect={onSelect}
onSelect={(item) => onSelect(item)}
Copy link
Contributor

Choose a reason for hiding this comment

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

Ideally I think it shouldn't be possible to select it while it is being deleted.
Perhaps a disabled state should be introduced?

Copy link
Member Author

Choose a reason for hiding this comment

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

The RadioGroupSection doesn't have support for a disabled state as of now. Would be nice, but won't invest the effort now.

A quick fix can be:

onSelect={(item) =>
  !activeDeletions.includes(item.accountId) && onSelect(item)
}

This way selecting the recipient while it is being deleted won't do anything.

tooManyRecipients: _(
'Du kan ikke legge til flere mottakere. Om du ønsker å sende til noen andre, må du fjerne en av mottakerne i listen ovenfor.',
"You can't add more recipients. If you wish to send to someone else, then you need to remove one of the recipients in the list above.",
'Du kan ikke leggje til fleire mottakarar. Om du ønskjer sende til nokon andre, må du fjerne ein av mottakarane i lista ovanfor.',
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
'Du kan ikke leggje til fleire mottakarar. Om du ønskjer sende til nokon andre, må du fjerne ein av mottakarane i lista ovanfor.',
'Du kan ikkje leggje til fleire mottakarar. Om du ønskjer å sende til nokon andre, må du fjerne ein av mottakarane i lista ovanfor.',

mutation.mutate(accountId);
};

const isAtMaxRecipients =
Copy link
Contributor

Choose a reason for hiding this comment

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

When state.settingName is false, the max limit shouldn't be relevant?

Copy link
Member Author

Choose a reason for hiding this comment

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

It is implemented as it is in Figma, where it is shown below the recipient list, disabling the possibility to send to other. This is the Figma sketch:
Screenshot 2024-08-12 at 11 33 55

But based on your question, I realise that maybe the user should be able to send to a another phone number (without saving) even if the recipient list is at max. I'll ask designer.

Copy link
Member

Choose a reason for hiding this comment

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

Maybe this has been discussed already but I'll ask:

Is there really any issues with allowing the user to add an unlimited amount of recipients? I doubt anyone will bother to save so many recipients that it becomes a performance issue, and for the few that actually need more than 10 recipients, the limit can be annoying. (Say you wanted to send tickets to a whole school class or football team)

Copy link
Member Author

Choose a reason for hiding this comment

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

At least now things are fixed accoring to Figma.

Figma:

App (max recipients at 2 just for the screenshot):

@ckbilstad may comment on whether it should be a max recipients limit or not.

Choose a reason for hiding this comment

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

I dont have a strong opinion on the exact number, but i do think we should have some kind of max amount. If the list becomes too long, it might be difficult for users to keep track of everything. A lengthy list can also slow down navigation and make it harder to find the CTA button.

Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps a "recipient group" could be a new feature request, intended for such use cases as an entire football team?

Copy link
Member

Choose a reason for hiding this comment

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

@ckbilstad I'm sure the current solution will work great for 99,9% of users, so I don't think it's important to change how it works now, but I have a couple of thoughts:

difficult for users to keep track of everything

I think a long list is easier to manage than not being able to add more users (and having to type phone numbers manually). Also the user needs to put a fair bit of effort into adding more than 10 recipients, so they are probably fine with scrolling a bit afterwards. If they think the list is too long, items are easy to remove.

A lengthy list can also slow down navigation and make it harder to find the CTA button.

Maybe the CTA button should be fixed to the bottom of the screen then? Today it can be hidden behind the keyboard even when the list is quite short.

src/translations/screens/subscreens/OnBehalfOf.ts Outdated Show resolved Hide resolved
mutation.mutate(accountId);
};

const isAtMaxRecipients =
Copy link
Member

Choose a reason for hiding this comment

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

Maybe this has been discussed already but I'll ask:

Is there really any issues with allowing the user to add an unlimited amount of recipients? I doubt anyone will bother to save so many recipients that it becomes a performance issue, and for the few that actually need more than 10 recipients, the limit can be annoying. (Say you wanted to send tickets to a whole school class or football team)

@gorandalum gorandalum merged commit 82a009a into master Aug 13, 2024
6 checks passed
@gorandalum gorandalum deleted the dalum/delete_recipient branch August 13, 2024 09:29
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.

4 participants