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

Refactor LearnerCreditAllocationTable #1019

Merged
merged 8 commits into from
Aug 31, 2023
Merged

Refactor LearnerCreditAllocationTable #1019

merged 8 commits into from
Aug 31, 2023

Conversation

emrosarioa
Copy link
Contributor

@emrosarioa emrosarioa commented Aug 18, 2023

Refactor the LearnerCreditAllocationTable to have a single Enrollment Details column for both the user email or the course title, and also a single input for filtering the search results.
This uses the API filtering implementation from here: openedx/edx-enterprise-data#388

Previous table:
Screenshot 2023-08-29 at 4 40 17 PM

Table after changes:

Screenshot 2023-08-31 at 9 54 22 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

@codecov
Copy link

codecov bot commented Aug 18, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.01% ⚠️

Comparison is base (9af4648) 82.88% compared to head (b7bc888) 82.88%.

❗ Current head b7bc888 differs from pull request most recent head 6c5cd39. Consider uploading reports for the commit 6c5cd39 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1019      +/-   ##
==========================================
- Coverage   82.88%   82.88%   -0.01%     
==========================================
  Files         401      401              
  Lines        8730     8727       -3     
  Branches     1801     1800       -1     
==========================================
- Hits         7236     7233       -3     
  Misses       1455     1455              
  Partials       39       39              
Files Changed Coverage Δ
...onents/learner-credit-management/BudgetCard-V2.jsx 100.00% <ø> (ø)
...components/learner-credit-management/data/utils.js 92.85% <ø> (ø)
...credit-management/LearnerCreditAllocationTable.jsx 94.11% <100.00%> (ø)
...components/learner-credit-management/data/hooks.js 90.16% <100.00%> (-0.47%) ⬇️

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

@pwnage101
Copy link
Contributor

pwnage101 commented Aug 18, 2023

The mocks show that the content title was more bolded or larger than the email, but in your screenshot both the title and email share the same typeface. Was this intentionally deferred? https://2u-internal.atlassian.net/browse/ENT-7431

Copy link
Contributor

@pwnage101 pwnage101 left a comment

Choose a reason for hiding this comment

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

LGTM, to my vanilla react eye

Copy link
Member

@adamstankiewicz adamstankiewicz left a comment

Choose a reason for hiding this comment

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

LGTM! Just a nit about disabled ESLint rules.

@emrosarioa emrosarioa force-pushed the ea/ent-7512 branch 2 times, most recently from 3e07dfb to b7bc888 Compare August 30, 2023 22:05
Copy link
Member

@adamstankiewicz adamstankiewicz left a comment

Choose a reason for hiding this comment

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

LGTM! Just one non-blocking question.

@@ -63,18 +63,15 @@ const applySortByToOptions = (sortBy, options) => {
};

const applyFiltersToOptions = (filters, options) => {
const userSearchQuery = filters?.find(filter => filter.id === 'userEmail')?.value;
const courseTitleSearchQuery = filters?.find(filter => filter.id === 'courseTitle')?.value;
const courseProductLineSearchQuery = filters?.find(filter => filter.id === 'courseProductLine')?.value;
Copy link
Member

Choose a reason for hiding this comment

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

Follow-up from Slack conversation:

[clarification] in the current state of the (LCM) world, is the courseProductLine filter being used?
const courseProductLineSearchQuery = filters?.find(filter => filter.id === 'courseProductLine')?.value;

[Emily] probably not.

[Adam] even if not used in the current state, since the "Product" column you're keeping in for now isn't exposed in the filters (i.e., disableFilters: true), Markhors next iteration probably will be using it again lolol. So maybe we just leave it in for now with that assumption it will be used again in the near future.

if (courseTitleSearchQuery) {
Object.assign(options, { searchCourse: courseTitleSearchQuery });
}
const searchQuery = filters?.find(filter => filter.id.toLowerCase() === 'enrollment details')?.value;
Copy link
Member

Choose a reason for hiding this comment

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

[curious/clarification] Do you happen to know where this filter id of "enrollment details" (with the space) is coming from? My understanding was that the filter.id was based on the accessor for the column (e.g., like courseProductLine above). But the accessor for the "Enrollment details" column is an object (first time seeing this).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I was surprised as well. It appears that if the accessor is a function (which in this case, it is), it defaults the filter.id to the Header of the column.

@emrosarioa emrosarioa merged commit ef1692d into master Aug 31, 2023
3 checks passed
@emrosarioa emrosarioa deleted the ea/ent-7512 branch August 31, 2023 18:43
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