Skip to content

Introduce EventTypeAppCard in app-store and make it super easy to add it through CLI - Also adds Fathom app#4727

Merged
zomars merged 41 commits intomainfrom
app-store-cli-event-type-extensions
Oct 14, 2022
Merged

Introduce EventTypeAppCard in app-store and make it super easy to add it through CLI - Also adds Fathom app#4727
zomars merged 41 commits intomainfrom
app-store-cli-event-type-extensions

Conversation

@hariombalhara
Copy link
Copy Markdown
Member

@hariombalhara hariombalhara commented Sep 28, 2022

What does this PR do?

Fixes #4221 #4700 #4791 #4792

Also, review https://app.gitbook.com/o/6snd8PyPYMhg0wUw6CeQ/s/VXRprBTuMlihk37NQgUU/~/changes/6xkqZ4qvJ3Xh9k8UaWaZ/engineering/product-specs/app-store#user-apps docs. Will keep on updating it as and when required.

Note: This PR also deletes some V1 files whose V2 versions I was modifying.

Also adds fathom app through the merge of #4804

Important

  • Because we are parsing metadata schema with zod now, it's possible that some users might have metadata(already existing) that might not be meeting zod schema and thus that might fail eventTypes loading. Though zod schema is as per the current code but it's possible that code might have evolved and there might be data not meeting current code expectations.
    Recovery Plan in case the issue comes
    • If many people are being impacted, revert. Because there are no migrations in it, it is completely safe to revert this change. Any event types that make an update to Apps in the mean time, wouldn't have that change reflected but as soon as we make the change live again, they should be able to see their configurations back.
    • If few cases appear, go and fix their data as per the schema

Design Principle-1: One App shouldn't break another App.

  • Thanks to ErrorBoundaries, error in one AppCard won't impact another.
    e.g. why should Stripe App issue make other Apps unavailable?
    Screenshot 2022-10-01 at 3 06 36 PM
  • Each app can only modify its respective slot under the metadata.apps namespace. This avoids the chances of one app breaking the other app with name conflicts on properties.
  • Moves rainbow, stripe and giphy app-related code from EventAppsTab to their respective app folders.
    • Deprecates eventType.price and eventType.currency as these are specific to stripe only. Migration to drop the columns will follow later.
  • Replaced all occurrences of eventType.price and eventType.currency to stripeAppData.price and stripeData.currency - This requires testing of all pages involved as payment is an important flow.

Design Principle-2: While adding a new app, the developer shouldn't worry about code beyond the app directory

  • So, the entire app code exists in app-store/APP_NAME only.

Design Principle-3: Adding new apps and maintenance should be easy. See Loom

  • Adding a new EventType app should be super easy and quick.
  • Limited the ways app data can be accessed. getEventTypeAppData is the only accepted entry point to access event-type app data. This allows capabilities like denying access to data if the app is disabled.
  • AppStore CLI has the support to instantly create such an app which can be toggled
  • Introduced the concept of extensions in AppStore(to extend EventTypes, Routing Forms and other features) that can be specified using extendsFeature property. Currently it supports only EventType.
    - EventTypeAppCard.tsx file would automatically be generated for Apps with extendsFeature set to EventType
    - zod.ts would also be generated that would allow the app to expose the data it wants to store in eventType.metadata as appDataSchema export
    - apps.browser.generated.tsx would have the required exports automatically generated for ease of use.

Design Principle-4: Easy discoverability of apps(See Loom)

  • Screenshot 2022-10-03 at 3 59 11 PM
  • Not installed apps, would also show now under AppsTab allowing users to easily discover apps relevant to EventType within that view itself.
  • User would be able to do mostly a one-click install of apps using OmniInstallAppButton from the AppsTab page itself. Giphy and Rainbow would be one click but because stripe requires authentication it can't be one click.
  • AppCard now links to the app in app-store so that users can get more details about the app quickly.

Other Fixes

  • UX Improvement: Disabling doesn't discard app data now, that you would have spent time in configuring. See this loom for a demo
  • Updated EventTypeDescription to V2 on event-types listing page. This is consistent with booking pages now.
    Before:

