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

Open
wants to merge 23 commits into
base: main
Choose a base branch
from

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 living the 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 & Details79d26721-8705-4b33-975c-50a85d5ad933

New Issues

Severity Issue Source File / Package Checkmarx Insight
MEDIUM Client_Privacy_Violation /apps/web/src/app/tools/access-intelligence/password-health-members.component.html: 105 Attack Vector
MEDIUM Client_Privacy_Violation /apps/web/src/app/tools/access-intelligence/password-health-members.component.html: 100 Attack Vector
MEDIUM Client_Privacy_Violation /apps/web/src/app/tools/access-intelligence/password-health-members.component.html: 105 Attack Vector
MEDIUM Client_Privacy_Violation /apps/web/src/app/tools/access-intelligence/password-health-members.component.html: 110 Attack Vector
LOW Client_JQuery_Deprecated_Symbols /apps/cli/src/service-container/service-container.ts: 876 Attack Vector
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
MEDIUM Client_Privacy_Violation /apps/web/src/app/tools/risk-insights/password-health-members.component.html: 55
MEDIUM Client_Privacy_Violation /apps/web/src/app/tools/risk-insights/password-health-members.component.html: 50
MEDIUM Client_Privacy_Violation /apps/web/src/app/tools/risk-insights/password-health-members.component.html: 45
MEDIUM Client_Privacy_Violation /apps/web/src/app/tools/risk-insights/password-health-members.component.html: 50

@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.47%. Comparing base (4b6f70a) to head (18d4881).
Report is 15 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.41%   33.47%   +0.06%     
==========================================
  Files        2871     2880       +9     
  Lines       89827    89896      +69     
  Branches    17105    17105              
==========================================
+ Hits        30012    30097      +85     
+ Misses      57453    57424      -29     
- Partials     2362     2375      +13     

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


🚨 Try these New Features:

@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
@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 a review from a team as a code owner November 18, 2024 16:45
eliykat
eliykat previously approved these changes Nov 19, 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 appreciate you taking the time to tighten up the implementation and write stories.

There is one last thing to do: review (and approve) the changes in Chromatic. See the process here: https://contributing.bitwarden.com/contributing/pull-requests/chromatic but let me know if you have any questions. It's important that you do this before you merge, otherwise main will have unapproved Chromatic changes and it'll leak into everyone's development branches. (You can still approve it from main, it's just more disruptive to other devs.)

Once Chromatic changes are approved, the Chromatic PR checks should have a green tick next to them.

I see that there is some visual change (in Chromatic) to the Kitchen Sink story, but it seems minor and I can't see that you've done anything to cause it. But to be safe, I recommend asking #team-eng-design-system about that one. (EDIT: or something for @bitwarden/team-design-system to check when they review)

.storybook/main.ts Show resolved Hide resolved
willmartian
willmartian previously approved these changes Nov 19, 2024
Copy link
Contributor

@willmartian willmartian left a comment

Choose a reason for hiding this comment

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

DS changes looks good 👍

Had a few non-blocking thoughts on other files:

</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

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for writing a story 👏

willmartian
willmartian previously approved these changes Nov 21, 2024
Copy link
Contributor

@willmartian willmartian left a comment

Choose a reason for hiding this comment

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

DS changes look good 👍

eliykat
eliykat previously approved these changes Nov 22, 2024
@Hinton
Copy link
Member

Hinton commented Nov 22, 2024

Images are minified, no concerns from my side.

@Hinton Hinton removed their request for review November 22, 2024 15:47
@BTreston BTreston dismissed stale reviews from eliykat and willmartian via fb3b903 November 22, 2024 18:02
@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.

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.

5 participants