Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[7.x] fix(code/frontend): should show updating instead of cloning when updating (#45238) #45336

Merged
merged 1 commit into from
Sep 11, 2019
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
1 change: 1 addition & 0 deletions x-pack/legacy/plugins/code/model/repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ export interface IndexWorkerProgress extends WorkerProgress {

export enum RepoState {
CLONING,
UPDATING,
DELETING,
INDEXING,
READY,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import { RepoStatus } from '../../actions/status';

const stateColor = {
[RepoState.CLONING]: 'secondary',
[RepoState.UPDATING]: 'secondary',
[RepoState.DELETING]: 'accent',
[RepoState.INDEXING]: 'primary',
};
Expand Down Expand Up @@ -126,6 +127,12 @@ class CodeProjectItem extends React.PureComponent<
<FormattedMessage id="xpack.code.repoItem.cloningText" defaultMessage="CLONING..." />
</div>
);
} else if (status.state === RepoState.UPDATING) {
footer = (
<div className="codeFooter">
<FormattedMessage id="xpack.code.repoItem.updatingText" defaultMessage="UPDATING..." />
</div>
);
} else if (status.state === RepoState.DELETE_ERROR) {
footer = (
<div className="codeFooter codeFooter--error">
Expand Down
3 changes: 3 additions & 0 deletions x-pack/legacy/plugins/code/public/reducers/status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ const getGitState = (gitStatus: CloneWorkerProgress) => {
) {
return RepoState.CLONE_ERROR;
} else if (progress < WorkerReservedProgress.COMPLETED) {
if (gitStatus.cloneProgress && gitStatus.cloneProgress.isCloned) {
return RepoState.UPDATING;
}
return RepoState.CLONING;
} else if (progress === WorkerReservedProgress.COMPLETED) {
return RepoState.READY;
Expand Down
1 change: 1 addition & 0 deletions x-pack/plugins/translations/translations/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -4328,6 +4328,7 @@
"xpack.code.repoItem.cancelButtonText": "否,取消",
"xpack.code.repoItem.cloneErrorText": "克隆错误",
"xpack.code.repoItem.cloningText": "克隆中...",
"xpack.code.repoItem.updatingText": "更新中...",
"xpack.code.repoItem.confirmButtonText": "是,继续",
"xpack.code.repoItem.deleteButtonLabel": "删除",
"xpack.code.repoItem.deleteConfirmTitle": "确认删除仓库?",
Expand Down