Skip to content

Commit

Permalink
Use constant
Browse files Browse the repository at this point in the history
  • Loading branch information
Kerry350 committed Aug 7, 2024
1 parent b1adcd2 commit 6530c50
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import { DeprecationsDetails } from '@kbn/core-deprecations-common';
import { GetDeprecationsContext } from '@kbn/core-deprecations-server';
import { i18n } from '@kbn/i18n';
import { defaultLogViewId } from '../../common/log_views';
import { MIGRATE_LOG_VIEW_SETTINGS_URL } from '../../common/http_api/deprecations';
import { logSourcesKibanaAdvancedSettingRT } from '../../common';
import { LogsSharedPluginStartServicesAccessor } from '../types';
Expand All @@ -29,7 +30,7 @@ export const getLogSourcesSettingDeprecationInfo = async ({
logSourcesService
);

const logView = await logViewsClient.getLogView('default');
const logView = await logViewsClient.getLogView(defaultLogViewId);

if (logView && !logSourcesKibanaAdvancedSettingRT.is(logView.attributes.logIndices)) {
return [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { LogsSharedKibanaLogEntriesAdapter } from './lib/adapters/log_entries/ki
import { LogEntriesService } from './services/log_entries';
import { LogsSharedConfig } from '../common/plugin_config';
import { registerDeprecations } from './deprecations';
import { defaultLogViewId } from '../common/log_views';

export class LogsSharedPlugin
implements
Expand Down Expand Up @@ -59,7 +60,7 @@ export class LogsSharedPlugin
core.savedObjects.registerType(logViewSavedObjectType);
} else {
// Register a static internal view to use as a fallback when the log view SO is not registered
logViews.defineInternalLogView('default', {});
logViews.defineInternalLogView(defaultLogViewId, {});
}

const domainLibs: LogsSharedDomainLibs = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const initMigrateLogViewSettingsRoute = ({
);
const logViewsClient = pluginStart.logViews.getScopedClient(request);

const logView = await logViewsClient.getLogView('default');
const logView = await logViewsClient.getLogView(defaultLogViewId);

if (!logView || logSourcesKibanaAdvancedSettingRT.is(logView.attributes.logIndices)) {
return response.customError({
Expand Down

0 comments on commit 6530c50

Please sign in to comment.