1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-02-04 00:18:01 +01:00

feat: demo sorts features by name (#3663)

https://linear.app/unleash/issue/2-983/can-we-we-reverse-order-of-the-toggles

This PR makes it so that, on topic navigation to the project overview
page, we assume a feature toggle name sorting by default:


![image](https://user-images.githubusercontent.com/14320932/235666804-94511704-010d-4173-809b-0c61252b02d6.png)

Relates to [roadmap](https://github.com/orgs/Unleash/projects/10) item:
#3537
This commit is contained in:
Nuno Góis 2023-05-02 14:20:23 +01:00 committed by GitHub
parent f172c8851f
commit 2e1064b1f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 9 deletions

View File

@ -193,7 +193,10 @@ export const DemoSteps = ({
const currentStep = currentTopic.steps[currentStepIndex];
if (!currentStep) return;
if (currentStep.href && location.pathname !== currentStep.href) {
if (
currentStep.href &&
location.pathname !== currentStep.href.split('?')[0]
) {
navigate(currentStep.href);
}
waitForLoad(currentStep);

View File

@ -34,7 +34,7 @@ export const TOPICS: ITutorialTopic[] = [
title: 'Enable/disable a feature toggle',
steps: [
{
href: `/projects/${PROJECT}`,
href: `/projects/${PROJECT}?sort=name`,
target: 'body',
placement: 'center',
content: (
@ -63,7 +63,7 @@ export const TOPICS: ITutorialTopic[] = [
nextButton: true,
},
{
href: `/projects/${PROJECT}`,
href: `/projects/${PROJECT}?sort=name`,
target: `div[data-testid="TOGGLE-demoApp.step1-${ENVIRONMENT}"]`,
content: (
<>
@ -87,7 +87,7 @@ export const TOPICS: ITutorialTopic[] = [
title: 'Enable for a specific user',
steps: [
{
href: `/projects/${PROJECT}`,
href: `/projects/${PROJECT}?sort=name`,
target: 'body',
placement: 'center',
content: (
@ -111,7 +111,7 @@ export const TOPICS: ITutorialTopic[] = [
nextButton: true,
},
{
href: `/projects/${PROJECT}`,
href: `/projects/${PROJECT}?sort=name`,
target: `a[href="${basePath}/projects/${PROJECT}/features/demoApp.step2"]`,
content: (
<Description>
@ -263,7 +263,7 @@ export const TOPICS: ITutorialTopic[] = [
setup: gradualRollout,
steps: [
{
href: `/projects/${PROJECT}`,
href: `/projects/${PROJECT}?sort=name`,
target: 'body',
placement: 'center',
content: (
@ -293,7 +293,7 @@ export const TOPICS: ITutorialTopic[] = [
nextButton: true,
},
{
href: `/projects/${PROJECT}`,
href: `/projects/${PROJECT}?sort=name`,
target: `a[href="${basePath}/projects/${PROJECT}/features/demoApp.step3"]`,
content: (
<Description>
@ -369,7 +369,7 @@ export const TOPICS: ITutorialTopic[] = [
setup: variants,
steps: [
{
href: `/projects/${PROJECT}`,
href: `/projects/${PROJECT}?sort=name`,
target: 'body',
placement: 'center',
content: (
@ -394,7 +394,7 @@ export const TOPICS: ITutorialTopic[] = [
nextButton: true,
},
{
href: `/projects/${PROJECT}`,
href: `/projects/${PROJECT}?sort=name`,
target: `a[href="${basePath}/projects/${PROJECT}/features/demoApp.step4"]`,
content: (
<Description>