Skip to content

Commit

Permalink
Add message; remove toolbar project; add time to present
Browse files Browse the repository at this point in the history
  • Loading branch information
clintandrewhall committed Apr 26, 2021
1 parent 481a802 commit 4503c52
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ export const stackManagementSchema: MakeSchemaFrom<UsageStats> = {
type: 'text',
_meta: { description: 'Non-default value of setting.' },
},
'labs:presentation:unifiedToolbar': {
'labs:presentation:timeToPresent': {
type: 'boolean',
_meta: { description: 'Non-default value of setting.' },
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,5 +119,5 @@ export interface UsageStats {
'banners:textColor': string;
'banners:backgroundColor': string;
'labs:canvas:enable_ui': boolean;
'labs:presentation:unifiedToolbar': boolean;
'labs:presentation:timeToPresent': boolean;
}
18 changes: 10 additions & 8 deletions src/plugins/presentation_util/common/labs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

import { i18n } from '@kbn/i18n';

export const UNIFIED_TOOLBAR = 'labs:presentation:unifiedToolbar';
export const TIME_TO_PRESENT = 'labs:presentation:timeToPresent';

export const projectIDs = [UNIFIED_TOOLBAR] as const;
export const projectIDs = [TIME_TO_PRESENT] as const;
export const environmentNames = ['kibana', 'browser', 'session'] as const;
export const solutionNames = ['canvas', 'dashboard', 'presentation'] as const;

Expand All @@ -19,17 +19,18 @@ export const solutionNames = ['canvas', 'dashboard', 'presentation'] as const;
* provided to users of our solutions in Kibana.
*/
export const projects: { [ID in ProjectID]: ProjectConfig & { id: ID } } = {
[UNIFIED_TOOLBAR]: {
id: UNIFIED_TOOLBAR,
[TIME_TO_PRESENT]: {
id: TIME_TO_PRESENT,
isActive: false,
isDisplayed: false,
environments: ['kibana', 'browser', 'session'],
name: i18n.translate('presentationUtil.labs.enableUnifiedToolbarProjectName', {
defaultMessage: 'Unified Toolbar',
name: i18n.translate('presentationUtil.labs.enableTimeToPresentProjectName', {
defaultMessage: 'Canvas Presentation UI',
}),
description: i18n.translate('presentationUtil.labs.enableUnifiedToolbarProjectDescription', {
defaultMessage: 'Enable the new unified toolbar design for Presentation solutions',
defaultMessage: 'Enable the new presentation-oriented UI for Canvas.',
}),
solutions: ['dashboard', 'canvas'],
solutions: ['canvas'],
},
};

Expand All @@ -51,6 +52,7 @@ export interface ProjectConfig {
id: ProjectID;
name: string;
isActive: boolean;
isDisplayed: boolean;
environments: EnvironmentName[];
description: string;
solutions: SolutionName[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import React, { ReactNode, useRef, useState, useEffect } from 'react';
import {
EuiFlyout,
EuiTitle,
EuiSpacer,
EuiText,
EuiFlyoutBody,
EuiFlyoutFooter,
EuiFlyoutHeader,
Expand Down Expand Up @@ -124,7 +126,7 @@ export const LabsFlyout = (props: Props) => {
return (
<EuiOverlayMask onClick={() => onClose()} headerZindexLocation="below">
<EuiFlyout onClose={onClose} hideCloseButton={true}>
<EuiFlyoutHeader>
<EuiFlyoutHeader hasBorder>
<EuiTitle size="m">
<h2>
<EuiFlexGroup gutterSize="s" alignItems="center" responsive={false}>
Expand All @@ -135,6 +137,10 @@ export const LabsFlyout = (props: Props) => {
</EuiFlexGroup>
</h2>
</EuiTitle>
<EuiSpacer size="s" />
<EuiText size="s" color="subdued">
<p>{strings.getDescriptionMessage()}</p>
</EuiText>
</EuiFlyoutHeader>
<EuiFlyoutBody>
<ProjectList {...{ projects, solutions, onStatusChange }} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ export const ProjectList = (props: Props) => {

const items = Object.values(projects)
.map((project) => {
if (!project.isDisplayed) {
return null;
}

// Filter out any panels that don't match the solutions filter, (if provided).
if (solutions && !solutions.some((solution) => project.solutions.includes(solution))) {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export function EmptyList() {
export const ListItem = (
props: Pick<
Props['project'],
'description' | 'isActive' | 'name' | 'solutions' | 'environments'
'description' | 'isActive' | 'name' | 'solutions' | 'environments' | 'isDisplayed'
> &
Omit<ProjectStatus, 'defaultValue'>
) => {
Expand Down
5 changes: 5 additions & 0 deletions src/plugins/presentation_util/public/i18n/labs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ export const LabsStrings = {
i18n.translate('presentationUtil.labs.components.titleLabel', {
defaultMessage: 'Lab projects',
}),
getDescriptionMessage: () =>
i18n.translate('presentationUtil.labs.components.descriptionMessage', {
defaultMessage:
'Lab projects are features and functionality that are in-progress or experimental in nature. They can be enabled and disabled locally for your browser or tab, or in Kibana.',
}),
getResetToDefaultLabel: () =>
i18n.translate('presentationUtil.labs.components.resetToDefaultLabel', {
defaultMessage: 'Reset to defaults',
Expand Down
8 changes: 7 additions & 1 deletion src/plugins/telemetry/schema/oss_plugins.json
Original file line number Diff line number Diff line change
Expand Up @@ -8331,7 +8331,13 @@
"description": "Non-default value of setting."
}
},
"labs:presentation:unifiedToolbar": {
"labs:presentation:timeToPresent": {
"type": "boolean",
"_meta": {
"description": "Non-default value of setting."
}
},
"labs:canvas:enable_ui": {
"type": "boolean",
"_meta": {
"description": "Non-default value of setting."
Expand Down

0 comments on commit 4503c52

Please sign in to comment.