forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate legacy maps licensing (x-pack/tilemap) to NP (elastic#63539)
* Move logic to NP and add basic plugin structure * Remove unused server-side licensing logic and old index * Set license in maps_legacy via new plugin * Change add to set for service settings queryParams function * Fix accidentally changed emsClient method call * Require at least a basic license * Type updates * Remove unneeded legacy license test * Remove unused headers in test
- Loading branch information
Aaron Caldwell
committed
Apr 17, 2020
1 parent
19ed395
commit ae1e9d3
Showing
12 changed files
with
84 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
16 changes: 0 additions & 16 deletions
16
x-pack/legacy/plugins/tilemap/public/vis_type_enhancers/update_tilemap_settings.js
This file was deleted.
Oops, something went wrong.
36 changes: 0 additions & 36 deletions
36
x-pack/legacy/plugins/tilemap/server/lib/__tests__/inspect_settings.js
This file was deleted.
Oops, something went wrong.
32 changes: 0 additions & 32 deletions
32
x-pack/legacy/plugins/tilemap/server/lib/inspect_settings.js
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"id": "mapsLegacyLicensing", | ||
"version": "8.0.0", | ||
"kibanaVersion": "kibana", | ||
"server": false, | ||
"ui": true, | ||
"requiredPlugins": ["licensing", "mapsLegacy"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { MapsLegacyLicensing } from './plugin'; | ||
|
||
export function plugin() { | ||
return new MapsLegacyLicensing(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { CoreSetup, CoreStart, Plugin } from 'kibana/public'; | ||
import { LicensingPluginSetup, ILicense } from '../../licensing/public'; | ||
|
||
/** | ||
* These are the interfaces with your public contracts. You should export these | ||
* for other plugins to use in _their_ `SetupDeps`/`StartDeps` interfaces. | ||
* @public | ||
*/ | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-empty-interface | ||
export interface MapsLegacyLicensingSetupDependencies { | ||
licensing: LicensingPluginSetup; | ||
mapsLegacy: any; | ||
} | ||
// eslint-disable-next-line @typescript-eslint/no-empty-interface | ||
export interface MapsLegacyLicensingStartDependencies {} | ||
|
||
export type MapsLegacyLicensingSetup = ReturnType<MapsLegacyLicensing['setup']>; | ||
export type MapsLegacyLicensingStart = ReturnType<MapsLegacyLicensing['start']>; | ||
|
||
export class MapsLegacyLicensing | ||
implements Plugin<MapsLegacyLicensingSetup, MapsLegacyLicensingStart> { | ||
public setup(core: CoreSetup, plugins: MapsLegacyLicensingSetupDependencies) { | ||
const { | ||
licensing, | ||
mapsLegacy: { serviceSettings }, | ||
} = plugins; | ||
if (licensing) { | ||
licensing.license$.subscribe((license: ILicense) => { | ||
const { uid, isActive } = license; | ||
if (isActive && license.hasAtLeast('basic')) { | ||
serviceSettings.setQueryParams({ license: uid }); | ||
serviceSettings.disableZoomMessage(); | ||
} else { | ||
serviceSettings.setQueryParams({ license: undefined }); | ||
serviceSettings.enableZoomMessage(); | ||
} | ||
}); | ||
} | ||
} | ||
|
||
public start(core: CoreStart, plugins: MapsLegacyLicensingStartDependencies) {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters