From 55080763c53f0c976b2b334c936281d04f35e4f5 Mon Sep 17 00:00:00 2001 From: Nikita Barsukov Date: Mon, 12 Aug 2024 17:15:03 +0300 Subject: [PATCH 1/2] chore(demo): `DocDemo` generates invalid urls during attempts to patch query params --- .github/workflows/snapshots.yml | 3 ++- projects/demo/src/modules/app/app.providers.ts | 9 +++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/snapshots.yml b/.github/workflows/snapshots.yml index 5a17740832d7..f66172ff1c84 100644 --- a/.github/workflows/snapshots.yml +++ b/.github/workflows/snapshots.yml @@ -1,5 +1,6 @@ name: 🚀 Snapshots on: + pull_request: # debug only, revert before merge push: branches: [main, 'v[0-9]+.x', 'release/**'] workflow_dispatch: @@ -30,7 +31,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.TAIGA_FAMILY_BOT_PAT }} snapshots-of-release: - if: ${{ contains(github.head_ref || github.ref_name, 'release/') || github.event.inputs.updateMain == 'true' }} + # debug only, revert before merge name: production runs-on: ubuntu-latest steps: diff --git a/projects/demo/src/modules/app/app.providers.ts b/projects/demo/src/modules/app/app.providers.ts index 020bbb58c45c..b0fd9d636863 100644 --- a/projects/demo/src/modules/app/app.providers.ts +++ b/projects/demo/src/modules/app/app.providers.ts @@ -26,7 +26,6 @@ import { tuiSortPages, } from '@taiga-ui/addon-doc'; import { - TUI_BASE_HREF, TUI_DIALOG_CLOSES_ON_BACK, TUI_IS_E2E, TUI_IS_PLAYWRIGHT, @@ -171,9 +170,11 @@ export const APP_PROVIDERS: Provider[] = [ }, { provide: TUI_DOC_URL_STATE_HANDLER, - deps: [TUI_BASE_HREF], - useFactory: (baseHref: string) => (tree: UrlTree) => - String(tree).replace(baseHref, ''), + useFactory: (baseHref: string) => (tree: UrlTree) => { + console.info('=[TUI_DOC_URL_STATE_HANDLER]= ', {baseHref, tree}); + + return String(tree).replace(/^\/(next|v[0-9]+)\//, ''); + }, }, { provide: TUI_DOC_TYPE_REFERENCE_HANDLER, From f6cff75fd24f52c7996081d0ec64d03e1ba59cce Mon Sep 17 00:00:00 2001 From: Nikita Barsukov Date: Mon, 12 Aug 2024 17:33:20 +0300 Subject: [PATCH 2/2] chore: revert debug code --- .github/workflows/snapshots.yml | 3 +-- projects/demo/src/modules/app/app.providers.ts | 7 ++----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/snapshots.yml b/.github/workflows/snapshots.yml index f66172ff1c84..5a17740832d7 100644 --- a/.github/workflows/snapshots.yml +++ b/.github/workflows/snapshots.yml @@ -1,6 +1,5 @@ name: 🚀 Snapshots on: - pull_request: # debug only, revert before merge push: branches: [main, 'v[0-9]+.x', 'release/**'] workflow_dispatch: @@ -31,7 +30,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.TAIGA_FAMILY_BOT_PAT }} snapshots-of-release: - # debug only, revert before merge + if: ${{ contains(github.head_ref || github.ref_name, 'release/') || github.event.inputs.updateMain == 'true' }} name: production runs-on: ubuntu-latest steps: diff --git a/projects/demo/src/modules/app/app.providers.ts b/projects/demo/src/modules/app/app.providers.ts index b0fd9d636863..24c59b89a5b1 100644 --- a/projects/demo/src/modules/app/app.providers.ts +++ b/projects/demo/src/modules/app/app.providers.ts @@ -170,11 +170,8 @@ export const APP_PROVIDERS: Provider[] = [ }, { provide: TUI_DOC_URL_STATE_HANDLER, - useFactory: (baseHref: string) => (tree: UrlTree) => { - console.info('=[TUI_DOC_URL_STATE_HANDLER]= ', {baseHref, tree}); - - return String(tree).replace(/^\/(next|v[0-9]+)\//, ''); - }, + useFactory: () => (tree: UrlTree) => + String(tree).replace(/^\/(next|v[0-9]+)\//, ''), }, { provide: TUI_DOC_TYPE_REFERENCE_HANDLER,