Screenshot 2022-10-01 at 2 42 47 PM

After:

Screenshot 2022-10-01 at 2 44 33 PM

Before:
Screenshot 2022-10-01 at 3 42 12 PM

After:
Screenshot 2022-10-01 at 3 41 43 PM

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Chore (refactoring code, technical debt, workflow improvements)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How should this be tested?

  • Install Rainbow, Stripe, Giphy apps and verify their impact on booking pages.
  • Enable these apps and then verify their impact
  • Configure these apps with various options.
  • Test that stripe installation n correctly resets price to 0 in metadata.apps

Checklist

  • I haven't added tests that prove my fix is effective or that my feature works

@vercel
Copy link
Copy Markdown

vercel Bot commented Sep 28, 2022

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

Name Status Preview Updated
cal ✅ Ready (Inspect) Visit Preview Oct 14, 2022 at 11:25AM (UTC)

@hariombalhara hariombalhara changed the title Add OmniInstall button Introduce EventTypeAppCard in app-store and make it super easy to add it through CLI Sep 28, 2022
* added fathom app wrapper, needs script injection to public booking page

* new logo

* Add Fathom script support on booking pages and add it as an eventTypeapp

* Add automation and analytics apps

* Add missing pieces for analytics category

* Rename BookingPageScripts to BookingPageTagManager

Co-authored-by: Hariom Balhara <hariombalhara@gmail.com>
@hariombalhara hariombalhara changed the title Introduce EventTypeAppCard in app-store and make it super easy to add it through CLI Introduce EventTypeAppCard in app-store and make it super easy to add it through CLI - Also adds Fathom app Oct 10, 2022
Copy link
Copy Markdown
Contributor

@leog leog left a comment

Choose a reason for hiding this comment

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

Left some comments, nothing blocking I think. Great changes!

* Use this component to allow installing an app from anywhere on the app.
* Use of this component requires you to remove custom InstallAppButtonComponent so that it can manage the redirection itself
*/
export default function OmniInstallAppButton({ appId, className }: { appId: string; className: string }) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not sure if I get why we need this sort of button. Does it makes it easier to include anywhere in the app? Like in the app store single category page?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah, it allows you to install an app from any page on our webapp

icon: Icon.FiGrid,
info: `${enabledAppsNumber} ${t("active")}`,
//TODO: Handle proper translation with count handling
info: `${installedAppsNumber} apps, ${enabledAppsNumber} ${t("active")}`,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This should be easy to do. You could also add a comment if possible next to the translation in common.js to let the translators know where does the string apply, as it is difficult to infer context.

Comment thread apps/web/pages/[user].tsx
})
).map((eventType) => ({
...eventType,
metadata: EventTypeMetaDataSchema.parse(eventType.metadata),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just to be clear, as I saw you renamed metadata to appData at the beginning, metadata in this context is the same as appData? If so, should we rename it everywhere else? I like appData the most as it clearly states the entity that holds that data.

InstalledAppVariants.calendar,
InstalledAppVariants.analytics,
InstalledAppVariants.automation,
]}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I like the explicitness here 👍

},
});

const appsMetadata = formMethods.getValues("metadata")?.apps;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same question about having now two names for the same thing if that's what it is. IMHO introducing new names should rename everything, otherwise we will end up confusing names.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Agreed, eventType.metadata.apps should be called appData

Copy link
Copy Markdown
Contributor

@zomars zomars left a comment

Choose a reason for hiding this comment

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

This PR is a bold move. But a welcome one nonetheless. Let's ship this to staging and test the heck out of it before going to prod on Monday.

Impressive work @hariombalhara 🙏

Ship it

@zomars zomars merged commit 271d431 into main Oct 14, 2022
@zomars zomars deleted the app-store-cli-event-type-extensions branch October 14, 2022 16:24
@PeerRich PeerRich added the core area: core, team members only label Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core area: core, team members only

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

Rainbow App not visible under Apps in EventType even if installed /event-types-detail - Active apps count is wrong

4 participants