Skip to content

Commit a16548c

Browse files
lizozomJoel Griffith
authored andcommitted
Deleted bar, progress and progressbar directives (#33585)
* Deleted - progress - bar - progressbar Changed - implementation of Discover > string field > proressbar to use EUI progressbar and tooltip. * added bug comment * Fixed CR
1 parent 3e51521 commit a16548c

File tree

9 files changed

+85
-121
lines changed

9 files changed

+85
-121
lines changed

src/legacy/core_plugins/kibana/public/discover/components/field_chooser/_field_chooser.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,10 @@
22
color: $euiColorMediumShade;
33
margin-left: $euiSizeS !important;
44
}
5+
6+
/*
7+
Fixes EUI known issue https://github.com/elastic/eui/issues/1749
8+
*/
9+
.dscProgressBarTooltip__anchor {
10+
display: block;
11+
}

src/legacy/core_plugins/kibana/public/discover/components/field_chooser/discover_field.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import html from './discover_field.html';
2222
import _ from 'lodash';
2323
import 'ui/directives/css_truncate';
2424
import 'ui/directives/field_name';
25+
import './string_progress_bar';
2526
import detailsHtml from './lib/detail_views/string.html';
2627
import { uiModules } from 'ui/modules';
2728
const app = uiModules.get('apps/discover');

src/legacy/core_plugins/kibana/public/discover/components/field_chooser/lib/detail_views/string.html

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,10 @@
7777
</button>
7878
</div>
7979
</div>
80-
<kbn-tooltip text="{{::bucket.count}}" placement="right" append-to-body="1">
81-
<progressbar
82-
value="bucket.percent"
83-
max="100"
84-
animate="false"
85-
>
86-
<span class="dscFieldDetails__progress">{{bucket.percent}}%</span>
87-
</progressbar>
88-
</kbn-tooltip>
80+
<string-field-progress-bar
81+
percent="{{bucket.percent}}"
82+
count="{{::bucket.count}}"
83+
></string-field-progress-bar>
8984
</div>
9085
</div>
9186
</div>
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
21+
import { wrapInI18nContext } from 'ui/i18n';
22+
import { uiModules } from 'ui/modules';
23+
24+
import React from 'react';
25+
26+
import {
27+
EuiFlexGroup,
28+
EuiFlexItem,
29+
EuiProgress,
30+
EuiText,
31+
EuiToolTip,
32+
} from '@elastic/eui';
33+
34+
const module = uiModules.get('discover/field_chooser');
35+
36+
function StringFieldProgressBar(props) {
37+
return (
38+
<EuiToolTip
39+
anchorClassName="dscProgressBarTooltip__anchor"
40+
content={props.count}
41+
delay="regular"
42+
position="right"
43+
>
44+
<EuiFlexGroup
45+
alignItems="center"
46+
>
47+
<EuiFlexItem>
48+
<EuiProgress
49+
value={props.percent}
50+
max={100}
51+
color="secondary"
52+
aria-labelledby="CanvasAssetManagerLabel"
53+
size="l"
54+
/>
55+
</EuiFlexItem>
56+
<EuiFlexItem grow={false}>
57+
<EuiText
58+
size="xs"
59+
>
60+
{props.percent}%
61+
</EuiText>
62+
</EuiFlexItem>
63+
</EuiFlexGroup>
64+
</EuiToolTip>
65+
);
66+
}
67+
68+
module.directive('stringFieldProgressBar', function (reactDirective) {
69+
return reactDirective(wrapInI18nContext(StringFieldProgressBar));
70+
});

src/legacy/ui/public/angular-bootstrap/index.js

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,17 @@ angular.module('ui.bootstrap', [
2626
'ui.bootstrap.bindHtml',
2727
'ui.bootstrap.modal',
2828
'ui.bootstrap.tooltip',
29-
'ui.bootstrap.progressbar',
3029
]);
3130

3231
angular.module('ui.bootstrap.tpls', [
3332
'template/modal/backdrop.html',
34-
'template/modal/window.html',
35-
'template/tooltip/tooltip-html-unsafe-popup.html',
36-
'template/tooltip/tooltip-popup.html',
37-
'template/progressbar/bar.html',
38-
'template/progressbar/progress.html',
39-
'template/progressbar/progressbar.html',
33+
'template/modal/window.html',
34+
'template/tooltip/tooltip-html-unsafe-popup.html',
35+
'template/tooltip/tooltip-popup.html',
4036
]);
4137

4238
import './bindHtml/bindHtml';
4339
import './modal/modal';
44-
import './progressbar/progressbar';
4540
import './tooltip/tooltip';
4641
import './transition/transition';
4742

@@ -68,21 +63,3 @@ import tooltipPopup from './tooltip/tooltip-popup.html';
6863
angular.module('template/tooltip/tooltip-popup.html', []).run(['$templateCache', function($templateCache) {
6964
$templateCache.put('template/tooltip/tooltip-popup.html', tooltipPopup);
7065
}]);
71-
72-
import bar from './progressbar/bar.html';
73-
74-
angular.module('template/progressbar/bar.html', []).run(['$templateCache', function($templateCache) {
75-
$templateCache.put('template/progressbar/bar.html', bar);
76-
}]);
77-
78-
import progress from './progressbar/progress.html';
79-
80-
angular.module('template/progressbar/progress.html', []).run(['$templateCache', function($templateCache) {
81-
$templateCache.put('template/progressbar/progress.html', progress);
82-
}]);
83-
84-
import progressbar from './progressbar/progressbar.html';
85-
86-
angular.module('template/progressbar/progressbar.html', []).run(['$templateCache', function($templateCache) {
87-
$templateCache.put('template/progressbar/progressbar.html', progressbar);
88-
}]);

src/legacy/ui/public/angular-bootstrap/progressbar/bar.html

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/legacy/ui/public/angular-bootstrap/progressbar/progress.html

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/legacy/ui/public/angular-bootstrap/progressbar/progressbar.html

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/legacy/ui/public/angular-bootstrap/progressbar/progressbar.js

Lines changed: 0 additions & 81 deletions
This file was deleted.

0 commit comments

Comments
 (0)