From 92c0ce699c74900782f2ba6c651697b76124bb8c Mon Sep 17 00:00:00 2001 From: Vladimir Potekhin <46284632+vladimirpotekhin@users.noreply.github.com> Date: Wed, 7 Aug 2024 18:06:03 +0300 Subject: [PATCH] chore: fix pseudo- migration (#8401) --- .../constants/attr-with-values-to-replace.ts | 20 ------------------- .../tests/schematic-migrate-blocked.spec.ts | 5 ++--- .../v4/tests/schematic-migrate-button.spec.ts | 4 ++-- .../tests/schematic-migrate-labeled.spec.ts | 4 ++-- 4 files changed, 6 insertions(+), 27 deletions(-) diff --git a/projects/cdk/schematics/ng-update/v4/steps/constants/attr-with-values-to-replace.ts b/projects/cdk/schematics/ng-update/v4/steps/constants/attr-with-values-to-replace.ts index 8290a8c3891d..b3b9fc4875c3 100644 --- a/projects/cdk/schematics/ng-update/v4/steps/constants/attr-with-values-to-replace.ts +++ b/projects/cdk/schematics/ng-update/v4/steps/constants/attr-with-values-to-replace.ts @@ -35,49 +35,29 @@ export const ATTR_WITH_VALUES_TO_REPLACE: ReplacementAttributeValue[] = [ newAttrName: '[tuiAppearanceState]', withTagNames: hasPseudo, valueReplacer: (condition) => `${condition} ? 'active' : null`, - directiveModule: { - name: 'TuiAppearance', - moduleSpecifier: '@taiga-ui/core', - }, }, { attrNames: ['[pseudoFocus]'], newAttrName: '[tuiAppearanceState]', withTagNames: hasPseudo, valueReplacer: (condition) => `${condition} ? 'focus' : null`, - directiveModule: { - name: 'TuiAppearance', - moduleSpecifier: '@taiga-ui/core', - }, }, { attrNames: ['[pseudoHover]'], newAttrName: '[tuiAppearanceState]', withTagNames: hasPseudo, valueReplacer: (condition) => `${condition} ? 'hover' : null`, - directiveModule: { - name: 'TuiAppearance', - moduleSpecifier: '@taiga-ui/core', - }, }, { attrNames: ['[pseudoInvalid]'], newAttrName: '[tuiAppearanceState]', withTagNames: hasPseudo, valueReplacer: (condition) => `${condition} ? 'invalid' : null`, - directiveModule: { - name: 'TuiAppearance', - moduleSpecifier: '@taiga-ui/core', - }, }, { attrNames: ['[pseudoDisabled]'], newAttrName: '[tuiAppearanceState]', withTagNames: ['tui-radio-block', 'tui-radio-labeled', 'tui-radio'], valueReplacer: (condition) => `${condition} ? 'disabled' : null`, - directiveModule: { - name: 'TuiAppearance', - moduleSpecifier: '@taiga-ui/core', - }, }, ]; diff --git a/projects/cdk/schematics/ng-update/v4/tests/schematic-migrate-blocked.spec.ts b/projects/cdk/schematics/ng-update/v4/tests/schematic-migrate-blocked.spec.ts index c34ba94ff889..fc646f235955 100644 --- a/projects/cdk/schematics/ng-update/v4/tests/schematic-migrate-blocked.spec.ts +++ b/projects/cdk/schematics/ng-update/v4/tests/schematic-migrate-blocked.spec.ts @@ -24,15 +24,14 @@ import { TuiCheckboxBlockModule, TuiRadioBlockModule } from "@taiga-ui/kit"; }) export class Test {}`; -const COMPONENT_AFTER = `import { TuiAppearance } from "@taiga-ui/core"; - +const COMPONENT_AFTER = ` import {FormsModule} from '@angular/forms'; import { TuiBlock, TuiCheckbox, TuiRadio } from "@taiga-ui/kit"; @Component({ standalone: true, templateUrl: './test.template.html', - imports: [FormsModule, TuiBlock, TuiCheckbox, TuiBlock, TuiRadio, TuiAppearance] + imports: [FormsModule, TuiBlock, TuiCheckbox, TuiBlock, TuiRadio] }) export class Test {}`; diff --git a/projects/cdk/schematics/ng-update/v4/tests/schematic-migrate-button.spec.ts b/projects/cdk/schematics/ng-update/v4/tests/schematic-migrate-button.spec.ts index 9d8793699240..88759cd3db80 100644 --- a/projects/cdk/schematics/ng-update/v4/tests/schematic-migrate-button.spec.ts +++ b/projects/cdk/schematics/ng-update/v4/tests/schematic-migrate-button.spec.ts @@ -29,12 +29,12 @@ export class Test { }`; const COMPONENT_AFTER = `import { TuiButtonLoading } from "@taiga-ui/kit"; -import { TuiButton, tuiButtonOptionsProvider, TuiAppearance } from "@taiga-ui/core"; +import { TuiButton, tuiButtonOptionsProvider } from "@taiga-ui/core"; @Component({ standalone: true, templateUrl: './test.template.html', - imports: [TuiButton, TuiButtonLoading, TuiAppearance], + imports: [TuiButton, TuiButtonLoading], providers: [ tuiButtonOptionsProvider({size: 's'}), ], diff --git a/projects/cdk/schematics/ng-update/v4/tests/schematic-migrate-labeled.spec.ts b/projects/cdk/schematics/ng-update/v4/tests/schematic-migrate-labeled.spec.ts index 23b4ab02a979..46f73d8e860f 100644 --- a/projects/cdk/schematics/ng-update/v4/tests/schematic-migrate-labeled.spec.ts +++ b/projects/cdk/schematics/ng-update/v4/tests/schematic-migrate-labeled.spec.ts @@ -25,12 +25,12 @@ export class Test { }`; const COMPONENT_AFTER = `import { TuiCheckbox, TuiRadio } from "@taiga-ui/kit"; -import { TuiLabel, TuiAppearance } from "@taiga-ui/core"; +import { TuiLabel } from "@taiga-ui/core"; @Component({ standalone: true, templateUrl: './test.template.html', - imports: [TuiLabel, TuiAppearance, TuiCheckbox, TuiRadio] + imports: [TuiLabel, TuiCheckbox, TuiRadio] }) export class Test { }`;