Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Refactor SendingAccordion with Contact Selection & Email Placeholder #227

Open
5 tasks
mahid797 opened this issue Feb 23, 2025 · 0 comments
Open
5 tasks
Assignees
Labels
Frontend Frontend Related Issue ⚡Important High-impact issue that needs to be resolved before the next release New Feature New feature to be implemented Refactor Code Improvement
Milestone

Comments

@mahid797
Copy link
Collaborator

Improve the “SendingAccordion” so the user can realistically pick from an existing contact list (placeholder or real) and/or manually type in email addresses. Then send them the newly created link by calling a placeholder endpoint (e.g. /api/documents/[documentId]/links/email).

Detailed Tasks

  1. Fetch or Mock a Contact List

    • Possibly GET /api/contacts or GET /api/documents/[documentId]/linkVisitors for stored emails.
    • Display them in a multi-select or chips, letting the user pick multiple.
  2. Manual Email Entry

    • Provide a text field for “Other Emails.”
    • The user can type comma‐separated emails. Validate them briefly if desired.
  3. Send Action

    • After the link is created, call a function (e.g., handleSendInvites(linkUrl)) that does:
      await axios.post(`/api/documents/${documentId}/links/email`, {
      	linkUrl,
      	recipients: [...selectedContacts, ...parsedEmails],
      });
    • Show success, partial success, or error. The actual emailing is not yet implemented, but the UI must be functional.
  4. Typed Models

    • Optionally define an InviteRecipientsPayload with linkUrl: string, recipients: string[].
    • This ensures we keep type safety if the server later implements real logic.
  5. Integration

    • If the user sets sendInvites: true, we display the SendingAccordion or integrated UI.
    • If they confirm, we call the placeholder endpoint.

Acceptance Criteria

  • The user can select multiple known contacts and/or manually enter emails in Other Emails.
  • On “Send,” we do a (placeholder) POST request with typed data.
  • Show a success or partial success message.
  • The code is neatly integrated—no ephemeral logic mixing in CreateLink.tsx.
  • If the server side is not yet implemented, we at least handle the success or error gracefully.

Notes

  • Keep ephemeral styling minimal—prefer sx or small local components.
  • This refactoring plan ensures we fully respect the new server approach, storing only minimal visitorFields keys, using typed forms & hooks, and a robust “SendingAccordion” for invites.
@mahid797 mahid797 added this to the v0.1 milestone Feb 23, 2025
@mahid797 mahid797 added New Feature New feature to be implemented Refactor Code Improvement Frontend Frontend Related Issue ⚡Important High-impact issue that needs to be resolved before the next release labels Feb 23, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Frontend Frontend Related Issue ⚡Important High-impact issue that needs to be resolved before the next release New Feature New feature to be implemented Refactor Code Improvement
Projects
None yet
Development

No branches or pull requests

2 participants