|
|
|
@ -19,7 +19,7 @@ export const GitHubCredentials = () => { |
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
refresh() |
|
|
|
|
if (context.gitHubUser){ |
|
|
|
|
if (context.gitHubUser) { |
|
|
|
|
setScopeWarning(!(context.gitHubScopes && context.gitHubScopes.length > 0)) |
|
|
|
|
} else { |
|
|
|
|
setScopeWarning(false) |
|
|
|
@ -67,14 +67,15 @@ export const GitHubCredentials = () => { |
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
<> |
|
|
|
|
<label className="text-uppercase">Enter GitHub credentials manually</label> |
|
|
|
|
<div className="input-group text-secondary mb-3 h6"> |
|
|
|
|
<input data-id='githubToken' type="password" value={githubToken} placeholder="GitHub token" className="form-control" name='githubToken' onChange={e => handleChangeTokenState(e.target.value)} /> |
|
|
|
|
<input data-id='githubToken' type="password" autoComplete="off" value={githubToken} placeholder="GitHub token" className="form-control" name='githubToken' onChange={e => handleChangeTokenState(e.target.value)} /> |
|
|
|
|
<div className="input-group-append"> |
|
|
|
|
<CopyToClipboard content={githubToken} data-id='copyToClipboardCopyIcon' className='far fa-copy ml-1 p-2 mt-1' direction={"top"} /> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<input data-id='gitubUsername' name='githubUsername' onChange={e => handleChangeUserNameState(e.target.value)} value={githubUsername} className="form-control mb-3" placeholder="Git username" type="text" id="githubUsername" /> |
|
|
|
|
<input data-id='githubEmail' name='githubEmail' onChange={e => handleChangeEmailState(e.target.value)} value={githubEmail} className="form-control mb-3" placeholder="Git email" type="text" id="githubEmail" /> |
|
|
|
|
<input data-id='gitubUsername' name='githubUsername' onChange={e => handleChangeUserNameState(e.target.value)} value={githubUsername} className="form-control mb-3" placeholder="* Git username" type="text" id="githubUsername" /> |
|
|
|
|
<input data-id='githubEmail' name='githubEmail' onChange={e => handleChangeEmailState(e.target.value)} value={githubEmail} className="form-control mb-3" placeholder="* Git email" type="text" id="githubEmail" /> |
|
|
|
|
<div className="d-flex justify-content-between"> |
|
|
|
|
<button data-id='saveGitHubCredentials' className="btn btn-primary w-100" onClick={saveGithubToken}> |
|
|
|
|
<FormattedMessage id="save" defaultMessage="Save" /> |
|
|
|
@ -82,8 +83,8 @@ export const GitHubCredentials = () => { |
|
|
|
|
<button className="btn btn-danger far fa-trash-alt" onClick={removeToken}> |
|
|
|
|
</button> |
|
|
|
|
</div> |
|
|
|
|
{scopeWarning? |
|
|
|
|
<div className="text-warning">Your GitHub token may not have the correct permissions. Please use the login with GitHub feature.</div>:null} |
|
|
|
|
{scopeWarning ? |
|
|
|
|
<div className="text-warning">Your GitHub token may not have the correct permissions. Please use the login with GitHub feature.</div> : null} |
|
|
|
|
<hr /> |
|
|
|
|
</> |
|
|
|
|
); |
|
|
|
|