mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-06 08:37:22 +00:00
Fix origin type errors
This commit is contained in:
3 files changed
+8
-12
No files matched your search
@@ -20,8 +20,7 @@ function TestComponent() {
|
|||||||
const credential: GitCredential = {
|
const credential: GitCredential = {
|
||||||
id: crypto.randomUUID(),
|
id: crypto.randomUUID(),
|
||||||
name: 'GitHub',
|
name: 'GitHub',
|
||||||
protocol: 'https',
|
origin: 'https://github.com',
|
||||||
host: 'github.com',
|
|
||||||
username: 'git',
|
username: 'git',
|
||||||
password: 'test-token',
|
password: 'test-token',
|
||||||
};
|
};
|
||||||
@@ -29,7 +28,7 @@ function TestComponent() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleUpdate = () => {
|
const handleUpdate = () => {
|
||||||
const githubCred = settings.credentials.find(c => c.host === 'github.com');
|
const githubCred = settings.credentials.find(c => c.origin === 'https://github.com');
|
||||||
if (githubCred) {
|
if (githubCred) {
|
||||||
const updatedCredentials = settings.credentials.map((cred) =>
|
const updatedCredentials = settings.credentials.map((cred) =>
|
||||||
cred.id === githubCred.id ? { ...cred, password: 'updated-token' } : cred
|
cred.id === githubCred.id ? { ...cred, password: 'updated-token' } : cred
|
||||||
@@ -39,13 +38,13 @@ function TestComponent() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleRemove = () => {
|
const handleRemove = () => {
|
||||||
const githubCred = settings.credentials.find(c => c.host === 'github.com');
|
const githubCred = settings.credentials.find(c => c.origin === 'https://github.com');
|
||||||
if (githubCred) {
|
if (githubCred) {
|
||||||
removeCredential(githubCred.id);
|
removeCredential(githubCred.id);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const githubCred = settings.credentials.find(c => c.host === 'github.com');
|
const githubCred = settings.credentials.find(c => c.origin === 'https://github.com');
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
@@ -181,8 +180,7 @@ describe('GitSettingsProvider', () => {
|
|||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
credentials: expect.arrayContaining([
|
credentials: expect.arrayContaining([
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
protocol: 'https',
|
origin: 'https://github.com',
|
||||||
host: 'github.com',
|
|
||||||
username: 'git',
|
username: 'git',
|
||||||
password: 'test-token',
|
password: 'test-token',
|
||||||
})
|
})
|
||||||
@@ -199,8 +197,7 @@ describe('GitSettingsProvider', () => {
|
|||||||
{
|
{
|
||||||
id: crypto.randomUUID(),
|
id: crypto.randomUUID(),
|
||||||
name: 'GitLab',
|
name: 'GitLab',
|
||||||
protocol: 'https',
|
origin: 'https://gitlab.com',
|
||||||
host: 'gitlab.com',
|
|
||||||
username: 'git',
|
username: 'git',
|
||||||
password: 'gitlab-token',
|
password: 'gitlab-token',
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -442,7 +442,7 @@ export function PullRequestDialog({
|
|||||||
if (remoteInfo.platform !== 'nostr') {
|
if (remoteInfo.platform !== 'nostr') {
|
||||||
credentials = findCredentialsForRepo(remoteUrl || '', settings.credentials);
|
credentials = findCredentialsForRepo(remoteUrl || '', settings.credentials);
|
||||||
console.log('Found credentials:', credentials ? 'Yes' : 'No');
|
console.log('Found credentials:', credentials ? 'Yes' : 'No');
|
||||||
console.log('Available credentials:', settings.credentials.map(c => `${c.protocol}://${c.host}`));
|
console.log('Available credentials:', settings.credentials.map(c => c.origin));
|
||||||
|
|
||||||
if (credentials) {
|
if (credentials) {
|
||||||
console.log('Credential username:', credentials.username);
|
console.log('Credential username:', credentials.username);
|
||||||
|
|||||||
@@ -74,8 +74,7 @@ export function useGitHubOAuth() {
|
|||||||
addCredential({
|
addCredential({
|
||||||
id: crypto.randomUUID(),
|
id: crypto.randomUUID(),
|
||||||
name: 'GitHub',
|
name: 'GitHub',
|
||||||
protocol: 'https',
|
origin: 'https://github.com',
|
||||||
host: 'github.com',
|
|
||||||
username: result.username || 'git',
|
username: result.username || 'git',
|
||||||
password: result.accessToken,
|
password: result.accessToken,
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in new issue
Block a user