Skip to content

[ML] Disabling start trial option when license management ui is disabled - #60987

Merged
jgowdyelastic merged 3 commits into
elastic:masterfrom
jgowdyelastic:disabling-start-trial-option-when-license-management-ui-is-disabled
Mar 25, 2020
Merged

jgowdyelastic merged 3 commits into
elastic:masterfrom
jgowdyelastic:disabling-start-trial-option-when-license-management-ui-is-disabled

Conversation

@jgowdyelastic

Copy link
Copy Markdown
Member

If the license management plugin is disabled, we should not show the option to navigate to the license management page to start a trial.

Setup contract was needed in the license management plugin.

Fixes #58207

@jgowdyelastic jgowdyelastic added review non-issue Indicates to automation that a pull request should not appear in the release notes :ml v8.0.0 release_note:skip Skip the PR/issue when compiling release notes v7.7.0 labels Mar 23, 2020
@jgowdyelastic
jgowdyelastic requested a review from a team as a code owner March 23, 2020 20:38
@jgowdyelastic jgowdyelastic self-assigned this Mar 23, 2020
@elasticmachine

Copy link
Copy Markdown
Contributor

Pinging @elastic/ml-ui (:ml)

@peteharverson peteharverson left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@peteharverson peteharverson added release_note:fix and removed non-issue Indicates to automation that a pull request should not appear in the release notes release_note:skip Skip the PR/issue when compiling release notes labels Mar 24, 2020

@loixlab loixlab left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good to me, left a few comments about code preferences and one about declaring the plugin dependency as optional and thus we need to check its existence before reading its config.

stop() {}
}

export type LicenseManagementUIPluginSetup = ReturnType<LicenseManagementUIPlugin['setup']>;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer to declare explicitly the setup interface above the class.
It makes it easier to scan IMO

export interface LicenseManagementUIPluginSetup {
  enabled: boolean;
}

export class LicenseManagementUIPlugin ...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes in 73e832b

*/
import { PluginInitializerContext } from 'src/core/public';

export { LicenseManagementUIPluginSetup, LicenseManagementUIPluginStart } from './plugin';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mind putting the exports below the imports ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes in 73e832b

interface StartPlugins {
data: DataPublicPluginStart;
security: SecurityPluginSetup;
licenseManagement: LicenseManagementUIPluginSetup;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As it is optional we need to add the ?

licenseManagement?: LicenseManagementUIPluginSetup;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes in 73e832b

} = useMlKibana();

const startTrialVisible = isFullLicense() === false;
const startTrialVisible = licenseManagement.enabled === true && isFullLicense() === false;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As the licenseManagement plugin is optional, you first need to check for the plugin existence.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes in 73e832b

Comment thread x-pack/plugins/ml/public/plugin.ts Outdated
licensing: LicensingPluginSetup;
management: ManagementSetup;
usageCollection: UsageCollectionSetup;
licenseManagement: LicenseManagementUIPluginSetup;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here the same

licenseManagement?: LicenseManagementUIPluginSetup;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes in 73e832b

@kibanamachine

Copy link
Copy Markdown
Contributor

💚 Build Succeeded

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@walterra walterra left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@loixlab
loixlab self-requested a review March 25, 2020 10:28

@loixlab loixlab left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for making the changes.

Just a note, there are other plugins declared as optional in the kibana.json but are not declared with the ? in the interface (like the "security" plugin). Probably worth a look to check if some code might break if those plugins are disabled.

@jgowdyelastic
jgowdyelastic merged commit 2ae1235 into elastic:master Mar 25, 2020
@jgowdyelastic
jgowdyelastic deleted the disabling-start-trial-option-when-license-management-ui-is-disabled branch March 25, 2020 10:39
jgowdyelastic added a commit to jgowdyelastic/kibana that referenced this pull request Mar 25, 2020
…led (elastic#60987)

* [ML] Disabling start trial option when license management ui is disabled

* tiny refactor

* changes based on review
jgowdyelastic added a commit that referenced this pull request Mar 25, 2020
…led (#60987) (#61237)

* [ML] Disabling start trial option when license management ui is disabled

* tiny refactor

* changes based on review
jgowdyelastic added a commit to jgowdyelastic/kibana that referenced this pull request Mar 25, 2020
…led (elastic#60987)

* [ML] Disabling start trial option when license management ui is disabled

* tiny refactor

* changes based on review
jgowdyelastic added a commit that referenced this pull request Mar 25, 2020
…led (#60987) (#61309)

* [ML] Disabling start trial option when license management ui is disabled

* tiny refactor

* changes based on review
patrykkopycinski pushed a commit to patrykkopycinski/kibana that referenced this pull request May 6, 2026
…led (elastic#60987)

* [ML] Disabling start trial option when license management ui is disabled

* tiny refactor

* changes based on review
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ML] Enabling a trial license should not be proposed in the ML Data Visualizer page if license management is disabled

6 participants