Skip to content

Commit f81d3c0

Browse files
Merge pull request #178 from codacy/setup-webview
fix: refactor webview script to make it more readable + fix billing check
2 parents 3b92626 + e907bca commit f81d3c0

3 files changed

Lines changed: 319 additions & 143 deletions

File tree

src/git/CodacyCloud.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,10 @@ export class CodacyCloud implements vscode.Disposable {
592592
return this._organization?.organization
593593
}
594594

595+
get organizationWithMeta() {
596+
return this._organization
597+
}
598+
595599
get lastAnalysedCommit() {
596600
return this._repository?.lastAnalysedCommit
597601
}

src/views/SetupView.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,9 @@ export class SetupViewProvider implements vscode.WebviewViewProvider {
138138
case 'openCLISettings':
139139
vscode.commands.executeCommand('workbench.action.openSettings', 'codacy.cli')
140140
break
141+
case 'debug':
142+
Logger.appendLine(`Debug message: ${message.message}`, JSON.stringify(message.data))
143+
break
141144
default:
142145
Logger.appendLine(`Unknown message type: ${message.type}`)
143146
break
@@ -176,7 +179,7 @@ export class SetupViewProvider implements vscode.WebviewViewProvider {
176179
const isLoggedIn = !!Config.apiToken
177180
const isOrgInCodacy = this._codacyCloud?.state !== CodacyCloudState.NeedsToAddOrganization
178181
const isRepoInCodacy = this._codacyCloud?.state !== CodacyCloudState.NeedsToAddRepository
179-
const organizationInfo = this._codacyCloud?.organization
182+
const organizationInfo = this._codacyCloud?.organizationWithMeta
180183
const repositoryInfo = this._codacyCloud?.repository
181184

182185
let userInfo = undefined

0 commit comments

Comments
 (0)