Skip to content

Commit

Permalink
added upgrade button in callout (#1981)
Browse files Browse the repository at this point in the history
Signed-off-by: sumukhswamy <[email protected]>
  • Loading branch information
sumukhswamy authored Jul 23, 2024
1 parent 8d4ba26 commit 7bfe2e0
Show file tree
Hide file tree
Showing 12 changed files with 246 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ exports[`Log Config component renders empty log config 1`] = `
"getApplicationClasses$": [MockFunction],
"getBadge$": [MockFunction],
"getBreadcrumbs$": [MockFunction],
"getBreadcrumbsEnricher$": [MockFunction],
"getCustomNavLink$": [MockFunction],
"getHeaderComponent": [MockFunction],
"getHelpExtension$": [MockFunction],
Expand Down Expand Up @@ -116,6 +117,7 @@ exports[`Log Config component renders empty log config 1`] = `
"setAppTitle": [MockFunction],
"setBadge": [MockFunction],
"setBreadcrumbs": [MockFunction],
"setBreadcrumbsEnricher": [MockFunction],
"setCustomNavLink": [MockFunction],
"setHelpExtension": [MockFunction],
"setHelpSupportUrl": [MockFunction],
Expand Down Expand Up @@ -644,6 +646,7 @@ exports[`Log Config component renders with query 1`] = `
"getApplicationClasses$": [MockFunction],
"getBadge$": [MockFunction],
"getBreadcrumbs$": [MockFunction],
"getBreadcrumbsEnricher$": [MockFunction],
"getCustomNavLink$": [MockFunction],
"getHeaderComponent": [MockFunction],
"getHelpExtension$": [MockFunction],
Expand Down Expand Up @@ -747,6 +750,7 @@ exports[`Log Config component renders with query 1`] = `
"setAppTitle": [MockFunction],
"setBadge": [MockFunction],
"setBreadcrumbs": [MockFunction],
"setBreadcrumbsEnricher": [MockFunction],
"setCustomNavLink": [MockFunction],
"setHelpExtension": [MockFunction],
"setHelpSupportUrl": [MockFunction],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ exports[`Service Config component renders empty service config 1`] = `
"getApplicationClasses$": [MockFunction],
"getBadge$": [MockFunction],
"getBreadcrumbs$": [MockFunction],
"getBreadcrumbsEnricher$": [MockFunction],
"getCustomNavLink$": [MockFunction],
"getHeaderComponent": [MockFunction],
"getHelpExtension$": [MockFunction],
Expand Down Expand Up @@ -116,6 +117,7 @@ exports[`Service Config component renders empty service config 1`] = `
"setAppTitle": [MockFunction],
"setBadge": [MockFunction],
"setBreadcrumbs": [MockFunction],
"setBreadcrumbsEnricher": [MockFunction],
"setCustomNavLink": [MockFunction],
"setHelpExtension": [MockFunction],
"setHelpSupportUrl": [MockFunction],
Expand Down Expand Up @@ -1214,6 +1216,7 @@ exports[`Service Config component renders with one service selected 1`] = `
"getApplicationClasses$": [MockFunction],
"getBadge$": [MockFunction],
"getBreadcrumbs$": [MockFunction],
"getBreadcrumbsEnricher$": [MockFunction],
"getCustomNavLink$": [MockFunction],
"getHeaderComponent": [MockFunction],
"getHelpExtension$": [MockFunction],
Expand Down Expand Up @@ -1317,6 +1320,7 @@ exports[`Service Config component renders with one service selected 1`] = `
"setAppTitle": [MockFunction],
"setBadge": [MockFunction],
"setBreadcrumbs": [MockFunction],
"setBreadcrumbsEnricher": [MockFunction],
"setCustomNavLink": [MockFunction],
"setHelpExtension": [MockFunction],
"setHelpSupportUrl": [MockFunction],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ exports[`Trace Config component renders empty trace config 1`] = `
"getApplicationClasses$": [MockFunction],
"getBadge$": [MockFunction],
"getBreadcrumbs$": [MockFunction],
"getBreadcrumbsEnricher$": [MockFunction],
"getCustomNavLink$": [MockFunction],
"getHeaderComponent": [MockFunction],
"getHelpExtension$": [MockFunction],
Expand Down Expand Up @@ -115,6 +116,7 @@ exports[`Trace Config component renders empty trace config 1`] = `
"setAppTitle": [MockFunction],
"setBadge": [MockFunction],
"setBreadcrumbs": [MockFunction],
"setBreadcrumbsEnricher": [MockFunction],
"setCustomNavLink": [MockFunction],
"setHelpExtension": [MockFunction],
"setHelpSupportUrl": [MockFunction],
Expand Down Expand Up @@ -926,6 +928,7 @@ exports[`Trace Config component renders with one trace selected 1`] = `
"getApplicationClasses$": [MockFunction],
"getBadge$": [MockFunction],
"getBreadcrumbs$": [MockFunction],
"getBreadcrumbsEnricher$": [MockFunction],
"getCustomNavLink$": [MockFunction],
"getHeaderComponent": [MockFunction],
"getHelpExtension$": [MockFunction],
Expand Down Expand Up @@ -1029,6 +1032,7 @@ exports[`Trace Config component renders with one trace selected 1`] = `
"setAppTitle": [MockFunction],
"setBadge": [MockFunction],
"setBreadcrumbs": [MockFunction],
"setBreadcrumbsEnricher": [MockFunction],
"setCustomNavLink": [MockFunction],
"setHelpExtension": [MockFunction],
"setHelpSupportUrl": [MockFunction],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -885,6 +885,7 @@ exports[`Panels View Component renders panel view container with visualizations
"getApplicationClasses$": [MockFunction],
"getBadge$": [MockFunction],
"getBreadcrumbs$": [MockFunction],
"getBreadcrumbsEnricher$": [MockFunction],
"getCustomNavLink$": [MockFunction],
"getHeaderComponent": [MockFunction],
"getHelpExtension$": [MockFunction],
Expand Down Expand Up @@ -1282,6 +1283,7 @@ exports[`Panels View Component renders panel view container with visualizations
},
],
},
"setBreadcrumbsEnricher": [MockFunction],
"setCustomNavLink": [MockFunction],
"setHelpExtension": [MockFunction],
"setHelpSupportUrl": [MockFunction],
Expand Down Expand Up @@ -2680,6 +2682,7 @@ exports[`Panels View Component renders panel view container with visualizations
"getApplicationClasses$": [MockFunction],
"getBadge$": [MockFunction],
"getBreadcrumbs$": [MockFunction],
"getBreadcrumbsEnricher$": [MockFunction],
"getCustomNavLink$": [MockFunction],
"getHeaderComponent": [MockFunction],
"getHelpExtension$": [MockFunction],
Expand Down Expand Up @@ -3077,6 +3080,7 @@ exports[`Panels View Component renders panel view container with visualizations
},
],
},
"setBreadcrumbsEnricher": [MockFunction],
"setCustomNavLink": [MockFunction],
"setHelpExtension": [MockFunction],
"setHelpSupportUrl": [MockFunction],
Expand Down Expand Up @@ -3245,6 +3249,7 @@ exports[`Panels View Component renders panel view container without visualizatio
"getApplicationClasses$": [MockFunction],
"getBadge$": [MockFunction],
"getBreadcrumbs$": [MockFunction],
"getBreadcrumbsEnricher$": [MockFunction],
"getCustomNavLink$": [MockFunction],
"getHeaderComponent": [MockFunction],
"getHelpExtension$": [MockFunction],
Expand Down Expand Up @@ -3531,6 +3536,7 @@ exports[`Panels View Component renders panel view container without visualizatio
},
],
},
"setBreadcrumbsEnricher": [MockFunction],
"setCustomNavLink": [MockFunction],
"setHelpExtension": [MockFunction],
"setHelpSupportUrl": [MockFunction],
Expand Down Expand Up @@ -4924,6 +4930,7 @@ exports[`Panels View Component renders panel view container without visualizatio
"getApplicationClasses$": [MockFunction],
"getBadge$": [MockFunction],
"getBreadcrumbs$": [MockFunction],
"getBreadcrumbsEnricher$": [MockFunction],
"getCustomNavLink$": [MockFunction],
"getHeaderComponent": [MockFunction],
"getHelpExtension$": [MockFunction],
Expand Down Expand Up @@ -5210,6 +5217,7 @@ exports[`Panels View Component renders panel view container without visualizatio
},
],
},
"setBreadcrumbsEnricher": [MockFunction],
"setCustomNavLink": [MockFunction],
"setHelpExtension": [MockFunction],
"setHelpSupportUrl": [MockFunction],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ exports[`Panel Grid Component renders panel grid component with empty visualizat
"getApplicationClasses$": [MockFunction],
"getBadge$": [MockFunction],
"getBreadcrumbs$": [MockFunction],
"getBreadcrumbsEnricher$": [MockFunction],
"getCustomNavLink$": [MockFunction],
"getHeaderComponent": [MockFunction],
"getHelpExtension$": [MockFunction],
Expand Down Expand Up @@ -273,6 +274,7 @@ exports[`Panel Grid Component renders panel grid component with empty visualizat
"setAppTitle": [MockFunction],
"setBadge": [MockFunction],
"setBreadcrumbs": [MockFunction],
"setBreadcrumbsEnricher": [MockFunction],
"setCustomNavLink": [MockFunction],
"setHelpExtension": [MockFunction],
"setHelpSupportUrl": [MockFunction],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ exports[`Metrics Grid Component renders Metrics Grid Component 1`] = `
"getApplicationClasses$": [MockFunction],
"getBadge$": [MockFunction],
"getBreadcrumbs$": [MockFunction],
"getBreadcrumbsEnricher$": [MockFunction],
"getCustomNavLink$": [MockFunction],
"getHeaderComponent": [MockFunction],
"getHelpExtension$": [MockFunction],
Expand Down Expand Up @@ -126,6 +127,7 @@ exports[`Metrics Grid Component renders Metrics Grid Component 1`] = `
"setAppTitle": [MockFunction],
"setBadge": [MockFunction],
"setBreadcrumbs": [MockFunction],
"setBreadcrumbsEnricher": [MockFunction],
"setCustomNavLink": [MockFunction],
"setHelpExtension": [MockFunction],
"setHelpSupportUrl": [MockFunction],
Expand Down Expand Up @@ -193,6 +195,7 @@ exports[`Metrics Grid Component renders Metrics Grid Component 1`] = `
"getApplicationClasses$": [MockFunction],
"getBadge$": [MockFunction],
"getBreadcrumbs$": [MockFunction],
"getBreadcrumbsEnricher$": [MockFunction],
"getCustomNavLink$": [MockFunction],
"getHeaderComponent": [MockFunction],
"getHelpExtension$": [MockFunction],
Expand Down Expand Up @@ -296,6 +299,7 @@ exports[`Metrics Grid Component renders Metrics Grid Component 1`] = `
"setAppTitle": [MockFunction],
"setBadge": [MockFunction],
"setBreadcrumbs": [MockFunction],
"setBreadcrumbsEnricher": [MockFunction],
"setCustomNavLink": [MockFunction],
"setHelpExtension": [MockFunction],
"setHelpSupportUrl": [MockFunction],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@ exports[`<Notebook /> spec Renders the empty component 1`] = `
>
sample-notebook-1
</h1>
<div
class="euiSpacer euiSpacer--l"
/>
<div
class="euiSpacer euiSpacer--m"
/>
Expand Down Expand Up @@ -386,7 +389,7 @@ exports[`<Notebook /> spec Renders the visualization component 1`] = `
>
<button
class="euiButton euiButton--primary"
data-test-subj="upgrade-notebook"
data-test-subj="upgrade-notebook-callout"
type="button"
>
<span
Expand Down Expand Up @@ -428,17 +431,49 @@ exports[`<Notebook /> spec Renders the visualization component 1`] = `
data-test-subj="notebookTitle"
/>
<div
class="euiCallOut euiCallOut--primary"
class="euiSpacer euiSpacer--l"
/>
<div
class="euiFlexGroup euiFlexGroup--gutterLarge euiFlexGroup--directionRow euiFlexGroup--responsive"
>
<div
class="euiText euiText--small"
class="euiFlexItem"
>
<div
class="euiTextColor euiTextColor--default"
class="euiCallOut euiCallOut--primary"
>
Upgrade this notebook to take full advantage of the latest features
<div
class="euiText euiText--small"
>
<div
class="euiTextColor euiTextColor--default"
>
Upgrade this notebook to take full advantage of the latest features
<div
class="euiSpacer euiSpacer--s"
/>
<button
class="euiButton euiButton--primary"
data-test-subj="upgrade-notebook"
type="button"
>
<span
class="euiButtonContent euiButton__content"
>
<span
class="euiButton__text"
>
Upgrade Notebook
</span>
</span>
</button>
</div>
</div>
</div>
</div>
<div
class="euiFlexItem euiFlexItem--flexGrowZero"
/>
</div>
<div
class="euiSpacer euiSpacer--m"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ describe('<Notebook /> spec', () => {
});

act(() => {
fireEvent.click(utils.getByText('Upgrade Notebook'));
fireEvent.click(utils.getByTestId('upgrade-notebook'));
});

act(() => {
Expand Down
21 changes: 17 additions & 4 deletions public/components/notebooks/components/notebook.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1091,7 +1091,7 @@ export class Notebook extends Component<NotebookProps, NotebookState> {
<>
<EuiFlexItem grow={false}>
<EuiButton
data-test-subj="upgrade-notebook"
data-test-subj="upgrade-notebook-callout"
onClick={() => this.showUpgradeModal()}
>
Upgrade Notebook
Expand All @@ -1112,10 +1112,23 @@ export class Notebook extends Component<NotebookProps, NotebookState> {
<EuiTitle size="l" data-test-subj="notebookTitle">
<h1>{this.state.path}</h1>
</EuiTitle>
<EuiSpacer />
{!this.state.savedObjectNotebook && (
<EuiCallOut color="primary" iconType='iInCircle"'>
Upgrade this notebook to take full advantage of the latest features
</EuiCallOut>
<EuiFlexGroup>
<EuiFlexItem>
<EuiCallOut color="primary" iconType='iInCircle"'>
Upgrade this notebook to take full advantage of the latest features
<EuiSpacer size="s" />
<EuiButton
data-test-subj="upgrade-notebook"
onClick={() => this.showUpgradeModal()}
>
Upgrade Notebook
</EuiButton>
</EuiCallOut>
</EuiFlexItem>
<EuiFlexItem grow={false} />
</EuiFlexGroup>
)}
<EuiSpacer size="m" />
<EuiFlexGroup alignItems={'flexStart'} gutterSize={'l'}>
Expand Down
Loading

0 comments on commit 7bfe2e0

Please sign in to comment.