mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[ML] Changes for optional spaces plugin (#151170)
Changes to ensure ML behaves correctly when the spaces plugin is disabled. Related to https://github.com/elastic/kibana/issues/149687 Closes https://github.com/elastic/kibana/issues/149953 ML was in pretty good shape for this change as we already assumed spaces could be optional. The only change needed is to ensure the saved object sync button is enabled on the management page even when spaces is missing. Previously we incorrectly hid this button.
This commit is contained in:
parent
41afa5c9c4
commit
31c73b9719
4 changed files with 15 additions and 18 deletions
|
@ -19,7 +19,7 @@ import { useMlApiContext } from '../../contexts/kibana';
|
|||
import { useToastNotificationService } from '../../services/toast_notification_service';
|
||||
|
||||
interface Props {
|
||||
spacesApi: SpacesPluginStart;
|
||||
spacesApi: SpacesPluginStart; // this component is only ever used when spaces is enabled
|
||||
spaceIds: string[];
|
||||
id: string;
|
||||
mlSavedObjectType: MlSavedObjectType;
|
||||
|
|
|
@ -40,7 +40,7 @@ interface StartPlugins {
|
|||
usageCollection?: UsageCollectionSetup;
|
||||
fieldFormats: FieldFormatsRegistry;
|
||||
dashboard: DashboardSetup;
|
||||
spacesApi: SpacesPluginStart;
|
||||
spacesApi?: SpacesPluginStart;
|
||||
charts: ChartsPluginStart;
|
||||
cases?: CasesUiStart;
|
||||
unifiedSearch: UnifiedSearchPublicPluginStart;
|
||||
|
|
|
@ -62,7 +62,6 @@ export const JobsListPage: FC<{
|
|||
() => mlApiServicesProvider(new HttpService(coreStart.http)),
|
||||
[coreStart.http]
|
||||
);
|
||||
const spacesEnabled = spacesApi !== undefined;
|
||||
const [initialized, setInitialized] = useState(false);
|
||||
const [accessDenied, setAccessDenied] = useState(false);
|
||||
const [isPlatinumOrTrialLicense, setIsPlatinumOrTrialLicense] = useState(true);
|
||||
|
@ -153,20 +152,18 @@ export const JobsListPage: FC<{
|
|||
>
|
||||
<EuiFlexGroup>
|
||||
<EuiFlexItem grow={false}>
|
||||
{spacesEnabled && (
|
||||
<>
|
||||
<EuiButtonEmpty
|
||||
onClick={() => setShowSyncFlyout(true)}
|
||||
data-test-subj="mlStackMgmtSyncButton"
|
||||
>
|
||||
{i18n.translate('xpack.ml.management.jobsList.syncFlyoutButton', {
|
||||
defaultMessage: 'Synchronize saved objects',
|
||||
})}
|
||||
</EuiButtonEmpty>
|
||||
{showSyncFlyout && <JobSpacesSyncFlyout onClose={onCloseSyncFlyout} />}
|
||||
<EuiSpacer size="s" />
|
||||
</>
|
||||
)}
|
||||
<>
|
||||
<EuiButtonEmpty
|
||||
onClick={() => setShowSyncFlyout(true)}
|
||||
data-test-subj="mlStackMgmtSyncButton"
|
||||
>
|
||||
{i18n.translate('xpack.ml.management.jobsList.syncFlyoutButton', {
|
||||
defaultMessage: 'Synchronize saved objects',
|
||||
})}
|
||||
</EuiButtonEmpty>
|
||||
{showSyncFlyout && <JobSpacesSyncFlyout onClose={onCloseSyncFlyout} />}
|
||||
<EuiSpacer size="s" />
|
||||
</>
|
||||
</EuiFlexItem>
|
||||
<EuiFlexItem grow={false}>
|
||||
<ExportJobsFlyout
|
||||
|
|
|
@ -32,7 +32,7 @@ import { getFilters } from './filters';
|
|||
import { useTableState } from './use_table_state';
|
||||
|
||||
interface Props {
|
||||
spacesApi: SpacesPluginStart | undefined;
|
||||
spacesApi?: SpacesPluginStart;
|
||||
setCurrentTab: (tabId: MlSavedObjectType) => void;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue