Skip to content

feat: Added feature of embeding availability to emails#10183

Merged
hariombalhara merged 25 commits intocalcom:mainfrom
Pradumn27:feat/embed-in-emails
Jul 24, 2023
Merged

feat: Added feature of embeding availability to emails#10183
hariombalhara merged 25 commits intocalcom:mainfrom
Pradumn27:feat/embed-in-emails

Conversation

@Pradumn27
Copy link
Copy Markdown
Contributor

What does this PR do?

This PR adds the feature of embedding availability times to email. Have added this as another embed option where users can select their desired date and times to share and can just copy that to their email.

Technical Details:
Have added a global state of selectedDatesAndTimes this keeps track of all the selected days and the times associated with them for every eventType, have used this type for checking in the selection of multiple dates and times.

For the email preview, I had to use tables and inline styles as they worked best for our purpose of copying the content inside the divs.

Remaining Debt:
Need the illustration for this email embed from the design team.

Fixes #6533
/claim #6533

Screen.Recording.2023-07-16.at.7.09.59.PM.mov

Type of change

  • New feature (non-breaking change which adds functionality)

How should this be tested?

  • Go to your events types page
  • Select the embed option from the dropdown of any event or click on embed inside any particular event
  • Click on email embed
  • Add dates and times and copy
  • paste in your email

Mandatory Tasks

  • Make sure you have self-reviewed the code. A decent size PR without self-review might be rejected.

@vercel
Copy link
Copy Markdown

vercel bot commented Jul 16, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 24, 2023 10:03am

@vercel
Copy link
Copy Markdown

vercel bot commented Jul 16, 2023

@Pradumn27 is attempting to deploy a commit to the cal Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jul 16, 2023

Thank you for following the naming conventions! 🙏

@github-actions github-actions bot added embed area: embed, widget, react embed Low priority Created by Linear-GitHub Sync ✨ feature New feature or request 🎨 needs design Before engineering kick-off, a designer needs to submit a mockup 💎 Bounty A bounty on Algora.io 🙋🏻‍♂️help wanted Help from the community is appreciated labels Jul 16, 2023
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jul 16, 2023

📦 Next.js Bundle Analysis for @calcom/web

This analysis was generated by the Next.js Bundle Analysis action. 🤖

Five Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load % of Budget (350 KB)
/apps/[slug]/[...pages] 611.7 KB 765.77 KB 218.79% (🔴 +52.50%)
/availability/[schedule] 351.36 KB 505.43 KB 144.41% (🟡 +2.86%)
/booking/[uid] 322.4 KB 476.47 KB 136.13% (🟢 -0.16%)
/event-types 591.98 KB 746.05 KB 213.16% (🔴 +44.91%)
/event-types/[type] 475.94 KB 630.01 KB 180.00% (🔴 +54.13%)
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

The "Budget %" column shows what percentage of your performance budget the First Load total takes up. For example, if your budget was 100kb, and a given page's first load size was 10kb, it would be 10% of your budget. You can also see how much this has increased or decreased compared to the base branch of your PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this. If you see "+/- <0.01%" it means that there was a change in bundle size, but it is a trivial enough amount that it can be ignored.

@PeerRich PeerRich changed the title Feat: Added feature of embeding availability to emails feat: Added feature of embeding availability to emails Jul 16, 2023
Comment on lines +575 to +596
illustration: (
<svg
width="100%"
height="100%"
className="rounded-md"
viewBox="0 0 308 265"
fill="none"
xmlns="http://www.w3.org/2000/svg">
<path
d="M0 1.99999C0 0.895423 0.895431 0 2 0H306C307.105 0 308 0.895431 308 2V263C308 264.105 307.105 265 306 265H2C0.895431 265 0 264.105 0 263V1.99999Z"
fill="white"
/>
<rect x="24" width="260" height="38.5" rx="6" fill="#F3F4F6" />
<rect x="24" y="50.5" width="120" height="76" rx="6" fill="#F3F4F6" />
<rect x="24" y="138.5" width="120" height="76" rx="6" fill="#F3F4F6" />
<rect x="156" y="50.5" width="128" height="164" rx="6" fill="#F3F4F6" />
<rect x="24" y="226.5" width="260" height="38.5" rx="6" fill="#F3F4F6" />
<rect x="226" y="223.5" width="66" height="26" rx="6" fill="#292929" />
<rect x="242" y="235.5" width="34" height="2" rx="1" fill="white" />
</svg>
),
},
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This illustration is needed from design team

Comment on lines +860 to +868
style={{
paddingBottom: "3px",
fontSize: "13px",
color: "black",
lineHeight: "1.4",
minWidth: "30vw",
maxHeight: "60vh",
overflowY: "auto",
backgroundColor: "white",
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Have used inline styles here as when copying the data from this div we want the style to stay intact and in copying the content the styles need to be part of the html element rather than being computed

className="rounded-lg p-0.5 sm:max-w-[80rem]"
enableOverflow
type="creation">
<DialogContent ref={dialogContentRef} className="rounded-lg p-0.5 sm:max-w-[80rem]" type="creation">
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Have removed overflow from the entire Dialog as it was leading for the entire dialog to be scrolled rather than just the child divs with overflow

Comment on lines +779 to +784
useInitializeBookerStore({
username,
eventSlug: eventType?.slug ?? "",
eventId: eventType?.id,
layout: BookerLayouts.MONTH_VIEW,
});
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Need to initialise the booker store here to access the required state variables from the store in the child components

@ciaranha
Copy link
Copy Markdown
Member

ciaranha commented Jul 20, 2023

@PeerRich this work for the svg embed graphic? (right)

CleanShot 2023-07-20 at 10 54 50@2x

@emrysal
Copy link
Copy Markdown
Contributor

emrysal commented Jul 20, 2023

Two observations; Feel free to disregard both as @Jaibles will cover these anyway, just some feedback as early is better than later.

  • I noticed there's no vertical spacing between times like there is horizontal spacing; there needs to be some (probably 1/2th the horizontal)
  • It makes sense to order the dates in the email by date, not by the order they were selected in the date picker for the embed.

@ciaranha
Copy link
Copy Markdown
Member

Agree with both comments by @emrysal. Vertical margin can just match the horizontal one.

  • Can we also make the color in the time selection pills #111827 instead of blue
  • The text alignment looks off vertical center in those pills also, it's sitting closer to the bottom. Please move up to vertical center

Great work and a really cool feature 👏

@Pradumn27
Copy link
Copy Markdown
Contributor Author

Thanks for the reviews @emrysal @Jaibles , will make the changes accordingly. @Jaibles can you share the figma file for the illustration will add that too then.

@Pradumn27
Copy link
Copy Markdown
Contributor Author

Have done the UI changes and also added ordering based on dates. @Jaibles @emrysal

Screenshot 2023-07-22 at 4 49 54 PM

@ciaranha
Copy link
Copy Markdown
Member

Looks much better thank you @Pradumn27 🙏

hariombalhara
hariombalhara previously approved these changes Jul 24, 2023
Copy link
Copy Markdown
Member

@hariombalhara hariombalhara left a comment

Choose a reason for hiding this comment

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

LGTM !! Amazing work @Pradumn27 🙏

hariombalhara
hariombalhara previously approved these changes Jul 24, 2023
@hariombalhara
Copy link
Copy Markdown
Member

hariombalhara commented Jul 24, 2023

Followup:

  • Email Embed Illustration from @Jaibles that's already shared.
  • Loader on Email Embed(to prevent an empty screen) as it needs to fetch 1-2 queries

@hariombalhara hariombalhara enabled auto-merge (squash) July 24, 2023 09:39
@hariombalhara hariombalhara merged commit 8de75ae into calcom:main Jul 24, 2023
fritterhoff pushed a commit to hm-edu/cal.com that referenced this pull request Jul 25, 2023
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
Co-authored-by: Hariom Balhara <hariombalhara@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💎 Bounty A bounty on Algora.io embed area: embed, widget, react embed ✨ feature New feature or request 🙋🏻‍♂️help wanted Help from the community is appreciated Low priority Created by Linear-GitHub Sync

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CAL-915] embed times in mail

6 participants