Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup OSS code from visualizations wizard #89092

Merged
merged 10 commits into from
Jan 27, 2021
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
/src/plugins/advanced_settings/ @elastic/kibana-app
/src/plugins/charts/ @elastic/kibana-app
/src/plugins/discover/ @elastic/kibana-app
/src/plugins/lens_oss/ @elastic/kibana-app
/src/plugins/management/ @elastic/kibana-app
/src/plugins/kibana_legacy/ @elastic/kibana-app
/src/plugins/timelion/ @elastic/kibana-app
Expand Down Expand Up @@ -127,7 +126,6 @@
/x-pack/test/functional/es_archives/maps/ @elastic/kibana-gis
/x-pack/test/visual_regression/tests/maps/index.js @elastic/kibana-gis
#CC# /src/plugins/maps_legacy/ @elastic/kibana-gis
#CC# /src/plugins/maps_oss/ @elastic/kibana-gis
#CC# /x-pack/plugins/file_upload @elastic/kibana-gis
#CC# /x-pack/plugins/maps_legacy_licensing @elastic/kibana-gis
/src/plugins/tile_map/ @elastic/kibana-gis
Expand Down
2 changes: 0 additions & 2 deletions .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@
"visTypeVislib": "src/plugins/vis_type_vislib",
"visTypeXy": "src/plugins/vis_type_xy",
"visualizations": "src/plugins/visualizations",
"lensOss": "src/plugins/lens_oss",
"mapsOss": "src/plugins/maps_oss",
"visualize": "src/plugins/visualize",
"apmOss": "src/plugins/apm_oss",
"usageCollection": "src/plugins/usage_collection"
Expand Down
10 changes: 0 additions & 10 deletions docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,6 @@ in Kibana, e.g. visualizations. It has the form of a flyout panel.
|The legacyExport plugin adds support for the legacy saved objects export format.


|{kib-repo}blob/{branch}/src/plugins/lens_oss/README.md[lensOss]
|The lens_oss plugin registers the lens visualization on OSS.
It is registered as disabled. The x-pack plugin should unregister this.


|{kib-repo}blob/{branch}/src/plugins/management/README.md[management]
|This plugins contains the "Stack Management" page framework. It offers navigation and an API
to link individual managment section into it. This plugin does not contain any individual
Expand All @@ -145,11 +140,6 @@ management section itself.
|Internal objects used by the Coordinate, Region, and Vega visualizations.


|{kib-repo}blob/{branch}/src/plugins/maps_oss/README.md[mapsOss]
|The maps_oss plugin registers the maps visualization on OSS.
It is registered as disabled. The x-pack plugin should unregister this.


|{kib-repo}blob/{branch}/src/plugins/navigation/README.md[navigation]
|The navigation plugins exports the TopNavMenu component.
It also provides a stateful version of it on the start contract.
Expand Down
85 changes: 1 addition & 84 deletions packages/kbn-config/src/deprecation/deprecation_factory.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import { ConfigDeprecationLogger } from './types';
import { configDeprecationFactory, copyFromRoot } from './deprecation_factory';
import { configDeprecationFactory } from './deprecation_factory';

describe('DeprecationFactory', () => {
const { rename, unused, renameFromRoot, unusedFromRoot } = configDeprecationFactory;
Expand Down Expand Up @@ -239,89 +239,6 @@ describe('DeprecationFactory', () => {
});
});

describe('copyFromRoot', () => {
it('copies a property to a different namespace', () => {
const rawConfig = {
originplugin: {
deprecated: 'toberenamed',
valid: 'valid',
},
destinationplugin: {
property: 'value',
},
};
const processed = copyFromRoot('originplugin.deprecated', 'destinationplugin.renamed')(
rawConfig,
'does-not-matter',
logger
);
expect(processed).toEqual({
originplugin: {
deprecated: 'toberenamed',
valid: 'valid',
},
destinationplugin: {
renamed: 'toberenamed',
property: 'value',
},
});
expect(deprecationMessages.length).toEqual(0);
});

it('does not alter config if origin property is not present', () => {
const rawConfig = {
myplugin: {
new: 'new',
valid: 'valid',
},
someOtherPlugin: {
property: 'value',
},
};
const processed = copyFromRoot('myplugin.deprecated', 'myplugin.new')(
rawConfig,
'does-not-matter',
logger
);
expect(processed).toEqual({
myplugin: {
new: 'new',
valid: 'valid',
},
someOtherPlugin: {
property: 'value',
},
});
expect(deprecationMessages.length).toEqual(0);
});

it('does not alter config if they both exist', () => {
const rawConfig = {
myplugin: {
deprecated: 'deprecated',
renamed: 'renamed',
},
someOtherPlugin: {
property: 'value',
},
};
const processed = copyFromRoot('myplugin.deprecated', 'someOtherPlugin.property')(
rawConfig,
'does-not-matter',
logger
);
expect(processed).toEqual({
myplugin: {
deprecated: 'deprecated',
renamed: 'renamed',
},
someOtherPlugin: {
property: 'value',
},
});
});
});

describe('unused', () => {
it('removes the unused property from the config and logs a warning is present', () => {
const rawConfig = {
Expand Down
26 changes: 0 additions & 26 deletions packages/kbn-config/src/deprecation/deprecation_factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,26 +45,6 @@ const _rename = (
return config;
};

const _copy = (
config: Record<string, any>,
rootPath: string,
originKey: string,
destinationKey: string
) => {
const originPath = getPath(rootPath, originKey);
const originValue = get(config, originPath);
if (originValue === undefined) {
return config;
}

const destinationPath = getPath(rootPath, destinationKey);
const destinationValue = get(config, destinationPath);
if (destinationValue === undefined) {
set(config, destinationPath, originValue);
}
return config;
};

const _unused = (
config: Record<string, any>,
rootPath: string,
Expand All @@ -89,12 +69,6 @@ const renameFromRoot = (oldKey: string, newKey: string, silent?: boolean): Confi
log
) => _rename(config, '', log, oldKey, newKey, silent);

export const copyFromRoot = (originKey: string, destinationKey: string): ConfigDeprecation => (
config,
rootPath,
log
) => _copy(config, '', originKey, destinationKey);

const unused = (unusedKey: string): ConfigDeprecation => (config, rootPath, log) =>
_unused(config, rootPath, log, unusedKey);

Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-config/src/deprecation/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ export {
ConfigDeprecationFactory,
ConfigDeprecationProvider,
} from './types';
export { configDeprecationFactory, copyFromRoot } from './deprecation_factory';
export { configDeprecationFactory } from './deprecation_factory';
export { applyDeprecations } from './apply_deprecations';
1 change: 0 additions & 1 deletion packages/kbn-config/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export {
ConfigDeprecationLogger,
ConfigDeprecationProvider,
ConfigDeprecationWithContext,
copyFromRoot,
} from './deprecation';

export { RawConfigurationProvider, RawConfigService, getConfigFromFiles } from './raw';
Expand Down
2 changes: 0 additions & 2 deletions packages/kbn-optimizer/limits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ pageLoadAssetSize:
kibanaReact: 161921
kibanaUtils: 198829
lens: 96624
lensOss: 19341
licenseManagement: 41817
licensing: 39008
lists: 202261
Expand All @@ -54,7 +53,6 @@ pageLoadAssetSize:
maps: 183610
mapsLegacy: 116817
mapsLegacyLicensing: 20214
mapsOss: 19284
ml: 82187
monitoring: 50000
navigation: 37269
Expand Down
6 changes: 0 additions & 6 deletions src/plugins/lens_oss/README.md

This file was deleted.

12 changes: 0 additions & 12 deletions src/plugins/lens_oss/common/constants.ts

This file was deleted.

9 changes: 0 additions & 9 deletions src/plugins/lens_oss/common/index.ts

This file was deleted.

15 changes: 0 additions & 15 deletions src/plugins/lens_oss/config.ts

This file was deleted.

10 changes: 0 additions & 10 deletions src/plugins/lens_oss/kibana.json

This file was deleted.

11 changes: 0 additions & 11 deletions src/plugins/lens_oss/public/index.ts

This file was deleted.

32 changes: 0 additions & 32 deletions src/plugins/lens_oss/public/plugin.ts

This file was deleted.

37 changes: 0 additions & 37 deletions src/plugins/lens_oss/public/vis_type_alias.ts

This file was deleted.

21 changes: 0 additions & 21 deletions src/plugins/lens_oss/server/index.ts

This file was deleted.

Loading