Skip to content

Commit

Permalink
Add redirects from old add data views to integrations app
Browse files Browse the repository at this point in the history
  • Loading branch information
joshdover committed Oct 18, 2021
1 parent 605a703 commit 1667d1c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion src/plugins/home/public/application/components/home_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@ import { getTutorial } from '../load_tutorials';
import { replaceTemplateStrings } from './tutorial/replace_template_strings';
import { getServices } from '../kibana_services';

const REDIRECT_TO_INTEGRATIONS_TAB_IDS = ['all', 'logging', 'metrics', 'security'];

export function HomeApp({ directories, solutions }) {
const {
application,
savedObjectsClient,
getBasePath,
addBasePath,
Expand All @@ -30,10 +33,17 @@ export function HomeApp({ directories, solutions }) {
const isCloudEnabled = environment.cloud;

const renderTutorialDirectory = (props) => {
// Redirect to integrations app unless a specific tab that is still supported was specified.
const tabId = props.match.params.tab;
if (!tabId || REDIRECT_TO_INTEGRATIONS_TAB_IDS.includes(tabId)) {
application.navigateToApp('integrations', { replace: true });
return null;
}

return (
<TutorialDirectory
addBasePath={addBasePath}
openTab={props.match.params.tab}
openTab={tabId}
isCloudEnabled={isCloudEnabled}
/>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class TutorialDirectoryUi extends React.Component {
})),
];

let openTab = ALL_TAB_ID;
let openTab = SAMPLE_DATA_TAB_ID;
if (
props.openTab &&
this.tabs.some((tab) => {
Expand Down

0 comments on commit 1667d1c

Please sign in to comment.