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

feat: populates datatable with subsidies #343

Merged
merged 25 commits into from
Jul 13, 2023
Merged

Conversation

brobro10000
Copy link
Member

@brobro10000 brobro10000 commented Jun 13, 2023

Populates datatable with data from the subsidy endpoint
Also sorts and filters leveraging manualSort/manualFilter

Revamps validation for message and regex logic to handle '00k' prefix for the opportunity product.
Screenshot 2023-06-27 at 4 10 24 PM

Screenshot 2023-06-27 at 1 58 28 PM

Pending updated tests

@brobro10000 brobro10000 force-pushed the hu/ent-fastfix-2 branch 2 times, most recently from 5995787 to f140065 Compare June 26, 2023 15:36
@@ -29,10 +29,10 @@
"url": "https://github.com/openedx/frontend-app-support-tools/issues"
},
"dependencies": {
"@edx/brand": "npm:@edx/brand-edx.org@^1.4.2",
"@edx/brand": "npm:@edx/brand-[email protected]",
Copy link
Member Author

Choose a reason for hiding this comment

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

Updated to handle "~@edx/brand/paragon/overrides" import for datatable styles

Copy link
Member

Choose a reason for hiding this comment

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

[inform] Additional context: because this is an open-source repo in the openedx Github organization, the brand-openedx theme should be the default theme installed. Should a consumer want to use the brand-edx.org theme for an MFE, that should be configured outside of committed code. For 2U/edX, the @edx/brand package may be overridden at build+deploy time via configuration (example).

"@edx/frontend-enterprise-utils": "^3.0.0",
"@edx/frontend-platform": "^4.2.0",
"@edx/paragon": "^20.26.0",
"@edx/paragon": "20.45.0",
Copy link
Member Author

Choose a reason for hiding this comment

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

Upgraded to handle new DjangoShort icon
Screenshot 2023-06-26 at 11 38 34 AM

@codecov
Copy link

codecov bot commented Jun 26, 2023

Codecov Report

Patch coverage: 97.82% and project coverage change: +0.21 🎉

Comparison is base (f397748) 87.50% compared to head (8d81730) 87.72%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #343      +/-   ##
==========================================
+ Coverage   87.50%   87.72%   +0.21%     
==========================================
  Files         138      140       +2     
  Lines        2850     2948      +98     
  Branches      682      735      +53     
==========================================
+ Hits         2494     2586      +92     
- Misses        355      361       +6     
  Partials        1        1              
Impacted Files Coverage Δ
src/Configuration/Provisioning/Dashboard.jsx 100.00% <ø> (+10.52%) ⬆️
...rc/Configuration/Provisioning/DashboardContext.jsx 100.00% <ø> (ø)
src/Configuration/Provisioning/data/constants.js 100.00% <ø> (ø)
...ion/testData/Dashboard/DashboardContextWrapper.jsx 100.00% <ø> (ø)
...stData/Provisioning/ProvisioningContextWrapper.jsx 100.00% <ø> (ø)
src/index.jsx 0.00% <0.00%> (ø)
...isioning/DashboardDataTable/DashboardDataTable.jsx 94.11% <94.11%> (ø)
...oning/DashboardDataTable/DashboardTableActions.jsx 100.00% <100.00%> (ø)
...ioning/DashboardDataTable/DashboardTableBadges.jsx 100.00% <100.00%> (ø)
...ning/ProvisioningForm/ProvisioningFormCustomer.jsx 86.20% <100.00%> (+1.02%) ⬆️
... and 5 more

... and 24 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@@ -1,24 +0,0 @@
import { screen } from '@testing-library/react';
Copy link
Member Author

Choose a reason for hiding this comment

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

Removed because of duplicate file

@brobro10000 brobro10000 force-pushed the hu/ent-fastfix-2 branch 4 times, most recently from 69f5101 to 93e90ab Compare July 4, 2023 04:01
@@ -29,10 +29,10 @@
"url": "https://github.com/openedx/frontend-app-support-tools/issues"
},
"dependencies": {
"@edx/brand": "npm:@edx/brand-edx.org@^1.4.2",
"@edx/brand": "npm:@edx/brand-[email protected]",
Copy link
Member

Choose a reason for hiding this comment

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

[inform] Additional context: because this is an open-source repo in the openedx Github organization, the brand-openedx theme should be the default theme installed. Should a consumer want to use the brand-edx.org theme for an MFE, that should be configured outside of committed code. For 2U/edX, the @edx/brand package may be overridden at build+deploy time via configuration (example).

@@ -42,7 +42,6 @@
"classnames": "2.2.6",
"lodash.debounce": "4.0.8",
"moment": "2.29.1",
"newrelic": "5.13.1",
Copy link
Member

Choose a reason for hiding this comment

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

[inform] Context: newrelic is installed, but seemingly unused by this repo. All New Relic related things for MFEs currently comes from @edx/frontend-build and @edx/frontend-platform, without consumers needing to install newrelic themselves.

Having newrelic in package.json causes issues such as:

❯ npm i
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '[email protected]',
npm WARN EBADENGINE   required: { node: '>=6.0.0 <13.0.0', npm: '>=3.0.0' },
npm WARN EBADENGINE   current: { node: 'v18.16.0', npm: '9.5.1' }
npm WARN EBADENGINE }
npm WARN deprecated [email protected]: This version of the New Relic Node Agent has reached the end of life.

src/utils/index.js Outdated Show resolved Hide resolved
src/utils/index.js Outdated Show resolved Hide resolved
src/Configuration/Provisioning/data/utils.js Show resolved Hide resolved
src/Configuration/Provisioning/data/utils.js Outdated Show resolved Hide resolved
src/Configuration/Provisioning/data/utils.js Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
Header: 'Start date',
accessor: 'activeDatetime',
disableFilters: true,
Cell: ({ row }) => transformDatatableDate(row.values.activeDatetime),
Copy link
Member

Choose a reason for hiding this comment

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

nit: just a caution that if/when these functions were to return JSX, this line and line 94 below would be going against the no-unstable-nested-components ESLint rule. Not suggesting you need to change anything here, but just wanted to inform.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point, will leave open for reference 👍🏽

Header: 'Start date',
accessor: 'activeDatetime',
disableFilters: true,
Cell: ({ row }) => transformDatatableDate(row.values.activeDatetime),
Copy link
Member

Choose a reason for hiding this comment

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

nitty nit: transformDataTableDate

Copy link
Member Author

Choose a reason for hiding this comment

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

Same as above, 👍🏽

src/Configuration/Provisioning/data/utils.js Outdated Show resolved Hide resolved
src/Configuration/Provisioning/data/utils.js Outdated Show resolved Hide resolved
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. 2 additional, non-blocking little nits but :shipit:

const { hydrateEnterpriseSubsidies } = useDashboardContext();
const [isLoading, setIsLoading] = useState(true);

// Implementation due to filterText value displaying accessor value customerName as opposed to Customer Name
Copy link
Member

Choose a reason for hiding this comment

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

[clarification] Is this comment dangling from the now-moved FilterStatus above?

Copy link
Member Author

Choose a reason for hiding this comment

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

lol yeah it is my bad


const { HOME } = ROUTES.CONFIGURATION.SUB_DIRECTORY.PROVISIONING;

const useHistoryPush = jest.fn();
Copy link
Member

Choose a reason for hiding this comment

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

nit: mockHistoryPush might be a slightly more descriptive variable name

@brobro10000 brobro10000 merged commit 3b4941e into master Jul 13, 2023
5 checks passed
@brobro10000 brobro10000 deleted the hu/ent-fastfix-2 branch July 13, 2023 18:19
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