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

[D&D] Empty-workspace polish #1900

Merged
merged 3 commits into from
Jul 18, 2022
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
24 changes: 24 additions & 0 deletions src/plugins/wizard/public/application/components/workspace.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.wizWorkspace {
display: grid;
-ms-grid-rows: auto $euiSizeM 1fr;
grid-template-rows: auto 1fr;
grid-area: workspace;
grid-gap: $euiSizeM;
Expand All @@ -9,4 +10,27 @@
&__empty {
height: 100%;
}

&__container {
position: relative;
}

&__handFieldSvg {
animation-name: dragAndDropAnimation;
animation-direction: alternate-reverse;
animation-duration: 1.5s;
animation-iteration-count: infinite;
position: absolute;
top: 43%;
}
}

@keyframes dragAndDropAnimation {
0% {
transform: translate(65%, 0);
}

100% {
transform: none;
}
}
22 changes: 18 additions & 4 deletions src/plugins/wizard/public/application/components/workspace.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,17 @@ import {
EuiPanel,
EuiPopover,
} from '@elastic/eui';
import React, { FC, useState, useMemo, useEffect } from 'react';
import React, { FC, useState, useMemo, useEffect, Fragment } from 'react';
import { useOpenSearchDashboards } from '../../../../opensearch_dashboards_react/public';
import { WizardServices } from '../../types';
import { validateSchemaState } from '../utils/validate_schema_state';
import { useTypedDispatch, useTypedSelector } from '../utils/state_management';
import { setActiveVisualization } from '../utils/state_management/visualization_slice';
import { useVisualizationType } from '../utils/use';

import hand_field from '../../assets/hand_field.svg';
import fields_bg from '../../assets/fields_bg.svg';

import './workspace.scss';

export const Workspace: FC = ({ children }) => {
Expand Down Expand Up @@ -67,9 +70,20 @@ export const Workspace: FC = ({ children }) => {
) : (
<EuiFlexItem className="wizWorkspace__empty">
<EuiEmptyPrompt
iconType="visBarVertical"
title={<h2>Welcome to the wizard!</h2>}
body={<p>Drag some fields onto the panel to visualize some data.</p>}
title={<h2>Drop some fields here to start</h2>}
body={
<Fragment>
<p>Drag a field directly to the canvas or axis to generate a visualization.</p>
<span className="wizWorkspace__container">
<EuiIcon className="wizWorkspace__fieldSvg" type={fields_bg} size="original" />
<EuiIcon
className="wizWorkspace__handFieldSvg"
type={hand_field}
size="original"
/>
</span>
</Fragment>
}
/>
</EuiFlexItem>
)}
Expand Down
36 changes: 36 additions & 0 deletions src/plugins/wizard/public/assets/fields_bg.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 44 additions & 0 deletions src/plugins/wizard/public/assets/hand_field.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.