From 43f637e403dea0e3ccf70c5fc2a81249b58b88ff Mon Sep 17 00:00:00 2001 From: Erik Ritter Date: Tue, 3 Dec 2019 13:13:42 -0800 Subject: [PATCH] [Explore] Fix annotation layer select box formatting (#8734) --- .../components/controls/AnnotationLayer.jsx | 10 ++++++++ .../components/controls/AnnotationLayer.less | 24 +++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 superset/assets/src/explore/components/controls/AnnotationLayer.less diff --git a/superset/assets/src/explore/components/controls/AnnotationLayer.jsx b/superset/assets/src/explore/components/controls/AnnotationLayer.jsx index e022b485a2537..b6f2253280ed8 100644 --- a/superset/assets/src/explore/components/controls/AnnotationLayer.jsx +++ b/superset/assets/src/explore/components/controls/AnnotationLayer.jsx @@ -41,6 +41,7 @@ import ANNOTATION_TYPES, { import PopoverSection from '../../../components/PopoverSection'; import ControlHeader from '../ControlHeader'; import { nonEmpty } from '../../validators'; +import './AnnotationLayer.less'; const AUTOMATIC_COLOR = ''; @@ -331,6 +332,14 @@ export default class AnnotationLayer extends React.PureComponent { this.props.close(); } + renderOption(option) { + return ( + + {option.label} + + ); + } + renderValueConfiguration() { const { annotationType, @@ -373,6 +382,7 @@ export default class AnnotationLayer extends React.PureComponent { value={value} onChange={this.handleValue} validationErrors={!value ? ['Mandatory'] : []} + optionRenderer={this.renderOption} /> ); } diff --git a/superset/assets/src/explore/components/controls/AnnotationLayer.less b/superset/assets/src/explore/components/controls/AnnotationLayer.less new file mode 100644 index 0000000000000..2f8c6c2f4303b --- /dev/null +++ b/superset/assets/src/explore/components/controls/AnnotationLayer.less @@ -0,0 +1,24 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +.optionWrapper { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +}