From 872ac0b5186db6f9e98942678ed9b27ab14ba120 Mon Sep 17 00:00:00 2001 From: Benjamin Janssens Date: Fri, 14 Jun 2024 11:37:16 +0200 Subject: [PATCH] refactor: update RepoUrlPicker to be compatible with the original API Signed-off-by: Benjamin Janssens --- .../components/fields/RepoUrlPicker/RepoUrlPicker.test.tsx | 6 +++--- .../src/components/fields/RepoUrlPicker/RepoUrlPicker.tsx | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.test.tsx b/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.test.tsx index 9afbaf30f5..573838b960 100644 --- a/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.test.tsx +++ b/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.test.tsx @@ -249,7 +249,7 @@ describe('RepoUrlPicker', () => { }); expect(mockScmAuthApi.getCredentials).toHaveBeenCalledWith({ - host: 'github.com', + url: 'https://github.com', additionalScope: { repoWrite: true, customScopes: { @@ -309,7 +309,7 @@ describe('RepoUrlPicker', () => { }); expect(mockScmAuthApi.getCredentials).toHaveBeenCalledWith({ - host: 'gitlab.example.com', + url: 'https://gitlab.example.com', additionalScope: { repoWrite: true, }, @@ -359,7 +359,7 @@ describe('RepoUrlPicker', () => { }); expect(mockScmAuthApi.getCredentials).toHaveBeenCalledWith({ - host: 'server.bitbucket.org', + url: 'https://server.bitbucket.org', additionalScope: { repoWrite: true, }, diff --git a/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.tsx b/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.tsx index ad01ee0fd7..85245639b0 100644 --- a/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.tsx +++ b/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.tsx @@ -137,7 +137,7 @@ export const RepoUrlPicker = (props: RepoUrlPickerProps) => { // so lets grab them using the scmAuthApi and pass through // any additional scopes from the ui:options const { token } = await scmAuthApi.getCredentials({ - host: state.host, + url: `https://${state.host}`, additionalScope: { repoWrite: true, customScopes: requestUserCredentials.additionalScopes,