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

🪟 ☁️ Free alpha/beta connectors pills #21564

Merged
merged 7 commits into from
Jan 19, 2023

Conversation

ambirdsall
Copy link
Contributor

@ambirdsall ambirdsall commented Jan 18, 2023

What

Adds free tag to alpha/beta status pills for enrolled users (largely courtesy of #21526); also adds an SVG of the free pills to the modal header. Closes #21228.

How

  • cherry-picked @josephkmh's WIP free pill implementation onto the email verification branch to stay in sync with the latest feature code
  • updated useFreeConnectorProgram to pass a (LaunchDarkly-flag-guarded) boolean for enrollment status alongside the boolean to show enrollment UI
  • used that new value in ReleaseStageBadge's conditional
  • exported the free pills SVG from Figma and imported them in the modal header
    • because the exported SVG wasn't vertically-centered, there's an ad hoc margin-top: 2em to make it look nice.

One last issue that cropped up: by making the ReleaseStageBadge component depend on useFreeConnectorProgram, it added a whole slew of (partially cloud-specific) providers that needed to be added to

<IntlProvider locale="en" messages={en}>
<FrequentlyUsedConnectorsCard {...props} />
</IntlProvider>
to get tests passing. Out of expedience, since the free pills are much lower priority than testing the core enrollment flows, I removed that logic: now ReleaseStageBadge accepts showFreeTag as a "dumb" prop, making it the responsibility of the components that use it to figure out whether free tags are appropriate.

@octavia-squidington-iv octavia-squidington-iv added the area/frontend Related to the Airbyte webapp label Jan 18, 2023
@ambirdsall ambirdsall changed the title :Window:ree ab connectors pill 🪟 ☁️ Free alpha/beta connectors pills Jan 18, 2023
@ambirdsall ambirdsall changed the base branch from master to alex/check-email-verification-status-for-free-connector-enrollment January 18, 2023 23:16
@ambirdsall ambirdsall marked this pull request as ready for review January 18, 2023 23:25
Copy link
Contributor

@josephkmh josephkmh 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! I tested it locally ✨

@@ -26,7 +26,8 @@ export const ConnectionPageTitle: React.FC = () => {

const { connection } = useConnectionEditService();

const { data: displayEnrollmentCallout } = useFreeConnectorProgram();
const { data: freeConnectorProgramInfo } = useFreeConnectorProgram();
const displayEnrollmentCallout = freeConnectorProgramInfo?.showEnrollmentUi;
Copy link
Contributor

Choose a reason for hiding this comment

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

This can probably be the same in both CreditsPage and ConnectionTitlePage if we just rename the variable showEnrollmentUi... No real strong feeling in how we do it.

@ambirdsall ambirdsall force-pushed the alex/check-email-verification-status-for-free-connector-enrollment branch from 6815c14 to abb7abd Compare January 19, 2023 17:58
@ambirdsall ambirdsall force-pushed the alex+joey/free-ab-connectors-pill branch from ebc7e33 to 7484541 Compare January 19, 2023 18:01
@ambirdsall ambirdsall force-pushed the alex/check-email-verification-status-for-free-connector-enrollment branch from abb7abd to f766423 Compare January 19, 2023 18:15
@ambirdsall ambirdsall force-pushed the alex+joey/free-ab-connectors-pill branch from 7484541 to afaf850 Compare January 19, 2023 18:15
Base automatically changed from alex/check-email-verification-status-for-free-connector-enrollment to master January 19, 2023 19:50
@ambirdsall
Copy link
Contributor Author

ambirdsall commented Jan 19, 2023

Just need a rebase to remove conflicts again and this is good to go. My kingdom for a setting to enable rerere on github 😫.

EDIT: There were more conflicts than expected, but the resolution was clean. Comparing the post-resolution state to the prior branch SHA, the only frontend change in the end state is from an unrelated commit pulled in from master:

┌ ~/c/airbyte (alex+joey/free-ab-connectors-pill|✔) 🌗 f87699518d3
└➣ g diff HEAD..afaf85028f7 -- airbyte-webapp/
diff --git a/airbyte-webapp/src/pages/connections/ConnectionSettingsPage/ConnectionSettingsPage.tsx b/airbyte-webapp/src/pages/connections/ConnectionSettingsPage/ConnectionSettingsPage.tsx
index 49b07342ebb..0663166e8ee 100644
--- a/airbyte-webapp/src/pages/connections/ConnectionSettingsPage/ConnectionSettingsPage.tsx
+++ b/airbyte-webapp/src/pages/connections/ConnectionSettingsPage/ConnectionSettingsPage.tsx
@@ -19,8 +19,7 @@ export const ConnectionSettingsPageInner: React.FC = () => {
   const { connection } = useConnectionEditService();
   const { mutateAsync: deleteConnection } = useDeleteConnection();
   const canUpdateDataResidency = useFeature(FeatureItem.AllowChangeDataGeographies);
-  // TODO: Disabled until feature is implemented in backend
-  const canSendSchemaUpdateNotifications = false; // useFeature(FeatureItem.AllowAutoDetectSchema);
+  const allowAutoDetectSchema = useFeature(FeatureItem.AllowAutoDetectSchema);

   const [isAdvancedMode] = useAdvancedModeSetting();
   useTrackPage(PageTrackingCodes.CONNECTIONS_ITEM_SETTINGS);
@@ -28,7 +27,7 @@ export const ConnectionSettingsPageInner: React.FC = () => {

   return (
     <div className={styles.container}>
-      {canSendSchemaUpdateNotifications && <SchemaUpdateNotifications />}
+      {allowAutoDetectSchema && <SchemaUpdateNotifications />}
       {canUpdateDataResidency && <UpdateConnectionDataResidency />}
       {isAdvancedMode && <StateBlock connectionId={connection.connectionId} />}
       <DeleteBlock type="connection" onDelete={onDelete} />

@ambirdsall ambirdsall force-pushed the alex+joey/free-ab-connectors-pill branch from afaf850 to f876995 Compare January 19, 2023 20:06
@ambirdsall ambirdsall enabled auto-merge (squash) January 19, 2023 20:13
@ambirdsall ambirdsall merged commit af5843a into master Jan 19, 2023
@ambirdsall ambirdsall deleted the alex+joey/free-ab-connectors-pill branch January 19, 2023 20:36
etsybaev pushed a commit that referenced this pull request Jan 19, 2023
* check email verification status for real

* Clean up useFreeConnectorProgram

- rename the function to match its filename
- check the experiment within the hook, not at every call site

* add free tag to release stage badge

* Fix ReleaseStageBadge's useFreeConnectorProgram usage

* Add isEnrolled to useFreeConnectorProgram

* Add free pills SVG to enrollment modal header

* Make ReleaseStageBadge show free tag based on prop

Co-authored-by: josephkmh <joseph@airbyte.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/frontend Related to the Airbyte webapp
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Free connectors] Create variant of status pill with "free" label
4 participants