From 5e0b04321cdf21288e6834dad64cf0b1a0637629 Mon Sep 17 00:00:00 2001 From: CSimoesJr Date: Tue, 28 Jan 2025 17:54:12 -0300 Subject: [PATCH] =?UTF-8?q?fix(icons):=20corrige=20migra=C3=A7=C3=A3o=20do?= =?UTF-8?q?s=20=C3=ADcones=20para=20v19?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Corrige migração de todos os ícones corretamente para v19 fixes DTHFUI-10714 --- .../ui/schematics/ng-update/v19/changes.ts | 183 +----------------- projects/ui/schematics/ng-update/v19/index.ts | 6 +- 2 files changed, 13 insertions(+), 176 deletions(-) diff --git a/projects/ui/schematics/ng-update/v19/changes.ts b/projects/ui/schematics/ng-update/v19/changes.ts index 9c857d35d2..9215ad52bf 100644 --- a/projects/ui/schematics/ng-update/v19/changes.ts +++ b/projects/ui/schematics/ng-update/v19/changes.ts @@ -4,6 +4,9 @@ import { UpdateDependencies } from '@po-ui/ng-schematics/package-config'; const regexRemovePoIconInside = new RegExp('(?<=\\s|^)po-icon(?=\\s|$)', 'gmi'); const regexRemovePoIcon = new RegExp('(? = [ { replace: 'po-icon-a11y-elderly', replaceWith: 'an-elderly' }, { replace: 'po-icon-a11y-pregnant', replaceWith: 'an-pregnant' }, @@ -179,181 +182,7 @@ export const iconsReplaced: Array = [ { replace: 'po-icon-world', replaceWith: 'an-globe' }, { replace: 'po-icon-xml', replaceWith: 'an-file-xml' }, { replace: 'po-icon-zoom-in', replaceWith: 'an-magnifying-glass-plus' }, - { replace: 'po-icon-zoom-out', replaceWith: 'an-magnifying-glass-minus' }, - { replace: 'ph-elderly', replaceWith: 'an-elderly' }, - { replace: 'ph-pregnant', replaceWith: 'an-pregnant' }, - { replace: 'ph-wheelchair', replaceWith: 'an-wheelchair' }, - { replace: 'ph-plant', replaceWith: 'an-plant' }, - { replace: 'ph-text-align-center', replaceWith: 'an-text-align-center' }, - { replace: 'ph-text-align-justify', replaceWith: 'an-text-align-justify' }, - { replace: 'ph-text-align-left', replaceWith: 'an-text-align-left' }, - { replace: 'ph-text-align-right', replaceWith: 'an-text-align-right' }, - { replace: 'ph-anchor', replaceWith: 'an-anchor' }, - { replace: 'ph-archive', replaceWith: 'an-archive' }, - { replace: 'ph-caret-down', replaceWith: 'an-caret-down' }, - { replace: 'ph-caret-left', replaceWith: 'an-caret-left' }, - { replace: 'ph-caret-right', replaceWith: 'an-caret-right' }, - { replace: 'ph-caret-up', replaceWith: 'an-caret-up' }, - { replace: 'ph-paperclip', replaceWith: 'an-paperclip' }, - { replace: 'ph-automatic-barrier', replaceWith: 'an-automatic-barrier' }, - { replace: 'ph-scales', replaceWith: 'an-scales' }, - { replace: 'ph-balance-weight', replaceWith: 'an-balance-weight' }, - { replace: 'ph-barcode', replaceWith: 'an-barcode' }, - { replace: 'ph-basket', replaceWith: 'an-basket' }, - { replace: 'ph-bluetooth', replaceWith: 'an-bluetooth' }, - { replace: 'ph-book-bookmark', replaceWith: 'an-book-bookmark' }, - { replace: 'ph-calculator', replaceWith: 'an-calculator' }, - { replace: 'ph-calendar-dots', replaceWith: 'an-calendar-dots' }, - { replace: 'ph-calendar-check', replaceWith: 'an-calendar-check' }, - { replace: 'ph-calendar-gear', replaceWith: 'an-calendar-gear' }, - { replace: 'ph-camera', replaceWith: 'an-camera' }, - { replace: 'ph-shopping-cart-simple', replaceWith: 'an-shopping-cart-simple' }, - { replace: 'ph-swap', replaceWith: 'an-swap' }, - { replace: 'ph-chart-line', replaceWith: 'an-chart-line' }, - { replace: 'ph-chart-bar', replaceWith: 'an-chart-bar' }, - { replace: 'ph-chats', replaceWith: 'an-chats' }, - { replace: 'ph-fill ph-x-circle', replaceWith: 'an-fill an-x-circle' }, - { replace: 'ph-clipboard', replaceWith: 'an-clipboard' }, - { replace: 'ph-clock', replaceWith: 'an-clock' }, - { replace: 'ph-x', replaceWith: 'an-x' }, - { replace: 'ph-building-apartment', replaceWith: 'an-building-apartment' }, - { replace: 'ph-hard-hat', replaceWith: 'an-hard-hat' }, - { replace: 'ph-copy', replaceWith: 'an-copy' }, - { replace: 'ph-cotton', replaceWith: 'an-cotton' }, - { replace: 'ph-credit-card', replaceWith: 'an-credit-card' }, - { replace: 'ph-selection-background', replaceWith: 'an-selection-background' }, - { replace: 'ph-database', replaceWith: 'an-database' }, - { replace: 'ph-debit-card', replaceWith: 'an-debit-card' }, - { replace: 'ph-trash', replaceWith: 'an-trash' }, - { replace: 'ph-monitor', replaceWith: 'an-monitor' }, - { replace: 'ph-laptop', replaceWith: 'an-laptop' }, - { replace: 'ph-device-mobile', replaceWith: 'an-device-mobile' }, - { replace: 'ph-device-tablet-speaker', replaceWith: 'an-device-tablet-speaker' }, - { replace: 'ph-file-xls', replaceWith: 'an-file-xls' }, - { replace: 'ph-file', replaceWith: 'an-file' }, - { replace: 'ph-files', replaceWith: 'an-files' }, - { replace: 'ph-file-text', replaceWith: 'an-file-text' }, - { replace: 'ph-download-simple', replaceWith: 'an-download-simple' }, - { replace: 'ph-pencil-simple', replaceWith: 'an-pencil-simple' }, - { replace: 'ph-flask', replaceWith: 'an-flask' }, - { replace: 'ph-warning-circle', replaceWith: 'an-warning-circle' }, - { replace: 'ph-sign-out', replaceWith: 'an-sign-out' }, - { replace: 'ph-arrow-square-out', replaceWith: 'an-arrow-square-out' }, - { replace: 'ph-eye', replaceWith: 'an-eye' }, - { replace: 'ph-eye-closed', replaceWith: 'an-eye-closed' }, - { replace: 'ph-funnel', replaceWith: 'an-funnel' }, - { replace: 'ph-currency-circle-dollar', replaceWith: 'an-currency-circle-dollar' }, - { replace: 'ph-currency-btc', replaceWith: 'an-currency-btc' }, - { replace: 'ph-currency-dollar-simple', replaceWith: 'an-currency-dollar-simple' }, - { replace: 'ph-caret-double-left', replaceWith: 'an-caret-double-left' }, - { replace: 'ph-folder', replaceWith: 'an-folder' }, - { replace: 'ph-fork-knife', replaceWith: 'an-fork-knife' }, - { replace: 'ph-fork-knife', replaceWith: 'an-fork-knife' }, - { replace: 'ph-gas-pump', replaceWith: 'an-gas-pump' }, - { replace: 'ph-gift', replaceWith: 'an-gift' }, - { replace: 'ph-squares-four', replaceWith: 'an-squares-four' }, - { replace: 'ph-handshake', replaceWith: 'an-handshake' }, - { replace: 'ph-hard-drive-disk', replaceWith: 'an-hard-drive-disk' }, - { replace: 'ph-question', replaceWith: 'an-question' }, - { replace: 'ph-clock-counter-clockwise', replaceWith: 'an-clock-counter-clockwise' }, - { replace: 'ph-house-line', replaceWith: 'an-house-line' }, - { replace: 'ph-image-align-inline', replaceWith: 'an-image-align-inline' }, - { replace: 'ph-image-align-left', replaceWith: 'an-image-align-left' }, - { replace: 'ph-image-align-right', replaceWith: 'an-image-align-right' }, - { replace: 'ph-info', replaceWith: 'an-info' }, - { replace: 'ph-syringe', replaceWith: 'an-syringe' }, - { replace: 'ph-keyboard', replaceWith: 'an-keyboard' }, - { replace: 'ph-caret-double-right', replaceWith: 'an-caret-double-right' }, - { replace: 'ph-stack-simple', replaceWith: 'an-stack-simple' }, - { replace: 'ph-lightbulb', replaceWith: 'an-lightbulb' }, - { replace: 'ph-heart', replaceWith: 'an-heart' }, - { replace: 'ph-link', replaceWith: 'an-link' }, - { replace: 'ph-list-bullets', replaceWith: 'an-list-bullets' }, - { replace: 'ph-lock', replaceWith: 'an-lock' }, - { replace: 'ph-lock-open', replaceWith: 'an-lock-open' }, - { replace: 'ph-envelope', replaceWith: 'an-envelope' }, - { replace: 'ph-factory', replaceWith: 'an-factory' }, - { replace: 'ph-map-trifold', replaceWith: 'an-map-trifold' }, - { replace: 'ph-list', replaceWith: 'an-list' }, - { replace: 'ph-menu-close', replaceWith: 'an-menu-close' }, - { replace: 'ph-menu-open', replaceWith: 'an-menu-open' }, - { replace: 'ph-chat', replaceWith: 'an-chat' }, - { replace: 'ph-microphone', replaceWith: 'an-microphone' }, - { replace: 'ph-minus', replaceWith: 'an-minus' }, - { replace: 'ph-minus-circle', replaceWith: 'an-minus-circle' }, - { replace: 'ph-money', replaceWith: 'an-money' }, - { replace: 'ph-dots-three', replaceWith: 'an-dots-three' }, - { replace: 'ph-dots-three-vertical', replaceWith: 'an-dots-three-vertical' }, - { replace: 'ph-newspaper', replaceWith: 'an-newspaper' }, - { replace: 'ph-cloud-slash', replaceWith: 'an-cloud-slash' }, - { replace: 'ph-bell', replaceWith: 'an-bell' }, - { replace: 'ph-drop', replaceWith: 'an-drop' }, - { replace: 'ph-oil-magnifying-glass', replaceWith: 'an-oil-magnifying-glass' }, - { replace: 'ph-check', replaceWith: 'an-check' }, - { replace: 'ph-pallet-full', replaceWith: 'an-pallet-full' }, - { replace: 'ph-pallet-partial', replaceWith: 'an-pallet-partial' }, - { replace: 'ph-sliders-horizontal', replaceWith: 'an-sliders-horizontal' }, - { replace: 'ph-selection-foreground', replaceWith: 'an-selection-foreground' }, - { replace: 'ph-hand-coins', replaceWith: 'an-hand-coins' }, - { replace: 'ph-file-pdf', replaceWith: 'an-file-pdf' }, - { replace: 'ph-eyedropper', replaceWith: 'an-eyedropper' }, - { replace: 'ph-image', replaceWith: 'an-image' }, - { replace: 'ph-map-pin', replaceWith: 'an-map-pin' }, - { replace: 'ph-pix-logo', replaceWith: 'an-pix-logo' }, - { replace: 'ph-plus', replaceWith: 'an-plus' }, - { replace: 'ph-circle', replaceWith: 'an-circle' }, - { replace: 'ph-printer', replaceWith: 'an-printer' }, - { replace: 'ph-shopping-cart-simple', replaceWith: 'an-shopping-cart-simple' }, - { replace: 'ph-qr-code', replaceWith: 'an-qr-code' }, - { replace: 'ph-arrows-clockwise', replaceWith: 'an-arrows-clockwise' }, - { replace: 'ph-newspaper-clipping', replaceWith: 'an-newspaper-clipping' }, - { replace: 'ph-corners-out', replaceWith: 'an-corners-out' }, - { replace: 'ph-corners-in', replaceWith: 'an-corners-in' }, - { replace: 'ph-magnifying-glass', replaceWith: 'an-magnifying-glass' }, - { replace: 'ph-shield-check', replaceWith: 'an-shield-check' }, - { replace: 'ph-server', replaceWith: 'an-server' }, - { replace: 'ph-gear', replaceWith: 'an-gear' }, - { replace: 'ph-share', replaceWith: 'an-share' }, - { replace: 'ph-radio-signal', replaceWith: 'an-radio-signal' }, - { replace: 'ph-chat-dots', replaceWith: 'an-chat-dots' }, - { replace: 'ph-github-logo', replaceWith: 'an-github-logo' }, - { replace: 'ph-instagram-logo', replaceWith: 'an-instagram-logo' }, - { replace: 'ph-x-logo', replaceWith: 'an-x-logo' }, - { replace: 'ph-whatsapp-logo', replaceWith: 'an-whatsapp-logo' }, - { replace: 'ph-arrows-down-up', replaceWith: 'an-arrows-down-up' }, - { replace: 'ph-arrow-down', replaceWith: 'an-arrow-down' }, - { replace: 'ph-sort-ascending', replaceWith: 'an-sort-ascending' }, - { replace: 'ph-arrow-up', replaceWith: 'an-arrow-up' }, - { replace: 'ph-sort-descending', replaceWith: 'an-sort-descending' }, - { replace: 'ph-fill ph-star', replaceWith: 'an-fill an-star' }, - { replace: 'ph-fill ph-star-half', replaceWith: 'an-fill ph-star-half' }, - { replace: 'ph-steering-wheel', replaceWith: 'an-steering-wheel' }, - { replace: 'ph-package', replaceWith: 'an-package' }, - { replace: 'ph-desk', replaceWith: 'an-desk' }, - { replace: 'ph-target', replaceWith: 'an-target' }, - { replace: 'ph-phone', replaceWith: 'an-phone' }, - { replace: 'ph-text-b', replaceWith: 'an-text-b' }, - { replace: 'ph-text-italic', replaceWith: 'an-text-italic' }, - { replace: 'ph-text-underline', replaceWith: 'an-text-underline' }, - { replace: 'ph-hand-tap', replaceWith: 'an-hand-tap' }, - { replace: 'ph-suitcase-rolling', replaceWith: 'an-suitcase-rolling' }, - { replace: 'ph-truck', replaceWith: 'an-truck' }, - { replace: 'ph-upload-simple', replaceWith: 'an-upload-simple' }, - { replace: 'ph-cloud-arrow-up', replaceWith: 'an-cloud-arrow-up' }, - { replace: 'ph-user', replaceWith: 'an-user' }, - { replace: 'ph-user-plus', replaceWith: 'an-user-plus' }, - { replace: 'ph-user-x', replaceWith: 'an-user-x' }, - { replace: 'ph-users', replaceWith: 'an-users' }, - { replace: 'ph-video-camera', replaceWith: 'an-video-camera' }, - { replace: 'ph-waiter', replaceWith: 'an-waiter' }, - { replace: 'ph-wallet', replaceWith: 'an-wallet' }, - { replace: 'ph-warehouse', replaceWith: 'an-warehouse' }, - { replace: 'ph-warning-circle', replaceWith: 'an-warning-circle' }, - { replace: 'ph-weight', replaceWith: 'an-weight' }, - { replace: 'ph-globe', replaceWith: 'an-globe' }, - { replace: 'ph-file-xml', replaceWith: 'an-file-xml' }, - { replace: 'ph-magnifying-glass-plus', replaceWith: 'an-magnifying-glass-plus' }, - { replace: 'ph-magnifying-glass-minus', replaceWith: 'an-magnifying-glass-minus' } + { replace: 'po-icon-zoom-out', replaceWith: 'an-magnifying-glass-minus' } ]; export interface ReplaceChanges { @@ -376,3 +205,7 @@ export const updateDepedenciesVersion: UpdateDependencies = { export const poIconInsideReplaces: Array = [{ replace: regexRemovePoIconInside, replaceWith: '' }]; export const poIconReplaces: Array = [{ replace: regexRemovePoIcon, replaceWith: '' }]; + +export const phIconReplaces: Array = [{ replace: regexRemovePhIcon, replaceWith: 'an' }]; + +export const phIconHifenReplaces: Array = [{ replace: regexRemovePhHifenIcon, replaceWith: 'an-' }]; diff --git a/projects/ui/schematics/ng-update/v19/index.ts b/projects/ui/schematics/ng-update/v19/index.ts index bf64ac3461..772ad33b5d 100644 --- a/projects/ui/schematics/ng-update/v19/index.ts +++ b/projects/ui/schematics/ng-update/v19/index.ts @@ -1,4 +1,4 @@ -import { Rule, SchematicContext, Tree, chain } from '@angular-devkit/schematics'; +import { chain, Rule, SchematicContext, Tree } from '@angular-devkit/schematics'; import { NodePackageInstallTask } from '@angular-devkit/schematics/tasks'; import { updatePackageJson } from '@po-ui/ng-schematics/package-config'; @@ -11,6 +11,8 @@ import { import { addProviderToModule } from '@schematics/angular/utility/ast-utils'; import { iconsReplaced, + phIconHifenReplaces, + phIconReplaces, poIconInsideReplaces, poIconReplaces, ReplaceChanges, @@ -253,6 +255,8 @@ function applyUpdateInContent(tree: Tree, path: string) { // Atualiza para as instâncias dos novos ícones updated = replaceWithChanges(poIconInsideReplaces, updated); updated = replaceWithChanges(poIconReplaces, updated); + updated = replaceWithChanges(phIconReplaces, updated); + updated = replaceWithChanges(phIconHifenReplaces, updated); const icons = iconsReplaced.filter((icon: any) => updated.includes(icon.replace));