Skip to content

Commit

Permalink
[D&D] Final fixes (#2071)
Browse files Browse the repository at this point in the history
* chore: Disable wizard by default

Signed-off-by: Ashwin Pc <ashwinpc@amazon.com>

* chore: remove routes

Signed-off-by: Ashwin Pc <ashwinpc@amazon.com>

* chore: remove translations

Signed-off-by: Ashwin Pc <ashwinpc@amazon.com>

* chore: nit fixes

Signed-off-by: Ashwin Pc <ashwinpc@amazon.com>

* chore: adds license to scss files

Signed-off-by: Ashwin Pc <ashwinpc@amazon.com>

* chore: drop hover dark mode

Signed-off-by: Ashwin Pc <ashwinpc@amazon.com>

* chore: nit fixes

Signed-off-by: Ashwin Pc <ashwinpc@amazon.com>
  • Loading branch information
ashwin-pc committed Aug 4, 2022
1 parent 5429e8e commit 159f4a6
Show file tree
Hide file tree
Showing 26 changed files with 70 additions and 52 deletions.
2 changes: 1 addition & 1 deletion config/opensearch_dashboards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -187,4 +187,4 @@

# Set the value of this setting to true to start exploring wizard
# functionality in Visualization.
# wizard.enabled: true
# wizard.enabled: false
2 changes: 1 addition & 1 deletion src/plugins/saved_objects_management/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Save objects management
# Saved objects management

Provides a UI (via the `management` plugin) to find and manage all saved objects in one place (you can see the primary page by navigating to `/app/management/opensearch-dashboards/objects`). Not to be confused with the `savedObjects` plugin, which provides all the core capabilities of saved objects.

Expand Down
7 changes: 0 additions & 7 deletions src/plugins/wizard/.i18nrc.json

This file was deleted.

2 changes: 1 addition & 1 deletion src/plugins/wizard/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ To use this plugin, navigate to:

Visualize -> Create Visualization -> Wizard

## Add a visualization (TODO: Cleanup before merging into mainline)
## Add a visualization

All new visualizations currently reside in [public/visualizations](./public/visualizations). To add a new one, create a new visualization directory and add the required code (below) to setup and register a new vis type.

Expand Down
3 changes: 1 addition & 2 deletions src/plugins/wizard/common/wizard_saved_object_attributes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { integer } from '@opensearch-project/opensearch/api/types';
import { SavedObjectAttributes } from '../../../core/types';

export const WIZARD_SAVED_OBJECT = 'wizard';
Expand All @@ -13,5 +12,5 @@ export interface WizardSavedObjectAttributes extends SavedObjectAttributes {
description?: string;
visualizationState?: string;
styleState?: string;
version: integer;
version: number;
}
2 changes: 1 addition & 1 deletion src/plugins/wizard/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import { schema, TypeOf } from '@osd/config-schema';

export const configSchema = schema.object({
enabled: schema.boolean({ defaultValue: true }),
enabled: schema.boolean({ defaultValue: false }),
});

export type ConfigSchema = TypeOf<typeof configSchema>;
4 changes: 4 additions & 0 deletions src/plugins/wizard/public/application/_util.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
@mixin scrollNavParent($template-row: none) {
display: grid;
min-height: 0;
Expand Down
4 changes: 4 additions & 0 deletions src/plugins/wizard/public/application/_variables.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
@import "@elastic/eui/src/global_styling/variables/header";
@import "@elastic/eui/src/global_styling/variables/form";

Expand Down
4 changes: 4 additions & 0 deletions src/plugins/wizard/public/application/app.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
@import "variables";

.wizLayout {
Expand Down
5 changes: 2 additions & 3 deletions src/plugins/wizard/public/application/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@
import React from 'react';
import { I18nProvider } from '@osd/i18n/react';
import { EuiPage } from '@elastic/eui';
import { SideNav } from './components/side_nav';
import { DragDropProvider } from './utils/drag_drop/drag_drop_context';
import { SideNav } from './components/side_nav';
import { TopNav } from './components/top_nav';
import { Workspace } from './components/workspace';

import './app.scss';
import { TopNav } from './components/top_nav';

export const WizardApp = () => {
// Render the application DOM.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
.wizConfig {
@include euiYScrollWithShadows;

background: $euiColorLightestShade;
border-left: $euiBorderThin;
border-right: $euiBorderThin;
position: relative;
overflow-x: hidden;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
.dropBox {
margin-top: $euiSize;
border-bottom: $euiBorderThin;
Expand Down Expand Up @@ -49,12 +53,12 @@
animation: pop-in $euiAnimSpeedFast $euiAnimSlightResistance forwards;

&.validField {
background-color: #a8d9e7;
border-color: #a8d9e7;
background-color: tintOrShade($euiColorPrimary, 80%, 70%);
border-color: tintOrShade($euiColorPrimary, 80%, 70%);

&.canDrop {
background-color: rgba(0, 161, 201, 30%);
border-color: #006bb4;
background-color: tintOrShade($euiColorPrimary, 60%, 40%);
border-color: tintOrShade($euiColorPrimary, 30%, 20%);
border-style: dashed;
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
@import "../../util";

.wizFieldSelector {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
.wizFieldSelectorField {
@include euiBottomShadowSmall;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
@import "../../util";

.wizDataTab {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const useDropbox = (props: UseDropboxProps): DropboxProps => {
// Event handlers for each dropbox action type
const onAddField = useCallback(() => {
if (!aggConfigs || !indexPattern) {
throw new Error('Cannot create new field, missing parameters');
throw new Error('Cannot create new field, missing aggConfigs or indexPattern');
}

const aggConfig = aggConfigs.createAggConfig(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
@import "../variables";

.searchableDropdown {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
@import "../util";
@import "../variables";

Expand Down
4 changes: 4 additions & 0 deletions src/plugins/wizard/public/application/components/top_nav.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
.wizTopNav {
grid-area: topNav;
border-bottom: $euiBorderThin;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
.wizWorkspace {
display: grid;
-ms-grid-rows: auto $euiSizeM 1fr;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
.wizDisabledVisualization {
width: 100%;
display: grid;
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/wizard/public/services/type_service/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export interface VisualizationTypeOptions<T = any> {
readonly title: string;
readonly description?: string;
readonly icon: IconType;
readonly stage?: 'beta' | 'production';
readonly stage?: 'experimental' | 'production';
readonly ui: {
containerConfig: {
data: DataTabConfig;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export class VisualizationType implements IVisualizationType {
public readonly title: string;
public readonly description: string;
public readonly icon: IconType;
public readonly stage: 'beta' | 'production';
public readonly stage: 'experimental' | 'production';
public readonly ui: IVisualizationType['ui'];
public readonly toExpression: (state: RootState) => Promise<string | undefined>;

Expand Down
5 changes: 0 additions & 5 deletions src/plugins/wizard/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {

import { WizardPluginSetup, WizardPluginStart } from './types';
import { capabilitiesProvider } from './capabilities_provider';
import { defineRoutes } from './routes';
import { wizardSavedObjectType } from './saved_objects';

export class WizardPlugin implements Plugin<WizardPluginSetup, WizardPluginStart> {
Expand All @@ -25,10 +24,6 @@ export class WizardPlugin implements Plugin<WizardPluginSetup, WizardPluginStart

public setup({ capabilities, http, savedObjects }: CoreSetup) {
this.logger.debug('wizard: Setup');
const router = http.createRouter();

// Register server side APIs
defineRoutes(router);

// Register saved object types
savedObjects.registerType(wizardSavedObjectType);
Expand Down
23 changes: 0 additions & 23 deletions src/plugins/wizard/server/routes/index.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/plugins/wizard/server/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* SPDX-License-Identifier: Apache-2.0
*/

// eslint-disable-next-line @typescript-eslint/no-empty-interface
// We need to export plugin server types, even if empty
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface WizardPluginSetup {}
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface WizardPluginStart {}

0 comments on commit 159f4a6

Please sign in to comment.