Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions __mocks__/packagejson.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
module.exports = {
default: {
name: 'atlascode',
publisher: 'atlassian',
rovoDev: {
version: '1.0.0'
}
Expand Down
6 changes: 3 additions & 3 deletions src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { createIssue } from './commands/jira/createIssue';
import { showIssue, showIssueForKey, showIssueForSiteIdAndKey, showIssueForURL } from './commands/jira/showIssue';
import { startWorkOnIssue } from './commands/jira/startWorkOnIssue';
import { configuration } from './config/configuration';
import { Commands, HelpTreeViewId } from './constants';
import { Commands, ExtensionId, HelpTreeViewId } from './constants';
import { Container } from './container';
import { FilterProvider } from './filter/filterProvider';
import { transitionIssue } from './jira/transitionIssue';
Expand Down Expand Up @@ -239,10 +239,10 @@ export function registerCommands(vscodeContext: ExtensionContext) {
),
// Natigate them to VSCode Native settings
commands.registerCommand(Commands.ShowPullRequestSettings, () =>
commands.executeCommand('workbench.action.openSettings', '@ext:atlassian.atlascode pull requests'),
commands.executeCommand('workbench.action.openSettings', `@ext:${ExtensionId} pull requests`),
),
commands.registerCommand(Commands.ShowPipelineSettings, () =>
commands.executeCommand('workbench.action.openSettings', '@ext:atlassian.atlascode pipeline'),
commands.executeCommand('workbench.action.openSettings', `@ext:${ExtensionId} pipeline`),
),
commands.registerCommand(Commands.JiraAPITokenLogin, () => {
const useNewAuthFlow = Container.featureFlagClient.checkGate(Features.UseNewAuthFlow);
Expand Down
6 changes: 3 additions & 3 deletions src/commands/addRecommendedExtension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import * as path from 'path';
import { Uri, window, workspace } from 'vscode';

import { addRecommendedExtensionTriggeredEvent } from '../analytics';
import { ExtensionId } from '../constants';
import { Container } from '../container';
import { Logger } from '../logger';

const ATLASCODE_EXTENSION_ID = 'atlassian.atlascode';
const VSCODE_FOLDER = '.vscode';
const EXTENSIONS_JSON_FILE = 'extensions.json';

Expand Down Expand Up @@ -59,13 +59,13 @@ export async function addAtlascodeAsRecommendedExtension(source: string = 'comma
}

// Check if atlascode is already recommended
if (extensionsConfig.recommendations.includes(ATLASCODE_EXTENSION_ID)) {
if (extensionsConfig.recommendations.includes(ExtensionId)) {
window.showInformationMessage('Atlassian extension is already in the recommended extensions list.');
return;
}

// Add atlascode to recommendations
extensionsConfig.recommendations.push(ATLASCODE_EXTENSION_ID);
extensionsConfig.recommendations.push(ExtensionId);

// Write the updated extensions.json file
try {
Expand Down
4 changes: 3 additions & 1 deletion src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export const ExtensionId = 'atlassian.atlascode';
import packageJson from 'package.json';

export const ExtensionId = `${packageJson.publisher}.${packageJson.name}`;
export const ConfigNamespace = 'atlascode';
export const extensionOutputChannelName = 'Atlassian';
export const JiraPreSelectedCreateKey = 'jira.lastCreatePreSelectedValues';
Expand Down
3 changes: 2 additions & 1 deletion src/errorReporting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import { errorEvent } from './analytics';
import { AnalyticsClient } from './analytics-node-client/src/client.min';
import { TrackEvent } from './analytics-node-client/src/types';
import { ErrorProductArea } from './analyticsTypes';
import { ExtensionId } from './constants';
import { Logger } from './logger';

const AtlascodeStackTraceHint = '/.vscode/extensions/atlassian.atlascode-';
const AtlascodeStackTraceHint = `/.vscode/extensions/${ExtensionId}-`;

let nodeJsErrorReportingRegistered = false;
let analyticsClientRegistered = false;
Expand Down
4 changes: 2 additions & 2 deletions src/webview/config/vscConfigActionApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
SiteInfo,
} from '../../atlclients/authInfo';
import { configuration, IConfig, JQLEntry } from '../../config/configuration';
import { Commands } from '../../constants';
import { Commands, ExtensionId } from '../../constants';
import { Container } from '../../container';
import { getFeedbackUser } from '../../feedback/feedbackUser';
import { AnalyticsApi } from '../../lib/analyticsApi';
Expand Down Expand Up @@ -351,7 +351,7 @@ export class VSCConfigActionApi implements ConfigActionApi {
}

public async openNativeSettings(): Promise<void> {
await commands.executeCommand('workbench.action.openSettings', '@ext:atlassian.atlascode');
await commands.executeCommand('workbench.action.openSettings', `@ext:${ExtensionId}`);
this._analyticsApi.fireOpenSettingsButtonEvent('advancedConfigsPanel');
}

Expand Down