这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 4 additions & 12 deletions console/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion console/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
"@types/react-hot-loader": "4.1.1",
"@types/react-notification-system-redux": "1.1.6",
"@types/react-redux": "7.1.7",
"@types/react-router": "^3.0.8",
"@types/react-router": "3.0.22",
"@types/react-router-redux": "4.0.44",
"@types/react-toggle": "4.0.2",
"@types/redux-devtools": "3.0.47",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import styles from '../Common.scss';

const Check = ({ className, title = '' }) => {
const Check = ({ className = '', title = '' }) => {
return (
<i
className={`fa fa-check ${styles.iconCheck} ${className}`}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';

const Clock = ({ className, title = '' }) => {
const Clock = ({ className = '', title = '' }) => {
return (
<i
className={`fa fa-clock-o ${className || ''}`}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';

const Copy = ({ className }) => {
const Copy = ({ className = '' }) => {
return <i className={`fa fa-copy ${className || ''}`} aria-hidden="true" />;
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import styles from '../Common.scss';

const Cross = ({ className, title = '' }) => {
const Cross = ({ className = '', title = '' }) => {
return (
<i
className={`fa fa-times ${styles.iconCross} ${className}`}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';

const Invalid = ({ className, title = '' }) => {
const Invalid = ({ className = '', title = '' }) => {
return (
<i
className={`fa fa-exclamation ${className || ''}`}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';

const Reload = ({ className }) => {
const Reload = ({ className = '' }) => {
return <i className={`fa fa-repeat ${className || ''}`} aria-hidden="true" />;
};

Expand Down
13 changes: 0 additions & 13 deletions console/src/components/Common/Icons/Remove.js

This file was deleted.

17 changes: 17 additions & 0 deletions console/src/components/Common/Icons/Remove.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React, { ComponentProps } from 'react';
import styles from '../Common.scss';

interface RemoveIconProps extends ComponentProps<'i'> {}
const RemoveIcon: React.FC<RemoveIconProps> = ({
className = '',
...props
}) => (
<i
className={`${styles.fontAwosomeClose} fa-lg fa fa-times ${
className || ''
}`}
{...props}
/>
);

export default RemoveIcon;
4 changes: 2 additions & 2 deletions console/src/components/Services/Settings/Container.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import { Connect } from 'react-redux';
import { LocationShape } from 'react-router/lib/PropTypes';
import { RouteComponentProps } from 'react-router';
import Sidebar from './Sidebar';
import PageContainer from '../../Common/Layout/PageContainer/PageContainer';

Expand All @@ -11,7 +11,7 @@ type Metadata = {
};

type ExternalProps = {
location: LocationShape;
location: RouteComponentProps<{}, {}>['location'];
children: JSX.Element;
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { Link, RouteComponentProps } from 'react-router';
import LeftContainer from '../../Common/Layout/LeftContainer/LeftContainer';
import { Link } from 'react-router';
import CheckIcon from '../../Common/Icons/Check';
import CrossIcon from '../../Common/Icons/Cross';
import globals from '../../../Globals';
Expand All @@ -9,8 +9,31 @@ import { getAdminSecret } from '../ApiExplorer/ApiRequest/utils';

import styles from '../../Common/TableCommon/Table.scss';

const Sidebar = ({ location, metadata }) => {
const sectionsData = [];
interface Metadata {
inconsistentObjects: object[];
}

type SidebarProps = {
location: RouteComponentProps<{}, {}>['location'];
metadata: Metadata;
};

type SectionDataKey =
| 'actions'
| 'status'
| 'allowed-queries'
| 'logout'
| 'about';

interface SectionData {
key: SectionDataKey;
link: string;
dataTestVal: string;
title: string | JSX.Element;
}

const Sidebar: React.FC<SidebarProps> = ({ location, metadata }) => {
const sectionsData: SectionData[] = [];

sectionsData.push({
key: 'actions',
Expand Down Expand Up @@ -61,7 +84,7 @@ const Sidebar = ({ location, metadata }) => {

const currentLocation = location.pathname;

const sections = [];
const sections: JSX.Element[] = [];

sectionsData.forEach(section => {
sections.push(
Expand Down