Skip to content

Commit

Permalink
Rename config name
Browse files Browse the repository at this point in the history
  • Loading branch information
ElenaStoeva committed Apr 29, 2024
1 parent 06d98ba commit 813297e
Show file tree
Hide file tree
Showing 12 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion config/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ xpack.index_management.editableIndexSettings: limited
# Disable Storage size column in the Data streams table from Index Management UI
xpack.index_management.enableDataStreamsStorageColumn: false
# Disable _source field in the Mappings editor's advanced options form from Index Management UI
xpack.index_management.enableMappingsSourceField: false
xpack.index_management.enableMappingsSourceFieldSection: false

# Keep deeplinks visible so that they are shown in the sidenav
dev_tools.deeplinks.navLinkStatus: visible
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ export default function ({ getService }: PluginFunctionalProviderContext) {
'xpack.index_management.enableIndexStats (any)',
'xpack.index_management.editableIndexSettings (any)',
'xpack.index_management.enableDataStreamsStorageColumn (any)',
'xpack.index_management.enableMappingsSourceField (any)',
'xpack.index_management.enableMappingsSourceFieldSection (any)',
'xpack.license_management.ui.enabled (boolean)',
'xpack.maps.preserveDrawingBuffer (boolean)',
'xpack.maps.showMapsInspectorAdapter (boolean)',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const appDependencies = {
enableIndexStats: true,
editableIndexSettings: 'all',
enableDataStreamsStorageColumn: true,
enableMappingsSourceField: true,
enableMappingsSourceFieldSection: true,
},
} as any;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export interface AppDependencies {
enableIndexStats: boolean;
editableIndexSettings: 'all' | 'limited';
enableDataStreamsStorageColumn: boolean;
enableMappingsSourceField: boolean;
enableMappingsSourceFieldSection: boolean;
};
history: ScopedHistory;
setBreadcrumbs: (type: IndexManagementBreadcrumb, additionalBreadcrumb?: EuiBreadcrumb) => void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ describe('Mappings editor: configuration form', () => {
it('renders the form', async () => {
const ctx = {
config: {
enableMappingsSourceField: true,
enableMappingsSourceFieldSection: true,
},
} as unknown as AppDependencies;

Expand All @@ -70,7 +70,7 @@ describe('Mappings editor: configuration form', () => {
it('renders the _source field when it is enabled', async () => {
const ctx = {
config: {
enableMappingsSourceField: true,
enableMappingsSourceFieldSection: true,
},
} as unknown as AppDependencies;

Expand All @@ -86,7 +86,7 @@ describe('Mappings editor: configuration form', () => {
it("doesn't render the _source field when it is disabled", async () => {
const ctx = {
config: {
enableMappingsSourceField: false,
enableMappingsSourceFieldSection: false,
},
} as unknown as AppDependencies;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ describe('Mappings editor: core', () => {

const ctx = {
config: {
enableMappingsSourceField: true,
enableMappingsSourceFieldSection: true,
},
};

Expand Down Expand Up @@ -293,7 +293,7 @@ describe('Mappings editor: core', () => {

const ctx = {
config: {
enableMappingsSourceField: true,
enableMappingsSourceFieldSection: true,
},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const formDeserializer = (formData: GenericObject) => {

export const ConfigurationForm = React.memo(({ value, esNodesPlugins }: Props) => {
const {
config: { enableMappingsSourceField },
config: { enableMappingsSourceFieldSection },
} = useAppContext();

const isMounted = useRef(false);
Expand Down Expand Up @@ -164,7 +164,7 @@ export const ConfigurationForm = React.memo(({ value, esNodesPlugins }: Props) =
<EuiSpacer size="xl" />
<MetaFieldSection />
<EuiSpacer size="xl" />
{enableMappingsSourceField && (
{enableMappingsSourceFieldSection && (
<>
<SourceFieldSection /> <EuiSpacer size="xl" />
</>
Expand Down
6 changes: 3 additions & 3 deletions x-pack/plugins/index_management/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class IndexMgmtUIPlugin
editableIndexSettings: 'all' | 'limited';
enableDataStreamsStorageColumn: boolean;
isIndexManagementUiEnabled: boolean;
enableMappingsSourceField: boolean;
enableMappingsSourceFieldSection: boolean;
};

constructor(ctx: PluginInitializerContext) {
Expand All @@ -59,7 +59,7 @@ export class IndexMgmtUIPlugin
enableIndexStats,
editableIndexSettings,
enableDataStreamsStorageColumn,
enableMappingsSourceField,
enableMappingsSourceFieldSection,
} = ctx.config.get<ClientConfigType>();
this.config = {
isIndexManagementUiEnabled,
Expand All @@ -68,7 +68,7 @@ export class IndexMgmtUIPlugin
enableIndexStats: enableIndexStats ?? true,
editableIndexSettings: editableIndexSettings ?? 'all',
enableDataStreamsStorageColumn: enableDataStreamsStorageColumn ?? true,
enableMappingsSourceField: enableMappingsSourceField ?? true,
enableMappingsSourceFieldSection: enableMappingsSourceFieldSection ?? true,
};
}

Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/index_management/public/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ export interface ClientConfigType {
enableIndexStats?: boolean;
editableIndexSettings?: 'all' | 'limited';
enableDataStreamsStorageColumn?: boolean;
enableMappingsSourceField?: boolean;
enableMappingsSourceFieldSection?: boolean;
}
4 changes: 2 additions & 2 deletions x-pack/plugins/index_management/server/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const schemaLatest = schema.object(
// We take this approach in order to have a central place (serverless.yml) for serverless config across Kibana
serverless: schema.boolean({ defaultValue: true }),
}),
enableMappingsSourceField: offeringBasedSchema({
enableMappingsSourceFieldSection: offeringBasedSchema({
// The _source field in the Mappings editor's advanced options form is disabled in serverless; refer to the serverless.yml file as the source of truth
// We take this approach in order to have a central place (serverless.yml) for serverless config across Kibana
serverless: schema.boolean({ defaultValue: true }),
Expand All @@ -69,7 +69,7 @@ const configLatest: PluginConfigDescriptor<IndexManagementConfig> = {
enableIndexStats: true,
editableIndexSettings: true,
enableDataStreamsStorageColumn: true,
enableMappingsSourceField: true,
enableMappingsSourceFieldSection: true,
},
schema: schemaLatest,
deprecations: ({ unused }) => [unused('dev.enableIndexDetailsPage', { level: 'warning' })],
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/index_management/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export class IndexMgmtServerPlugin implements Plugin<IndexManagementPluginSetup,
isLegacyTemplatesEnabled: this.config.enableLegacyTemplates,
isIndexStatsEnabled: this.config.enableIndexStats,
isDataStreamsStorageColumnEnabled: this.config.enableDataStreamsStorageColumn,
enableMappingsSourceField: this.config.enableMappingsSourceField,
enableMappingsSourceFieldSection: this.config.enableMappingsSourceFieldSection,
},
indexDataEnricher: this.indexDataEnricher,
lib: {
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/index_management/server/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export interface RouteDependencies {
isLegacyTemplatesEnabled: boolean;
isIndexStatsEnabled: boolean;
isDataStreamsStorageColumnEnabled: boolean;
enableMappingsSourceField: boolean;
enableMappingsSourceFieldSection: boolean;
};
indexDataEnricher: IndexDataEnricher;
lib: {
Expand Down

0 comments on commit 813297e

Please sign in to comment.