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

[To Main] Add tenant listing page #2503

Merged
merged 9 commits into from
May 15, 2024

Conversation

NatSquared
Copy link
Contributor

Issue #: https://apps.itsm.gov.bc.ca/jira/browse/DESENG-592

Description of changes:

  • Feature Added the initial version of the tenant listing page
    • The page lists all tenants in the system
    • Functionality to view or create individual tenants is still under construction
    • Began work on adding new components from the MET component library, with high reusability in mind

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the met-public license (Apache 2.0).

@codecov-commenter
Copy link

codecov-commenter commented May 9, 2024

Codecov Report

Attention: Patch coverage is 80.89888% with 34 lines in your changes are missing coverage. Please review.

Project coverage is 75.81%. Comparing base (bb62952) to head (a8df1a1).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2503      +/-   ##
==========================================
+ Coverage   75.78%   75.81%   +0.03%     
==========================================
  Files         590      597       +7     
  Lines       21133    21363     +230     
  Branches     1529     1568      +39     
==========================================
+ Hits        16016    16197     +181     
- Misses       4870     4912      +42     
- Partials      247      254       +7     
Flag Coverage Δ
metapi 87.93% <63.15%> (+0.04%) ⬆️
metweb 63.82% <83.01%> (+0.23%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
met-web/src/apiManager/endpoints/index.ts 100.00% <ø> (ø)
met-web/src/components/FormCAC/FirstTab.tsx 88.46% <100.00%> (ø)
met-web/src/components/FormCAC/Form.tsx 100.00% <100.00%> (ø)
met-web/src/components/FormCAC/SecondTab.tsx 81.81% <100.00%> (ø)
...omments/admin/review/emailPreview/EmailPreview.tsx 82.60% <100.00%> (ø)
...ments/admin/review/emailPreview/EmailTemplates.tsx 100.00% <100.00%> (ø)
...ts/comments/admin/reviewListing/AdvancedSearch.tsx 63.15% <100.00%> (ø)
...nents/comments/admin/reviewListing/Submissions.tsx 81.81% <100.00%> (ø)
...rc/components/comments/admin/textListing/index.tsx 80.00% <100.00%> (ø)
met-web/src/components/common/index.tsx 94.25% <100.00%> (+2.68%) ⬆️
... and 102 more

... and 17 files with indirect coverage changes

Copy link
Collaborator

@Baelx Baelx left a comment

Choose a reason for hiding this comment

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

Looks great! Could you please:

  • add the ticket reference to the Changelog entry
  • remove the console.log
  • review the naming of "Feedback" in resources/tenant.py
  • review if the material UI icon can be used with fontawesome (or let me know if it's not possible)

I'd also love to just chat briefly about some of the infrastructure decisions you made with the new design system components. It would be great if all the developers were on the same page with how we're going to start integrating Jess' design system :)

CHANGELOG.MD Outdated
@@ -1,3 +1,10 @@
## May 9, 2024

- **Feature** Added the initial version of the tenant listing page
Copy link
Collaborator

Choose a reason for hiding this comment

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

Don't forget a reference to the ticket!


return tenants, HTTPStatus.OK
except ValueError as err:
return str(err), HTTPStatus.INTERNAL_SERVER_ERROR

@cors_preflight('GET OPTIONS')
@API.route('/<tenant_id>')
class Feedback(Resource):
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm guessing this needs to be:

Suggested change
class Feedback(Resource):
class Tenant(Resource):

@@ -0,0 +1,89 @@
import React from 'react';
Copy link
Collaborator

Choose a reason for hiding this comment

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

I appreciate that you've started to add some high fidelity, reusable components based on Jess' work! Just curious about how you chose to organize it:

smallScreenOnly,
}) => {
return (
<Breadcrumbs aria-label="breadcrumb" sx={smallScreenOnly ? { display: { xs: 'block', md: 'none' } } : {}}>
Copy link
Collaborator

Choose a reason for hiding this comment

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

I feel like it'd be a bit more Reactive to have screen size check happen outside the component and have it not render, rather than having it built in and trigger a display:none. Although I get the impulse to have a component be super self-contained.

outline: `2px solid ${colors.focus.regular.outer}`,
boxShadow: globalFocusShadow,
},
};
Copy link
Collaborator

Choose a reason for hiding this comment

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

I appreciate that you took the trouble to get all these styling variables accounted for - and for creating those new design system components.

MET already has lots of common components in use. Just curious if you looked into how much of it we can massage into the Design System rather than creating everything from scratch.

@@ -0,0 +1,114 @@
import { AddCircleOutline } from '@mui/icons-material';
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this be with fontawesome?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes; I was waiting for the Font Awesome PR to be merged

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ahh yes, sorry


useEffect(() => {
const fetchTenants = async () => {
const tenants = await getAllTenants();
Copy link
Collaborator

Choose a reason for hiding this comment

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

You might be able to save a couple lines of code(plus add more specific error handling), and the function declaration with:

Suggested change
const tenants = await getAllTenants();
getAllTenants
.then(returnedTenants => setTenants(returnedTenants)
.catch(// Handle Error)
.finally(() => setLoading(false))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unfortunately, .finally() isn't available because we're compiling in ES2017 mode

Copy link
Collaborator

Choose a reason for hiding this comment

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

I believe you should be able to use it if you want to still. I think the target option just indicates which ES features are "downgraded" and which are left intact.

https://www.typescriptlang.org/tsconfig/#target

met-web/src/components/tenantManagement/Listing.tsx Outdated Show resolved Hide resolved
Copy link
Collaborator

@Baelx Baelx left a comment

Choose a reason for hiding this comment

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

I'm not in the office today so I'll switch my review to Approved so you're not blocked!

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
D Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint

Copy link
Collaborator

@Baelx Baelx left a comment

Choose a reason for hiding this comment

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

Thanks! Approved

@NatSquared NatSquared merged commit a17fe76 into main May 15, 2024
14 of 15 checks passed
@NatSquared NatSquared deleted the feature/DESENG-592-create-tenant-listing-page branch May 15, 2024 21:31
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.

3 participants