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

Enhancement/328 Sophi Overrides API Integration #333

Merged
merged 74 commits into from
Oct 26, 2022
Merged

Conversation

faisal-alvi
Copy link
Contributor

@faisal-alvi faisal-alvi commented Oct 3, 2022

Description of the Change

  • Integrated the Sophi Override functions (add, remove, replace, ban) into the existing Site Automation block.
  • The existing block will not break after this integration because the final code snippet of the block does not change! (i.e. nothing to worry about the migration of existing block).

Closes #328 & Closes #216

Alternate Designs

List view:

image
image link


The 4 Override buttons:

image
image link


Add/Replace Override Popup:

image
image link


Out/Ban Override Popup:

image
image link


Settings page:

image
image link


When posts are received from the Sophi server, but none of them exist in the WordPress site:

image
image link


When posts are received from the Sophi server, but none of them exist in the WordPress site:

image
image link

Possible Drawbacks

Verification Process

  1. Make sure you have configured proper credential details on the Sophi settings page.
  2. Add a Site Automation block to a page.
  3. Fill in "Page name" and "Widget name" in the block settings on the right sidebar.
  4. See the curated post list, it should appear.
  5. Select any individual post item and see it has its own settings (Blockcontrol) at the top.
  6. Click the gear icon, and a popup should appear.
  7. Perform Add/Replace/Remove/Ban actions by filling out the form.
  8. For add/replace, the result will appear quickly.
  9. But for remove/ban, the Sophi server will take some time to reflect.

Checklist:

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests passed.

Changelog Entry

Added - Override feature to the Sophi Site Automation Block.
Added - ??? hook to allow for code-based Override feature integrations.
Changed - Sophi Site Automation Block from a server-side-rendered custom block to a nested block.

Credits

Props @jeffpaul @fabiankaegy @faisal-alvi

@faisal-alvi faisal-alvi self-assigned this Oct 3, 2022
@faisal-alvi faisal-alvi added this to the 1.3.0 milestone Oct 3, 2022
@jeffpaul
Copy link
Contributor

jeffpaul commented Oct 6, 2022

Pinging @fabiankaegy for initial code review / feedback on approach here to help guide any iterations or strong recommendations on how best to tweak approach here for an optimal editorial UX.

}

// eslint-disable-next-line array-callback-return
data.map((item) => {

Choose a reason for hiding this comment

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

if you don't care about the returned value you can also use .forEach here. It doesn't care about a return value

dkotter
dkotter previously approved these changes Oct 25, 2022
@jeffpaul
Copy link
Contributor

@faisal-alvi for the nested block override buttons, please ensure they're labeled Add, Replace, Remove, and Ban (so update Update to Replace and Trash to Ban).

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 280 Code Smells

No Coverage information No Coverage information
0.9% 0.9% Duplication

@jeffpaul jeffpaul merged commit 8499a65 into develop Oct 26, 2022
@jeffpaul jeffpaul deleted the enhancement/328 branch October 26, 2022 16:53
@faisal-alvi faisal-alvi mentioned this pull request Oct 27, 2022
6 tasks
@jeffpaul jeffpaul mentioned this pull request Oct 27, 2022
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants