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

Conversation

BTreston
Copy link
Contributor

@BTreston BTreston commented Nov 6, 2024

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-12273

📔 Objective

This PR adds a new Integrations page in Admin console and refactors the Integration Card and Integration Grid components from living in Secrets Manager to being in Shared Components.

📸 Screenshots

Screen.Recording.2024-11-13.at.8.37.48.PM.mov

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

Copy link
Contributor

github-actions bot commented Nov 6, 2024

Logo
Checkmarx One – Scan Summary & Details83daac9b-c605-4267-a1ca-d3a5d4c658da

New Issues

Severity Issue Source File / Package Checkmarx Insight
LOW Unsafe_Use_Of_Target_blank /bitwarden_license/bit-web/src/app/admin-console/organizations/manage/scim.component.html: 5 Attack Vector

Fixed Issues

Severity Issue Source File / Package
LOW Client_JQuery_Deprecated_Symbols /apps/cli/src/service-container/service-container.ts: 876

@BTreston BTreston marked this pull request as ready for review November 6, 2024 19:12
@BTreston BTreston requested review from a team as code owners November 6, 2024 19:12
Copy link

codecov bot commented Nov 6, 2024

Codecov Report

Attention: Patch coverage is 33.80282% with 47 lines in your changes missing coverage. Please review.

Project coverage is 33.53%. Comparing base (b25dc63) to head (0030483).
Report is 12 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...tions/integration-grid/integration-grid.stories.ts 0.00% 15 Missing ⚠️
...tions/integration-card/integration-card.stories.ts 0.00% 13 Missing ⚠️
...ganizations/integrations/integrations.component.ts 0.00% 10 Missing ⚠️
...nsole/organizations/organization-routing.module.ts 0.00% 4 Missing ⚠️
...nizations/layouts/organization-layout.component.ts 33.33% 2 Missing ⚠️
...le/organizations/guards/is-enterprise-org.guard.ts 50.00% 1 Missing ⚠️
...hared/components/integrations/integrations.pipe.ts 66.66% 1 Missing ⚠️
...ecrets-manager/integrations/integrations.module.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #11883      +/-   ##
==========================================
- Coverage   33.53%   33.53%   -0.01%     
==========================================
  Files        2886     2891       +5     
  Lines       90157    90218      +61     
  Branches    17137    17138       +1     
==========================================
+ Hits        30234    30251      +17     
- Misses      57533    57578      +45     
+ Partials     2390     2389       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@BTreston BTreston changed the title Ac/pm 12273 integration page [PM-12273] Admin Console Integration Page Nov 12, 2024
Copy link
Member

@eliykat eliykat left a comment

Choose a reason for hiding this comment

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

Great work!

I'm surprised we don't have any Storybook stories for the integration grid and card. Can you please add these? There are lots of examples (files ending in .stories.ts), or check out the Storybook documentation. That way it will show up at https://components.bitwarden.com (or npm run storybook locally).

Also, some of the logos look quite dark in dark mode (from your video). Can you please discuss with design and see if we can fix that somehow?

@@ -1,2 +1,3 @@
export * from "./shared.module";
export * from "./loose-components.module";
export * from "./components/integrations/integrations.module";
Copy link
Member

Choose a reason for hiding this comment

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

Ideally you should have barrel files at each level, e.g. this would export * from "./components", then components would export * from "./integrations".

apps/web/src/app/shared/components/integrations/models.ts Outdated Show resolved Hide resolved
justindbaur
justindbaur previously approved these changes Nov 14, 2024
@BTreston BTreston requested a review from justindbaur November 14, 2024 22:23
@eliykat eliykat removed the request for review from jrmccannon November 15, 2024 03:48
@eliykat eliykat added the ee Create ephemeral environment for PR label Nov 15, 2024
@BTreston BTreston requested review from Hinton, eliykat and willmartian and removed request for Hinton November 22, 2024 19:36
@@ -108,6 +108,16 @@ export class OrganizationLayoutComponent implements OnInit {
provider.providerStatus !== ProviderStatusType.Billable,
),
);

this.integrationPageEnabled$ = this.organization$.pipe(
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).

),
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.

eliykat
eliykat previously approved these changes Nov 27, 2024
Copy link
Contributor

@vleague2 vleague2 left a comment

Choose a reason for hiding this comment

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

Is the grid story supposed to be overlapped like this?

Screenshot 2024-12-03 at 11 50 53 AM

@BTreston BTreston requested review from eliykat and vleague2 December 3, 2024 17:49
vleague2
vleague2 previously approved these changes Dec 3, 2024
eliykat
eliykat previously approved these changes Dec 4, 2024
@BTreston BTreston dismissed stale reviews from eliykat and vleague2 via 0030483 December 4, 2024 14:56
@BTreston BTreston requested review from vleague2 and eliykat December 4, 2024 15:00
@BTreston BTreston enabled auto-merge (squash) December 4, 2024 15:01
@BTreston BTreston removed the request for review from a team December 5, 2024 15:01
@BTreston BTreston merged commit c11f429 into main Dec 5, 2024
72 checks passed
@BTreston BTreston deleted the ac/pm-12273-integration-page branch December 5, 2024 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants