Skip to content

Commit

Permalink
[Explore] Fix annotation layer select box formatting (apache#8734)
Browse files Browse the repository at this point in the history
  • Loading branch information
Erik Ritter authored Dec 3, 2019
1 parent f8e15e1 commit 43f637e
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '';

Expand Down Expand Up @@ -331,6 +332,14 @@ export default class AnnotationLayer extends React.PureComponent {
this.props.close();
}

renderOption(option) {
return (
<span className="optionWrapper" title={option.label}>
{option.label}
</span>
);
}

renderValueConfiguration() {
const {
annotationType,
Expand Down Expand Up @@ -373,6 +382,7 @@ export default class AnnotationLayer extends React.PureComponent {
value={value}
onChange={this.handleValue}
validationErrors={!value ? ['Mandatory'] : []}
optionRenderer={this.renderOption}
/>
);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
}

0 comments on commit 43f637e

Please sign in to comment.