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

Remove lab stage for visualizations #25702

Merged
merged 4 commits into from
Nov 19, 2018
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ The list of common parameters:
- *options.showQueryBar*: <bool> show or hide query bar (defaults to true)
- *options.showFilterBar*: <bool> show or hide filter bar (defaults to true)
- *options.showIndexSelection*: <bool> show or hide index selection (defaults to true)
- *stage*: <string> Set this to "experimental" or "labs" to mark your visualization as experimental.
Labs visualizations can also be disabled from the advanced settings. (defaults to "production")
- *stage*: <string> Set this to "experimental" to mark your visualization as experimental.
Experimental visualizations can also be disabled from the advanced settings. (defaults to "production")
- *feedbackMessage*: <string> You can provide a message (which can contain HTML), that will be appended
to the experimental notification in visualize, if your visualization is experimental or in lab mode.

Expand Down
2 changes: 1 addition & 1 deletion src/core_plugins/input_control_vis/public/register_vis.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function InputControlVisProvider(Private) {
defaultMessage: 'Create interactive controls for easy dashboard manipulation.'
}),
category: CATEGORY.OTHER,
stage: 'lab',
stage: 'experimental',
requiresUpdateStatus: [Status.PARAMS, Status.TIME],
feedbackMessage: defaultFeedbackMessage,
visualization: VisController,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export class VisualizeEmbeddableFactory extends EmbeddableFactory {
.then(([loader, savedObject]) => {
const isLabsEnabled = this._config.get('visualize:enableLabs');

if (!isLabsEnabled && savedObject.vis.type.stage === 'lab') {
if (!isLabsEnabled && savedObject.vis.type.stage === 'experimental') {
return new Embeddable({
metadata: {
title: savedObject.title,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export function VisualizeListingController($injector) {
this.totalItems = result.total;
this.showLimitError = result.total > config.get('savedObjects:listingLimit');
this.listingLimit = config.get('savedObjects:listingLimit');
return result.hits.filter(result => (isLabsEnabled || result.type.stage !== 'lab'));
return result.hits.filter(result => (isLabsEnabled || result.type.stage !== 'experimental'));
});
};

Expand Down
6 changes: 2 additions & 4 deletions src/core_plugins/kibana/public/visualize/wizard/wizard.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ module.controller('VisualizeWizardStep1', function ($scope, $route, kbnUrl, Priv
return;
}

if (!isLabsEnabled && visType.stage === 'lab') {
if (!isLabsEnabled && visType.stage === 'experimental') {
return;
}

Expand Down Expand Up @@ -158,9 +158,7 @@ module.controller('VisualizeWizardStep1', function ($scope, $route, kbnUrl, Priv
//to not clutter the tooltip, just only notify if labs or experimental.
//labs is more important in this regard.
let prefix = '';
if (type.stage === 'lab') {
prefix = '(Lab)';
} else if (type.stage === 'experimental') {
if (type.stage === 'experimental') {
prefix = '(Experimental)';
}
return `${prefix} ${type.description}`;
Copy link
Member

Choose a reason for hiding this comment

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

This will always have an empty space if there is no prefix.
What about writing something like this:

if(type.stage === 'experimental'){
  return `(Experimental) ${type.description}`;
} else {
  return type.description;
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will ignore your comment for now, since all of that code is already removed in #23833 :-)

Expand Down
5 changes: 3 additions & 2 deletions src/core_plugins/kibana/ui_setting_defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,10 @@ export function getUiSettingDefaults() {
description: `Never show more than this many bars in date histograms, scale values if needed`,
},
'visualize:enableLabs': {
name: 'Enable labs',
name: 'Enable experimental visualizations',
value: true,
description: `Enable lab visualizations in Visualize.`,
description: `Allows users to create, view, and edit experimental visualizations. If disabled,
only visualizations that are considered production-ready are available to the user.`,
category: ['visualization'],
},
'visualization:tileMap:maxPrecision': {
Expand Down
2 changes: 1 addition & 1 deletion src/core_plugins/vega/public/vega_type.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ VisTypesRegistryProvider.register((Private) => {
showQueryBar: true,
showFilterBar: true,
},
stage: 'lab',
stage: 'experimental',
feedbackMessage: defaultFeedbackMessage,
});
});
2 changes: 1 addition & 1 deletion src/ui/public/directives/saved_object_finder.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ module.directive('savedObjectFinder', function ($location, $injector, kbnUrl, Pr
self.service.find(filter)
.then(function (hits) {

hits.hits = hits.hits.filter((hit) => (isLabsEnabled || _.get(hit, 'type.stage') !== 'lab'));
hits.hits = hits.hits.filter((hit) => (isLabsEnabled || _.get(hit, 'type.stage') !== 'experimental'));
hits.total = hits.hits.length;

// ensure that we don't display old results
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export class SavedObjectFinder extends React.Component {
resp.savedObjects = resp.savedObjects.filter(savedObject => {
const typeName = JSON.parse(savedObject.attributes.visState).type;
const visType = this.props.visTypes.byName[typeName];
return visType.stage !== 'lab';
return visType.stage !== 'experimental';
});
}

Expand Down
4 changes: 1 addition & 3 deletions src/ui/public/vis/vis_types/base_vis_type.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,7 @@ export function BaseVisTypeProvider(Private) {
}

shouldMarkAsExperimentalInUI() {
//we are not making a distinction in the UI if a plugin is experimental and/or labs.
//we just want to indicate it is special. the current flask icon is sufficient for that.
return this.stage === 'experimental' || this.stage === 'lab';
return this.stage === 'experimental';
}

get schemas() {
Expand Down
17 changes: 0 additions & 17 deletions test/functional/apps/visualize/_experimental_vis.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,23 +50,6 @@ export default ({ getService, getPageObjects }) => {
expect(await info.getVisibleText()).to.contain('experimental');
});

it('should show an notification when creating lab visualizations', async () => {
// Try to find a lab visualization.
const labTypes = await PageObjects.visualize.getLabTypeLinks();

This comment was marked as resolved.

if (labTypes.length === 0) {
log.info('No lab visualization found. Skipping this test.');
return;
}

// Create a new visualization
await labTypes[0].click();
// Select a index-pattern/search if this vis requires it
await PageObjects.visualize.selectVisSourceIfRequired();
// Check that the experimental banner is there and state that this is experimental
const info = await PageObjects.visualize.getExperimentalInfo();
expect(await info.getVisibleText()).to.contain('experimental');
});

it('should not show that notification for stable visualizations', async () => {
await PageObjects.visualize.clickAreaChart();
await PageObjects.visualize.clickNewSearch();
Expand Down
4 changes: 0 additions & 4 deletions test/functional/page_objects/visualize_page.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,6 @@ export function VisualizePageProvider({ getService, getPageObjects }) {
}
}

async getLabTypeLinks() {
return await remote.findAllByPartialLinkText('(Lab)');
}

async getExperimentalTypeLinks() {
return await remote.findAllByPartialLinkText('(Experimental)');
}
Expand Down