mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[Workplace Search] Redirect to correct route for form created sources (#98215)
* [Workplace Search] Redirect to correct route for form created sources * Remove unnecessary passing of query params This is no longer needed with the new route Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
fec07b766f
commit
f0a3244f54
1 changed files with 13 additions and 8 deletions
|
@ -6,17 +6,17 @@
|
|||
*/
|
||||
|
||||
import React, { useEffect } from 'react';
|
||||
import { useLocation } from 'react-router-dom';
|
||||
|
||||
import { Location } from 'history';
|
||||
|
||||
import { useActions, useValues } from 'kea';
|
||||
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
import { setSuccessMessage } from '../../../../../shared/flash_messages';
|
||||
import { KibanaLogic } from '../../../../../shared/kibana';
|
||||
import { Loading } from '../../../../../shared/loading';
|
||||
import { AppLogic } from '../../../../app_logic';
|
||||
import { CUSTOM_SERVICE_TYPE } from '../../../../constants';
|
||||
import { SOURCE_ADDED_PATH, getSourcesPath } from '../../../../routes';
|
||||
import { SOURCES_PATH, getSourcesPath } from '../../../../routes';
|
||||
import { SourceDataItem } from '../../../../types';
|
||||
import { staticSourceData } from '../../source_data';
|
||||
|
||||
|
@ -34,7 +34,6 @@ import { SaveCustom } from './save_custom';
|
|||
import './add_source.scss';
|
||||
|
||||
export const AddSource: React.FC<AddSourceProps> = (props) => {
|
||||
const { search } = useLocation() as Location;
|
||||
const {
|
||||
initializeAddSource,
|
||||
setAddSourceStep,
|
||||
|
@ -78,6 +77,13 @@ export const AddSource: React.FC<AddSourceProps> = (props) => {
|
|||
const goToSaveConfig = () => setAddSourceStep(AddSourceSteps.SaveConfigStep);
|
||||
const setConfigCompletedStep = () => setAddSourceStep(AddSourceSteps.ConfigCompletedStep);
|
||||
const goToConfigCompleted = () => saveSourceConfig(false, setConfigCompletedStep);
|
||||
const FORM_SOURCE_ADDED_SUCCESS_MESSAGE = i18n.translate(
|
||||
'xpack.enterpriseSearch.workplaceSearch.contentSource.formSourceAddedSuccessMessage',
|
||||
{
|
||||
defaultMessage: '{name} connected',
|
||||
values: { name },
|
||||
}
|
||||
);
|
||||
|
||||
const goToConnectInstance = () => {
|
||||
setAddSourceStep(AddSourceSteps.ConnectInstanceStep);
|
||||
|
@ -88,9 +94,8 @@ export const AddSource: React.FC<AddSourceProps> = (props) => {
|
|||
const goToSaveCustom = () => createContentSource(CUSTOM_SERVICE_TYPE, saveCustomSuccess);
|
||||
|
||||
const goToFormSourceCreated = () => {
|
||||
KibanaLogic.values.navigateToUrl(
|
||||
`${getSourcesPath(SOURCE_ADDED_PATH, isOrganization)}${search}`
|
||||
);
|
||||
KibanaLogic.values.navigateToUrl(`${getSourcesPath(SOURCES_PATH, isOrganization)}`);
|
||||
setSuccessMessage(FORM_SOURCE_ADDED_SUCCESS_MESSAGE);
|
||||
};
|
||||
|
||||
const header = <AddSourceHeader name={name} serviceType={serviceType} categories={categories} />;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue