Skip to content

Commit

Permalink
fix: remove dataurl type (elastic#613)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasolson authored and Rashid Khan committed May 22, 2018
1 parent 0fce399 commit f51cef3
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 30 deletions.
24 changes: 0 additions & 24 deletions common/types/dataurl.js

This file was deleted.

2 changes: 0 additions & 2 deletions common/types/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { boolean } from './boolean';
import { datatable } from './datatable';
import { dataurl } from './dataurl';
import { error } from './error';
import { filter } from './filter';
import { image } from './image';
Expand All @@ -15,7 +14,6 @@ import { style } from './style';
export const typeSpecs = [
boolean,
datatable,
dataurl,
error,
filter,
image,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,15 @@ class ImageUpload extends React.Component {
render() {
const { resolvedArgValue } = this.props;
const isLoading = this.state.loading;
const isDataUrl =
resolvedArgValue && resolvedArgValue.type === 'dataurl' && isValid(resolvedArgValue.value);
const isDataUrl = resolvedArgValue && isValid(resolvedArgValue);

const previewImage = isDataUrl && (
<EuiImage
size="s"
hasShadow
allowFullScreen
alt="Image Preview"
url={resolvedArgValue.value}
url={resolvedArgValue}
className="canvas__checkered"
/>
);
Expand Down
4 changes: 3 additions & 1 deletion public/functions/asset.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export const asset = () => ({
context: {
types: ['null'],
},
type: 'string',
help: 'Use Canvas workpad asset objects to provide argument values. Usually images.',
args: {
_: {
Expand All @@ -18,6 +19,7 @@ export const asset = () => ({
fn: (context, args) => {
// TODO: handle the case where the asset id provided doesn't exist
const assetId = args._;
return getAssetById(getState(), assetId);
const { value } = getAssetById(getState(), assetId);
return value;
},
});

0 comments on commit f51cef3

Please sign in to comment.