Skip to content

Commit cd18a59

Browse files
Adds org whitelist to launchpad settings
1 parent f5403fa commit cd18a59

File tree

5 files changed

+24
-4
lines changed

5 files changed

+24
-4
lines changed

package.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1237,6 +1237,16 @@
12371237
"scope": "window",
12381238
"order": 10
12391239
},
1240+
"gitlens.launchpad.includedOrganizations": {
1241+
"type": "array",
1242+
"default": [],
1243+
"items": {
1244+
"type": "string"
1245+
},
1246+
"markdownDescription": "Specifies the organizations to include in the _Launchpad_. If empty, all organizations are included",
1247+
"scope": "window",
1248+
"order": 11
1249+
},
12401250
"gitlens.launchpad.ignoredOrganizations": {
12411251
"type": "array",
12421252
"default": [],
@@ -1245,7 +1255,7 @@
12451255
},
12461256
"markdownDescription": "Specifies the organizations to ignore in the _Launchpad_",
12471257
"scope": "window",
1248-
"order": 11
1258+
"order": 12
12491259
},
12501260
"gitlens.launchpad.staleThreshold": {
12511261
"type": [

src/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ export interface Config {
9191
};
9292
readonly launchpad: {
9393
readonly allowMultiple: boolean;
94+
readonly includedOrganizations: string[];
9495
readonly ignoredOrganizations: string[];
9596
readonly ignoredRepositories: string[];
9697
readonly staleThreshold: number | null;

src/constants.telemetry.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ export type TelemetryEvents = {
183183
/** Sent when the user changes launchpad configuration settings */
184184
'launchpad/configurationChanged': {
185185
'config.launchpad.staleThreshold': number | null;
186+
'config.launchpad.includedOrganizations': number;
186187
'config.launchpad.ignoredOrganizations': number;
187188
'config.launchpad.ignoredRepositories': number;
188189
'config.launchpad.indicator.enabled': boolean;

src/plus/integrations/providers/github/github.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2874,9 +2874,15 @@ export class GitHubApi implements Disposable {
28742874
}
28752875

28762876
// Hack for now, ultimately this should be passed in
2877-
const ignoredOrgs = configuration.get('launchpad.ignoredOrganizations') ?? [];
2878-
if (ignoredOrgs.length) {
2879-
search += ` -org:${ignoredOrgs.join(' -org:')}`;
2877+
const enabledOrgs = configuration.get('launchpad.includedOrganizations') ?? [];
2878+
if (enabledOrgs.length) {
2879+
search += ` org:${enabledOrgs.join(' org:')}`;
2880+
} else {
2881+
// Hack for now, ultimately this should be passed in
2882+
const ignoredOrgs = configuration.get('launchpad.ignoredOrganizations') ?? [];
2883+
if (ignoredOrgs.length) {
2884+
search += ` -org:${ignoredOrgs.join(' -org:')}`;
2885+
}
28802886
}
28812887

28822888
const rsp = await this.graphql<SearchResult>(

src/plus/launchpad/launchpadProvider.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -891,6 +891,7 @@ export class LaunchpadProvider implements Disposable {
891891
const cfg = configuration.get('launchpad');
892892
this.container.telemetry.sendEvent('launchpad/configurationChanged', {
893893
'config.launchpad.staleThreshold': cfg.staleThreshold,
894+
'config.launchpad.includedOrganizations': cfg.includedOrganizations?.length ?? 0,
894895
'config.launchpad.ignoredOrganizations': cfg.ignoredOrganizations?.length ?? 0,
895896
'config.launchpad.ignoredRepositories': cfg.ignoredRepositories?.length ?? 0,
896897
'config.launchpad.indicator.enabled': cfg.indicator.enabled,
@@ -903,6 +904,7 @@ export class LaunchpadProvider implements Disposable {
903904
});
904905

905906
if (
907+
configuration.changed(e, 'launchpad.includedOrganizations') ||
906908
configuration.changed(e, 'launchpad.ignoredOrganizations') ||
907909
configuration.changed(e, 'launchpad.ignoredRepositories') ||
908910
configuration.changed(e, 'launchpad.staleThreshold')

0 commit comments

Comments
 (0)