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

fix: assorted groups bug fixes #1225

Merged
merged 10 commits into from
May 23, 2024
Merged

fix: assorted groups bug fixes #1225

merged 10 commits into from
May 23, 2024

Conversation

kiram15
Copy link
Contributor

@kiram15 kiram15 commented May 16, 2024

Couple changes in this PR - Jira ticket

  1. All status badges in the members table should have new popovers when clicked
  2. When the viewport gets smaller, the members icon should not squish into an oval
  3. If a group is set to the entire org, the members tab should be hidden and the CTA should not allow you to invite members
  4. Addition of the catalog tab
Screenshot 2024-05-16 at 9 57 00 AM Screenshot 2024-05-16 at 9 56 25 AM

For all changes

  • Ensure adequate tests are in place (or reviewed existing tests cover changes)

Only if submitting a visual change

  • Ensure to attach screenshots
  • Ensure to have UX team confirm screenshots

@kiram15 kiram15 requested a review from a team May 16, 2024 15:57
Copy link

codecov bot commented May 21, 2024

Codecov Report

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

Project coverage is 85.43%. Comparing base (e69159d) to head (47d00f0).

Files Patch % Lines
...redit-management/cards/CourseCardFooterActions.jsx 75.00% 1 Missing and 1 partial ⚠️
...anagement/BudgetDetailPageOverviewAvailability.jsx 66.66% 1 Missing ⚠️
...learner-credit-management/search/CatalogSearch.jsx 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1225      +/-   ##
==========================================
+ Coverage   85.35%   85.43%   +0.08%     
==========================================
  Files         537      537              
  Lines       11709    11739      +30     
  Branches     2478     2457      -21     
==========================================
+ Hits         9994    10029      +35     
+ Misses       1664     1658       -6     
- Partials       51       52       +1     

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

Comment on lines 17 to 20
const { data: appliesToAllContexts } = useEnterpriseGroup(subsidyAccessPolicy);

const catalogGroupView = subsidyAccessPolicy?.groupAssociations?.length > 0
&& !appliesToAllContexts.appliesToAllContexts;
Copy link
Contributor

Choose a reason for hiding this comment

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

nit

Suggested change
const { data: appliesToAllContexts } = useEnterpriseGroup(subsidyAccessPolicy);
const catalogGroupView = subsidyAccessPolicy?.groupAssociations?.length > 0
&& !appliesToAllContexts.appliesToAllContexts;
const { data: { appliesToAllContexts } } = useEnterpriseGroup(subsidyAccessPolicy);
const catalogGroupView = subsidyAccessPolicy?.groupAssociations?.length > 0
&& !appliesToAllContexts;

@@ -12,7 +12,7 @@ import LmsApiService from '../../../../data/services/LmsApiService';
* @returns The enterprise group object
*/
const getEnterpriseGroup = async ({ subsidyAccessPolicy }) => {
if (!subsidyAccessPolicy.groupAssociations || isEmpty(subsidyAccessPolicy.groupAssociations)) {
if (subsidyAccessPolicy === undefined || isEmpty(subsidyAccessPolicy.groupAssociations)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit

Suggested change
if (subsidyAccessPolicy === undefined || isEmpty(subsidyAccessPolicy.groupAssociations)) {
if (isEmpty(subsidyAccessPolicy?.groupAssociations)) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If the policy didn't have any group associations, with the ? it would return undefined, and isEmpty(undefined) == false ramda/ramda#2507

Copy link
Contributor

Choose a reason for hiding this comment

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

We're using lodash's isEmpty here, and when I tried it out on the lodash site, passing in undefined resulted in true.

@kiram15 kiram15 merged commit 4861bd3 into master May 23, 2024
6 checks passed
@kiram15 kiram15 deleted the kiram15/ENT-8928 branch May 23, 2024 15:07
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.

2 participants