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

Access plan block editor, access plans block, & @lifterlms/data module (access plan redux store) #2062

Draft
wants to merge 30 commits into
base: dev
Choose a base branch
from

Conversation

thomasplevy
Copy link
Contributor

Description

Per #2061

Introduces a new module, @lifterlms/data which will act as a place to store various LifterLMS-specific react redux stores.

This will be exposed as a useable dependency (llms-data) that can be referenced by other scripts in order to read and write access plans to the api via the store. Examples and more information to be written.

Introduces the access plan store, accessible via wp.data.select( 'llms/access-plans' ) or wp.data.dispatch( 'llms/access-plans' ). The store configuration and name can be retrieved via llms.data.accessPlans.

This is the first step towards realizing #2061. In order to power the interface we need to be able to retrieve and persist access plan data to the database (via the rest api) via a redux store. With this in place, we can move onto implementation of the UI overhaul.

How has this been tested?

  • Manually
  • New JS Unit tests (with mocked request data)
  • e2e tests should be implemented later which will thoroughly test the integration with the REST API. This will come alongside the UI code.

Types of changes

  • New features

Checklist:

  • My code has been tested.
  • My code passes all existing automated tests.
  • My code follows the LifterLMS Coding & Documentation Standards.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 10, 2022

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
75.66% (+4.14% 🔼)
286/378
🟡 Branches
66.49% (+3.51% 🔼)
127/191
🟢 Functions
81.4% (+3.81% 🔼)
70/86
🟡 Lines
75.34% (+4.46% 🔼)
278/369
Show new covered files 🐣
St.
File Statements Branches Functions Lines
🟢
... / index.js
100% 0% 100% 100%
🟢
... / constants.js
100% 100% 100% 100%
🟢
... / constants.js
83.33% 0% 0% 83.33%
🟢
... / selectors.js
100% 75% 100% 100%
🟢
... / index.js
92.31% 96.43% 60% 100%
🟢
... / actions.js
100% 0% 100% 100%
🟢
... / entity.js
100% 100% 100% 100%
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟡
... / index.js
66.67%
33.33% (-4.17% 🔻)
50% 66.67%

Test suite run success

147 tests passing in 19 suites.

Report generated by 🧪jest coverage report action from 96db42f

@thomasplevy thomasplevy requested a review from a team March 11, 2022 16:23
@thomasplevy thomasplevy self-assigned this Mar 17, 2022
@thomasplevy thomasplevy changed the title @lifterlms/data module and access plan redux store Access plan block editor, access plans block, & @lifterlms/data module (access plan redux store) Mar 23, 2022
@thomasplevy thomasplevy marked this pull request as draft March 23, 2022 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

Successfully merging this pull request may close these issues.

None yet

2 participants