Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PM-12273] Admin Console Integration Page #11883

Merged
merged 26 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
e58470c
Integration page initial implementation
BTreston Nov 6, 2024
57d1996
replace placeholder integrations
BTreston Nov 6, 2024
81545e6
fix linting and tests
BTreston Nov 6, 2024
9950dcd
fix locales
BTreston Nov 6, 2024
19c81ad
update locale
BTreston Nov 6, 2024
757d9af
Change logos, add link to SCIM page
BTreston Nov 12, 2024
7a001ff
refactor to standalone components, add integration filtering pipe
BTreston Nov 13, 2024
d08fcf4
refactor modules and imports. Remove hyperlink text from integration โ€ฆ
BTreston Nov 13, 2024
d51fd2e
refactor i18n usage to be more generic
BTreston Nov 13, 2024
00d2750
Add storybooks
BTreston Nov 14, 2024
bd17d12
fix tests
BTreston Nov 14, 2024
5d783d1
Merge branch 'main' into ac/pm-12273-integration-page
BTreston Nov 14, 2024
08e8485
minify svgs, include spec files in TS config, fix stories
BTreston Nov 15, 2024
068a143
Update apps/web/src/locales/en/messages.json
BTreston Nov 18, 2024
bef43a4
fix imports, add static dir for stories
BTreston Nov 18, 2024
d337521
Merge branch 'main' into ac/pm-12273-integration-page
BTreston Nov 19, 2024
8ef5ceb
Add darkmode svgs for integrations
BTreston Nov 21, 2024
c5e7916
Merge branch 'ac/pm-12273-integration-page' of github.com:bitwarden/cโ€ฆ
BTreston Nov 21, 2024
b3ca48a
Merge branch 'main' into ac/pm-12273-integration-page
BTreston Nov 21, 2024
fb3b903
Merge branch 'main' into ac/pm-12273-integration-page
BTreston Nov 22, 2024
c088806
hide nav link for non enterprise orgs
BTreston Nov 22, 2024
ac1e4b1
add router guard
BTreston Nov 25, 2024
18d4881
change rxjs selector
BTreston Nov 25, 2024
855f153
Remove tailwind class causing style issues
BTreston Dec 3, 2024
59b0693
Merge branch 'main' into ac/pm-12273-integration-page
BTreston Dec 3, 2024
0030483
Merge branch 'main' into ac/pm-12273-integration-page
BTreston Dec 4, 2024
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
1 change: 1 addition & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ const config: StorybookConfig = {
return config;
},
docs: {},
staticDirs: ["../apps/web/src/images"],
eliykat marked this conversation as resolved.
Show resolved Hide resolved
};

export default config;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<app-header> </app-header>

<bit-tab-group [(selectedIndex)]="tabIndex">
<bit-tab [label]="'singleSignOn' | i18n">
<section class="tw-mb-9">
<h2 bitTypography="h2">{{ "singleSignOn" | i18n }}</h2>
<p bitTypography="body1">
{{ "ssoDescStart" | i18n }}
<a bitLink routerLink="../settings/sso" class="tw-lowercase">{{ "singleSignOn" | i18n }}</a>
{{ "ssoDescEnd" | i18n }}
</p>
<app-integration-grid
[integrations]="integrationsList | filterIntegrations: IntegrationType.SSO"
willmartian marked this conversation as resolved.
Show resolved Hide resolved
></app-integration-grid>
</section>
</bit-tab>

<bit-tab [label]="'userProvisioning' | i18n">
<section class="tw-mb-9">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is also a bit-section component in the DS if you want consistent spacing with other sections in the app. Not sure if this needs to be different or not. cc @bitwarden/dept-design

<h2 bitTypography="h2">
{{ "scimIntegration" | i18n }}
</h2>
<p bitTypography="body1">
{{ "scimIntegrationDescStart" | i18n }}
<a bitLink routerLink="../settings/scim">{{ "scimIntegration" | i18n }}</a>
{{ "scimIntegrationDescEnd" | i18n }}
</p>
<app-integration-grid
[integrations]="integrationsList | filterIntegrations: IntegrationType.SCIM"
></app-integration-grid>
</section>
<section class="tw-mb-9">
<h2 bitTypography="h2">
{{ "bwdc" | i18n }}
</h2>
<p bitTypography="body1">{{ "bwdcDesc" | i18n }}</p>
<app-integration-grid
[integrations]="integrationsList | filterIntegrations: IntegrationType.BWDC"
></app-integration-grid>
</section>
</bit-tab>

<bit-tab [label]="'eventManagement' | i18n">
<section class="tw-mb-9">
<h2 bitTypography="h2">
{{ "eventManagement" | i18n }}
</h2>
<p bitTypography="body1">{{ "eventManagementDesc" | i18n }}</p>
<app-integration-grid
[integrations]="integrationsList | filterIntegrations: IntegrationType.EVENT"
></app-integration-grid>
</section>
</bit-tab>

<bit-tab [label]="'deviceManagement' | i18n">
<section class="tw-mb-9">
<h2 bitTypography="h2">
{{ "deviceManagement" | i18n }}
</h2>
<p bitTypography="body1">{{ "deviceManagementDesc" | i18n }}</p>
<app-integration-grid
[integrations]="integrationsList | filterIntegrations: IntegrationType.DEVICE"
></app-integration-grid>
</section>
</bit-tab>
</bit-tab-group>
Original file line number Diff line number Diff line change
@@ -0,0 +1,207 @@
import { Component } from "@angular/core";

Check warning on line 1 in apps/web/src/app/admin-console/organizations/integrations/integrations.component.ts

View check run for this annotation

Codecov / codecov/patch

apps/web/src/app/admin-console/organizations/integrations/integrations.component.ts#L1

Added line #L1 was not covered by tests

import { IntegrationType } from "@bitwarden/common/enums";

Check warning on line 3 in apps/web/src/app/admin-console/organizations/integrations/integrations.component.ts

View check run for this annotation

Codecov / codecov/patch

apps/web/src/app/admin-console/organizations/integrations/integrations.component.ts#L3

Added line #L3 was not covered by tests

import { HeaderModule } from "../../../layouts/header/header.module";
import { FilterIntegrationsPipe, IntegrationGridComponent, Integration } from "../../../shared/";
import { SharedModule } from "../../../shared/shared.module";
import { SharedOrganizationModule } from "../shared";

Check warning on line 8 in apps/web/src/app/admin-console/organizations/integrations/integrations.component.ts

View check run for this annotation

Codecov / codecov/patch

apps/web/src/app/admin-console/organizations/integrations/integrations.component.ts#L5-L8

Added lines #L5 - L8 were not covered by tests

@Component({
selector: "ac-integrations",
templateUrl: "./integrations.component.html",
standalone: true,
imports: [
SharedModule,
SharedOrganizationModule,
IntegrationGridComponent,
HeaderModule,
FilterIntegrationsPipe,
],
})
export class AdminConsoleIntegrationsComponent {
integrationsList: Integration[] = [];

Check warning on line 23 in apps/web/src/app/admin-console/organizations/integrations/integrations.component.ts

View check run for this annotation

Codecov / codecov/patch

apps/web/src/app/admin-console/organizations/integrations/integrations.component.ts#L22-L23

Added lines #L22 - L23 were not covered by tests
tabIndex: number;

constructor() {
this.integrationsList = [

Check warning on line 27 in apps/web/src/app/admin-console/organizations/integrations/integrations.component.ts

View check run for this annotation

Codecov / codecov/patch

apps/web/src/app/admin-console/organizations/integrations/integrations.component.ts#L27

Added line #L27 was not covered by tests
{
name: "AD FS",
willmartian marked this conversation as resolved.
Show resolved Hide resolved
linkURL: "https://bitwarden.com/help/saml-adfs/",
image: "../../../../../../../images/integrations/azure-active-directory.svg",
type: IntegrationType.SSO,
},
{
name: "Auth0",
linkURL: "https://bitwarden.com/help/saml-auth0/",
image: "../../../../../../../images/integrations/logo-auth0-badge-color.svg",
type: IntegrationType.SSO,
},
{
name: "AWS",
linkURL: "https://bitwarden.com/help/saml-aws/",
image: "../../../../../../../images/integrations/aws-color.svg",
imageDarkMode: "../../../../../../../images/integrations/aws-darkmode.svg",
type: IntegrationType.SSO,
},
{
name: "Microsoft Entra ID",
linkURL: "https://bitwarden.com/help/saml-azure/",
image: "../../../../../../../images/integrations/logo-microsoft-entra-id-color.svg",
type: IntegrationType.SSO,
},
{
name: "Duo",
linkURL: "https://bitwarden.com/help/saml-duo/",
image: "../../../../../../../images/integrations/logo-duo-color.svg",
type: IntegrationType.SSO,
},
{
name: "Google",
linkURL: "https://bitwarden.com/help/saml-google/",
image: "../../../../../../../images/integrations/logo-google-badge-color.svg",
type: IntegrationType.SSO,
},
{
name: "JumpCloud",
linkURL: "https://bitwarden.com/help/saml-jumpcloud/",
image: "../../../../../../../images/integrations/logo-jumpcloud-badge-color.svg",
imageDarkMode: "../../../../../../../images/integrations/jumpcloud-darkmode.svg",
type: IntegrationType.SSO,
},
{
name: "KeyCloak",
linkURL: "https://bitwarden.com/help/saml-keycloak/",
image: "../../../../../../../images/integrations/logo-keycloak-icon.svg",
type: IntegrationType.SSO,
},
{
name: "Okta",
linkURL: "https://bitwarden.com/help/saml-okta/",
image: "../../../../../../../images/integrations/logo-okta-symbol-black.svg",
imageDarkMode: "../../../../../../../images/integrations/okta-darkmode.svg",
type: IntegrationType.SSO,
},
{
name: "OneLogin",
linkURL: "https://bitwarden.com/help/saml-onelogin/",
image: "../../../../../../../images/integrations/logo-onelogin-badge-color.svg",
imageDarkMode: "../../../../../../../images/integrations/onelogin-darkmode.svg",
type: IntegrationType.SSO,
},
{
name: "PingFederate",
linkURL: "https://bitwarden.com/help/saml-pingfederate/",
image: "../../../../../../../images/integrations/logo-ping-identity-badge-color.svg",
type: IntegrationType.SSO,
},
{
name: "Microsoft Entra ID",
linkURL: "https://bitwarden.com/help/microsoft-entra-id-scim-integration/",
image: "../../../../../../../images/integrations/logo-microsoft-entra-id-color.svg",
type: IntegrationType.SCIM,
},
{
name: "Okta",
linkURL: "https://bitwarden.com/help/okta-scim-integration/",
image: "../../../../../../../images/integrations/logo-okta-symbol-black.svg",
imageDarkMode: "../../../../../../../images/integrations/okta-darkmode.svg",
type: IntegrationType.SCIM,
},
{
name: "OneLogin",
linkURL: "https://bitwarden.com/help/onelogin-scim-integration/",
image: "../../../../../../../images/integrations/logo-onelogin-badge-color.svg",
imageDarkMode: "../../../../../../../images/integrations/onelogin-darkmode.svg",
type: IntegrationType.SCIM,
},
{
name: "JumpCloud",
linkURL: "https://bitwarden.com/help/jumpcloud-scim-integration/",
image: "../../../../../../../images/integrations/logo-jumpcloud-badge-color.svg",
imageDarkMode: "../../../../../../../images/integrations/jumpcloud-darkmode.svg",
type: IntegrationType.SCIM,
},
{
name: "Ping Identity",
linkURL: "https://bitwarden.com/help/ping-identity-scim-integration/",
image: "../../../../../../../images/integrations/logo-ping-identity-badge-color.svg",
type: IntegrationType.SCIM,
},
{
name: "Active Directory",
linkURL: "https://bitwarden.com/help/ldap-directory/",
image: "../../../../../../../images/integrations/azure-active-directory.svg",
type: IntegrationType.BWDC,
},
{
name: "Microsoft Entra ID",
linkURL: "https://bitwarden.com/help/microsoft-entra-id/",
image: "../../../../../../../images/integrations/logo-microsoft-entra-id-color.svg",
type: IntegrationType.BWDC,
},
{
name: "Google Workspace",
linkURL: "https://bitwarden.com/help/workspace-directory/",
image: "../../../../../../../images/integrations/logo-google-badge-color.svg",
type: IntegrationType.BWDC,
},
{
name: "Okta",
linkURL: "https://bitwarden.com/help/okta-directory/",
image: "../../../../../../../images/integrations/logo-okta-symbol-black.svg",
imageDarkMode: "../../../../../../../images/integrations/okta-darkmode.svg",
type: IntegrationType.BWDC,
},
{
name: "OneLogin",
linkURL: "https://bitwarden.com/help/onelogin-directory/",
image: "../../../../../../../images/integrations/logo-onelogin-badge-color.svg",
imageDarkMode: "../../../../../../../images/integrations/onelogin-darkmode.svg",
type: IntegrationType.BWDC,
},
{
name: "Splunk",
linkURL: "https://bitwarden.com/help/splunk-siem/",
image: "../../../../../../../images/integrations/logo-splunk-black.svg",
imageDarkMode: "../../../../../../../images/integrations/splunk-darkmode.svg",
type: IntegrationType.EVENT,
},
{
name: "Microsoft Sentinel",
linkURL: "https://bitwarden.com/help/microsoft-sentinel-siem/",
image: "../../../../../../../images/integrations/logo-microsoft-sentinel-color.svg",
type: IntegrationType.EVENT,
},
{
name: "Rapid7",
linkURL: "https://bitwarden.com/help/rapid7-siem/",
image: "../../../../../../../images/integrations/logo-rapid7-black.svg",
imageDarkMode: "../../../../../../../images/integrations/rapid7-darkmode.svg",
type: IntegrationType.EVENT,
},
{
name: "Elastic",
linkURL: "https://bitwarden.com/help/elastic-siem/",
image: "../../../../../../../images/integrations/logo-elastic-badge-color.svg",
type: IntegrationType.EVENT,
},
{
name: "Panther",
linkURL: "https://bitwarden.com/help/panther-siem/",
image: "../../../../../../../images/integrations/logo-panther-round-color.svg",
type: IntegrationType.EVENT,
},
{
name: "Microsoft Intune",
linkURL: "https://bitwarden.com/help/deploy-browser-extensions-with-intune/",
image: "../../../../../../../images/integrations/logo-microsoft-intune-color.svg",
type: IntegrationType.DEVICE,
},
];
}

get IntegrationType(): typeof IntegrationType {
return IntegrationType;

Check warning on line 205 in apps/web/src/app/admin-console/organizations/integrations/integrations.component.ts

View check run for this annotation

Codecov / codecov/patch

apps/web/src/app/admin-console/organizations/integrations/integrations.component.ts#L205

Added line #L205 was not covered by tests
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@
<bit-nav-item [text]="'billingHistory' | i18n" route="billing/history"></bit-nav-item>
</ng-container>
</bit-nav-group>
<bit-nav-item
icon="bwi-providers"
[text]="'integrations' | i18n"
route="integrations"
*ngIf="integrationPageEnabled$ | async"
></bit-nav-item>
<bit-nav-group
icon="bwi-cog"
[text]="'settings' | i18n"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { CommonModule } from "@angular/common";
import { Component, OnInit } from "@angular/core";
import { ActivatedRoute, RouterModule } from "@angular/router";
import { combineLatest, filter, map, Observable, switchMap } from "rxjs";
import { combineLatest, filter, map, Observable, switchMap, withLatestFrom } from "rxjs";

import { JslibModule } from "@bitwarden/angular/jslib.module";
import {
Expand All @@ -18,6 +18,7 @@
import { ProviderService } from "@bitwarden/common/admin-console/abstractions/provider.service";
import { PolicyType, ProviderStatusType } from "@bitwarden/common/admin-console/enums";
import { Organization } from "@bitwarden/common/admin-console/models/domain/organization";
import { ProductTierType } from "@bitwarden/common/billing/enums";
import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum";
import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service";
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
Expand Down Expand Up @@ -47,12 +48,15 @@

protected orgFilter = (org: Organization) => canAccessOrgAdmin(org);

protected integrationPageEnabled$: Observable<boolean>;

organization$: Observable<Organization>;
canAccessExport$: Observable<boolean>;
showPaymentAndHistory$: Observable<boolean>;
hideNewOrgButton$: Observable<boolean>;
organizationIsUnmanaged$: Observable<boolean>;
isAccessIntelligenceFeatureEnabled = false;
enterpriseOrganization$: Observable<boolean>;

constructor(
private route: ActivatedRoute,
Expand Down Expand Up @@ -104,6 +108,16 @@
provider.providerStatus !== ProviderStatusType.Billable,
),
);

this.integrationPageEnabled$ = this.organization$.pipe(

Check warning on line 112 in apps/web/src/app/admin-console/organizations/layouts/organization-layout.component.ts

View check run for this annotation

Codecov / codecov/patch

apps/web/src/app/admin-console/organizations/layouts/organization-layout.component.ts#L112

Added line #L112 was not covered by tests
withLatestFrom(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think combineLatest is a better fit here. It will emit all new values when any source observable emits, which is better for independent observables (e.g. an org and a feature flag state - you need both but they emit independently).

With your current use of withLatestFrom, if the feature flag updates during execution, it won't emit a new value until and unless the organization$ observable emits a new value (which it might never do, so you never get an updated emission).

this.configService.getFeatureFlag$(FeatureFlag.PM14505AdminConsoleIntegrationPage),
),
map(
([org, featrueFlagEnabled]) =>
org.productTierType === ProductTierType.Enterprise && featrueFlagEnabled,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this right? Some integrations listed are available for Free and Teams orgs (e.g. Directory Connector is available for Teams, SM integrations are available for all plan types to my knowledge). We might need more granular logic for each section within the integration page. Can you check with Priya?

If that does need further work, you might consider merging your initial work (given that it's behind a feature flag) and then making these further changes in a separate PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Navigation permissions should also be enforced at the routing level, see organizationPermissionsGuard. (There are lots of example uses.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eliykat I've added the routing permissions and will merge this if its good to go. The org tier logic will come in a followup PR.

),
);
}

canShowVaultTab(organization: Organization): boolean {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { RouterModule, Routes } from "@angular/router";

import { authGuard } from "@bitwarden/angular/auth/guards";
import { canAccessFeature } from "@bitwarden/angular/platform/guard/feature-flag.guard";

Check warning on line 5 in apps/web/src/app/admin-console/organizations/organization-routing.module.ts

View check run for this annotation

Codecov / codecov/patch

apps/web/src/app/admin-console/organizations/organization-routing.module.ts#L5

Added line #L5 was not covered by tests
import {
canAccessOrgAdmin,
canAccessGroupsTab,
Expand All @@ -11,13 +12,15 @@
canAccessSettingsTab,
} from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction";
import { Organization } from "@bitwarden/common/admin-console/models/domain/organization";
import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum";

Check warning on line 15 in apps/web/src/app/admin-console/organizations/organization-routing.module.ts

View check run for this annotation

Codecov / codecov/patch

apps/web/src/app/admin-console/organizations/organization-routing.module.ts#L15

Added line #L15 was not covered by tests

import { organizationPermissionsGuard } from "../../admin-console/organizations/guards/org-permissions.guard";
import { organizationRedirectGuard } from "../../admin-console/organizations/guards/org-redirect.guard";
import { OrganizationLayoutComponent } from "../../admin-console/organizations/layouts/organization-layout.component";
import { deepLinkGuard } from "../../auth/guards/deep-link.guard";
import { VaultModule } from "../../vault/org-vault/vault.module";

import { AdminConsoleIntegrationsComponent } from "./integrations/integrations.component";

Check warning on line 23 in apps/web/src/app/admin-console/organizations/organization-routing.module.ts

View check run for this annotation

Codecov / codecov/patch

apps/web/src/app/admin-console/organizations/organization-routing.module.ts#L23

Added line #L23 was not covered by tests
import { GroupsComponent } from "./manage/groups.component";

const routes: Routes = [
Expand All @@ -36,6 +39,14 @@
path: "vault",
loadChildren: () => VaultModule,
},
{
path: "integrations",
canActivate: [canAccessFeature(FeatureFlag.PM14505AdminConsoleIntegrationPage)],
component: AdminConsoleIntegrationsComponent,
data: {
titleId: "integrations",
},
},
{
path: "settings",
loadChildren: () =>
Expand Down
4 changes: 4 additions & 0 deletions apps/web/src/app/shared/components/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export * from "./integrations/integration-card/integration-card.component";
export * from "./integrations/integration-grid/integration-grid.component";
export * from "./integrations/integrations.pipe";
export * from "./integrations/models";
Loading
Loading