Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 60 additions & 60 deletions features/Personalization.feature
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ Feature: Personalization
Scenario: Personalization menu default state
Given I load the SaaSquatch docs page at any location for the first time
And a personalization menu is shown at the top of the main content section
Then the default option of "Docs are being personalised for new programs" is selected
Then the default option of "Current" is selected

Scenario Outline: Personalization menu filter state can be changed
Given I am on the SaaSquatch docs page at any location
And a personalization menu is shown at the top of the main content section
When I select <filter option>
Then the personalization menu is updated with the selected <filter option>
Examples:
| filter option |
| Docs are being personalised for new programs |
| Docs are being personalised for Classic programs |
| Docs are being personalised for all programs |
| filter option |
| Current |
| Classic Only |
| Classic Enabled |

Scenario: Personalization menu icon displayed
Given I am on the SaaSquatch docs page at any location
Expand All @@ -36,21 +36,21 @@ Feature: Personalization
When I select <filter option>
Then the icon displayed is updated and matches <filter option>
Examples:
| filter option |
| Docs are being personalised for new programs |
| Docs are being personalised for Classic programs |
| Docs are being personalised for all programs |
| filter option |
| Current |
| Classic Only |
| Classic Enabled |

Scenario Outline: Personalization menu active icon is updated
Given I am on the SaaSquatch docs page at any location
And a personalization menu is shown at the top of the main content section
When I select <filter option>
Then the icon in the personalization menu that matches <filter option> displayed in colour and not grey
Examples:
| filter option |
| Docs are being personalised for new programs |
| Docs are being personalised for Classic programs |
| Docs are being personalised for all programs |
| filter option |
| Current |
| Classic Only |
| Classic Enabled |

Scenario Outline: Personalization menu state is maintained when navigating
Given I am on the SaaSquatch docs page at any location
Expand All @@ -60,10 +60,10 @@ Feature: Personalization
When I navigate to different pages of the docs
Then the selected <filter option> remains
Examples:
| filter option |
| Docs are being personalised for new programs |
| Docs are being personalised for Classic programs |
| Docs are being personalised for all programs |
| filter option |
| Current |
| Classic Only |
| Classic Enabled |

Scenario Outline: Personalization menu state is maintained when refreshing
Given I am on the SaaSquatch docs page at any location
Expand All @@ -73,10 +73,10 @@ Feature: Personalization
When I refresh the docs page
Then the selected <filter option> remains
Examples:
| filter option |
| Docs are being personalised for new programs |
| Docs are being personalised for Classic programs |
| Docs are being personalised for all programs |
| filter option |
| Current |
| Classic Only |
| Classic Enabled |

Scenario Outline: Personalization menu only one filter can be selected
Given I am on the SaaSquatch docs page at any location
Expand All @@ -86,10 +86,10 @@ Feature: Personalization
When I attempt to select a second filter term
Then the personalization menu only allows a single filter term to be selected
Examples:
| filter option |
| Docs are being personalised for new programs |
| Docs are being personalised for Classic programs |
| Docs are being personalised for all programs |
| filter option |
| Current |
| Classic Only |
| Classic Enabled |

Scenario Outline: Personalization menu selected filter is shown
Given I am on the SaaSquatch docs page at any location
Expand All @@ -99,10 +99,10 @@ Feature: Personalization
When I click the personalization menu again
Then the selected <filter option> is updated
Examples:
| filter option |
| Docs are being personalised for new programs |
| Docs are being personalised for Classic programs |
| Docs are being personalised for all programs |
| filter option |
| Current |
| Classic Only |
| Classic Enabled |

Scenario: Personalization cookie is not dropped on first load
Given I load the SaaSquatch docs page at any location for the first time
Expand All @@ -119,10 +119,10 @@ Feature: Personalization
When I select <filter option>
Then the personalization cookie is updated with a corresponding <cookie value> that matches <filter option>
Examples:
| filter option | cookie value |
| Docs are being personalised for new programs | ga-only |
| Docs are being personalised for Classic programs | classic-only |
| Docs are being personalised for all programs | everything |
| filter option | cookie value |
| Current | ga-only |
| Classic Only | classic-only |
| Classic Enabled | everything |

