-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🪟 🎨 Display free tag on release stage pills for users enrolled in the…
… free connectors program (#21892) * Add FeatureItem.FreeConnectorProgram This is distinct from the LaunchDarkly-backed experiment we're referencing within `cloud/components/experiments/FreeConnectorProgram`: it's primary use is to prevent triggering cloud-only API calls in the OSS build. * Extract shareable FreeTag for various release stage pills It does seem as though we should consolidate on a single release stage pill implementation! That will have to wait for a follow-up, though. * Fix typo (s/inheret/inherit/) * Prefer useFeature to useFreeConnectorProgram in OSS components * Use TestWrapper for more future-proof test renders
- Loading branch information
1 parent
1475d6e
commit 4068bbe
Showing
14 changed files
with
75 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
...webapp/src/packages/cloud/components/experiments/FreeConnectorProgram/FreeTag.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
@use "scss/colors"; | ||
@use "scss/variables"; | ||
|
||
.freeTag { | ||
background-color: colors.$green-300; | ||
color: colors.$white; | ||
border-radius: variables.$border-radius-pill; | ||
padding: 2px 5px; | ||
|
||
// margin: 0 2px; | ||
margin-left: 2px; | ||
margin-right: -4px; | ||
} |
22 changes: 22 additions & 0 deletions
22
airbyte-webapp/src/packages/cloud/components/experiments/FreeConnectorProgram/FreeTag.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { useIntl } from "react-intl"; | ||
|
||
import { ReleaseStage } from "core/request/AirbyteClient"; | ||
|
||
import styles from "./FreeTag.module.scss"; | ||
import { useFreeConnectorProgram } from "./hooks/useFreeConnectorProgram"; | ||
|
||
interface FreeTagProps { | ||
releaseStage: ReleaseStage; | ||
} | ||
|
||
// A tag labeling a release stage pill as free. Defined here for easy reuse between the | ||
// two release stage pill implementations (which should likely be refactored!) | ||
export const FreeTag: React.FC<FreeTagProps> = ({ releaseStage }) => { | ||
const { enrollmentStatusQuery } = useFreeConnectorProgram(); | ||
const { isEnrolled } = enrollmentStatusQuery.data || {}; | ||
const { formatMessage } = useIntl(); | ||
|
||
return isEnrolled && ["alpha", "beta"].includes(releaseStage) ? ( | ||
<span className={styles.freeTag}>{formatMessage({ id: "freeConnectorProgram.releaseStageBadge.free" })}</span> | ||
) : null; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
airbyte-webapp/src/packages/cloud/components/experiments/FreeConnectorProgram/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from "./hooks/useFreeConnectorProgram"; | ||
export * from "./FreeTag"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 3 additions & 5 deletions
8
...r/ConnectorForm/components/FrequentlyUsedConnectors/FrequentlyUsedConnectorsCard.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters