Skip to content

Commit

Permalink
Improvement/jenkins 46186 bitbucket credential prompt (#52)
Browse files Browse the repository at this point in the history
* display proper labels for bitbucket / git in the credential dialog

* rename method

* fix label

* all i do is lint lint lint
  • Loading branch information
cliffmeyers committed Aug 16, 2017
1 parent 8a4b136 commit dc5b005
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/main/js/EditorPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ class PipelineLoader extends React.Component {
if (err.type === LoadError.JENKINSFILE_NOT_FOUND) {
this.makeEmptyPipeline();
} else if (err.type === LoadError.TOKEN_NOT_FOUND || err.type === LoadError.TOKEN_REVOKED) {
this.createTokenDialog({ loading: true });
this.showCredentialDialog({ loading: true });
} else {
this.showLoadingError(err);
}
Expand Down Expand Up @@ -385,7 +385,7 @@ class PipelineLoader extends React.Component {
)});
}

createTokenDialog({ loading = false } = {}) {
showCredentialDialog({ loading = false } = {}) {
const pipeline = pipelineService.getPipeline(this.href);
const { scmSource } = pipeline;
const title = this.getScmTitle(scmSource.id);
Expand Down Expand Up @@ -423,6 +423,12 @@ class PipelineLoader extends React.Component {
scmLabel = 'GitHub';
} else if (scmId === 'github-enterprise') {
scmLabel = 'GitHub Enterprise';
} else if (scmId === 'bitbucket-cloud') {
scmLabel = 'Bitbucket Cloud';
} else if (scmId === 'bitbucket-server') {
scmLabel = 'Bitbucket Server';
} else if (scmId === 'git') {
scmLabel = 'Git';
}

if (scmLabel) {
Expand All @@ -434,7 +440,7 @@ class PipelineLoader extends React.Component {

onCredentialStatus(status) {
if (status === 'promptReady') {
this.createTokenDialog();
this.showCredentialDialog();
}
}

Expand Down

0 comments on commit dc5b005

Please sign in to comment.