Scenario Outline: Personalization menu state is lost when cookies are cleared
Given I am on the SaaSquatch docs page at any location
Expand All @@ -132,10 +132,10 @@ Feature: Personalization
When I clear my browser cookies
Then the personalization menu reverts to the default state
Examples:
| filter option |
| Docs are being personalised for new programs |
| Docs are being personalised for Classic programs |
| Docs are being personalised for all programs |
| filter option |
| Current |
| Classic Only |
| Classic Enabled |

Scenario Outline: Rest API Reference methods are shown/hidden based on selected personalization menu state
Given I am on the SaaSquatch docs page at the "../api/methods" location
Expand All @@ -144,32 +144,32 @@ Feature: Personalization
Then the personalization menu is updated with the new <filterOption>
And <apiMethod> is visible in the REST API Reference
Examples:
| filterOption | filterValue | apiMethod |
| Docs are being personalised for new programs | ga-only | /api/v1/{tenant_alias}/account/{accountId} |
| Docs are being personalised for new programs | ga-only | /api/v1/{tenant_alias}/open/account/{accountId} |
| Docs are being personalised for new programs | ga-only | /api/v1/{tenant_alias}/open/account/{accountId}/user/{userId} |
| Docs are being personalised for new programs | ga-only | /api/v1/{tenant_alias}/code/{code} |
| Docs are being personalised for new programs | ga-only | /api/v1/{tenant_alias}/referrals |
| Docs are being personalised for new programs | ga-only | /api/v1/{tenant_alias}/open/account/{accountId}/user/{userId}/shareurls |
| Docs are being personalised for new programs | ga-only | /api/v1/{tenant_alias}/theme/{locale}/variables/instance |
| Docs are being personalised for Classic programs | classic-only | /api/v1/{tenant_alias}/accountsync |
| Docs are being personalised for Classic programs | classic-only | /api/v1/{tenant_alias}/account/{accountId}/user/{userId}/sharelinks |
| Docs are being personalised for Classic programs | classic-only | /api/v1/{tenant_alias}/open/user/cookie_user |
| Docs are being personalised for Classic programs | classic-only | /api/v1/{tenant_alias}/discount/{code} |
| Docs are being personalised for Classic programs | classic-only | /api/v1/{tenant_alias}/discount |
| Docs are being personalised for Classic programs | classic-only | /api/v1/{tenant_alias}/account/{accountId}/discount |
| Docs are being personalised for all programs | everything | all api methods |
| filterOption | filterValue | apiMethod |
| Current | ga-only | /api/v1/{tenant_alias}/account/{accountId} |
| Current | ga-only | /api/v1/{tenant_alias}/open/account/{accountId} |
| Current | ga-only | /api/v1/{tenant_alias}/open/account/{accountId}/user/{userId} |
| Current | ga-only | /api/v1/{tenant_alias}/code/{code} |
| Current | ga-only | /api/v1/{tenant_alias}/referrals |
| Current | ga-only | /api/v1/{tenant_alias}/open/account/{accountId}/user/{userId}/shareurls |
| Current | ga-only | /api/v1/{tenant_alias}/theme/{locale}/variables/instance |
| Classic Only | classic-only | /api/v1/{tenant_alias}/accountsync |
| Classic Only | classic-only | /api/v1/{tenant_alias}/account/{accountId}/user/{userId}/sharelinks |
| Classic Only | classic-only | /api/v1/{tenant_alias}/open/user/cookie_user |
| Classic Only | classic-only | /api/v1/{tenant_alias}/discount/{code} |
| Classic Only | classic-only | /api/v1/{tenant_alias}/discount |
| Classic Only | classic-only | /api/v1/{tenant_alias}/account/{accountId}/discount |
| Classic Enabled | everything | all api methods |

