mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
Fix date-fns related exports for Core lib (#10102)
This commit is contained in:
@@ -65,7 +65,7 @@ export const ADF_DATE_FORMATS: MatDateFormats = {
|
||||
}
|
||||
};
|
||||
|
||||
@Injectable()
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class AdfDateFnsAdapter extends DateFnsAdapter {
|
||||
private _displayFormat?: string = null;
|
||||
|
||||
|
@@ -58,7 +58,7 @@ function range<T>(length: number, valueFunction: (index: number) => T): T[] {
|
||||
return valuesArray;
|
||||
}
|
||||
|
||||
@Injectable()
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class AdfDateTimeFnsAdapter extends DatetimeAdapter<Date> {
|
||||
private _displayFormat?: string = null;
|
||||
|
||||
|
@@ -51,9 +51,7 @@ import { loadAppConfig } from './app-config/app-config.loader';
|
||||
import { AppConfigService } from './app-config/app-config.service';
|
||||
import { StorageService } from './common/services/storage.service';
|
||||
import { AlfrescoApiLoaderService, createAlfrescoApiInstance } from './api-factories/alfresco-api-v2-loader.service';
|
||||
import { AdfDateFnsAdapter } from './common/utils/date-fns-adapter';
|
||||
import { MomentDateAdapter } from './common/utils/moment-date-adapter';
|
||||
import { AdfDateTimeFnsAdapter } from './common/utils/datetime-fns-adapter';
|
||||
import { AppConfigPipe, StoragePrefixFactory } from './app-config';
|
||||
import { IconComponent } from './icon';
|
||||
import { SortingPickerComponent } from './sorting-picker';
|
||||
@@ -140,8 +138,6 @@ export class CoreModule {
|
||||
TranslateStore,
|
||||
TranslateService,
|
||||
{ provide: TranslateLoader, useClass: TranslateLoaderService },
|
||||
AdfDateFnsAdapter,
|
||||
AdfDateTimeFnsAdapter,
|
||||
MomentDateAdapter,
|
||||
StoragePrefixFactory,
|
||||
{
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { AdfDateFnsAdapter, DownloadService, ToolbarComponent, ToolbarTitleComponent } from '@alfresco/adf-core';
|
||||
import { ADF_DATE_FORMATS, AdfDateFnsAdapter, DownloadService, ToolbarComponent, ToolbarTitleComponent } from '@alfresco/adf-core';
|
||||
import {
|
||||
AfterContentChecked,
|
||||
Component,
|
||||
@@ -46,6 +46,7 @@ import { MatMenuModule } from '@angular/material/menu';
|
||||
import { WIDGET_DIRECTIVES } from './widgets';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { ButtonsMenuComponent } from './buttons-menu/buttons-menu.component';
|
||||
import { DateAdapter, MAT_DATE_FORMATS } from '@angular/material/core';
|
||||
|
||||
const FORMAT_DATE_ACTIVITI = 'YYYY-MM-DD';
|
||||
|
||||
@@ -124,6 +125,10 @@ export interface ReportFormValues {
|
||||
MatButtonModule,
|
||||
ButtonsMenuComponent
|
||||
],
|
||||
providers: [
|
||||
{ provide: MAT_DATE_FORMATS, useValue: ADF_DATE_FORMATS },
|
||||
{ provide: DateAdapter, useClass: AdfDateFnsAdapter }
|
||||
],
|
||||
templateUrl: './analytics-report-parameters.component.html',
|
||||
styleUrls: ['./analytics-report-parameters.component.scss'],
|
||||
encapsulation: ViewEncapsulation.None
|
||||
|
@@ -20,6 +20,7 @@ import { provideTranslations } from '@alfresco/adf-core';
|
||||
import { ANALYTICS_PROCESS_DIRECTIVES } from './analytics-process/public-api';
|
||||
import { DIAGRAM_DIRECTIVES } from './diagram/public-api';
|
||||
|
||||
/** @deprecated This module is deprecated and will be removed in a future release. */
|
||||
@NgModule({
|
||||
imports: [...ANALYTICS_PROCESS_DIRECTIVES, ...DIAGRAM_DIRECTIVES],
|
||||
exports: [...ANALYTICS_PROCESS_DIRECTIVES, ...DIAGRAM_DIRECTIVES]
|
||||
|
@@ -18,7 +18,6 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { InsightsModule } from '../insights.module';
|
||||
import {
|
||||
AlfrescoApiService,
|
||||
AlfrescoApiServiceMock,
|
||||
@@ -26,17 +25,17 @@ import {
|
||||
AppConfigServiceMock,
|
||||
TranslationService,
|
||||
TranslationMock,
|
||||
CoreModule,
|
||||
AuthModule
|
||||
} from '@alfresco/adf-core';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
|
||||
@NgModule({
|
||||
imports: [AuthModule.forRoot({ useHash: true }), NoopAnimationsModule, TranslateModule.forRoot(), CoreModule.forRoot(), InsightsModule],
|
||||
imports: [AuthModule.forRoot({ useHash: true }), NoopAnimationsModule, HttpClientTestingModule, TranslateModule.forRoot()],
|
||||
providers: [
|
||||
{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock },
|
||||
{ provide: AppConfigService, useClass: AppConfigServiceMock },
|
||||
{ provide: TranslationService, useClass: TranslationMock }
|
||||
],
|
||||
exports: [NoopAnimationsModule, TranslateModule, CoreModule, InsightsModule]
|
||||
exports: [NoopAnimationsModule, TranslateModule]
|
||||
})
|
||||
export class InsightsTestingModule {}
|
||||
|
Reference in New Issue
Block a user