Skip to content

Commit e6ac8f5

Browse files
committed
Feature Flag, Routing, and UI Set up and partial integration for dev env
Set up feature flag for configs v3 and the routing for accessing the UI of the new config page. Still need to set up analytics to have a fully performative feature flag and routing set up. Working out the UI of new config page currently.
1 parent 984d0f4 commit e6ac8f5

File tree

12 files changed

+428
-4
lines changed

12 files changed

+428
-4
lines changed

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,11 @@
332332
"title": "Open Settings",
333333
"category": "Atlassian"
334334
},
335+
{
336+
"command": "atlascode.showConfigPageV3",
337+
"title": "Open Settings V3",
338+
"category": "Atlassian"
339+
},
335340
{
336341
"command": "atlascode.extensionContext.showConfigPage",
337342
"title": "Extension Settings (UI)",

src/commands.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ export function registerCommands(vscodeContext: ExtensionContext) {
4848
subSection: ConfigSubSection.Auth,
4949
}),
5050
),
51+
commands.registerCommand(Commands.ShowConfigPageV3, () =>
52+
Container.settingsV3WebviewFactory.createOrShow({
53+
section: ConfigSection.Jira,
54+
subSection: ConfigSubSection.Auth,
55+
}),
56+
),
5157
commands.registerCommand(Commands.ShowConfigPageFromExtensionContext, () => {
5258
Container.analyticsApi.fireOpenSettingsButtonEvent('extensionContext');
5359
Container.settingsWebviewFactory.createOrShow({

src/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ export const enum Commands {
5656
ShowIssueForSiteIdAndKey = 'atlascode.jira.showIssueForSiteIdAndKey',
5757
ShowIssueForURL = 'atlascode.jira.showIssueForURL',
5858
ShowConfigPage = 'atlascode.showConfigPage',
59+
ShowConfigPageV3 = 'atlascode.showConfigPageV3',
5960
ShowConfigPageFromExtensionContext = 'atlascode.extensionContext.showConfigPage',
6061
ShowJiraAuth = 'atlascode.showJiraAuth',
6162
ShowBitbucketAuth = 'atlascode.showBitbucketAuth',

src/container.ts

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import { RovoDevCodeActionProvider } from './rovo-dev/rovoDevCodeActionProvider'
3535
import { RovoDevDecorator } from './rovo-dev/rovoDevDecorator';
3636
import { RovoDevWebviewProvider } from './rovo-dev/rovoDevWebviewProvider';
3737
import { SiteManager } from './siteManager';
38-
import { AtlascodeUriHandler, ONBOARDING_URL, SETTINGS_URL } from './uriHandler';
38+
import { AtlascodeUriHandler, ONBOARDING_URL, SETTINGS_URL, SETTINGS_URL_V3 } from './uriHandler';
3939
import { FeatureFlagClient, FeatureFlagClientInitError } from './util/featureFlags';
4040
import { AuthStatusBar } from './views/authStatusBar';
4141
import { HelpExplorer } from './views/HelpExplorer';
@@ -48,6 +48,7 @@ import { PipelinesExplorer } from './views/pipelines/PipelinesExplorer';
4848
import { VSCAnalyticsApi } from './vscAnalyticsApi';
4949
import { VSCCommonMessageHandler } from './webview/common/vscCommonMessageActionHandler';
5050
import { VSCConfigActionApi } from './webview/config/vscConfigActionApi';
51+
import { VSCConfigV3WebviewControllerFactory } from './webview/config/vscConfigV3WebviewControllerFactory';
5152
import { VSCConfigWebviewControllerFactory } from './webview/config/vscConfigWebviewControllerFactory';
5253
import { ExplorerFocusManager } from './webview/ExplorerFocusManager';
5354
import { MultiWebview } from './webview/multiViewFactory';
@@ -124,6 +125,17 @@ export class Container {
124125
this._analyticsApi,
125126
);
126127

128+
const settingsV3ViewFactory = new SingleWebview<SectionChangeMessage, ConfigAction>(
129+
context.extensionPath,
130+
new VSCConfigV3WebviewControllerFactory(
131+
new VSCConfigActionApi(this._analyticsApi, this._cancellationManager),
132+
this._commonMessageHandler,
133+
this._analyticsApi,
134+
SETTINGS_URL_V3,
135+
),
136+
this._analyticsApi,
137+
);
138+
127139
const onboardingV2ViewFactory = new SingleWebview<any, OnboardingAction>(
128140
context.extensionPath,
129141
new VSCOnboardingWebviewControllerFactory(
@@ -166,6 +178,7 @@ export class Container {
166178
);
167179

168180
context.subscriptions.push((this._settingsWebviewFactory = settingsV2ViewFactory));
181+
context.subscriptions.push((this._settingsV3WebviewFactory = settingsV3ViewFactory));
169182
context.subscriptions.push((this._onboardingWebviewFactory = onboardingV2ViewFactory));
170183
context.subscriptions.push((this._startWorkWebviewFactory = startWorkV2ViewFactory));
171184
context.subscriptions.push((this._startWorkV3WebviewFactory = startWorkV3ViewFactory));
@@ -365,6 +378,11 @@ export class Container {
365378
return this._settingsWebviewFactory;
366379
}
367380

381+
private static _settingsV3WebviewFactory: SingleWebview<SectionChangeMessage, ConfigAction>;
382+
public static get settingsV3WebviewFactory() {
383+
return this._settingsV3WebviewFactory;
384+
}
385+
368386
private static _onboardingWebviewFactory: SingleWebview<any, OnboardingAction>;
369387
public static get onboardingWebviewFactory() {
370388
return this._onboardingWebviewFactory;

src/lib/ipc/models/config.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ export enum ConfigSection {
1111
Explore = 'explore',
1212
}
1313

14+
export enum ConfigV3Section {
15+
Auth = 'auth',
16+
AdvancedConfig = 'advancedConfig',
17+
Explore = 'explore',
18+
}
19+
1420
export enum ConfigSubSection {
1521
Auth = 'auth',
1622
Issues = 'issues',
@@ -29,4 +35,9 @@ export enum ConfigSubSection {
2935
StartWork = 'startWork',
3036
}
3137

38+
export enum ConfigV3SubSection {
39+
BBAuth = 'bitbucketAuth',
40+
jiraAuth = 'jiraAuth',
41+
}
42+
3243
export type FlattenedConfig = { [key: string]: any };

src/lib/webview/controller/config/configWebviewController.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ import { ConfigActionApi } from './configActionApi';
2121

2222
const AUTH_URI = `${env.uriScheme || 'vscode'}://${ExtensionId}/auth`;
2323

24-
export const id: string = 'atlascodeSettingsV2';
24+
export const id: string = 'atlascodeSettingsV2'; // Need to change this to 'id_v2' to help with dif versions
25+
export const id_v3: string = 'atlascodeSettingsV3';
2526

2627
export class ConfigWebviewController implements WebviewController<SectionChangeMessage> {
2728
public readonly requiredFeatureFlags = [];

0 commit comments

Comments
 (0)