Scenario Outline: Hidden Rest API Reference methods are shown at bottom of page
Given I am on the SaaSquatch docs page at the ../api/methods location
And a personalization menu is shown at the top of the main content section
When I select <filter option> with a corresponding <filter value>
Then the personalization menu is updated with the new <filter option> and api methods not matching <filter value> are shown in the "Hidden Methods" section at the bottom of the "Rest API Reference" page
Examples:
| filter option | filter value |
| Docs are being personalised for new programs | ga-only |
| Docs are being personalised for Classic programs | classic-only |
| Docs are being personalised for all programs | everything |
| filter option | filter value |
| Current | ga-only |
| Classic Only | classic-only |
| Classic Enabled | everything |

Scenario Outline: Sidebar menu items are shown/hidden based on selected personalization menu state
Given I am on the SaaSquatch docs page at the ../api/methods location
Expand All @@ -178,7 +178,7 @@ Feature: Personalization
Then the personalization menu is updated with the new <filter option>
And sidebar menu items that do not match <filter value> are hidden
Examples:
| filter option | filter value |
| Docs are being personalised for new programs | ga-only |
| Docs are being personalised for Classic programs | classic-only |
| Docs are being personalised for all programs | everything |
| filter option | filter value |
| Current | ga-only |
| Classic Only | classic-only |
| Classic Enabled | everything |
47 changes: 23 additions & 24 deletions src/navigation/PersonalisationSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,20 +127,18 @@ export const PersonalisationSelect = () => {

const headerText =
version === "classic-only"
? "Classic programs"
? "Classic Only"
: version === "ga-only"
? "new programs"
: "all programs";
? "Current"
: "Classic Enabled";

return (
<div style={{ position: "relative" }}>
<Personalisation open={open} tabIndex={0} onBlur={() => setOpen(false)}>
<Preview onClick={() => setOpen((o) => !o)}>
<OptionIcon fill="#a3a3a3" />
<Info>
{open
? "Select a personalisation option"
: `Docs are being personalised for ${headerText}`}
{open ? "Select a personalisation option" : `${headerText}`}
</Info>
{!open ? (
<ExpandIcon>
Expand All @@ -157,37 +155,38 @@ export const PersonalisationSelect = () => {
<Award />
</ListIcon>
<div>
<Name>New Programs</Name>
<Name>Current</Name>
<Description>
Useful for customers that have started using SaaSquatch since
2019. Hides our classic program documentation.
Shows documentation for our current platform. Hides
documentation for classic referral programs.
</Description>
</div>
</Option>
<Option onClick={() => setVersion("classic-only")}>
<ListIcon active={version === "classic-only"}>
<Archive />
<Option onClick={() => setVersion("everything")}>
<ListIcon active={version === "everything"}>
<Global />
</ListIcon>
<div>
<Name>Works with Classic</Name>
<Name>Classic Enabled</Name>
<Description>
Useful for customers that have started using SaaSquatch before
2019 and are only running a referral program. Hides
documentation that works with new referral and loyalty
programs.
Shows all documentation, including both current and
classic-only program documentation. Useful for customers that
have a program created before 2019, but are also running
current loyalty, referral or partner programs.
</Description>
</div>
</Option>
<Option onClick={() => setVersion("everything")}>
<ListIcon active={version === "everything"}>
<Global />
<Option onClick={() => setVersion("classic-only")}>
<ListIcon active={version === "classic-only"}>
<Archive />
</ListIcon>
<div>
<Name>Show Everything</Name>
<Name>Classic Only</Name>
<Description>
Shows all documentation. Useful for customers that have a
program created before 2019, but are also running new loyalty,
referral or partner programs.
Useful for customers that started using SaaSquatch before 2019
and are only running a classic referral program. Hides
documentation that works with current referral and loyalty
programs.
</Description>
</div>
</Option>
Expand Down