Commit 0f7a4701 by Ivana Huckova Committed by GitHub

Icon: Replace font awesome icons where possible (#28757)

* Replace font awesome icons where possible

* Implement small updates
parent 45a34a30
...@@ -145,7 +145,7 @@ Suggestions can appear under the query field - click on them to update your quer ...@@ -145,7 +145,7 @@ Suggestions can appear under the query field - click on them to update your quer
### Table filters ### Table filters
Click on the filter button <span title="Filter for label" class="logs-label__icon fa fa-search-plus"></span> in a labels column in the Table panel to add filters to the query expression. This works with multiple queries too - the filter will be added for all the queries. Click on the filter button in the "label" column of a Table panel to add filters to the query expression. You can add filters for multiple queries as well - the filter is added for all the queries.
## Logs integration ## Logs integration
......
...@@ -3,7 +3,7 @@ import { GrafanaTheme } from '@grafana/data'; ...@@ -3,7 +3,7 @@ import { GrafanaTheme } from '@grafana/data';
import { css, cx } from 'emotion'; import { css, cx } from 'emotion';
import { getFocusStyle, sharedInputStyle } from '../Forms/commonStyles'; import { getFocusStyle, sharedInputStyle } from '../Forms/commonStyles';
import { stylesFactory, useTheme } from '../../themes'; import { stylesFactory, useTheme } from '../../themes';
import { Icon } from '../Icon/Icon'; import { Spinner } from '../Spinner/Spinner';
import { useClientRect } from '../../utils/useClientRect'; import { useClientRect } from '../../utils/useClientRect';
export interface Props extends Omit<HTMLProps<HTMLInputElement>, 'prefix' | 'size'> { export interface Props extends Omit<HTMLProps<HTMLInputElement>, 'prefix' | 'size'> {
...@@ -249,7 +249,7 @@ export const Input = React.forwardRef<HTMLInputElement, Props>((props, ref) => { ...@@ -249,7 +249,7 @@ export const Input = React.forwardRef<HTMLInputElement, Props>((props, ref) => {
{(suffix || loading) && ( {(suffix || loading) && (
<div className={styles.suffix} ref={suffixRef}> <div className={styles.suffix} ref={suffixRef}>
{loading && <Icon name="fa fa-spinner" className={cx('fa-spin', styles.loadingIndicator)} />} {loading && <Spinner className={styles.loadingIndicator} inline={true} />}
{suffix} {suffix}
</div> </div>
)} )}
......
import React, { SFC } from 'react'; import React, { SFC } from 'react';
import { Icon } from '../Icon/Icon'; import { Spinner } from '../Spinner/Spinner';
interface LoadingPlaceholderProps { interface LoadingPlaceholderProps {
text: string; text: string;
...@@ -7,6 +7,6 @@ interface LoadingPlaceholderProps { ...@@ -7,6 +7,6 @@ interface LoadingPlaceholderProps {
export const LoadingPlaceholder: SFC<LoadingPlaceholderProps> = ({ text }) => ( export const LoadingPlaceholder: SFC<LoadingPlaceholderProps> = ({ text }) => (
<div className="gf-form-group"> <div className="gf-form-group">
{text} <Icon name="fa fa-spinner" className="fa-spin" /> {text} <Spinner inline={true} />
</div> </div>
); );
...@@ -9,6 +9,7 @@ import { default as ReactAsyncSelect } from '@torkelo/react-select/async'; ...@@ -9,6 +9,7 @@ import { default as ReactAsyncSelect } from '@torkelo/react-select/async';
import { default as AsyncCreatable } from '@torkelo/react-select/async-creatable'; import { default as AsyncCreatable } from '@torkelo/react-select/async-creatable';
import { Icon } from '../Icon/Icon'; import { Icon } from '../Icon/Icon';
import { Spinner } from '../Spinner/Spinner';
import { css, cx } from 'emotion'; import { css, cx } from 'emotion';
import resetSelectStyles from './resetSelectStyles'; import resetSelectStyles from './resetSelectStyles';
import { SelectMenu, SelectMenuOptions } from './SelectMenu'; import { SelectMenu, SelectMenuOptions } from './SelectMenu';
...@@ -294,7 +295,7 @@ export function SelectBase<T>({ ...@@ -294,7 +295,7 @@ export function SelectBase<T>({
); );
}, },
LoadingIndicator: (props: any) => { LoadingIndicator: (props: any) => {
return <Icon className="fa-spin" name="fa fa-spinner" />; return <Spinner inline={true} />;
}, },
LoadingMessage: (props: any) => { LoadingMessage: (props: any) => {
return <div className={styles.loadingMessage}>{loadingMessage}</div>; return <div className={styles.loadingMessage}>{loadingMessage}</div>;
......
...@@ -14,6 +14,7 @@ import { ...@@ -14,6 +14,7 @@ import {
DataSourceHttpSettings, DataSourceHttpSettings,
GraphContextMenu, GraphContextMenu,
Icon, Icon,
Spinner,
LegacyForms, LegacyForms,
SeriesColorPickerPopoverWithTheme, SeriesColorPickerPopoverWithTheme,
UnitPicker, UnitPicker,
...@@ -36,12 +37,12 @@ const { SecretFormField } = LegacyForms; ...@@ -36,12 +37,12 @@ const { SecretFormField } = LegacyForms;
export function registerAngularDirectives() { export function registerAngularDirectives() {
react2AngularDirective('footer', Footer, []); react2AngularDirective('footer', Footer, []);
react2AngularDirective('icon', Icon, [ react2AngularDirective('icon', Icon, [
'color',
'name', 'name',
'size', 'size',
'type', 'type',
['onClick', { watchDepth: 'reference', wrapApply: true }], ['onClick', { watchDepth: 'reference', wrapApply: true }],
]); ]);
react2AngularDirective('spinner', Spinner, ['inline']);
react2AngularDirective('helpModal', HelpModal, []); react2AngularDirective('helpModal', HelpModal, []);
react2AngularDirective('sidemenu', SideMenu, []); react2AngularDirective('sidemenu', SideMenu, []);
react2AngularDirective('functionEditor', FunctionEditor, ['func', 'onRemove', 'onMoveLeft', 'onMoveRight']); react2AngularDirective('functionEditor', FunctionEditor, ['func', 'onRemove', 'onMoveLeft', 'onMoveRight']);
......
...@@ -24,7 +24,6 @@ class PermissionList extends PureComponent<Props> { ...@@ -24,7 +24,6 @@ class PermissionList extends PureComponent<Props> {
item={{ item={{
name: 'Admin', name: 'Admin',
permission: 4, permission: 4,
icon: 'fa fa-fw fa-street-view',
}} }}
/> />
{items.map((item, idx) => { {items.map((item, idx) => {
......
import React, { PureComponent } from 'react'; import React, { PureComponent } from 'react';
import { dateTimeFormat } from '@grafana/data'; import { dateTimeFormat } from '@grafana/data';
import { LdapUserSyncInfo } from 'app/types'; import { LdapUserSyncInfo } from 'app/types';
import { Icon } from '@grafana/ui'; import { Spinner } from '@grafana/ui';
interface Props { interface Props {
disableSync: boolean; disableSync: boolean;
...@@ -45,7 +45,7 @@ export class UserSyncInfo extends PureComponent<Props, State> { ...@@ -45,7 +45,7 @@ export class UserSyncInfo extends PureComponent<Props, State> {
<> <>
<button className={`btn btn-secondary pull-right`} onClick={this.onSyncClick} disabled={isDisabled}> <button className={`btn btn-secondary pull-right`} onClick={this.onSyncClick} disabled={isDisabled}>
<span className="btn-title">Sync user</span> <span className="btn-title">Sync user</span>
{isSyncing && <Icon name="fa fa-spinner" className="fa-fw fa-spin run-icon" />} {isSyncing && <Spinner inline={true} />}
</button> </button>
<div className="clearfix" /> <div className="clearfix" />
......
import React, { PureComponent } from 'react'; import React, { PureComponent } from 'react';
import { dateTimeFormat } from '@grafana/data'; import { dateTimeFormat } from '@grafana/data';
import { Icon } from '@grafana/ui'; import { Spinner } from '@grafana/ui';
import { SyncInfo } from 'app/types'; import { SyncInfo } from 'app/types';
interface Props { interface Props {
...@@ -35,7 +35,7 @@ export class LdapSyncInfo extends PureComponent<Props, State> { ...@@ -35,7 +35,7 @@ export class LdapSyncInfo extends PureComponent<Props, State> {
LDAP Synchronisation LDAP Synchronisation
<button className={`btn btn-secondary pull-right`} onClick={this.handleSyncClick} hidden={true}> <button className={`btn btn-secondary pull-right`} onClick={this.handleSyncClick} hidden={true}>
<span className="btn-title">Bulk-sync now</span> <span className="btn-title">Bulk-sync now</span>
{isSyncing && <Icon name="fa fa-spinner" className="fa-fw fa-spin run-icon" />} {isSyncing && <Spinner inline={true} />}
</button> </button>
</h3> </h3>
<div className="gf-form-group"> <div className="gf-form-group">
......
...@@ -53,7 +53,7 @@ export class DashboardRow extends React.Component<DashboardRowProps, any> { ...@@ -53,7 +53,7 @@ export class DashboardRow extends React.Component<DashboardRowProps, any> {
title: 'Delete Row', title: 'Delete Row',
text: 'Are you sure you want to remove this row and all its panels?', text: 'Are you sure you want to remove this row and all its panels?',
altActionText: 'Delete row only', altActionText: 'Delete row only',
icon: 'fa-trash', icon: 'trash-alt',
onConfirm: () => { onConfirm: () => {
this.props.dashboard.removeRow(this.props.panel, true); this.props.dashboard.removeRow(this.props.panel, true);
}, },
......
...@@ -11,7 +11,7 @@ import { ...@@ -11,7 +11,7 @@ import {
toCSV, toCSV,
transformDataFrame, transformDataFrame,
} from '@grafana/data'; } from '@grafana/data';
import { Button, Container, Field, HorizontalGroup, Icon, Select, Switch, Table, VerticalGroup } from '@grafana/ui'; import { Button, Container, Field, HorizontalGroup, Spinner, Select, Switch, Table, VerticalGroup } from '@grafana/ui';
import { CSVConfig } from '@grafana/data'; import { CSVConfig } from '@grafana/data';
import { selectors } from '@grafana/e2e-selectors'; import { selectors } from '@grafana/e2e-selectors';
...@@ -261,7 +261,7 @@ export class InspectDataTab extends PureComponent<Props, State> { ...@@ -261,7 +261,7 @@ export class InspectDataTab extends PureComponent<Props, State> {
if (isLoading) { if (isLoading) {
return ( return (
<div> <div>
Loading <Icon name="fa fa-spinner" className="fa-spin" size="lg" /> <Spinner inline={true} /> Loading
</div> </div>
); );
} }
......
import React, { PureComponent } from 'react'; import React, { PureComponent } from 'react';
import { Button, ClipboardButton, Icon, LegacyForms, LinkButton } from '@grafana/ui'; import { Button, ClipboardButton, Icon, Spinner, LegacyForms, LinkButton } from '@grafana/ui';
import { AppEvents, SelectableValue } from '@grafana/data'; import { AppEvents, SelectableValue } from '@grafana/data';
import { getBackendSrv } from '@grafana/runtime'; import { getBackendSrv } from '@grafana/runtime';
import { DashboardModel, PanelModel } from 'app/features/dashboard/state'; import { DashboardModel, PanelModel } from 'app/features/dashboard/state';
...@@ -306,7 +306,7 @@ export class ShareSnapshot extends PureComponent<Props, State> { ...@@ -306,7 +306,7 @@ export class ShareSnapshot extends PureComponent<Props, State> {
<div className="share-modal-header"> <div className="share-modal-header">
{isLoading ? ( {isLoading ? (
<div className="share-modal-big-icon"> <div className="share-modal-big-icon">
<Icon name="fa fa-spinner" className="fa-spin" /> <Spinner inline={true} />
</div> </div>
) : ( ) : (
<Icon name="camera" className="share-modal-big-icon" size="xxl" /> <Icon name="camera" className="share-modal-big-icon" size="xxl" />
......
...@@ -176,7 +176,7 @@ export class HistoryListCtrl { ...@@ -176,7 +176,7 @@ export class HistoryListCtrl {
title: 'Restore version', title: 'Restore version',
text: '', text: '',
text2: `Are you sure you want to restore the dashboard to version ${version}? All unsaved changes will be lost.`, text2: `Are you sure you want to restore the dashboard to version ${version}? All unsaved changes will be lost.`,
icon: 'fa-history', icon: 'history',
yesText: `Yes, restore to version ${version}`, yesText: `Yes, restore to version ${version}`,
onConfirm: this.restoreConfirm.bind(this, version), onConfirm: this.restoreConfirm.bind(this, version),
}); });
......
...@@ -10,7 +10,8 @@ ...@@ -10,7 +10,8 @@
<div ng-if="ctrl.mode === 'list'"> <div ng-if="ctrl.mode === 'list'">
<div ng-if="ctrl.loading"> <div ng-if="ctrl.loading">
<icon name="'fa fa-spinner'" class="fa-spin"></icon> <spinner inline="true" />
</spinner>
<em>Fetching history list&hellip;</em> <em>Fetching history list&hellip;</em>
</div> </div>
...@@ -63,7 +64,8 @@ ...@@ -63,7 +64,8 @@
</table> </table>
<div ng-if="ctrl.appending"> <div ng-if="ctrl.appending">
<icon name="'fa fa-spinner'" class="fa-spin"></icon> <spinner inline="true" />
</spinner>
<em>Fetching more entries&hellip;</em> <em>Fetching more entries&hellip;</em>
</div> </div>
...@@ -97,7 +99,8 @@ ...@@ -97,7 +99,8 @@
<div ng-if="ctrl.mode === 'compare'"> <div ng-if="ctrl.mode === 'compare'">
<div ng-if="ctrl.loading"> <div ng-if="ctrl.loading">
<icon name="'fa fa-spinner'" class="fa-spin"></icon> <spinner inline="true" />
</spinner>
<em>Fetching changes&hellip;</em> <em>Fetching changes&hellip;</em>
</div> </div>
......
...@@ -13,7 +13,7 @@ import { DashboardGrid } from '../dashgrid/DashboardGrid'; ...@@ -13,7 +13,7 @@ import { DashboardGrid } from '../dashgrid/DashboardGrid';
import { DashNav } from '../components/DashNav'; import { DashNav } from '../components/DashNav';
import { DashboardSettings } from '../components/DashboardSettings'; import { DashboardSettings } from '../components/DashboardSettings';
import { PanelEditor } from '../components/PanelEditor/PanelEditor'; import { PanelEditor } from '../components/PanelEditor/PanelEditor';
import { Alert, Button, CustomScrollbar, HorizontalGroup, Icon, VerticalGroup } from '@grafana/ui'; import { Alert, Button, CustomScrollbar, HorizontalGroup, Spinner, VerticalGroup } from '@grafana/ui';
// Redux // Redux
import { initDashboard } from '../state/initDashboard'; import { initDashboard } from '../state/initDashboard';
import { notifyApp, updateLocation } from 'app/core/actions'; import { notifyApp, updateLocation } from 'app/core/actions';
...@@ -235,7 +235,7 @@ export class DashboardPage extends PureComponent<Props, State> { ...@@ -235,7 +235,7 @@ export class DashboardPage extends PureComponent<Props, State> {
<div className="dashboard-loading__text"> <div className="dashboard-loading__text">
<VerticalGroup spacing="md"> <VerticalGroup spacing="md">
<HorizontalGroup align="center" justify="center" spacing="xs"> <HorizontalGroup align="center" justify="center" spacing="xs">
<Icon name="fa fa-spinner" className="fa-spin" /> {this.props.initPhase} <Spinner inline={true} /> {this.props.initPhase}
</HorizontalGroup>{' '} </HorizontalGroup>{' '}
<HorizontalGroup align="center" justify="center"> <HorizontalGroup align="center" justify="center">
<Button variant="secondary" size="md" icon="repeat" onClick={this.cancelVariables}> <Button variant="secondary" size="md" icon="repeat" onClick={this.cancelVariables}>
......
...@@ -332,9 +332,8 @@ exports[`DashboardPage Dashboard is fetching slowly Should render slow init stat ...@@ -332,9 +332,8 @@ exports[`DashboardPage Dashboard is fetching slowly Should render slow init stat
justify="center" justify="center"
spacing="xs" spacing="xs"
> >
<Icon <Component
className="fa-spin" inline={true}
name="fa fa-spinner"
/> />
Fetching Fetching
......
...@@ -46,7 +46,7 @@ export function RunButton(props: Props) { ...@@ -46,7 +46,7 @@ export function RunButton(props: Props) {
'btn--radius-right-0': showDropdown, 'btn--radius-right-0': showDropdown,
})} })}
icon={loading ? 'fa fa-spinner' : 'sync'} icon={loading ? 'fa fa-spinner' : 'sync'}
iconClassName={loading ? ' fa-spin run-icon' : undefined} iconClassName={loading ? ' fa-spin' : undefined}
aria-label={selectors.pages.Explore.General.runButton} aria-label={selectors.pages.Explore.General.runButton}
/> />
); );
......
import React from 'react'; import React from 'react';
import classNames from 'classnames'; import classNames from 'classnames';
import { css } from 'emotion'; import { Tooltip, Icon } from '@grafana/ui';
import { Tooltip, useTheme, stylesFactory, Icon } from '@grafana/ui';
import { GrafanaTheme } from '@grafana/data';
const getStyles = stylesFactory((theme: GrafanaTheme) => {
return {
noRightBorderStyle: css`
label: noRightBorderStyle;
border-right: 0;
`,
/*
* Required top-padding, otherwise is fa-link icon in active state
* cut off on top due to fontAwesome icon position
*/
topPadding: css`
label: topPadding;
padding-top: 1px;
`,
};
});
interface TimeSyncButtonProps { interface TimeSyncButtonProps {
isSynced: boolean; isSynced: boolean;
...@@ -29,8 +9,6 @@ interface TimeSyncButtonProps { ...@@ -29,8 +9,6 @@ interface TimeSyncButtonProps {
export function TimeSyncButton(props: TimeSyncButtonProps) { export function TimeSyncButton(props: TimeSyncButtonProps) {
const { onClick, isSynced } = props; const { onClick, isSynced } = props;
const theme = useTheme();
const styles = getStyles(theme);
const syncTimesTooltip = () => { const syncTimesTooltip = () => {
const { isSynced } = props; const { isSynced } = props;
...@@ -47,7 +25,7 @@ export function TimeSyncButton(props: TimeSyncButtonProps) { ...@@ -47,7 +25,7 @@ export function TimeSyncButton(props: TimeSyncButtonProps) {
aria-label={isSynced ? 'Synced times' : 'Unsynced times'} aria-label={isSynced ? 'Synced times' : 'Unsynced times'}
onClick={() => onClick()} onClick={() => onClick()}
> >
<Icon name="link" className={classNames(styles.topPadding, isSynced && 'icon-brand-gradient')} size="lg" /> <Icon name="link" className={isSynced ? 'icon-brand-gradient' : ''} size="lg" />
</button> </button>
</Tooltip> </Tooltip>
); );
......
...@@ -78,7 +78,7 @@ export class VariableOptions extends PureComponent<Props> { ...@@ -78,7 +78,7 @@ export class VariableOptions extends PureComponent<Props> {
className={`${tag.selected ? 'variable-option-tag pointer selected' : 'variable-option-tag pointer'}`} className={`${tag.selected ? 'variable-option-tag pointer selected' : 'variable-option-tag pointer'}`}
onClick={this.onToggleTag(tag)} onClick={this.onToggleTag(tag)}
> >
<span className="fa fa-fw variable-option-icon"></span> <span className="variable-option-icon"></span>
<span className="label-tag" style={{ backgroundColor: color, borderColor }}> <span className="label-tag" style={{ backgroundColor: color, borderColor }}>
{tag.text}&nbsp;&nbsp; {tag.text}&nbsp;&nbsp;
<Icon name="tag-alt" /> <Icon name="tag-alt" />
......
...@@ -3,6 +3,7 @@ import React, { Component } from 'react'; ...@@ -3,6 +3,7 @@ import React, { Component } from 'react';
import { CloudWatchLogsQuery } from '../types'; import { CloudWatchLogsQuery } from '../types';
import { PanelData } from '@grafana/data'; import { PanelData } from '@grafana/data';
import { Icon } from '@grafana/ui';
import { encodeUrl, AwsUrl } from '../aws_url'; import { encodeUrl, AwsUrl } from '../aws_url';
import { CloudWatchDatasource } from '../datasource'; import { CloudWatchDatasource } from '../datasource';
...@@ -58,7 +59,7 @@ export default class CloudWatchLink extends Component<Props, State> { ...@@ -58,7 +59,7 @@ export default class CloudWatchLink extends Component<Props, State> {
const { href } = this.state; const { href } = this.state;
return ( return (
<a href={href} target="_blank" rel="noopener"> <a href={href} target="_blank" rel="noopener">
<i className="fa fa-share-square-o" /> CloudWatch Logs Insights <Icon name="share-alt" /> CloudWatch Logs Insights
</a> </a>
); );
} }
......
...@@ -266,7 +266,7 @@ export class AnnoListPanel extends PureComponent<Props, State> { ...@@ -266,7 +266,7 @@ export class AnnoListPanel extends PureComponent<Props, State> {
// Previously we showed inidication that it covered all time // Previously we showed inidication that it covered all time
// { timeInfo && ( // { timeInfo && (
// <span className="panel-time-info"> // <span className="panel-time-info">
// <i className="fa fa-clock-o" /> {timeInfo} // <Icon name="clock-nine" /> {timeInfo}
// </span> // </span>
// )} // )}
......
...@@ -24,7 +24,7 @@ export function createNavModel(title: string, ...tabs: string[]): NavModel { ...@@ -24,7 +24,7 @@ export function createNavModel(title: string, ...tabs: string[]): NavModel {
const node: NavModelItem = { const node: NavModelItem = {
id: title, id: title,
text: title, text: title,
icon: 'fa fa-fw fa-warning', icon: 'exclamation-triangle',
subTitle: 'subTitle', subTitle: 'subTitle',
url: title, url: title,
children: [], children: [],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment