* Remove lab stage for visualizations * Fix typo Co-Authored-By: timroes <mail@timroes.de> * Remove dead code
This commit is contained in:
parent
63e021a437
commit
5d73ffadd5
|
@ -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.
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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'));
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@ module.controller('VisualizeWizardStep1', function ($scope, $route, kbnUrl, Priv
|
|||
return;
|
||||
}
|
||||
|
||||
if (!isLabsEnabled && visType.stage === 'lab') {
|
||||
if (!isLabsEnabled && visType.stage === 'experimental') {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -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}`;
|
||||
|
|
|
@ -217,9 +217,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': {
|
||||
|
|
|
@ -65,7 +65,7 @@ VisTypesRegistryProvider.register((Private) => {
|
|||
showQueryBar: true,
|
||||
showFilterBar: true,
|
||||
},
|
||||
stage: 'lab',
|
||||
stage: 'experimental',
|
||||
feedbackMessage: defaultFeedbackMessage,
|
||||
});
|
||||
});
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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';
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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();
|
||||
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();
|
||||
|
|
|
@ -194,10 +194,6 @@ export function VisualizePageProvider({ getService, getPageObjects }) {
|
|||
}
|
||||
}
|
||||
|
||||
async getLabTypeLinks() {
|
||||
return await remote.findAllByPartialLinkText('(Lab)');
|
||||
}
|
||||
|
||||
async getExperimentalTypeLinks() {
|
||||
return await remote.findAllByPartialLinkText('(Experimental)');
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue