]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-21403: Remove "login" field for SonarLint
authorTobias Hahnen <tobias.hahnen@sonarsource.com>
Thu, 4 Jan 2024 16:13:12 +0000 (17:13 +0100)
committersonartech <sonartech@sonarsource.com>
Fri, 5 Jan 2024 20:02:36 +0000 (20:02 +0000)
The "login" field is not required for the "Open in IDE" feature for revoking the token when no connected mode established.

server/sonar-web/src/main/js/apps/issues/components/IssueOpenInIdeButton.tsx
server/sonar-web/src/main/js/apps/issues/components/__tests__/IssueOpenInIdeButton-test.tsx
server/sonar-web/src/main/js/helpers/__tests__/sonarlint-test.ts
server/sonar-web/src/main/js/helpers/sonarlint.ts

index 2c80313ae4334dd2d50701bfa08ec107cf556165..8a1ab07731c2bcdf39f714c1075bafc3a70e3a15 100644 (file)
@@ -97,7 +97,6 @@ export function IssueOpenInIdeButton({
         branchName,
         calledPort: ide.port,
         issueKey,
-        login,
         projectKey,
         pullRequestID,
         tokenName: token.name,
index da9396e0453e3964311c19ae02379fdf521f169d..5109e4a9429ca1ffa71e5d050800116853954ca5 100644 (file)
@@ -132,7 +132,6 @@ it('handles button click with one ide found', async () => {
     branchName: undefined,
     calledPort: MOCK_IDES[0].port,
     issueKey: MOCK_ISSUE_KEY,
-    login: 'login-1',
     projectKey: MOCK_PROJECT_KEY,
     pullRequestID: undefined,
     tokenName: undefined,
@@ -181,7 +180,6 @@ it('handles button click with several ides found', async () => {
     branchName: undefined,
     calledPort: MOCK_IDES[1].port,
     issueKey: MOCK_ISSUE_KEY,
-    login: 'login-1',
     projectKey: MOCK_PROJECT_KEY,
     pullRequestID: undefined,
     tokenName: 'token name',
index b16d3026023b539106c2ce55ef394c0676d20192..ef2234a25a8d08de0ff9a99f969997e0a74d8e26 100644 (file)
@@ -95,7 +95,6 @@ describe('openHotspot', () => {
 describe('openIssue', () => {
   it('should send the correct request to the IDE to open an issue', async () => {
     let branchName: string | undefined = undefined;
-    let login: string | undefined = undefined;
     let pullRequestID: string | undefined = undefined;
     let tokenName: string | undefined = undefined;
     let tokenValue: string | undefined = undefined;
@@ -114,8 +113,6 @@ describe('openIssue', () => {
         // eslint-disable-next-line jest/no-conditional-in-test
         expect(calledUrl.searchParams.get('pullRequest') ?? undefined).toStrictEqual(pullRequestID);
         // eslint-disable-next-line jest/no-conditional-in-test
-        expect(calledUrl.searchParams.get('login') ?? undefined).toStrictEqual(login);
-        // eslint-disable-next-line jest/no-conditional-in-test
         expect(calledUrl.searchParams.get('tokenName') ?? undefined).toStrictEqual(tokenName);
         // eslint-disable-next-line jest/no-conditional-in-test
         expect(calledUrl.searchParams.get('tokenValue') ?? undefined).toStrictEqual(tokenValue);
@@ -148,10 +145,9 @@ describe('openIssue', () => {
     pullRequestID = 'pr-1';
     await testWith({ pullRequestID });
 
-    login = 'login-1';
     tokenName = 'token-name';
     tokenValue = 'token-value';
-    await testWith({ login, tokenName, tokenValue });
+    await testWith({ tokenName, tokenValue });
   });
 });
 
index 231da2aeca3f870739a2a905b267fbb2b5116f73..d187ae35b7a6f145374450f6316a4b8b067d111a 100644 (file)
@@ -97,7 +97,6 @@ export function openIssue({
   branchName,
   calledPort,
   issueKey,
-  login,
   projectKey,
   pullRequestID,
   tokenName,
@@ -106,7 +105,6 @@ export function openIssue({
   branchName?: string;
   calledPort: number;
   issueKey: string;
-  login?: string;
   projectKey: string;
   pullRequestID?: string;
   tokenName?: string;
@@ -126,8 +124,7 @@ export function openIssue({
     showUrl.searchParams.set('pullRequest', pullRequestID);
   }
 
-  if (login !== undefined && tokenName !== undefined && tokenValue !== undefined) {
-    showUrl.searchParams.set('login', login);
+  if (tokenName !== undefined && tokenValue !== undefined) {
     showUrl.searchParams.set('tokenName', tokenName);
     showUrl.searchParams.set('tokenValue', tokenValue);
   }