Skip to content

Commit

Permalink
Deleted bar, progress and progressbar directives (#33585) (#33764)
Browse files Browse the repository at this point in the history
* Deleted
- progress
- bar
- progressbar

Changed
 - implementation of Discover > string field > proressbar to use EUI progressbar and tooltip.
  • Loading branch information
lizozom authored Mar 24, 2019
1 parent 20a3f01 commit 4147d46
Show file tree
Hide file tree
Showing 9 changed files with 85 additions and 121 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,10 @@
color: $euiColorMediumShade;
margin-left: $euiSizeS !important;
}

/*
Fixes EUI known issue https://github.com/elastic/eui/issues/1749
*/
.dscProgressBarTooltip__anchor {
display: block;
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import html from './discover_field.html';
import _ from 'lodash';
import 'ui/directives/css_truncate';
import 'ui/directives/field_name';
import './string_progress_bar';
import detailsHtml from './lib/detail_views/string.html';
import { uiModules } from 'ui/modules';
const app = uiModules.get('apps/discover');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,10 @@
</button>
</div>
</div>
<kbn-tooltip text="{{::bucket.count}}" placement="right" append-to-body="1">
<progressbar
value="bucket.percent"
max="100"
animate="false"
>
<span class="dscFieldDetails__progress">{{bucket.percent}}%</span>
</progressbar>
</kbn-tooltip>
<string-field-progress-bar
percent="{{bucket.percent}}"
count="{{::bucket.count}}"
></string-field-progress-bar>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. 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.
*/


import { wrapInI18nContext } from 'ui/i18n';
import { uiModules } from 'ui/modules';

import React from 'react';

import {
EuiFlexGroup,
EuiFlexItem,
EuiProgress,
EuiText,
EuiToolTip,
} from '@elastic/eui';

const module = uiModules.get('discover/field_chooser');

function StringFieldProgressBar(props) {
return (
<EuiToolTip
anchorClassName="dscProgressBarTooltip__anchor"
content={props.count}
delay="regular"
position="right"
>
<EuiFlexGroup
alignItems="center"
>
<EuiFlexItem>
<EuiProgress
value={props.percent}
max={100}
color="secondary"
aria-labelledby="CanvasAssetManagerLabel"
size="l"
/>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiText
size="xs"
>
{props.percent}%
</EuiText>
</EuiFlexItem>
</EuiFlexGroup>
</EuiToolTip>
);
}

module.directive('stringFieldProgressBar', function (reactDirective) {
return reactDirective(wrapInI18nContext(StringFieldProgressBar));
});
29 changes: 3 additions & 26 deletions src/legacy/ui/public/angular-bootstrap/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,17 @@ angular.module('ui.bootstrap', [
'ui.bootstrap.bindHtml',
'ui.bootstrap.modal',
'ui.bootstrap.tooltip',
'ui.bootstrap.progressbar',
]);

angular.module('ui.bootstrap.tpls', [
'template/modal/backdrop.html',
'template/modal/window.html',
'template/tooltip/tooltip-html-unsafe-popup.html',
'template/tooltip/tooltip-popup.html',
'template/progressbar/bar.html',
'template/progressbar/progress.html',
'template/progressbar/progressbar.html',
'template/modal/window.html',
'template/tooltip/tooltip-html-unsafe-popup.html',
'template/tooltip/tooltip-popup.html',
]);

import './bindHtml/bindHtml';
import './modal/modal';
import './progressbar/progressbar';
import './tooltip/tooltip';
import './transition/transition';

Expand All @@ -68,21 +63,3 @@ import tooltipPopup from './tooltip/tooltip-popup.html';
angular.module('template/tooltip/tooltip-popup.html', []).run(['$templateCache', function($templateCache) {
$templateCache.put('template/tooltip/tooltip-popup.html', tooltipPopup);
}]);

import bar from './progressbar/bar.html';

angular.module('template/progressbar/bar.html', []).run(['$templateCache', function($templateCache) {
$templateCache.put('template/progressbar/bar.html', bar);
}]);

import progress from './progressbar/progress.html';

angular.module('template/progressbar/progress.html', []).run(['$templateCache', function($templateCache) {
$templateCache.put('template/progressbar/progress.html', progress);
}]);

import progressbar from './progressbar/progressbar.html';

angular.module('template/progressbar/progressbar.html', []).run(['$templateCache', function($templateCache) {
$templateCache.put('template/progressbar/progressbar.html', progressbar);
}]);

This file was deleted.

This file was deleted.

This file was deleted.

81 changes: 0 additions & 81 deletions src/legacy/ui/public/angular-bootstrap/progressbar/progressbar.js

This file was deleted.

0 comments on commit 4147d46

Please sign in to comment.