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

connect settings to the embed homepage and show it #40528

Merged
merged 4 commits into from
Apr 4, 2024

Conversation

npretto
Copy link
Member

@npretto npretto commented Mar 22, 2024

Part of [Epic] Initial homepage experience for embedding admins

This is stacked on top of add new settings for embedding homepage

This connects the settings from the previous PR to the actual homepage, and displays it.
It also contains tests for the variants/settings that are used.

The example dashboard link/button will be added in a future PR as it depends on #40066

@npretto npretto changed the title fix nested a warnings in browser console connect settings to the embed homepage and show it Mar 22, 2024
@npretto npretto force-pushed the embed-homepabe-connect-settings branch from 9bfe50c to 1363bb4 Compare March 22, 2024 17:23
// we want to show the interactive tab for EE builds
// unless it's a starter cloud plan, which is EE build but doesn't have interactive embedding
if (isEEBuild()) {
return plan === "starter" ? "static" : "interactive";
Copy link
Member Author

Choose a reason for hiding this comment

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

Small note: we want to show interactive even if there is no license active, the content of the card will prompt to activate the license. That's why I'm checking if it's a ee build and not if the plan is ee on line 44

</List.Item>
</>
<List.Item>
<Anchor
Copy link
Member Author

@npretto npretto Mar 25, 2024

Choose a reason for hiding this comment

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

This change is to avoid the warning about nested tags, same for following Link > Anchors in the next files

@npretto npretto marked this pull request as ready for review March 25, 2024 10:54
@@ -42,7 +59,7 @@ export const EmbedHomepage = () => {
exampleDashboardId={exampleDashboardId}
embeddingAutoEnabled={embeddingAutoEnabled}
licenseActiveAtSetup={licenseActiveAtSetup}
plan="oss-starter"
defaultTab={defaultTab}
Copy link
Member Author

Choose a reason for hiding this comment

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

I changed the prop here, I think the extra abstraction wasn't worth it, the plan was only used to determine the default tab

Copy link

github-actions bot commented Mar 25, 2024

Codenotify: Notifying subscribers in CODENOTIFY files for diff 34d8c79...a92764a.

Notify File(s)
@ranquild frontend/src/metabase/home/components/EmbedHomepage/EmbedHomepage.stories.tsx
frontend/src/metabase/home/components/EmbedHomepage/EmbedHomepage.tsx
frontend/src/metabase/home/components/EmbedHomepage/EmbedHomepageView.tsx
frontend/src/metabase/home/components/EmbedHomepage/InteractiveTabContent.tsx
frontend/src/metabase/home/components/EmbedHomepage/StaticTabContent.tsx
frontend/src/metabase/home/components/EmbedHomepage/tests/common.unit.spec.tsx
frontend/src/metabase/home/components/EmbedHomepage/tests/enterprise.unit.spec.tsx
frontend/src/metabase/home/components/EmbedHomepage/tests/premium.unit.spec.tsx
frontend/src/metabase/home/components/EmbedHomepage/tests/setup.tsx
frontend/src/metabase/home/components/HomeContent/HomeContent.tsx
frontend/src/metabase/home/components/HomeContent/HomeContent.unit.spec.tsx

Copy link

replay-io bot commented Mar 25, 2024

Status Complete ↗︎
Commit a92764a
Results
2 Failed
⚠️ 4 Flaky
2375 Passed

@npretto npretto force-pushed the embed-homepabe-connect-settings branch from ad0ce08 to 0bbc409 Compare March 25, 2024 14:15
@@ -57,14 +61,14 @@ export const EmbedHomepageView = (props: EmbedHomepageViewProps) => {
<Text color="text-light" size="sm">
{/* eslint-disable-next-line no-literal-metabase-strings -- only visible to admins */}
{jt`Because you expressed interest in embedding Metabase, we took this step for you so that you can more easily try it out. You can turn it off anytime in ${(
<Link
to="admin/settings/embedding-in-other-applications"
<Anchor
Copy link
Member Author

Choose a reason for hiding this comment

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

Changed from Link > Anchor to <Anchor component={Link} to address warning about nested a tags

Copy link
Contributor

@deniskaber deniskaber 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!

@npretto npretto requested a review from camsaul as a code owner March 26, 2024 10:38
@npretto npretto force-pushed the embed-homepabe-connect-settings branch from 0bbc409 to dd9c7c6 Compare March 26, 2024 10:44
Base automatically changed from embed-homepage-settings to embed-homepage April 4, 2024 16:10
@npretto npretto force-pushed the embed-homepabe-connect-settings branch from dd9c7c6 to a92764a Compare April 4, 2024 16:15
@npretto npretto merged commit d670885 into embed-homepage Apr 4, 2024
63 checks passed
@npretto npretto deleted the embed-homepabe-connect-settings branch April 4, 2024 16:16
deniskaber pushed a commit that referenced this pull request Apr 5, 2024
* create ui for the full embedding homepage, without any logic (#40251)

* wip ui for the full embedding homepage

* adds missing link + fix keys

* remove done TODO

* Update frontend/src/metabase/home/components/EmbedHomepage/InteractiveTabContent.tsx

Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>

* destructure props in the function arguments

* rename customerFacingAnalyticsDocsUrl to analyticsDocsUrl

---------

Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>

* add new settings for embedding homepage (#40455)

* remove old minimal version

* adds new embedding homepage settings and sets them at the end of the setup

* comment e2e test

* add tests for embedding homepage flags

* more tests

* remove unit tests related to old minimal version

* fixes flags descriptions

* :keyword for embedding-homepage

Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>

* replace reloadSettings and refreshSettingsList with initializeSettings

* `value => value === true` -> `Boolean`

* toMatchObject -> toEqual for more strict tests

* remove useless undefined check for settings, the component is conditionally rendered based on a setting so it means they're loaded anyway

* fix: use :hidden as we changed the type to :keyword

* specifically check for the `embedding` feature in the tokenFeatures object instead of checking if any feature is active

* remove double \n

Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>

---------

Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>

* connect settings to the embed homepage and show it (#40528)

* fix nested a warnings in browser console

* connect settings to the embed homepage and show it

* fix stories

* remove localStorage.clear() as we're not using it in the logic anymore

* dismiss without feedback for the embedding homepage (#40587)

* feat: add dismiss functionality to the embed homepage

* update setup e2e to check for the dismissal of embedding homepage

* use List from metabase/ui (#40638)

* set embedding-secret-key when embedding is enabled (#40813)

* set embedding-secret-key when embedding is enabled

* use "named" setters and getters as suggested by Noah

* Fix tests for ms1 after updating on master (#41069)

---------

Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants