Skip to content

Commit

Permalink
[7.x] Cleanup OSS code from visualizations wizard (#89092) (#89409)
Browse files Browse the repository at this point in the history
* Cleanup OSS code from visualizations wizard (#89092)

* Cleanup OSS code from visualizations wizard

* Remove unecessary translations

* Remove unused translation

* Fix functional test

* Disable the functional test for OSS

* Remove from oss correctly :D

* Fix ci
# Conflicts:
#	.github/CODEOWNERS
#	docs/developer/plugin-list.asciidoc
#	packages/kbn-optimizer/limits.yml

* fix plugin list docs

* Change plugins docs list
  • Loading branch information
stratoula authored Jan 27, 2021
1 parent 198ca1b commit ddc2058
Show file tree
Hide file tree
Showing 40 changed files with 11 additions and 569 deletions.
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 @@ -128,11 +128,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[management]
|WARNING: Missing README.
Expand All @@ -141,11 +136,6 @@ It is registered as disabled. The x-pack plugin should unregister this.
|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
4 changes: 1 addition & 3 deletions packages/kbn-optimizer/limits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,14 @@ pageLoadAssetSize:
kibanaReact: 162353
kibanaUtils: 198829
lens: 96624
licenseManagement: 41961
lensOss: 19341
licenseManagement: 41817
licensing: 39008
lists: 202261
logstash: 53548
management: 46112
maps: 183754
mapsLegacy: 116961
mapsLegacyLicensing: 20214
mapsOss: 19284
ml: 82187
monitoring: 50000
navigation: 37413
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.

20 changes: 0 additions & 20 deletions src/plugins/lens_oss/tsconfig.json

This file was deleted.

6 changes: 0 additions & 6 deletions src/plugins/maps_oss/README.md

This file was deleted.

Loading

0 comments on commit ddc2058

Please sign in to comment.