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
19 changes: 16 additions & 3 deletions x-pack/plugins/code/public/components/admin_page/project_tab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
// @ts-ignore
import {
EuiButton,
EuiCallOut,
EuiFieldText,
EuiFlexGroup,
EuiFlexItem,
Expand All @@ -18,8 +19,8 @@ import {
EuiModalHeader,
EuiModalHeaderTitle,
EuiOverlayMask,
EuiSpacer,
// @ts-ignore
EuiSpacer,
EuiSuperSelect,
EuiText,
EuiTitle,
Expand All @@ -30,6 +31,7 @@ import styled from 'styled-components';
import { Repository } from '../../../model';
import { importRepo } from '../../actions';
import { RootState } from '../../reducers';
import { CallOutType } from '../../reducers/repository';
import { ProjectItem } from './project_item';
import { ProjectSettings } from './project_settings';

Expand Down Expand Up @@ -69,6 +71,9 @@ interface Props {
isAdmin: boolean;
importRepo: (repoUrl: string) => void;
importLoading: boolean;
callOutMessage?: string;
showCallOut: boolean;
callOutType: CallOutType;
}
interface State {
showImportProjectModal: boolean;
Expand All @@ -95,7 +100,7 @@ class CodeProjectTab extends React.PureComponent<Props, State> {
}

public closeModal = () => {
this.setState({ showImportProjectModal: false });
this.setState({ showImportProjectModal: false, repoURL: '' });
};

public openModal = () => {
Expand Down Expand Up @@ -161,7 +166,7 @@ class CodeProjectTab extends React.PureComponent<Props, State> {
};

public render() {
const { projects, isAdmin, status } = this.props;
const { projects, isAdmin, status, callOutMessage, showCallOut, callOutType } = this.props;
const projectsCount = projects.length;
const modal = this.state.showImportProjectModal && this.renderImportModal();

Expand Down Expand Up @@ -190,6 +195,11 @@ class CodeProjectTab extends React.PureComponent<Props, State> {

return (
<div className="code-sidebar" data-test-subj="codeRepositoryList">
{showCallOut && (
<EuiCallOut color={callOutType} title="">
{callOutMessage}
</EuiCallOut>
)}
<EuiSpacer />
<EuiFlexGroup>
<EuiFlexItem>
Expand Down Expand Up @@ -231,6 +241,9 @@ const mapStateToProps = (state: RootState) => ({
status: state.status.status,
isAdmin: state.userProfile.isCodeAdmin,
importLoading: state.repository.importLoading,
callOutMessage: state.repository.callOutMessage,
callOutType: state.repository.callOutType,
showCallOut: state.repository.showCallOut,
});

const mapDispatchToProps = {
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/code/public/components/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import { connect } from 'react-redux';
import { Route as ReactRoute, RouteProps } from 'react-router';
import { Route as ReactRoute, RouteProps } from 'react-router-dom';
import { Match, routeChange } from '../actions';

interface Props extends RouteProps {
Expand Down