Skip to content

Commit

Permalink
Update internal readme
Browse files Browse the repository at this point in the history
  • Loading branch information
igorschoester committed Oct 24, 2023
1 parent 1f7e460 commit 20c509f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/introductions/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ Is for showing introductions to a user, on Yoast admin pages.
Based on plugin version, page, user capabilities and whether the user has seen it already.

- `Introduction_Interface` defines what data is needed
- `name` as unique identifier
- `id` as unique identifier
- `plugin` and `version` to determine if the introduction is new (version > plugin version)
- `pages` to be able to only show on certain Yoast admin pages
- `capabilities` to be able to only show for certain users
- `Introductions_Collector` uses that data to determine whether an introduction should be "shown" to a user
- uses the `wpseo_introductions` filter to be extendable from our other plugins
- uses `_yoast_introductions` user metadata to determine if the user saw an introduction already
- uses `Introductions_Seen_Repository` to get the data to determine if the user saw an introduction already
- `Introductions_Seen_Repository` is the doorway whether a user has seen an introduction or not
- uses the `_yoast_introductions` user metadata
- `Introduction_Bucket` and `Introduction_Item` are used by the collector to get an array
- `Introductions_Integration` runs on the Yoast Admin pages and loads the assets
- only loads on our Yoast admin pages, but never on our installation success pages as to not disturb onboarding
Expand All @@ -20,6 +22,6 @@ Based on plugin version, page, user capabilities and whether the user has seen i
- `css/src/ai-generator.css` holds the CSS

Inside JS, register the modal content via `window.YoastSEO._registerIntroductionComponent`, which takes a
`name` and a `Component`. The name needs to be the same as the name in the `Introduction_Interface`.
`id` and a `Component`. The id needs to be the same as the id in the `Introduction_Interface`.
The action `yoast.introductions.ready` can be used to know whether the registration function is available and ready for
use.

0 comments on commit 20c509f

Please sign in to comment.