From 177fe241e314f5b62290af1c2ac32fb2530265fe Mon Sep 17 00:00:00 2001 From: Arcadio Quintero Date: Mon, 2 Oct 2023 20:10:17 -0400 Subject: [PATCH] dotCMS/core#26033 Move `DotRelativeDatePipe` to UI lib (#26331) * 26033 move `DotRelativeDatePipe` to UI lib * #26033 fix lint --- .../add-to-menu/add-to-menu.service.spec.ts | 2 +- .../api/services/dot-account-service.spec.ts | 2 +- .../dot-apps/dot-apps.service.spec.ts | 2 +- .../dot-custom-event-handler.service.spec.ts | 2 +- ...dot-workflow-event-handler.service.spec.ts | 2 +- .../dot-workflow-event-handler.service.ts | 2 +- .../push-publish/push-publish.service.spec.ts | 2 +- .../push-publish/push-publish.service.ts | 13 ++++--- .../container-list.component.spec.ts | 6 +-- .../container-list/container-list.module.ts | 3 +- ...ot-container-list-resolver.service.spec.ts | 2 +- ...dot-container-properties.component.spec.ts | 3 +- .../dot-edit-page-toolbar.component.spec.ts | 3 +- ...t-page-workflows-actions.component.spec.ts | 2 +- .../dot-page-state.service.spec.ts | 2 +- .../dot-edit-page-main.component.spec.ts | 2 +- ...ot-edit-page-toolbar-seo.component.spec.ts | 3 +- .../dot-edit-page-resolver.service.spec.ts | 2 +- .../dot-pages-listing-panel.component.spec.ts | 3 +- .../dot-pages-listing-panel.module.ts | 3 +- .../dot-pages/dot-pages.component.spec.ts | 10 ++--- .../dot-contentlets.component.spec.ts | 2 +- .../dot-portlet-detail.component.spec.ts | 2 +- .../dot-workflow-task.component.spec.ts | 3 +- ...dot-template-list-resolver.service.spec.ts | 2 +- .../dot-template-list.component.spec.ts | 4 +- .../dot-template-list.module.ts | 3 +- ...nt-type-fields-drop-zone.component.spec.ts | 3 +- .../service/validators/date.validator.ts | 2 +- .../dot-content-types.component.spec.ts | 2 +- core-web/apps/dotcms-ui/src/app/providers.ts | 2 +- .../dotcms-ui/src/app/test/dot-test-bed.ts | 2 +- .../dot-bulk-information.component.spec.ts | 3 +- .../dot-bulk-information.stories.ts | 3 +- .../dot-custom-time.module.ts | 2 +- ...-comment-and-assign-form.component.spec.ts | 3 +- .../iframe-porlet-legacy.component.spec.ts | 2 +- ...ot-content-compare-table.component.spec.ts | 4 +- .../dot-content-compare.component.spec.ts | 2 +- .../dot-content-compare.module.ts | 3 +- .../store/dot-content-compare.store.spec.ts | 2 +- .../store/dot-content-compare.store.ts | 37 ++++++++----------- .../dot-add-contentlet.component.spec.ts | 2 +- .../dot-create-contentlet.component.spec.ts | 2 +- .../dot-contentlet-editor.service.spec.ts | 2 +- .../dot-listing-data-table.component.spec.ts | 5 +-- .../dot-listing-data-table.component.ts | 7 +--- .../dot-listing-data-table.module.ts | 3 +- .../dot-theme-selector-dropdown.stories.ts | 3 +- .../dot-toolbar-user.component.spec.ts | 3 +- .../dot-login.component.spec.ts | 3 +- .../dot-login.component.ts | 2 +- .../main-legacy/main-legacy.component.spec.ts | 2 +- ...t-experiments-list-table.component.spec.ts | 3 +- .../dot-experiments-list-table.component.ts | 8 +++- .../dot-experiments-list.component.spec.ts | 3 +- core-web/libs/ui/src/index.ts | 9 ++++- .../dot-relative-date.pipe.spec.ts | 4 +- .../dot-relative-date.pipe.ts | 2 +- .../lib}/services/dot-format-date-service.ts | 0 60 files changed, 98 insertions(+), 124 deletions(-) rename core-web/{apps/dotcms-ui/src/app/view => libs/ui/src/lib}/pipes/dot-relative-date/dot-relative-date.pipe.spec.ts (96%) rename core-web/{apps/dotcms-ui/src/app/view => libs/ui/src/lib}/pipes/dot-relative-date/dot-relative-date.pipe.ts (95%) rename core-web/{apps/dotcms-ui/src/app/api => libs/ui/src/lib}/services/dot-format-date-service.ts (100%) diff --git a/core-web/apps/dotcms-ui/src/app/api/services/add-to-menu/add-to-menu.service.spec.ts b/core-web/apps/dotcms-ui/src/app/api/services/add-to-menu/add-to-menu.service.spec.ts index 4bcf8ac2a2e9..bb9a85f582a3 100644 --- a/core-web/apps/dotcms-ui/src/app/api/services/add-to-menu/add-to-menu.service.spec.ts +++ b/core-web/apps/dotcms-ui/src/app/api/services/add-to-menu/add-to-menu.service.spec.ts @@ -9,6 +9,7 @@ import { DotMessageDisplayServiceMock } from '@components/dot-message-display/do import { DotMessageDisplayService } from '@components/dot-message-display/services'; import { DotAlertConfirmService } from '@dotcms/data-access'; import { CoreWebService, LoginService } from '@dotcms/dotcms-js'; +import { DotFormatDateService } from '@dotcms/ui'; import { CoreWebServiceMock, DotFormatDateServiceMock, @@ -16,7 +17,6 @@ import { MockDotRouterService, mockResponseView } from '@dotcms/utils-testing'; -import { DotFormatDateService } from '@services/dot-format-date-service'; import { DotHttpErrorManagerService } from '@services/dot-http-error-manager/dot-http-error-manager.service'; import { DotRouterService } from '@services/dot-router/dot-router.service'; diff --git a/core-web/apps/dotcms-ui/src/app/api/services/dot-account-service.spec.ts b/core-web/apps/dotcms-ui/src/app/api/services/dot-account-service.spec.ts index 6b5434798895..02f29a0bf23c 100644 --- a/core-web/apps/dotcms-ui/src/app/api/services/dot-account-service.spec.ts +++ b/core-web/apps/dotcms-ui/src/app/api/services/dot-account-service.spec.ts @@ -7,10 +7,10 @@ import { ConfirmationService } from 'primeng/api'; import { DotMessageDisplayServiceMock } from '@components/dot-message-display/dot-message-display.component.spec'; import { DotMessageDisplayService } from '@components/dot-message-display/services'; -import { DotFormatDateService } from '@dotcms/app/api/services/dot-format-date-service'; import { DotRouterService } from '@dotcms/app/api/services/dot-router/dot-router.service'; import { DotAlertConfirmService } from '@dotcms/data-access'; import { CoreWebService, LoginService } from '@dotcms/dotcms-js'; +import { DotFormatDateService } from '@dotcms/ui'; import { CoreWebServiceMock, DotFormatDateServiceMock, diff --git a/core-web/apps/dotcms-ui/src/app/api/services/dot-apps/dot-apps.service.spec.ts b/core-web/apps/dotcms-ui/src/app/api/services/dot-apps/dot-apps.service.spec.ts index 52667c96f7f0..a2079097c556 100644 --- a/core-web/apps/dotcms-ui/src/app/api/services/dot-apps/dot-apps.service.spec.ts +++ b/core-web/apps/dotcms-ui/src/app/api/services/dot-apps/dot-apps.service.spec.ts @@ -11,6 +11,7 @@ import { DotMessageDisplayService } from '@components/dot-message-display/servic import { DotAlertConfirmService } from '@dotcms/data-access'; import { CoreWebService, LoginService } from '@dotcms/dotcms-js'; import { DotApps, DotAppsImportConfiguration, DotAppsSaveData } from '@dotcms/dotcms-models'; +import { DotFormatDateService } from '@dotcms/ui'; import * as dotUtils from '@dotcms/utils/lib/dot-utils'; import { CoreWebServiceMock, @@ -22,7 +23,6 @@ import { import { DotAppsService } from './dot-apps.service'; -import { DotFormatDateService } from '../dot-format-date-service'; import { DotHttpErrorManagerService } from '../dot-http-error-manager/dot-http-error-manager.service'; import { DotRouterService } from '../dot-router/dot-router.service'; diff --git a/core-web/apps/dotcms-ui/src/app/api/services/dot-custom-event-handler/dot-custom-event-handler.service.spec.ts b/core-web/apps/dotcms-ui/src/app/api/services/dot-custom-event-handler/dot-custom-event-handler.service.spec.ts index cbd57ff0a723..7bf827bd9564 100644 --- a/core-web/apps/dotcms-ui/src/app/api/services/dot-custom-event-handler/dot-custom-event-handler.service.spec.ts +++ b/core-web/apps/dotcms-ui/src/app/api/services/dot-custom-event-handler/dot-custom-event-handler.service.spec.ts @@ -38,6 +38,7 @@ import { UserModel } from '@dotcms/dotcms-js'; import { FeaturedFlags } from '@dotcms/dotcms-models'; +import { DotFormatDateService } from '@dotcms/ui'; import { DotLoadingIndicatorService } from '@dotcms/utils'; import { CoreWebServiceMock, @@ -46,7 +47,6 @@ import { } from '@dotcms/utils-testing'; import { DotCustomEventHandlerService } from '@services/dot-custom-event-handler/dot-custom-event-handler.service'; import { DotDownloadBundleDialogService } from '@services/dot-download-bundle-dialog/dot-download-bundle-dialog.service'; -import { DotFormatDateService } from '@services/dot-format-date-service'; import { DotHttpErrorManagerService } from '@services/dot-http-error-manager/dot-http-error-manager.service'; import { DotMenuService } from '@services/dot-menu.service'; import { DotRouterService } from '@services/dot-router/dot-router.service'; diff --git a/core-web/apps/dotcms-ui/src/app/api/services/dot-workflow-event-handler/dot-workflow-event-handler.service.spec.ts b/core-web/apps/dotcms-ui/src/app/api/services/dot-workflow-event-handler/dot-workflow-event-handler.service.spec.ts index 38ef2818a965..2c99f52dc18f 100644 --- a/core-web/apps/dotcms-ui/src/app/api/services/dot-workflow-event-handler/dot-workflow-event-handler.service.spec.ts +++ b/core-web/apps/dotcms-ui/src/app/api/services/dot-workflow-event-handler/dot-workflow-event-handler.service.spec.ts @@ -15,7 +15,6 @@ import { DotIframeService } from '@components/_common/iframe/service/dot-iframe/ import { DotMessageDisplayServiceMock } from '@components/dot-message-display/dot-message-display.component.spec'; import { DotMessageSeverity, DotMessageType } from '@components/dot-message-display/model'; import { DotMessageDisplayService } from '@components/dot-message-display/services'; -import { DotFormatDateService } from '@dotcms/app/api/services/dot-format-date-service'; import { DotHttpErrorManagerService } from '@dotcms/app/api/services/dot-http-error-manager/dot-http-error-manager.service'; import { DotRouterService } from '@dotcms/app/api/services/dot-router/dot-router.service'; import { DotWizardService } from '@dotcms/app/api/services/dot-wizard/dot-wizard.service'; @@ -46,6 +45,7 @@ import { DotProcessedWorkflowPayload, DotWorkflowPayload } from '@dotcms/dotcms-models'; +import { DotFormatDateService } from '@dotcms/ui'; import { CoreWebServiceMock, DotFormatDateServiceMock, diff --git a/core-web/apps/dotcms-ui/src/app/api/services/dot-workflow-event-handler/dot-workflow-event-handler.service.ts b/core-web/apps/dotcms-ui/src/app/api/services/dot-workflow-event-handler/dot-workflow-event-handler.service.ts index 1771d88ce3a8..3b3998472fac 100644 --- a/core-web/apps/dotcms-ui/src/app/api/services/dot-workflow-event-handler/dot-workflow-event-handler.service.ts +++ b/core-web/apps/dotcms-ui/src/app/api/services/dot-workflow-event-handler/dot-workflow-event-handler.service.ts @@ -10,7 +10,6 @@ import { DotPushPublishFormComponent } from '@components/_common/forms/dot-push- import { DotIframeService } from '@components/_common/iframe/service/dot-iframe/dot-iframe.service'; import { DotMessageSeverity, DotMessageType } from '@components/dot-message-display/model'; import { DotMessageDisplayService } from '@components/dot-message-display/services'; -import { DotFormatDateService } from '@dotcms/app/api/services/dot-format-date-service'; import { DotHttpErrorManagerService } from '@dotcms/app/api/services/dot-http-error-manager/dot-http-error-manager.service'; import { PushPublishService } from '@dotcms/app/api/services/push-publish/push-publish.service'; import { DotMessageService, DotWorkflowActionsFireService } from '@dotcms/data-access'; @@ -23,6 +22,7 @@ import { DotProcessedWorkflowPayload, DotWorkflowPayload } from '@dotcms/dotcms-models'; +import { DotFormatDateService } from '@dotcms/ui'; import { DotEnvironment } from '@models/dot-environment/dot-environment'; import { DotWizardInput } from '@models/dot-wizard-input/dot-wizard-input.model'; import { DotWizardStep } from '@models/dot-wizard-step/dot-wizard-step.model'; diff --git a/core-web/apps/dotcms-ui/src/app/api/services/push-publish/push-publish.service.spec.ts b/core-web/apps/dotcms-ui/src/app/api/services/push-publish/push-publish.service.spec.ts index 0f75e842b205..b445fd01a97c 100644 --- a/core-web/apps/dotcms-ui/src/app/api/services/push-publish/push-publish.service.spec.ts +++ b/core-web/apps/dotcms-ui/src/app/api/services/push-publish/push-publish.service.spec.ts @@ -6,9 +6,9 @@ import { of } from 'rxjs'; import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; -import { DotFormatDateService } from '@dotcms/app/api/services/dot-format-date-service'; import { DotCurrentUserService } from '@dotcms/data-access'; import { ApiRoot, CoreWebService, LoggerService, StringUtils, UserModel } from '@dotcms/dotcms-js'; +import { DotFormatDateService } from '@dotcms/ui'; import { CoreWebServiceMock, DotFormatDateServiceMock } from '@dotcms/utils-testing'; import { DotPushPublishData } from '@models/dot-push-publish-data/dot-push-publish-data'; diff --git a/core-web/apps/dotcms-ui/src/app/api/services/push-publish/push-publish.service.ts b/core-web/apps/dotcms-ui/src/app/api/services/push-publish/push-publish.service.ts index 808aa2904e83..ad74d05106c9 100644 --- a/core-web/apps/dotcms-ui/src/app/api/services/push-publish/push-publish.service.ts +++ b/core-web/apps/dotcms-ui/src/app/api/services/push-publish/push-publish.service.ts @@ -4,10 +4,10 @@ import { Injectable } from '@angular/core'; import { filter, map, mergeMap, pluck, toArray } from 'rxjs/operators'; -import { DotFormatDateService } from '@dotcms/app/api/services/dot-format-date-service'; import { DotCurrentUserService } from '@dotcms/data-access'; import { ApiRoot, CoreWebService } from '@dotcms/dotcms-js'; import { DotAjaxActionResponseView, DotCurrentUser } from '@dotcms/dotcms-models'; +import { DotFormatDateService } from '@dotcms/ui'; import { DotEnvironment } from '@models/dot-environment/dot-environment'; import { DotPushPublishData } from '@models/dot-push-publish-data/dot-push-publish-data'; @@ -19,7 +19,6 @@ import { DotPushPublishData } from '@models/dot-push-publish-data/dot-push-publi @Injectable() export class PushPublishService { private pushEnvironementsUrl = '/api/environment/loadenvironments/roleId'; - private _lastEnvironmentPushed: string[]; /* TODO: I had to do this because this line concat'api/' into the URL https://github.com/dotCMS/dotcms-js/blob/master/src/core/core-web.service.ts#L169 @@ -34,6 +33,12 @@ export class PushPublishService { private dotFormatDateService: DotFormatDateService ) {} + private _lastEnvironmentPushed: string[]; + + get lastEnvironmentPushed(): string[] { + return this._lastEnvironmentPushed; + } + /** * Get push publish environments. * @returns Observable @@ -120,8 +125,4 @@ export class PushPublishService { return result; } - - get lastEnvironmentPushed(): string[] { - return this._lastEnvironmentPushed; - } } diff --git a/core-web/apps/dotcms-ui/src/app/portlets/dot-containers/container-list/container-list.component.spec.ts b/core-web/apps/dotcms-ui/src/app/portlets/dot-containers/container-list/container-list.component.spec.ts index c3d2aabb4a11..24bd5b83eea1 100644 --- a/core-web/apps/dotcms-ui/src/app/portlets/dot-containers/container-list/container-list.component.spec.ts +++ b/core-web/apps/dotcms-ui/src/app/portlets/dot-containers/container-list/container-list.component.spec.ts @@ -3,7 +3,7 @@ import { of } from 'rxjs'; import { CommonModule } from '@angular/common'; import { HttpClient } from '@angular/common/http'; import { HttpClientTestingModule } from '@angular/common/http/testing'; -import { CUSTOM_ELEMENTS_SCHEMA, Component, EventEmitter, Input, Output } from '@angular/core'; +import { Component, CUSTOM_ELEMENTS_SCHEMA, EventEmitter, Input, Output } from '@angular/core'; import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { ActivatedRoute } from '@angular/router'; @@ -24,7 +24,6 @@ import { ActionHeaderModule } from '@components/dot-listing-data-table/action-he import { DotMessageDisplayServiceMock } from '@components/dot-message-display/dot-message-display.component.spec'; import { DotMessageDisplayService } from '@components/dot-message-display/services'; import { DotPortletBaseModule } from '@components/dot-portlet-base/dot-portlet-base.module'; -import { DotRelativeDatePipe } from '@dotcms/app/view/pipes/dot-relative-date/dot-relative-date.pipe'; import { DotAlertConfirmService, DotMessageService, @@ -46,7 +45,7 @@ import { StringUtils } from '@dotcms/dotcms-js'; import { CONTAINER_SOURCE, DotActionBulkResult, DotContainer } from '@dotcms/dotcms-models'; -import { DotMessagePipe } from '@dotcms/ui'; +import { DotFormatDateService, DotMessagePipe, DotRelativeDatePipe } from '@dotcms/ui'; import { DotcmsConfigServiceMock, DotFormatDateServiceMock, @@ -54,7 +53,6 @@ import { SiteServiceMock } from '@dotcms/utils-testing'; import { DotContainersService } from '@services/dot-containers/dot-containers.service'; -import { DotFormatDateService } from '@services/dot-format-date-service'; import { DotHttpErrorManagerService } from '@services/dot-http-error-manager/dot-http-error-manager.service'; import { DotRouterService } from '@services/dot-router/dot-router.service'; import { dotEventSocketURLFactory } from '@tests/dot-test-bed'; diff --git a/core-web/apps/dotcms-ui/src/app/portlets/dot-containers/container-list/container-list.module.ts b/core-web/apps/dotcms-ui/src/app/portlets/dot-containers/container-list/container-list.module.ts index f09fc27388f9..3e005118f3ca 100644 --- a/core-web/apps/dotcms-ui/src/app/portlets/dot-containers/container-list/container-list.module.ts +++ b/core-web/apps/dotcms-ui/src/app/portlets/dot-containers/container-list/container-list.module.ts @@ -14,9 +14,8 @@ import { DotEmptyStateModule } from '@components/_common/dot-empty-state/dot-emp import { DotContentTypeSelectorModule } from '@components/dot-content-type-selector'; import { ActionHeaderModule } from '@components/dot-listing-data-table/action-header/action-header.module'; import { DotPortletBaseModule } from '@components/dot-portlet-base/dot-portlet-base.module'; -import { DotRelativeDatePipe } from '@dotcms/app/view/pipes/dot-relative-date/dot-relative-date.pipe'; import { DotSiteBrowserService } from '@dotcms/data-access'; -import { DotMessagePipe } from '@dotcms/ui'; +import { DotMessagePipe, DotRelativeDatePipe } from '@dotcms/ui'; import { DotContainerListResolver } from '@portlets/dot-containers/container-list/dot-container-list-resolver.service'; import { DotContainersService } from '@services/dot-containers/dot-containers.service'; diff --git a/core-web/apps/dotcms-ui/src/app/portlets/dot-containers/container-list/dot-container-list-resolver.service.spec.ts b/core-web/apps/dotcms-ui/src/app/portlets/dot-containers/container-list/dot-container-list-resolver.service.spec.ts index 4666c9ac6789..90aa015d921b 100644 --- a/core-web/apps/dotcms-ui/src/app/portlets/dot-containers/container-list/dot-container-list-resolver.service.spec.ts +++ b/core-web/apps/dotcms-ui/src/app/portlets/dot-containers/container-list/dot-container-list-resolver.service.spec.ts @@ -14,8 +14,8 @@ import { StringUtils, UserModel } from '@dotcms/dotcms-js'; +import { DotFormatDateService } from '@dotcms/ui'; import { CoreWebServiceMock } from '@dotcms/utils-testing'; -import { DotFormatDateService } from '@services/dot-format-date-service'; import { PushPublishService } from '@services/push-publish/push-publish.service'; import { DotContainerListResolver } from './dot-container-list-resolver.service'; diff --git a/core-web/apps/dotcms-ui/src/app/portlets/dot-containers/dot-container-create/dot-container-properties/dot-container-properties.component.spec.ts b/core-web/apps/dotcms-ui/src/app/portlets/dot-containers/dot-container-create/dot-container-properties/dot-container-properties.component.spec.ts index 924f9aef2c4c..e58e227d0736 100644 --- a/core-web/apps/dotcms-ui/src/app/portlets/dot-containers/dot-container-create/dot-container-properties/dot-container-properties.component.spec.ts +++ b/core-web/apps/dotcms-ui/src/app/portlets/dot-containers/dot-container-create/dot-container-properties/dot-container-properties.component.spec.ts @@ -54,14 +54,13 @@ import { StringUtils } from '@dotcms/dotcms-js'; import { DotCMSContentType } from '@dotcms/dotcms-models'; -import { DotAutofocusDirective, DotMessagePipe } from '@dotcms/ui'; +import { DotAutofocusDirective, DotFormatDateService, DotMessagePipe } from '@dotcms/ui'; import { CoreWebServiceMock, DotFormatDateServiceMock, MockDotMessageService } from '@dotcms/utils-testing'; import { DotContainersService } from '@services/dot-containers/dot-containers.service'; -import { DotFormatDateService } from '@services/dot-format-date-service'; import { DotHttpErrorManagerService } from '@services/dot-http-error-manager/dot-http-error-manager.service'; import { DotRouterService } from '@services/dot-router/dot-router.service'; import { dotEventSocketURLFactory } from '@tests/dot-test-bed'; diff --git a/core-web/apps/dotcms-ui/src/app/portlets/dot-edit-page/content/components/dot-edit-page-toolbar/dot-edit-page-toolbar.component.spec.ts b/core-web/apps/dotcms-ui/src/app/portlets/dot-edit-page/content/components/dot-edit-page-toolbar/dot-edit-page-toolbar.component.spec.ts index 2b712c84400f..3280e8becf54 100644 --- a/core-web/apps/dotcms-ui/src/app/portlets/dot-edit-page/content/components/dot-edit-page-toolbar/dot-edit-page-toolbar.component.spec.ts +++ b/core-web/apps/dotcms-ui/src/app/portlets/dot-edit-page/content/components/dot-edit-page-toolbar/dot-edit-page-toolbar.component.spec.ts @@ -22,7 +22,6 @@ import { DotWizardModule } from '@components/_common/dot-wizard/dot-wizard.modul import { DotIframeService } from '@components/_common/iframe/service/dot-iframe/dot-iframe.service'; import { DotMessageDisplayService } from '@components/dot-message-display/services'; import { DotSecondaryToolbarModule } from '@components/dot-secondary-toolbar'; -import { DotFormatDateService } from '@dotcms/app/api/services/dot-format-date-service'; import { DotHttpErrorManagerService } from '@dotcms/app/api/services/dot-http-error-manager/dot-http-error-manager.service'; import { DotRouterService } from '@dotcms/app/api/services/dot-router/dot-router.service'; import { dotEventSocketURLFactory } from '@dotcms/app/test/dot-test-bed'; @@ -56,7 +55,7 @@ import { ESContent, RUNNING_UNTIL_DATE_FORMAT } from '@dotcms/dotcms-models'; -import { DotMessagePipe } from '@dotcms/ui'; +import { DotFormatDateService, DotMessagePipe } from '@dotcms/ui'; import { CoreWebServiceMock, dotcmsContentletMock, diff --git a/core-web/apps/dotcms-ui/src/app/portlets/dot-edit-page/content/components/dot-edit-page-workflows-actions/dot-edit-page-workflows-actions.component.spec.ts b/core-web/apps/dotcms-ui/src/app/portlets/dot-edit-page/content/components/dot-edit-page-workflows-actions/dot-edit-page-workflows-actions.component.spec.ts index 196320bce2b4..7ba5ae17ea28 100644 --- a/core-web/apps/dotcms-ui/src/app/portlets/dot-edit-page/content/components/dot-edit-page-workflows-actions/dot-edit-page-workflows-actions.component.spec.ts +++ b/core-web/apps/dotcms-ui/src/app/portlets/dot-edit-page/content/components/dot-edit-page-workflows-actions/dot-edit-page-workflows-actions.component.spec.ts @@ -17,7 +17,6 @@ import { DotGlobalMessageService } from '@components/_common/dot-global-message/ import { DotIframeService } from '@components/_common/iframe/service/dot-iframe/dot-iframe.service'; import { DotMessageSeverity, DotMessageType } from '@components/dot-message-display/model'; import { DotMessageDisplayService } from '@components/dot-message-display/services'; -import { DotFormatDateService } from '@dotcms/app/api/services/dot-format-date-service'; import { DotHttpErrorManagerService } from '@dotcms/app/api/services/dot-http-error-manager/dot-http-error-manager.service'; import { DotRouterService } from '@dotcms/app/api/services/dot-router/dot-router.service'; import { DotWizardService } from '@dotcms/app/api/services/dot-wizard/dot-wizard.service'; @@ -43,6 +42,7 @@ import { StringUtils } from '@dotcms/dotcms-js'; import { DotPage } from '@dotcms/dotcms-models'; +import { DotFormatDateService } from '@dotcms/ui'; import { CoreWebServiceMock, dotcmsContentletMock, diff --git a/core-web/apps/dotcms-ui/src/app/portlets/dot-edit-page/content/services/dot-page-state/dot-page-state.service.spec.ts b/core-web/apps/dotcms-ui/src/app/portlets/dot-edit-page/content/services/dot-page-state/dot-page-state.service.spec.ts index e02dbdba2c0c..c56360e9e2d5 100644 --- a/core-web/apps/dotcms-ui/src/app/portlets/dot-edit-page/content/services/dot-page-state/dot-page-state.service.spec.ts +++ b/core-web/apps/dotcms-ui/src/app/portlets/dot-edit-page/content/services/dot-page-state/dot-page-state.service.spec.ts @@ -8,7 +8,6 @@ import { ConfirmationService } from 'primeng/api'; import { DotMessageDisplayServiceMock } from '@components/dot-message-display/dot-message-display.component.spec'; import { DotMessageDisplayService } from '@components/dot-message-display/services'; import { DotFavoritePageService } from '@dotcms/app/api/services/dot-favorite-page/dot-favorite-page.service'; -import { DotFormatDateService } from '@dotcms/app/api/services/dot-format-date-service'; import { DotHttpErrorManagerService } from '@dotcms/app/api/services/dot-http-error-manager/dot-http-error-manager.service'; import { DotRouterService } from '@dotcms/app/api/services/dot-router/dot-router.service'; import { @@ -29,6 +28,7 @@ import { DotPersona } from '@dotcms/dotcms-models'; import { DotExperimentsService } from '@dotcms/portlets/dot-experiments/data-access'; +import { DotFormatDateService } from '@dotcms/ui'; import { CoreWebServiceMock, dotcmsContentletMock, diff --git a/core-web/apps/dotcms-ui/src/app/portlets/dot-edit-page/main/dot-edit-page-main/dot-edit-page-main.component.spec.ts b/core-web/apps/dotcms-ui/src/app/portlets/dot-edit-page/main/dot-edit-page-main/dot-edit-page-main.component.spec.ts index 3b0028f1d0ad..f81cd83d33c8 100644 --- a/core-web/apps/dotcms-ui/src/app/portlets/dot-edit-page/main/dot-edit-page-main/dot-edit-page-main.component.spec.ts +++ b/core-web/apps/dotcms-ui/src/app/portlets/dot-edit-page/main/dot-edit-page-main/dot-edit-page-main.component.spec.ts @@ -17,7 +17,6 @@ import { DotIframeService } from '@components/_common/iframe/service/dot-iframe/ import { DotContentletEditorService } from '@components/dot-contentlet-editor/services/dot-contentlet-editor.service'; import { DotMessageDisplayService } from '@components/dot-message-display/services'; import { DotCustomEventHandlerService } from '@dotcms/app/api/services/dot-custom-event-handler/dot-custom-event-handler.service'; -import { DotFormatDateService } from '@dotcms/app/api/services/dot-format-date-service'; import { DotHttpErrorManagerService } from '@dotcms/app/api/services/dot-http-error-manager/dot-http-error-manager.service'; import { DotRouterService } from '@dotcms/app/api/services/dot-router/dot-router.service'; import { DotUiColorsService } from '@dotcms/app/api/services/dot-ui-colors/dot-ui-colors.service'; @@ -48,6 +47,7 @@ import { UserModel } from '@dotcms/dotcms-js'; import { DotPageRender, DotPageRenderState } from '@dotcms/dotcms-models'; +import { DotFormatDateService } from '@dotcms/ui'; import { DotLoadingIndicatorService } from '@dotcms/utils'; import { MockDotMessageService, diff --git a/core-web/apps/dotcms-ui/src/app/portlets/dot-edit-page/seo/components/dot-edit-page-toolbar-seo/dot-edit-page-toolbar-seo.component.spec.ts b/core-web/apps/dotcms-ui/src/app/portlets/dot-edit-page/seo/components/dot-edit-page-toolbar-seo/dot-edit-page-toolbar-seo.component.spec.ts index 4876a0dad617..cacb635c154f 100644 --- a/core-web/apps/dotcms-ui/src/app/portlets/dot-edit-page/seo/components/dot-edit-page-toolbar-seo/dot-edit-page-toolbar-seo.component.spec.ts +++ b/core-web/apps/dotcms-ui/src/app/portlets/dot-edit-page/seo/components/dot-edit-page-toolbar-seo/dot-edit-page-toolbar-seo.component.spec.ts @@ -23,7 +23,6 @@ import { DotIframeService } from '@components/_common/iframe/service/dot-iframe/ import { DotContentletEditorService } from '@components/dot-contentlet-editor/services/dot-contentlet-editor.service'; import { DotMessageDisplayService } from '@components/dot-message-display/services'; import { DotSecondaryToolbarModule } from '@components/dot-secondary-toolbar'; -import { DotFormatDateService } from '@dotcms/app/api/services/dot-format-date-service'; import { DotHttpErrorManagerService } from '@dotcms/app/api/services/dot-http-error-manager/dot-http-error-manager.service'; import { DotRouterService } from '@dotcms/app/api/services/dot-router/dot-router.service'; import { dotEventSocketURLFactory } from '@dotcms/app/test/dot-test-bed'; @@ -57,7 +56,7 @@ import { ESContent, RUNNING_UNTIL_DATE_FORMAT } from '@dotcms/dotcms-models'; -import { DotMessagePipe } from '@dotcms/ui'; +import { DotFormatDateService, DotMessagePipe } from '@dotcms/ui'; import { CoreWebServiceMock, dotcmsContentletMock, diff --git a/core-web/apps/dotcms-ui/src/app/portlets/dot-edit-page/shared/services/dot-edit-page-resolver/dot-edit-page-resolver.service.spec.ts b/core-web/apps/dotcms-ui/src/app/portlets/dot-edit-page/shared/services/dot-edit-page-resolver/dot-edit-page-resolver.service.spec.ts index e7c925398b46..8148ff686b41 100644 --- a/core-web/apps/dotcms-ui/src/app/portlets/dot-edit-page/shared/services/dot-edit-page-resolver/dot-edit-page-resolver.service.spec.ts +++ b/core-web/apps/dotcms-ui/src/app/portlets/dot-edit-page/shared/services/dot-edit-page-resolver/dot-edit-page-resolver.service.spec.ts @@ -12,7 +12,6 @@ import { ConfirmationService } from 'primeng/api'; import { DotMessageDisplayServiceMock } from '@components/dot-message-display/dot-message-display.component.spec'; import { DotMessageDisplayService } from '@components/dot-message-display/services'; import { DotFavoritePageService } from '@dotcms/app/api/services/dot-favorite-page/dot-favorite-page.service'; -import { DotFormatDateService } from '@dotcms/app/api/services/dot-format-date-service'; import { DotHttpErrorManagerService } from '@dotcms/app/api/services/dot-http-error-manager/dot-http-error-manager.service'; import { DotRouterService } from '@dotcms/app/api/services/dot-router/dot-router.service'; import { MockDotHttpErrorManagerService } from '@dotcms/app/test/dot-http-error-manager.service.mock'; @@ -27,6 +26,7 @@ import { import { CoreWebService, HttpCode, LoginService, SiteService } from '@dotcms/dotcms-js'; import { DotPageMode, DotPageRender, DotPageRenderState } from '@dotcms/dotcms-models'; import { DotExperimentsService } from '@dotcms/portlets/dot-experiments/data-access'; +import { DotFormatDateService } from '@dotcms/ui'; import { CoreWebServiceMock, LoginServiceMock, diff --git a/core-web/apps/dotcms-ui/src/app/portlets/dot-pages/dot-pages-listing-panel/dot-pages-listing-panel.component.spec.ts b/core-web/apps/dotcms-ui/src/app/portlets/dot-pages/dot-pages-listing-panel/dot-pages-listing-panel.component.spec.ts index 385d095e309b..d0c912303674 100644 --- a/core-web/apps/dotcms-ui/src/app/portlets/dot-pages/dot-pages-listing-panel/dot-pages-listing-panel.component.spec.ts +++ b/core-web/apps/dotcms-ui/src/app/portlets/dot-pages/dot-pages-listing-panel/dot-pages-listing-panel.component.spec.ts @@ -15,10 +15,9 @@ import { TooltipModule } from 'primeng/tooltip'; import { of } from 'rxjs/internal/observable/of'; -import { DotRelativeDatePipe } from '@dotcms/app/view/pipes/dot-relative-date/dot-relative-date.pipe'; import { DotMessageService } from '@dotcms/data-access'; import { CoreWebService, CoreWebServiceMock, DotcmsConfigService } from '@dotcms/dotcms-js'; -import { DotAutofocusDirective, DotMessagePipe } from '@dotcms/ui'; +import { DotAutofocusDirective, DotMessagePipe, DotRelativeDatePipe } from '@dotcms/ui'; import { DotcmsConfigServiceMock, dotcmsContentletMock, diff --git a/core-web/apps/dotcms-ui/src/app/portlets/dot-pages/dot-pages-listing-panel/dot-pages-listing-panel.module.ts b/core-web/apps/dotcms-ui/src/app/portlets/dot-pages/dot-pages-listing-panel/dot-pages-listing-panel.module.ts index e1ef7314fb3c..d47dc46abbff 100644 --- a/core-web/apps/dotcms-ui/src/app/portlets/dot-pages/dot-pages-listing-panel/dot-pages-listing-panel.module.ts +++ b/core-web/apps/dotcms-ui/src/app/portlets/dot-pages/dot-pages-listing-panel/dot-pages-listing-panel.module.ts @@ -12,8 +12,7 @@ import { SkeletonModule } from 'primeng/skeleton'; import { TableModule } from 'primeng/table'; import { TooltipModule } from 'primeng/tooltip'; -import { DotRelativeDatePipe } from '@dotcms/app/view/pipes/dot-relative-date/dot-relative-date.pipe'; -import { DotAutofocusDirective, DotMessagePipe } from '@dotcms/ui'; +import { DotAutofocusDirective, DotMessagePipe, DotRelativeDatePipe } from '@dotcms/ui'; import { DotPagesListingPanelComponent } from './dot-pages-listing-panel.component'; diff --git a/core-web/apps/dotcms-ui/src/app/portlets/dot-pages/dot-pages.component.spec.ts b/core-web/apps/dotcms-ui/src/app/portlets/dot-pages/dot-pages.component.spec.ts index 211cb1895ea3..446bcea70412 100644 --- a/core-web/apps/dotcms-ui/src/app/portlets/dot-pages/dot-pages.component.spec.ts +++ b/core-web/apps/dotcms-ui/src/app/portlets/dot-pages/dot-pages.component.spec.ts @@ -17,16 +17,15 @@ import { DotContentletEditorService } from '@components/dot-contentlet-editor/se import { DotMessageDisplayServiceMock } from '@components/dot-message-display/dot-message-display.component.spec'; import { DotMessageSeverity, DotMessageType } from '@components/dot-message-display/model'; import { DotMessageDisplayService } from '@components/dot-message-display/services'; -import { DotFormatDateService } from '@dotcms/app/api/services/dot-format-date-service'; import { DotHttpErrorManagerService } from '@dotcms/app/api/services/dot-http-error-manager/dot-http-error-manager.service'; import { DotRouterService } from '@dotcms/app/api/services/dot-router/dot-router.service'; import { DotUiColorsService } from '@dotcms/app/api/services/dot-ui-colors/dot-ui-colors.service'; import { MockDotHttpErrorManagerService } from '@dotcms/app/test/dot-http-error-manager.service.mock'; import { - DotSessionStorageService, DotAlertConfirmService, DotEventsService, - DotPageRenderService + DotPageRenderService, + DotSessionStorageService } from '@dotcms/data-access'; import { CoreWebService, @@ -35,11 +34,12 @@ import { HttpCode, LoggerService, LoginService, + mockSites, SiteService, - StringUtils, - mockSites + StringUtils } from '@dotcms/dotcms-js'; import { ComponentStatus } from '@dotcms/dotcms-models'; +import { DotFormatDateService } from '@dotcms/ui'; import { dotcmsContentletMock, dotcmsContentTypeBasicMock, diff --git a/core-web/apps/dotcms-ui/src/app/portlets/dot-porlet-detail/dot-contentlets/dot-contentlets.component.spec.ts b/core-web/apps/dotcms-ui/src/app/portlets/dot-porlet-detail/dot-contentlets/dot-contentlets.component.spec.ts index 7ffb0d605a92..716d8a0b84b8 100644 --- a/core-web/apps/dotcms-ui/src/app/portlets/dot-porlet-detail/dot-contentlets/dot-contentlets.component.spec.ts +++ b/core-web/apps/dotcms-ui/src/app/portlets/dot-porlet-detail/dot-contentlets/dot-contentlets.component.spec.ts @@ -16,7 +16,6 @@ import { DotContentletEditorService } from '@components/dot-contentlet-editor/se import { DotMessageDisplayService } from '@components/dot-message-display/services'; import { DotCustomEventHandlerService } from '@dotcms/app/api/services/dot-custom-event-handler/dot-custom-event-handler.service'; import { DotDownloadBundleDialogService } from '@dotcms/app/api/services/dot-download-bundle-dialog/dot-download-bundle-dialog.service'; -import { DotFormatDateService } from '@dotcms/app/api/services/dot-format-date-service'; import { DotHttpErrorManagerService } from '@dotcms/app/api/services/dot-http-error-manager/dot-http-error-manager.service'; import { DotRouterService } from '@dotcms/app/api/services/dot-router/dot-router.service'; import { DotUiColorsService } from '@dotcms/app/api/services/dot-ui-colors/dot-ui-colors.service'; @@ -43,6 +42,7 @@ import { StringUtils, UserModel } from '@dotcms/dotcms-js'; +import { DotFormatDateService } from '@dotcms/ui'; import { CoreWebServiceMock, LoginServiceMock, MockDotRouterService } from '@dotcms/utils-testing'; import { DotContentletsComponent } from './dot-contentlets.component'; diff --git a/core-web/apps/dotcms-ui/src/app/portlets/dot-porlet-detail/dot-portlet-detail.component.spec.ts b/core-web/apps/dotcms-ui/src/app/portlets/dot-porlet-detail/dot-portlet-detail.component.spec.ts index 0c086b7bb41f..b13f520d98be 100644 --- a/core-web/apps/dotcms-ui/src/app/portlets/dot-porlet-detail/dot-portlet-detail.component.spec.ts +++ b/core-web/apps/dotcms-ui/src/app/portlets/dot-porlet-detail/dot-portlet-detail.component.spec.ts @@ -13,7 +13,6 @@ import { DotGlobalMessageService } from '@components/_common/dot-global-message/ import { DotIframeService } from '@components/_common/iframe/service/dot-iframe/dot-iframe.service'; import { DotMessageDisplayService } from '@components/dot-message-display/services'; import { DotCustomEventHandlerService } from '@dotcms/app/api/services/dot-custom-event-handler/dot-custom-event-handler.service'; -import { DotFormatDateService } from '@dotcms/app/api/services/dot-format-date-service'; import { DotHttpErrorManagerService } from '@dotcms/app/api/services/dot-http-error-manager/dot-http-error-manager.service'; import { DotMenuService } from '@dotcms/app/api/services/dot-menu.service'; import { DotRouterService } from '@dotcms/app/api/services/dot-router/dot-router.service'; @@ -43,6 +42,7 @@ import { StringUtils, UserModel } from '@dotcms/dotcms-js'; +import { DotFormatDateService } from '@dotcms/ui'; import { LoginServiceMock, MockDotRouterService } from '@dotcms/utils-testing'; import { DotContentletsModule } from './dot-contentlets/dot-contentlets.module'; diff --git a/core-web/apps/dotcms-ui/src/app/portlets/dot-porlet-detail/dot-workflow-task/dot-workflow-task.component.spec.ts b/core-web/apps/dotcms-ui/src/app/portlets/dot-porlet-detail/dot-workflow-task/dot-workflow-task.component.spec.ts index de1170017a7d..206b41f07c7c 100644 --- a/core-web/apps/dotcms-ui/src/app/portlets/dot-porlet-detail/dot-workflow-task/dot-workflow-task.component.spec.ts +++ b/core-web/apps/dotcms-ui/src/app/portlets/dot-porlet-detail/dot-workflow-task/dot-workflow-task.component.spec.ts @@ -18,7 +18,6 @@ import { DotWorkflowTaskDetailModule } from '@components/dot-workflow-task-detai import { DotWorkflowTaskDetailService } from '@components/dot-workflow-task-detail/services/dot-workflow-task-detail.service'; import { DotCustomEventHandlerService } from '@dotcms/app/api/services/dot-custom-event-handler/dot-custom-event-handler.service'; import { DotDownloadBundleDialogService } from '@dotcms/app/api/services/dot-download-bundle-dialog/dot-download-bundle-dialog.service'; -import { DotFormatDateService } from '@dotcms/app/api/services/dot-format-date-service'; import { DotHttpErrorManagerService } from '@dotcms/app/api/services/dot-http-error-manager/dot-http-error-manager.service'; import { DotRouterService } from '@dotcms/app/api/services/dot-router/dot-router.service'; import { DotUiColorsService } from '@dotcms/app/api/services/dot-ui-colors/dot-ui-colors.service'; @@ -47,6 +46,7 @@ import { StringUtils, UserModel } from '@dotcms/dotcms-js'; +import { DotFormatDateService } from '@dotcms/ui'; import { CoreWebServiceMock, LoginServiceMock, @@ -55,6 +55,7 @@ import { } from '@dotcms/utils-testing'; import { DotWorkflowTaskComponent } from './dot-workflow-task.component'; + @Injectable() class MockDotWorkflowTaskDetailService { view = jasmine.createSpy('view'); diff --git a/core-web/apps/dotcms-ui/src/app/portlets/dot-templates/dot-template-list/dot-template-list-resolver.service.spec.ts b/core-web/apps/dotcms-ui/src/app/portlets/dot-templates/dot-template-list/dot-template-list-resolver.service.spec.ts index e5c4e947a16f..7271a7b0194f 100644 --- a/core-web/apps/dotcms-ui/src/app/portlets/dot-templates/dot-template-list/dot-template-list-resolver.service.spec.ts +++ b/core-web/apps/dotcms-ui/src/app/portlets/dot-templates/dot-template-list/dot-template-list-resolver.service.spec.ts @@ -5,7 +5,6 @@ import { TestBed } from '@angular/core/testing'; import { take } from 'rxjs/operators'; -import { DotFormatDateService } from '@dotcms/app/api/services/dot-format-date-service'; import { PushPublishService } from '@dotcms/app/api/services/push-publish/push-publish.service'; import { DotCurrentUserService, DotLicenseService } from '@dotcms/data-access'; import { @@ -16,6 +15,7 @@ import { StringUtils, UserModel } from '@dotcms/dotcms-js'; +import { DotFormatDateService } from '@dotcms/ui'; import { CoreWebServiceMock } from '@dotcms/utils-testing'; import { DotTemplateListResolver } from './dot-template-list-resolver.service'; diff --git a/core-web/apps/dotcms-ui/src/app/portlets/dot-templates/dot-template-list/dot-template-list.component.spec.ts b/core-web/apps/dotcms-ui/src/app/portlets/dot-templates/dot-template-list/dot-template-list.component.spec.ts index 6af72cbe7d0f..87e1eea87fe4 100644 --- a/core-web/apps/dotcms-ui/src/app/portlets/dot-templates/dot-template-list/dot-template-list.component.spec.ts +++ b/core-web/apps/dotcms-ui/src/app/portlets/dot-templates/dot-template-list/dot-template-list.component.spec.ts @@ -26,12 +26,10 @@ import { DotListingDataTableModule } from '@components/dot-listing-data-table'; import { DotListingDataTableComponent } from '@components/dot-listing-data-table/dot-listing-data-table.component'; import { DotMessageSeverity, DotMessageType } from '@components/dot-message-display/model'; import { DotMessageDisplayService } from '@components/dot-message-display/services'; -import { DotFormatDateService } from '@dotcms/app/api/services/dot-format-date-service'; import { DotHttpErrorManagerService } from '@dotcms/app/api/services/dot-http-error-manager/dot-http-error-manager.service'; import { DotRouterService } from '@dotcms/app/api/services/dot-router/dot-router.service'; import { DotTemplatesService } from '@dotcms/app/api/services/dot-templates/dot-templates.service'; import { dotEventSocketURLFactory } from '@dotcms/app/test/dot-test-bed'; -import { DotRelativeDatePipe } from '@dotcms/app/view/pipes/dot-relative-date/dot-relative-date.pipe'; import { DotAlertConfirmService, DotMessageService, @@ -49,7 +47,7 @@ import { StringUtils } from '@dotcms/dotcms-js'; import { DotActionBulkResult, DotContentState, DotTemplate } from '@dotcms/dotcms-models'; -import { DotMessagePipe } from '@dotcms/ui'; +import { DotFormatDateService, DotMessagePipe, DotRelativeDatePipe } from '@dotcms/ui'; import { CoreWebServiceMock, DotFormatDateServiceMock, diff --git a/core-web/apps/dotcms-ui/src/app/portlets/dot-templates/dot-template-list/dot-template-list.module.ts b/core-web/apps/dotcms-ui/src/app/portlets/dot-templates/dot-template-list/dot-template-list.module.ts index f6aa7c4c4ac9..8859bf341d3e 100644 --- a/core-web/apps/dotcms-ui/src/app/portlets/dot-templates/dot-template-list/dot-template-list.module.ts +++ b/core-web/apps/dotcms-ui/src/app/portlets/dot-templates/dot-template-list/dot-template-list.module.ts @@ -15,9 +15,8 @@ import { DotBulkInformationModule } from '@components/_common/dot-bulk-informati import { DotEmptyStateModule } from '@components/_common/dot-empty-state/dot-empty-state.module'; import { DotListingDataTableModule } from '@components/dot-listing-data-table'; import { DotTemplatesService } from '@dotcms/app/api/services/dot-templates/dot-templates.service'; -import { DotRelativeDatePipe } from '@dotcms/app/view/pipes/dot-relative-date/dot-relative-date.pipe'; import { DotSiteBrowserService } from '@dotcms/data-access'; -import { DotMessagePipe } from '@dotcms/ui'; +import { DotMessagePipe, DotRelativeDatePipe } from '@dotcms/ui'; import { DotTemplateListResolver } from '@portlets/dot-templates/dot-template-list/dot-template-list-resolver.service'; import { DotBinaryOptionSelectorComponent } from '@portlets/shared/dot-binary-option-selector/dot-binary-option-selector.component'; diff --git a/core-web/apps/dotcms-ui/src/app/portlets/shared/dot-content-types-edit/components/fields/content-type-fields-drop-zone/content-type-fields-drop-zone.component.spec.ts b/core-web/apps/dotcms-ui/src/app/portlets/shared/dot-content-types-edit/components/fields/content-type-fields-drop-zone/content-type-fields-drop-zone.component.spec.ts index 581fc6206955..739e95e49752 100644 --- a/core-web/apps/dotcms-ui/src/app/portlets/shared/dot-content-types-edit/components/fields/content-type-fields-drop-zone/content-type-fields-drop-zone.component.spec.ts +++ b/core-web/apps/dotcms-ui/src/app/portlets/shared/dot-content-types-edit/components/fields/content-type-fields-drop-zone/content-type-fields-drop-zone.component.spec.ts @@ -30,7 +30,6 @@ import { DotActionButtonModule } from '@components/_common/dot-action-button/dot import { DotDialogActions, DotDialogComponent } from '@components/dot-dialog/dot-dialog.component'; import { DotDialogModule } from '@components/dot-dialog/dot-dialog.module'; import { DotMessageDisplayService } from '@components/dot-message-display/services'; -import { DotFormatDateService } from '@dotcms/app/api/services/dot-format-date-service'; import { DotHttpErrorManagerService } from '@dotcms/app/api/services/dot-http-error-manager/dot-http-error-manager.service'; import { DotEventsService, DotMessageService } from '@dotcms/data-access'; import { CoreWebService, DotEventsSocket, LoginService } from '@dotcms/dotcms-js'; @@ -40,7 +39,7 @@ import { DotCMSContentTypeLayoutRow, DotFieldVariable } from '@dotcms/dotcms-models'; -import { DotFieldValidationMessageComponent, DotIconModule, DotMessagePipe } from '@dotcms/ui'; +import { DotFieldValidationMessageComponent, DotFormatDateService, DotIconModule, DotMessagePipe } from "@dotcms/ui"; import { DotLoadingIndicatorService } from '@dotcms/utils'; import { cleanUpDialog, diff --git a/core-web/apps/dotcms-ui/src/app/portlets/shared/dot-content-types-edit/components/fields/service/validators/date.validator.ts b/core-web/apps/dotcms-ui/src/app/portlets/shared/dot-content-types-edit/components/fields/service/validators/date.validator.ts index 2dcc18eee095..77cc4612d277 100644 --- a/core-web/apps/dotcms-ui/src/app/portlets/shared/dot-content-types-edit/components/fields/service/validators/date.validator.ts +++ b/core-web/apps/dotcms-ui/src/app/portlets/shared/dot-content-types-edit/components/fields/service/validators/date.validator.ts @@ -1,6 +1,6 @@ import { UntypedFormControl } from '@angular/forms'; -import { _isValid } from '@dotcms/app/api/services/dot-format-date-service'; +import { _isValid } from '@dotcms/ui'; const format = { 'com.dotcms.contenttype.model.field.ImmutableDateField': 'yyyy-MM-dd', diff --git a/core-web/apps/dotcms-ui/src/app/portlets/shared/dot-content-types-listing/dot-content-types.component.spec.ts b/core-web/apps/dotcms-ui/src/app/portlets/shared/dot-content-types-listing/dot-content-types.component.spec.ts index fe3b6b5309ca..57cc6c64958d 100644 --- a/core-web/apps/dotcms-ui/src/app/portlets/shared/dot-content-types-listing/dot-content-types.component.spec.ts +++ b/core-web/apps/dotcms-ui/src/app/portlets/shared/dot-content-types-listing/dot-content-types.component.spec.ts @@ -15,7 +15,6 @@ import { RouterTestingModule } from '@angular/router/testing'; import { ConfirmationService, SelectItem } from 'primeng/api'; import { DotListingDataTableModule } from '@components/dot-listing-data-table/dot-listing-data-table.module'; -import { DotFormatDateService } from '@dotcms/app/api/services/dot-format-date-service'; import { DotHttpErrorHandled, DotHttpErrorManagerService @@ -38,6 +37,7 @@ import { StringUtils } from '@dotcms/dotcms-js'; import { DotCMSContentType, DotCopyContentTypeDialogFormFields } from '@dotcms/dotcms-models'; +import { DotFormatDateService } from '@dotcms/ui'; import { CoreWebServiceMock, dotcmsContentTypeBasicMock, diff --git a/core-web/apps/dotcms-ui/src/app/providers.ts b/core-web/apps/dotcms-ui/src/app/providers.ts index 9cce420c109d..0f6dd8916734 100644 --- a/core-web/apps/dotcms-ui/src/app/providers.ts +++ b/core-web/apps/dotcms-ui/src/app/providers.ts @@ -21,11 +21,11 @@ import { PaginatorService } from '@dotcms/data-access'; import { DotPushPublishDialogService } from '@dotcms/dotcms-js'; +import { DotFormatDateService } from '@dotcms/ui'; import { CanDeactivateGuardService } from '@services/guards/can-deactivate-guard.service'; import { DotTitleStrategy } from '@shared/services/dot-title-strategy.service'; import { DotAccountService } from './api/services/dot-account-service'; -import { DotFormatDateService } from './api/services/dot-format-date-service'; import { DotUiColorsService } from './api/services/dot-ui-colors/dot-ui-colors.service'; import { DotWorkflowEventHandlerService } from './api/services/dot-workflow-event-handler/dot-workflow-event-handler.service'; import { AuthGuardService } from './api/services/guards/auth-guard.service'; diff --git a/core-web/apps/dotcms-ui/src/app/test/dot-test-bed.ts b/core-web/apps/dotcms-ui/src/app/test/dot-test-bed.ts index 7db158625d4d..10fa186d9597 100644 --- a/core-web/apps/dotcms-ui/src/app/test/dot-test-bed.ts +++ b/core-web/apps/dotcms-ui/src/app/test/dot-test-bed.ts @@ -28,6 +28,7 @@ import { StringUtils, UserModel } from '@dotcms/dotcms-js'; +import { DotFormatDateService } from '@dotcms/ui'; import { MockDotRouterService } from '@dotcms/utils-testing'; import { DotHttpErrorManagerService } from './../api/services/dot-http-error-manager/dot-http-error-manager.service'; @@ -35,7 +36,6 @@ import { DotIframeService } from './../view/components/_common/iframe/service/do import { DotCustomEventHandlerService } from '../api/services/dot-custom-event-handler/dot-custom-event-handler.service'; import { DotDownloadBundleDialogService } from '../api/services/dot-download-bundle-dialog/dot-download-bundle-dialog.service'; -import { DotFormatDateService } from '../api/services/dot-format-date-service'; import { DotRouterService } from '../api/services/dot-router/dot-router.service'; import { DotUiColorsService } from '../api/services/dot-ui-colors/dot-ui-colors.service'; import { NGFACES_MODULES } from '../modules'; diff --git a/core-web/apps/dotcms-ui/src/app/view/components/_common/dot-bulk-information/dot-bulk-information.component.spec.ts b/core-web/apps/dotcms-ui/src/app/view/components/_common/dot-bulk-information/dot-bulk-information.component.spec.ts index 5f37d8281644..9abeda2a4b58 100644 --- a/core-web/apps/dotcms-ui/src/app/view/components/_common/dot-bulk-information/dot-bulk-information.component.spec.ts +++ b/core-web/apps/dotcms-ui/src/app/view/components/_common/dot-bulk-information/dot-bulk-information.component.spec.ts @@ -10,10 +10,9 @@ import { DynamicDialogRef } from 'primeng/dynamicdialog'; -import { DotFormatDateService } from '@dotcms/app/api/services/dot-format-date-service'; import { DotMessageService } from '@dotcms/data-access'; import { DotActionBulkResult } from '@dotcms/dotcms-models'; -import { DotMessagePipe } from '@dotcms/ui'; +import { DotFormatDateService, DotMessagePipe } from '@dotcms/ui'; import { MockDotMessageService } from '@dotcms/utils-testing'; import { DotBulkInformationComponent } from './dot-bulk-information.component'; diff --git a/core-web/apps/dotcms-ui/src/app/view/components/_common/dot-bulk-information/dot-bulk-information.stories.ts b/core-web/apps/dotcms-ui/src/app/view/components/_common/dot-bulk-information/dot-bulk-information.stories.ts index 27db160251ae..a3a637566159 100644 --- a/core-web/apps/dotcms-ui/src/app/view/components/_common/dot-bulk-information/dot-bulk-information.stories.ts +++ b/core-web/apps/dotcms-ui/src/app/view/components/_common/dot-bulk-information/dot-bulk-information.stories.ts @@ -2,9 +2,8 @@ import { Meta, moduleMetadata, Story } from '@storybook/angular'; import { DialogService, DynamicDialogConfig, DynamicDialogRef } from 'primeng/dynamicdialog'; -import { DotFormatDateService } from '@dotcms/app/api/services/dot-format-date-service'; import { DotMessageService } from '@dotcms/data-access'; -import { DotMessagePipe } from '@dotcms/ui'; +import { DotFormatDateService, DotMessagePipe } from '@dotcms/ui'; import { MockDotMessageService } from '@dotcms/utils-testing'; import { DotBulkInformationComponent } from './dot-bulk-information.component'; diff --git a/core-web/apps/dotcms-ui/src/app/view/components/_common/dot-custom-time.component/dot-custom-time.module.ts b/core-web/apps/dotcms-ui/src/app/view/components/_common/dot-custom-time.component/dot-custom-time.module.ts index af800ef15d10..88dfad20e51a 100644 --- a/core-web/apps/dotcms-ui/src/app/view/components/_common/dot-custom-time.component/dot-custom-time.module.ts +++ b/core-web/apps/dotcms-ui/src/app/view/components/_common/dot-custom-time.component/dot-custom-time.module.ts @@ -1,7 +1,7 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { DotRelativeDatePipe } from '@dotcms/app/view/pipes/dot-relative-date/dot-relative-date.pipe'; +import { DotRelativeDatePipe } from '@dotcms/ui'; import { CustomTimeComponent } from './dot-custom-time.component'; diff --git a/core-web/apps/dotcms-ui/src/app/view/components/_common/forms/dot-comment-and-assign-form/dot-comment-and-assign-form.component.spec.ts b/core-web/apps/dotcms-ui/src/app/view/components/_common/forms/dot-comment-and-assign-form/dot-comment-and-assign-form.component.spec.ts index e34f500979b9..0db1638b5786 100644 --- a/core-web/apps/dotcms-ui/src/app/view/components/_common/forms/dot-comment-and-assign-form/dot-comment-and-assign-form.component.spec.ts +++ b/core-web/apps/dotcms-ui/src/app/view/components/_common/forms/dot-comment-and-assign-form/dot-comment-and-assign-form.component.spec.ts @@ -11,10 +11,9 @@ import { By } from '@angular/platform-browser'; import { Dropdown, DropdownModule } from 'primeng/dropdown'; import { InputTextareaModule } from 'primeng/inputtextarea'; -import { DotFormatDateService } from '@dotcms/app/api/services/dot-format-date-service'; import { DotRolesService } from '@dotcms/data-access'; import { CoreWebService } from '@dotcms/dotcms-js'; -import { DotMessagePipe } from '@dotcms/ui'; +import { DotFormatDateService, DotMessagePipe } from '@dotcms/ui'; import { CoreWebServiceMock, mockProcessedRoles } from '@dotcms/utils-testing'; import { DotPipesModule } from '@pipes/dot-pipes.module'; diff --git a/core-web/apps/dotcms-ui/src/app/view/components/_common/iframe/iframe-porlet-legacy/iframe-porlet-legacy.component.spec.ts b/core-web/apps/dotcms-ui/src/app/view/components/_common/iframe/iframe-porlet-legacy/iframe-porlet-legacy.component.spec.ts index 1ecd226c6750..8d5800e4374b 100644 --- a/core-web/apps/dotcms-ui/src/app/view/components/_common/iframe/iframe-porlet-legacy/iframe-porlet-legacy.component.spec.ts +++ b/core-web/apps/dotcms-ui/src/app/view/components/_common/iframe/iframe-porlet-legacy/iframe-porlet-legacy.component.spec.ts @@ -17,7 +17,6 @@ import { DotIframeService } from '@components/_common/iframe/service/dot-iframe/ import { DotContentletEditorService } from '@components/dot-contentlet-editor/services/dot-contentlet-editor.service'; import { DotMessageDisplayService } from '@components/dot-message-display/services'; import { DotCustomEventHandlerService } from '@dotcms/app/api/services/dot-custom-event-handler/dot-custom-event-handler.service'; -import { DotFormatDateService } from '@dotcms/app/api/services/dot-format-date-service'; import { DotHttpErrorManagerService } from '@dotcms/app/api/services/dot-http-error-manager/dot-http-error-manager.service'; import { DotMenuService } from '@dotcms/app/api/services/dot-menu.service'; import { DotRouterService } from '@dotcms/app/api/services/dot-router/dot-router.service'; @@ -48,6 +47,7 @@ import { StringUtils, UserModel } from '@dotcms/dotcms-js'; +import { DotFormatDateService } from '@dotcms/ui'; import { CoreWebServiceMock, LoginServiceMock, diff --git a/core-web/apps/dotcms-ui/src/app/view/components/dot-content-compare/components/dot-content-compare-table/dot-content-compare-table.component.spec.ts b/core-web/apps/dotcms-ui/src/app/view/components/dot-content-compare/components/dot-content-compare-table/dot-content-compare-table.component.spec.ts index e34fc3334d7f..ce07a2e77886 100644 --- a/core-web/apps/dotcms-ui/src/app/view/components/dot-content-compare/components/dot-content-compare-table/dot-content-compare-table.component.spec.ts +++ b/core-web/apps/dotcms-ui/src/app/view/components/dot-content-compare/components/dot-content-compare-table/dot-content-compare-table.component.spec.ts @@ -13,11 +13,9 @@ import { TableModule } from 'primeng/table'; import { DotContentComparePreviewFieldComponent } from '@components/dot-content-compare/components/fields/dot-content-compare-preview-field/dot-content-compare-preview-field.component'; import { DotContentCompareTableData } from '@components/dot-content-compare/store/dot-content-compare.store'; -import { DotFormatDateService } from '@dotcms/app/api/services/dot-format-date-service'; -import { DotRelativeDatePipe } from '@dotcms/app/view/pipes/dot-relative-date/dot-relative-date.pipe'; import { DotMessageService } from '@dotcms/data-access'; import { DotcmsConfigService } from '@dotcms/dotcms-js'; -import { DotMessagePipe } from '@dotcms/ui'; +import { DotFormatDateService, DotMessagePipe, DotRelativeDatePipe } from '@dotcms/ui'; import { MockDotMessageService } from '@dotcms/utils-testing'; import { DotDiffPipeModule } from '@pipes/dot-diff/dot-diff.pipe.module'; diff --git a/core-web/apps/dotcms-ui/src/app/view/components/dot-content-compare/dot-content-compare.component.spec.ts b/core-web/apps/dotcms-ui/src/app/view/components/dot-content-compare/dot-content-compare.component.spec.ts index dd81d941ddc6..0d58ed610a33 100644 --- a/core-web/apps/dotcms-ui/src/app/view/components/dot-content-compare/dot-content-compare.component.spec.ts +++ b/core-web/apps/dotcms-ui/src/app/view/components/dot-content-compare/dot-content-compare.component.spec.ts @@ -12,10 +12,10 @@ import { DotContentCompareTableComponent } from '@components/dot-content-compare import { dotContentCompareTableDataMock } from '@components/dot-content-compare/components/dot-content-compare-table/dot-content-compare-table.component.spec'; import { DotContentCompareModule } from '@components/dot-content-compare/dot-content-compare.module'; import { DotContentCompareStore } from '@components/dot-content-compare/store/dot-content-compare.store'; -import { DotFormatDateService } from '@dotcms/app/api/services/dot-format-date-service'; import { DotAlertConfirmService, DotMessageService } from '@dotcms/data-access'; import { DotcmsConfigService } from '@dotcms/dotcms-js'; import { DotCMSContentlet } from '@dotcms/dotcms-models'; +import { DotFormatDateService } from '@dotcms/ui'; import { MockDotMessageService } from '@dotcms/utils-testing'; import { diff --git a/core-web/apps/dotcms-ui/src/app/view/components/dot-content-compare/dot-content-compare.module.ts b/core-web/apps/dotcms-ui/src/app/view/components/dot-content-compare/dot-content-compare.module.ts index af2ab573ea5c..6b984a6e3dcd 100644 --- a/core-web/apps/dotcms-ui/src/app/view/components/dot-content-compare/dot-content-compare.module.ts +++ b/core-web/apps/dotcms-ui/src/app/view/components/dot-content-compare/dot-content-compare.module.ts @@ -13,14 +13,13 @@ import { DotContentCompareComponent } from '@components/dot-content-compare/dot- import { DotDialogModule } from '@components/dot-dialog/dot-dialog.module'; import { BlockEditorModule } from '@dotcms/block-editor'; import { DotContentletService, DotVersionableService } from '@dotcms/data-access'; -import { DotMessagePipe } from '@dotcms/ui'; +import { DotMessagePipe, DotRelativeDatePipe } from '@dotcms/ui'; import { DotDiffPipeModule } from '@pipes/dot-diff/dot-diff.pipe.module'; import { DotContentCompareBlockEditorComponent } from './components/dot-content-compare-block-editor/dot-content-compare-block-editor.component'; import { DotContentCompareDialogComponent } from './components/dot-content-compare-dialog/dot-content-compare-dialog.component'; import { DotPipesModule } from '../../pipes/dot-pipes.module'; -import { DotRelativeDatePipe } from '../../pipes/dot-relative-date/dot-relative-date.pipe'; @NgModule({ declarations: [ diff --git a/core-web/apps/dotcms-ui/src/app/view/components/dot-content-compare/store/dot-content-compare.store.spec.ts b/core-web/apps/dotcms-ui/src/app/view/components/dot-content-compare/store/dot-content-compare.store.spec.ts index 21df1fc3f816..abaf155d9d04 100644 --- a/core-web/apps/dotcms-ui/src/app/view/components/dot-content-compare/store/dot-content-compare.store.spec.ts +++ b/core-web/apps/dotcms-ui/src/app/view/components/dot-content-compare/store/dot-content-compare.store.spec.ts @@ -3,9 +3,9 @@ import { of } from 'rxjs'; import { TestBed } from '@angular/core/testing'; import { DotContentCompareStore } from '@components/dot-content-compare/store/dot-content-compare.store'; -import { DotFormatDateService } from '@dotcms/app/api/services/dot-format-date-service'; import { DotContentletService, DotContentTypeService } from '@dotcms/data-access'; import { DotcmsConfigService } from '@dotcms/dotcms-js'; +import { DotFormatDateService } from '@dotcms/ui'; const getContentTypeMOCKResponse = { baseType: 'CONTENT', diff --git a/core-web/apps/dotcms-ui/src/app/view/components/dot-content-compare/store/dot-content-compare.store.ts b/core-web/apps/dotcms-ui/src/app/view/components/dot-content-compare/store/dot-content-compare.store.ts index 31ccd5c816b8..5736a7004175 100644 --- a/core-web/apps/dotcms-ui/src/app/view/components/dot-content-compare/store/dot-content-compare.store.ts +++ b/core-web/apps/dotcms-ui/src/app/view/components/dot-content-compare/store/dot-content-compare.store.ts @@ -6,9 +6,9 @@ import { Injectable } from '@angular/core'; import { map, switchMap, take } from 'rxjs/operators'; import { DotContentCompareEvent } from '@components/dot-content-compare/dot-content-compare.component'; -import { DotFormatDateService } from '@dotcms/app/api/services/dot-format-date-service'; import { DotContentletService, DotContentTypeService } from '@dotcms/data-access'; import { DotCMSContentlet, DotCMSContentType, DotCMSContentTypeField } from '@dotcms/dotcms-models'; +import { DotFormatDateService } from '@dotcms/ui'; export interface DotContentCompareTableData { working: DotCMSContentlet; @@ -56,33 +56,17 @@ export enum FieldWhiteList { @Injectable() export class DotContentCompareStore extends ComponentStore { systemTime; - - constructor( - private dotContentTypeService: DotContentTypeService, - private dotContentletService: DotContentletService, - private dotFormatDateService: DotFormatDateService - ) { - super({ - data: null, - showDiff: true - }); - } - readonly vm$ = this.state$; - - // UPDATERS - private readonly updateData = this.updater((state, data: DotContentCompareTableData) => { - return { ...state, data }; - }); - readonly updateCompare = this.updater((state, compare: DotCMSContentlet) => { return { ...state, data: { ...state.data, compare } }; }); - readonly updateShowDiff = this.updater((state, showDiff: boolean) => { return { ...state, showDiff }; }); - + // UPDATERS + private readonly updateData = this.updater((state, data: DotContentCompareTableData) => { + return { ...state, data }; + }); //Effects readonly loadData = this.effect((data$: Observable) => { return data$.pipe( @@ -127,6 +111,17 @@ export class DotContentCompareStore extends ComponentStore FieldWhiteList[field.fieldType] != undefined); } diff --git a/core-web/apps/dotcms-ui/src/app/view/components/dot-contentlet-editor/components/dot-add-contentlet/dot-add-contentlet.component.spec.ts b/core-web/apps/dotcms-ui/src/app/view/components/dot-contentlet-editor/components/dot-add-contentlet/dot-add-contentlet.component.spec.ts index f598eb261f7c..50d8f8f5974e 100644 --- a/core-web/apps/dotcms-ui/src/app/view/components/dot-contentlet-editor/components/dot-add-contentlet/dot-add-contentlet.component.spec.ts +++ b/core-web/apps/dotcms-ui/src/app/view/components/dot-contentlet-editor/components/dot-add-contentlet/dot-add-contentlet.component.spec.ts @@ -10,7 +10,6 @@ import { ConfirmationService } from 'primeng/api'; import { DotIframeService } from '@components/_common/iframe/service/dot-iframe/dot-iframe.service'; import { DotMessageDisplayServiceMock } from '@components/dot-message-display/dot-message-display.component.spec'; import { DotMessageDisplayService } from '@components/dot-message-display/services'; -import { DotFormatDateService } from '@dotcms/app/api/services/dot-format-date-service'; import { DotHttpErrorManagerService } from '@dotcms/app/api/services/dot-http-error-manager/dot-http-error-manager.service'; import { DotMenuService } from '@dotcms/app/api/services/dot-menu.service'; import { DotRouterService } from '@dotcms/app/api/services/dot-router/dot-router.service'; @@ -29,6 +28,7 @@ import { StringUtils, UserModel } from '@dotcms/dotcms-js'; +import { DotFormatDateService } from '@dotcms/ui'; import { cleanUpDialog, CoreWebServiceMock, diff --git a/core-web/apps/dotcms-ui/src/app/view/components/dot-contentlet-editor/components/dot-create-contentlet/dot-create-contentlet.component.spec.ts b/core-web/apps/dotcms-ui/src/app/view/components/dot-contentlet-editor/components/dot-create-contentlet/dot-create-contentlet.component.spec.ts index a526c21d7b6a..2975636c54ac 100644 --- a/core-web/apps/dotcms-ui/src/app/view/components/dot-contentlet-editor/components/dot-create-contentlet/dot-create-contentlet.component.spec.ts +++ b/core-web/apps/dotcms-ui/src/app/view/components/dot-contentlet-editor/components/dot-create-contentlet/dot-create-contentlet.component.spec.ts @@ -12,10 +12,10 @@ import { RouterTestingModule } from '@angular/router/testing'; import { ConfirmationService } from 'primeng/api'; import { DotIframeService } from '@components/_common/iframe/service/dot-iframe/dot-iframe.service'; -import { DotFormatDateService } from '@dotcms/app/api/services/dot-format-date-service'; import { DotRouterService } from '@dotcms/app/api/services/dot-router/dot-router.service'; import { DotAlertConfirmService, DotEventsService } from '@dotcms/data-access'; import { CoreWebService, LoginService } from '@dotcms/dotcms-js'; +import { DotFormatDateService } from '@dotcms/ui'; import { CoreWebServiceMock, LoginServiceMock, MockDotRouterService } from '@dotcms/utils-testing'; import { DotCreateContentletComponent } from './dot-create-contentlet.component'; diff --git a/core-web/apps/dotcms-ui/src/app/view/components/dot-contentlet-editor/services/dot-contentlet-editor.service.spec.ts b/core-web/apps/dotcms-ui/src/app/view/components/dot-contentlet-editor/services/dot-contentlet-editor.service.spec.ts index 1f7f1993cf36..b87ba5ce3474 100644 --- a/core-web/apps/dotcms-ui/src/app/view/components/dot-contentlet-editor/services/dot-contentlet-editor.service.spec.ts +++ b/core-web/apps/dotcms-ui/src/app/view/components/dot-contentlet-editor/services/dot-contentlet-editor.service.spec.ts @@ -7,13 +7,13 @@ import { ConfirmationService } from 'primeng/api'; import { DotMessageDisplayServiceMock } from '@components/dot-message-display/dot-message-display.component.spec'; import { DotMessageDisplayService } from '@components/dot-message-display/services'; -import { DotFormatDateService } from '@dotcms/app/api/services/dot-format-date-service'; import { DotHttpErrorManagerService } from '@dotcms/app/api/services/dot-http-error-manager/dot-http-error-manager.service'; import { DotMenuService } from '@dotcms/app/api/services/dot-menu.service'; import { DotRouterService } from '@dotcms/app/api/services/dot-router/dot-router.service'; import { DotAlertConfirmService } from '@dotcms/data-access'; import { CoreWebService, LoginService } from '@dotcms/dotcms-js'; import { DotCMSContentlet, DotCMSContentType } from '@dotcms/dotcms-models'; +import { DotFormatDateService } from '@dotcms/ui'; import { CoreWebServiceMock, LoginServiceMock, MockDotRouterService } from '@dotcms/utils-testing'; import { DotContentletEditorService } from './dot-contentlet-editor.service'; diff --git a/core-web/apps/dotcms-ui/src/app/view/components/dot-listing-data-table/dot-listing-data-table.component.spec.ts b/core-web/apps/dotcms-ui/src/app/view/components/dot-listing-data-table/dot-listing-data-table.component.spec.ts index e8719ea2b2f5..bae9fcc6a489 100644 --- a/core-web/apps/dotcms-ui/src/app/view/components/dot-listing-data-table/dot-listing-data-table.component.spec.ts +++ b/core-web/apps/dotcms-ui/src/app/view/components/dot-listing-data-table/dot-listing-data-table.component.spec.ts @@ -17,10 +17,9 @@ import { MenuModule } from 'primeng/menu'; import { TableModule } from 'primeng/table'; import { TooltipModule } from 'primeng/tooltip'; -import { DotFormatDateService } from '@dotcms/app/api/services/dot-format-date-service'; import { DotAlertConfirmService, DotMessageService } from '@dotcms/data-access'; import { CoreWebService, DotcmsConfigService, LoggerService, StringUtils } from '@dotcms/dotcms-js'; -import { DotIconModule, DotMessagePipe, DotStringFormatPipe } from '@dotcms/ui'; +import { DotIconModule, DotMessagePipe, DotRelativeDatePipe, DotStringFormatPipe } from "@dotcms/ui"; import { CoreWebServiceMock, MockDotMessageService } from '@dotcms/utils-testing'; import { ActionHeaderOptions, ButtonAction } from '@models/action-header'; import { DataTableColumn } from '@models/data-table'; @@ -30,7 +29,6 @@ import { DotActionMenuItem } from '@shared/models/dot-action-menu/dot-action-men import { ActionHeaderComponent } from './action-header/action-header.component'; import { DotListingDataTableComponent } from './dot-listing-data-table.component'; -import { DotRelativeDatePipe } from '../../pipes/dot-relative-date/dot-relative-date.pipe'; import { DotActionButtonComponent } from '../_common/dot-action-button/dot-action-button.component'; import { DotActionMenuButtonComponent } from '../_common/dot-action-menu-button/dot-action-menu-button.component'; import { DotMenuModule } from '../_common/dot-menu/dot-menu.module'; @@ -151,7 +149,6 @@ describe('DotListingDataTableComponent', () => { { provide: CoreWebService, useClass: CoreWebServiceMock }, { provide: DotMessageService, useValue: messageServiceMock }, LoggerService, - DotFormatDateService, DotAlertConfirmService, ConfirmationService, StringUtils, diff --git a/core-web/apps/dotcms-ui/src/app/view/components/dot-listing-data-table/dot-listing-data-table.component.ts b/core-web/apps/dotcms-ui/src/app/view/components/dot-listing-data-table/dot-listing-data-table.component.ts index 9d7a1aee95fb..827c817e4529 100644 --- a/core-web/apps/dotcms-ui/src/app/view/components/dot-listing-data-table/dot-listing-data-table.component.ts +++ b/core-web/apps/dotcms-ui/src/app/view/components/dot-listing-data-table/dot-listing-data-table.component.ts @@ -17,7 +17,6 @@ import { Table } from 'primeng/table'; import { take } from 'rxjs/operators'; -import { DotFormatDateService } from '@dotcms/app/api/services/dot-format-date-service'; import { OrderDirection, PaginatorService } from '@dotcms/data-access'; import { LoggerService } from '@dotcms/dotcms-js'; import { ActionHeaderOptions, ButtonAction } from '@models/action-header'; @@ -82,11 +81,7 @@ export class DotListingDataTableComponent implements OnInit { maxLinksPage: number; totalRecords: number; - constructor( - public loggerService: LoggerService, - public paginatorService: PaginatorService, - private dotFormatDateService: DotFormatDateService - ) { + constructor(public loggerService: LoggerService, public paginatorService: PaginatorService) { this.paginatorService.url = this.url; } diff --git a/core-web/apps/dotcms-ui/src/app/view/components/dot-listing-data-table/dot-listing-data-table.module.ts b/core-web/apps/dotcms-ui/src/app/view/components/dot-listing-data-table/dot-listing-data-table.module.ts index 46a3013b0ba5..065275288010 100644 --- a/core-web/apps/dotcms-ui/src/app/view/components/dot-listing-data-table/dot-listing-data-table.module.ts +++ b/core-web/apps/dotcms-ui/src/app/view/components/dot-listing-data-table/dot-listing-data-table.module.ts @@ -10,13 +10,12 @@ import { TableModule } from 'primeng/table'; import { DotCrudService } from '@dotcms/data-access'; import { DotcmsConfigService, LoggerService } from '@dotcms/dotcms-js'; -import { DotIconModule, DotMessagePipe, DotStringFormatPipe } from '@dotcms/ui'; +import { DotIconModule, DotMessagePipe, DotRelativeDatePipe, DotStringFormatPipe } from "@dotcms/ui"; import { DotPipesModule } from '@pipes/dot-pipes.module'; import { ActionHeaderModule } from './action-header/action-header.module'; import { DotListingDataTableComponent } from './dot-listing-data-table.component'; -import { DotRelativeDatePipe } from '../../pipes/dot-relative-date/dot-relative-date.pipe'; import { DotActionMenuButtonModule } from '../_common/dot-action-menu-button/dot-action-menu-button.module'; @NgModule({ diff --git a/core-web/apps/dotcms-ui/src/app/view/components/dot-theme-selector-dropdown/dot-theme-selector-dropdown.stories.ts b/core-web/apps/dotcms-ui/src/app/view/components/dot-theme-selector-dropdown/dot-theme-selector-dropdown.stories.ts index 7cf203650808..eb0a77f6853a 100644 --- a/core-web/apps/dotcms-ui/src/app/view/components/dot-theme-selector-dropdown/dot-theme-selector-dropdown.stories.ts +++ b/core-web/apps/dotcms-ui/src/app/view/components/dot-theme-selector-dropdown/dot-theme-selector-dropdown.stories.ts @@ -5,10 +5,9 @@ import { of } from 'rxjs'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { SearchableDropDownModule } from '@components/_common/searchable-dropdown'; -import { DotFormatDateService } from '@dotcms/app/api/services/dot-format-date-service'; import { DotMessageService, DotThemesService, PaginatorService } from '@dotcms/data-access'; import { SiteService } from '@dotcms/dotcms-js'; -import { DotMessagePipe } from '@dotcms/ui'; +import { DotFormatDateService, DotMessagePipe } from '@dotcms/ui'; import { MockDotMessageService } from '@dotcms/utils-testing'; import { DotThemeSelectorDropdownComponent } from './dot-theme-selector-dropdown.component'; diff --git a/core-web/apps/dotcms-ui/src/app/view/components/dot-toolbar/components/dot-toolbar-user/dot-toolbar-user.component.spec.ts b/core-web/apps/dotcms-ui/src/app/view/components/dot-toolbar/components/dot-toolbar-user/dot-toolbar-user.component.spec.ts index 64db45957b40..756c4f41ced5 100644 --- a/core-web/apps/dotcms-ui/src/app/view/components/dot-toolbar/components/dot-toolbar-user/dot-toolbar-user.component.spec.ts +++ b/core-web/apps/dotcms-ui/src/app/view/components/dot-toolbar/components/dot-toolbar-user/dot-toolbar-user.component.spec.ts @@ -21,7 +21,6 @@ import { SearchableDropDownModule } from '@components/_common/searchable-dropdow import { DotDialogModule } from '@components/dot-dialog/dot-dialog.module'; import { DotNavigationService } from '@components/dot-navigation/services/dot-navigation.service'; import { DotGravatarDirective } from '@directives/dot-gravatar/dot-gravatar.directive'; -import { DotFormatDateService } from '@dotcms/app/api/services/dot-format-date-service'; import { DotGravatarService } from '@dotcms/app/api/services/dot-gravatar-service'; import { DotMenuService } from '@dotcms/app/api/services/dot-menu.service'; import { DotRouterService } from '@dotcms/app/api/services/dot-router/dot-router.service'; @@ -40,7 +39,7 @@ import { StringUtils, UserModel } from '@dotcms/dotcms-js'; -import { DotIconModule, DotMessagePipe } from '@dotcms/ui'; +import { DotFormatDateService, DotIconModule, DotMessagePipe } from '@dotcms/ui'; import { CoreWebServiceMock, LoginServiceMock } from '@dotcms/utils-testing'; import { DotPipesModule } from '@pipes/dot-pipes.module'; diff --git a/core-web/apps/dotcms-ui/src/app/view/components/login/dot-login-component/dot-login.component.spec.ts b/core-web/apps/dotcms-ui/src/app/view/components/login/dot-login-component/dot-login.component.spec.ts index 77d69b9582e1..86a3fbebf5ac 100644 --- a/core-web/apps/dotcms-ui/src/app/view/components/login/dot-login-component/dot-login.component.spec.ts +++ b/core-web/apps/dotcms-ui/src/app/view/components/login/dot-login-component/dot-login.component.spec.ts @@ -18,12 +18,11 @@ import { Dropdown, DropdownModule } from 'primeng/dropdown'; import { DotLoadingIndicatorModule } from '@components/_common/iframe/dot-loading-indicator/dot-loading-indicator.module'; import { DotLoginComponent } from '@components/login/dot-login-component/dot-login.component'; import { DotLoginPageStateService } from '@components/login/shared/services/dot-login-page-state.service'; -import { DotFormatDateService } from '@dotcms/app/api/services/dot-format-date-service'; import { DotRouterService } from '@dotcms/app/api/services/dot-router/dot-router.service'; import { DotMessageService } from '@dotcms/data-access'; import { CoreWebService, LoggerService, LoginService, StringUtils } from '@dotcms/dotcms-js'; import { DotLoginInformation } from '@dotcms/dotcms-models'; -import { DotFieldValidationMessageComponent } from '@dotcms/ui'; +import { DotFieldValidationMessageComponent, DotFormatDateService } from '@dotcms/ui'; import { DotLoadingIndicatorService } from '@dotcms/utils'; import { CoreWebServiceMock, diff --git a/core-web/apps/dotcms-ui/src/app/view/components/login/dot-login-component/dot-login.component.ts b/core-web/apps/dotcms-ui/src/app/view/components/login/dot-login-component/dot-login.component.ts index eca6a020b251..d787381c639f 100644 --- a/core-web/apps/dotcms-ui/src/app/view/components/login/dot-login-component/dot-login.component.ts +++ b/core-web/apps/dotcms-ui/src/app/view/components/login/dot-login-component/dot-login.component.ts @@ -10,11 +10,11 @@ import { SelectItem } from 'primeng/api'; import { take, takeUntil, tap } from 'rxjs/operators'; import { DotLoginPageStateService } from '@components/login/shared/services/dot-login-page-state.service'; -import { DotFormatDateService } from '@dotcms/app/api/services/dot-format-date-service'; import { DotRouterService } from '@dotcms/app/api/services/dot-router/dot-router.service'; import { DotMessageService } from '@dotcms/data-access'; import { DotLoginParams, HttpCode, LoggerService, LoginService, User } from '@dotcms/dotcms-js'; import { DotLoginInformation, DotLoginLanguage } from '@dotcms/dotcms-models'; +import { DotFormatDateService } from '@dotcms/ui'; import { DotLoadingIndicatorService } from '@dotcms/utils'; @Component({ diff --git a/core-web/apps/dotcms-ui/src/app/view/components/main-legacy/main-legacy.component.spec.ts b/core-web/apps/dotcms-ui/src/app/view/components/main-legacy/main-legacy.component.spec.ts index 920642da4939..0ba9cd038080 100644 --- a/core-web/apps/dotcms-ui/src/app/view/components/main-legacy/main-legacy.component.spec.ts +++ b/core-web/apps/dotcms-ui/src/app/view/components/main-legacy/main-legacy.component.spec.ts @@ -13,7 +13,6 @@ import { DotGlobalMessageService } from '@components/_common/dot-global-message/ import { DotWizardModule } from '@components/_common/dot-wizard/dot-wizard.module'; import { DotMessageDisplayService } from '@components/dot-message-display/services'; import { DotCustomEventHandlerService } from '@dotcms/app/api/services/dot-custom-event-handler/dot-custom-event-handler.service'; -import { DotFormatDateService } from '@dotcms/app/api/services/dot-format-date-service'; import { DotHttpErrorManagerService } from '@dotcms/app/api/services/dot-http-error-manager/dot-http-error-manager.service'; import { DotMenuService } from '@dotcms/app/api/services/dot-menu.service'; import { DotRouterService } from '@dotcms/app/api/services/dot-router/dot-router.service'; @@ -39,6 +38,7 @@ import { StringUtils, UserModel } from '@dotcms/dotcms-js'; +import { DotFormatDateService } from '@dotcms/ui'; import { CoreWebServiceMock, LoginServiceMock, MockDotRouterService } from '@dotcms/utils-testing'; import { MainComponentLegacyComponent } from './main-legacy.component'; diff --git a/core-web/libs/portlets/dot-experiments/portlet/src/lib/dot-experiments-list/components/dot-experiments-list-table/dot-experiments-list-table.component.spec.ts b/core-web/libs/portlets/dot-experiments/portlet/src/lib/dot-experiments-list/components/dot-experiments-list-table/dot-experiments-list-table.component.spec.ts index b725911d7c63..ec1cb835a2b6 100644 --- a/core-web/libs/portlets/dot-experiments/portlet/src/lib/dot-experiments-list/components/dot-experiments-list-table/dot-experiments-list-table.component.spec.ts +++ b/core-web/libs/portlets/dot-experiments/portlet/src/lib/dot-experiments-list/components/dot-experiments-list-table/dot-experiments-list-table.component.spec.ts @@ -9,13 +9,12 @@ import { Table } from 'primeng/table'; import { DotMessageService } from '@dotcms/data-access'; import { DotExperimentStatus, GroupedExperimentByStatus } from '@dotcms/dotcms-models'; -import { DotEmptyContainerComponent } from '@dotcms/ui'; +import { DotEmptyContainerComponent, DotFormatDateService } from '@dotcms/ui'; import { DotFormatDateServiceMock, getExperimentMock, MockDotMessageService } from '@dotcms/utils-testing'; -import { DotFormatDateService } from '@services/dot-format-date-service'; import { DotExperimentsListTableComponent } from './dot-experiments-list-table.component'; diff --git a/core-web/libs/portlets/dot-experiments/portlet/src/lib/dot-experiments-list/components/dot-experiments-list-table/dot-experiments-list-table.component.ts b/core-web/libs/portlets/dot-experiments/portlet/src/lib/dot-experiments-list/components/dot-experiments-list-table/dot-experiments-list-table.component.ts index 08b9dd5574c2..053b092867cc 100644 --- a/core-web/libs/portlets/dot-experiments/portlet/src/lib/dot-experiments-list/components/dot-experiments-list-table/dot-experiments-list-table.component.ts +++ b/core-web/libs/portlets/dot-experiments/portlet/src/lib/dot-experiments-list/components/dot-experiments-list-table/dot-experiments-list-table.component.ts @@ -17,8 +17,12 @@ import { TooltipModule } from 'primeng/tooltip'; import { DotMessageService } from '@dotcms/data-access'; import { DotExperiment, GroupedExperimentByStatus } from '@dotcms/dotcms-models'; -import { DotEmptyContainerComponent, DotMessagePipe, PrincipalConfiguration } from '@dotcms/ui'; -import { DotRelativeDatePipe } from '@pipes/dot-relative-date/dot-relative-date.pipe'; +import { + DotEmptyContainerComponent, + DotMessagePipe, + DotRelativeDatePipe, + PrincipalConfiguration +} from '@dotcms/ui'; @Component({ standalone: true, diff --git a/core-web/libs/portlets/dot-experiments/portlet/src/lib/dot-experiments-list/dot-experiments-list.component.spec.ts b/core-web/libs/portlets/dot-experiments/portlet/src/lib/dot-experiments-list/dot-experiments-list.component.spec.ts index 3ca121146c44..e75456c04a51 100644 --- a/core-web/libs/portlets/dot-experiments/portlet/src/lib/dot-experiments-list/dot-experiments-list.component.spec.ts +++ b/core-web/libs/portlets/dot-experiments/portlet/src/lib/dot-experiments-list/dot-experiments-list.component.spec.ts @@ -18,14 +18,13 @@ import { DotAddToBundleComponent } from '@components/_common/dot-add-to-bundle/d import { DotMessageService } from '@dotcms/data-access'; import { ComponentStatus, DotExperimentStatus } from '@dotcms/dotcms-models'; import { DotExperimentsService } from '@dotcms/portlets/dot-experiments/data-access'; -import { DotEmptyContainerComponent } from '@dotcms/ui'; +import { DotEmptyContainerComponent, DotFormatDateService } from '@dotcms/ui'; import { ActivatedRouteListStoreMock, DotExperimentsStoreMock, getExperimentAllMocks, getExperimentMock } from '@dotcms/utils-testing'; -import { DotFormatDateService } from '@services/dot-format-date-service'; import { DotHttpErrorManagerService } from '@services/dot-http-error-manager/dot-http-error-manager.service'; import { DotExperimentsCreateComponent } from './components/dot-experiments-create/dot-experiments-create.component'; diff --git a/core-web/libs/ui/src/index.ts b/core-web/libs/ui/src/index.ts index d69e3eb252f1..784d530bd968 100644 --- a/core-web/libs/ui/src/index.ts +++ b/core-web/libs/ui/src/index.ts @@ -1,5 +1,6 @@ export * from './lib/dot-icon/dot-icon.module'; export * from './lib/dot-spinner/dot-spinner.module'; + // Components export * from './lib/dot-spinner/dot-spinner.component'; export * from './lib/components/dot-drop-zone/dot-drop-zone.component'; @@ -7,13 +8,19 @@ export * from './lib/dot-icon/dot-icon.component'; export * from './lib/components/dot-empty-container/dot-empty-container.component'; export * from './lib/dot-tab-buttons/dot-tab-buttons.component'; export * from './lib/components/dot-field-validation-message/dot-field-validation-message.component'; + // Directives export * from './lib/dot-field-required/dot-field-required.directive'; export * from './lib/dot-remove-confirm-popup/dot-remove-confirm-popup.directive'; export * from './lib/dot-site-selector/dot-site-selector.directive'; export * from './lib/directives/dot-autofocus/dot-autofocus.directive'; -export * from './lib/pipes/dot-string-format/dot-string-format.pipe'; export * from './lib/directives/dot-trim-input/dot-trim-input.directive'; export * from './lib/dot-container-options/dot-container-options.directive'; + +// Services +export * from './lib/services/dot-format-date-service'; + // Pipes +export * from './lib/pipes/dot-relative-date/dot-relative-date.pipe'; export * from './lib/dot-message/dot-message.pipe'; +export * from './lib/pipes/dot-string-format/dot-string-format.pipe'; diff --git a/core-web/apps/dotcms-ui/src/app/view/pipes/dot-relative-date/dot-relative-date.pipe.spec.ts b/core-web/libs/ui/src/lib/pipes/dot-relative-date/dot-relative-date.pipe.spec.ts similarity index 96% rename from core-web/apps/dotcms-ui/src/app/view/pipes/dot-relative-date/dot-relative-date.pipe.spec.ts rename to core-web/libs/ui/src/lib/pipes/dot-relative-date/dot-relative-date.pipe.spec.ts index f55e0d0f961b..8b5222cf7816 100644 --- a/core-web/apps/dotcms-ui/src/app/view/pipes/dot-relative-date/dot-relative-date.pipe.spec.ts +++ b/core-web/libs/ui/src/lib/pipes/dot-relative-date/dot-relative-date.pipe.spec.ts @@ -1,11 +1,9 @@ import { fakeAsync, tick } from '@angular/core/testing'; -import { DotFormatDateService } from '@dotcms/app/api/services/dot-format-date-service'; import { DotcmsConfigService } from '@dotcms/dotcms-js'; +import { DotFormatDateService, DotRelativeDatePipe } from '@dotcms/ui'; import { DotcmsConfigServiceMock } from '@dotcms/utils-testing'; -import { DotRelativeDatePipe } from './dot-relative-date.pipe'; - const ONE_DAY = 86400000; const TWO_DAYS = ONE_DAY * 2; diff --git a/core-web/apps/dotcms-ui/src/app/view/pipes/dot-relative-date/dot-relative-date.pipe.ts b/core-web/libs/ui/src/lib/pipes/dot-relative-date/dot-relative-date.pipe.ts similarity index 95% rename from core-web/apps/dotcms-ui/src/app/view/pipes/dot-relative-date/dot-relative-date.pipe.ts rename to core-web/libs/ui/src/lib/pipes/dot-relative-date/dot-relative-date.pipe.ts index 3be135b2511e..7c7bcf7f6a85 100644 --- a/core-web/apps/dotcms-ui/src/app/view/pipes/dot-relative-date/dot-relative-date.pipe.ts +++ b/core-web/libs/ui/src/lib/pipes/dot-relative-date/dot-relative-date.pipe.ts @@ -1,6 +1,6 @@ import { Pipe, PipeTransform } from '@angular/core'; -import { DotFormatDateService } from '@dotcms/app/api/services/dot-format-date-service'; +import { DotFormatDateService } from '../../services/dot-format-date-service'; /* * Custom Pipe that returns the relative date. diff --git a/core-web/apps/dotcms-ui/src/app/api/services/dot-format-date-service.ts b/core-web/libs/ui/src/lib/services/dot-format-date-service.ts similarity index 100% rename from core-web/apps/dotcms-ui/src/app/api/services/dot-format-date-service.ts rename to core-web/libs/ui/src/lib/services/dot-format-date-service.ts