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
17 changes: 11 additions & 6 deletions x-pack/plugins/code/public/components/admin_page/project_item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,15 @@ const stateColor = {
class CodeProjectItem extends React.PureComponent<{
project: Repository;
enableManagement: boolean;
showStatus: boolean;
status?: RepoStatus;
deleteRepo?: (uri: string) => void;
indexRepo?: (uri: string) => void;
initRepoCommand?: (uri: string) => void;
openSettings?: (uri: string, url: string) => void;
}> {
public render() {
const { project, status, enableManagement } = this.props;
const { project, showStatus, status, enableManagement } = this.props;
const { name, org, uri, url } = project;
const onClickDelete = () => this.props.deleteRepo && this.props.deleteRepo(uri);
const onClickIndex = () => this.props.indexRepo && this.props.indexRepo(uri);
Expand Down Expand Up @@ -155,17 +156,21 @@ class CodeProjectItem extends React.PureComponent<{
</EuiFlexItem>
);

const repoStatus = (
<EuiText>
<h6>
<EuiTextColor color="subdued">{footer}</EuiTextColor>
</h6>
</EuiText>
);

return (
<Panel>
{this.renderProgress()}
<EuiFlexGroup alignItems="center" justifyContent="flexStart">
<EuiFlexItem grow={3}>
{disableRepoLink ? repoTitle : <Link to={`/${uri}`}>{repoTitle}</Link>}
<EuiText>
<h6>
<EuiTextColor color="subdued">{footer}</EuiTextColor>
</h6>
</EuiText>
{showStatus ? repoStatus : null}
</EuiFlexItem>
<EuiFlexItem grow={3}>
<EuiText color="subdued" size="s">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ class CodeProjectTab extends React.PureComponent<Props, State> {
openSettings={this.openSettingModal}
key={repo.uri}
project={repo}
showStatus={true}
status={status[repo.uri]}
enableManagement={isAdmin}
/>
Expand Down
7 changes: 6 additions & 1 deletion x-pack/plugins/code/public/components/search_page/search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,12 @@ class SearchPage extends React.PureComponent<Props, State> {
repos &&
repos.map((repo: any) => (
<EuiFlexItem key={repo.uri}>
<ProjectItem key={repo.uri} project={repo} enableManagement={false} />
<ProjectItem
key={repo.uri}
project={repo}
showStatus={false}
enableManagement={false}
/>
</EuiFlexItem>
));
const to = from + repos.length;
Expand Down
4 changes: 1 addition & 3 deletions x-pack/plugins/code/server/routes/repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,22 +151,20 @@ export function repositoryRoute(
try {
gitStatus = await repoObjectClient.getRepositoryGitStatus(repoUri);
} catch (error) {
log.error(`Get repository git status ${repoUri} error: ${error}`);
log.debug(`Get repository git status ${repoUri} error: ${error}`);
}

let indexStatus = null;
try {
indexStatus = await repoObjectClient.getRepositoryLspIndexStatus(repoUri);
} catch (error) {
// index status won't exist if during clone, so suppress the error log to debug level.
log.debug(`Get repository index status ${repoUri} error: ${error}`);
}

let deleteStatus = null;
try {
deleteStatus = await repoObjectClient.getRepositoryDeleteStatus(repoUri);
} catch (error) {
// delete status is not always there, so suppress the error log to debug level.
log.debug(`Get repository delete status ${repoUri} error: ${error}`);
}
return {
Expand Down