diff --git a/demo-shell-ng2/app/app.module.ts b/demo-shell-ng2/app/app.module.ts index 7047e9c47a..08ce82f5e3 100644 --- a/demo-shell-ng2/app/app.module.ts +++ b/demo-shell-ng2/app/app.module.ts @@ -21,19 +21,27 @@ import { BrowserModule } from '@angular/platform-browser'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { TranslateModule, TranslateLoader } from 'ng2-translate/ng2-translate'; +import { CoreModule } from 'ng2-alfresco-core'; import { SearchModule } from 'ng2-alfresco-search'; import { LoginModule } from 'ng2-alfresco-login'; +import { DataTableModule } from 'ng2-alfresco-datatable'; +import { DocumentListModule } from 'ng2-alfresco-documentlist'; import { AppComponent } from './app.component'; import { routing } from './app.routes'; -import { SearchBarComponent } from './components/index'; -import { MDL, ALFRESCO_CORE_PROVIDERS, CONTEXT_MENU_DIRECTIVES } from 'ng2-alfresco-core'; -import { ALFRESCO_DATATABLE_DIRECTIVES, PaginationComponent } from 'ng2-alfresco-datatable'; +/* +import { + MDL, + ALFRESCO_CORE_PROVIDERS, + CONTEXT_MENU_DIRECTIVES, + CONTEXT_MENU_PROVIDERS, + MATERIAL_DESIGN_DIRECTIVES +} from 'ng2-alfresco-core'; +*/ import { ALFRESCO_TASKLIST_DIRECTIVES } from 'ng2-activiti-tasklist'; import { ACTIVITI_PROCESSLIST_DIRECTIVES } from 'ng2-activiti-processlist'; -import { ActivitiForm, ATIVITI_FORM_PROVIDERS, CONTAINER_WIDGET_DIRECTIVES, PRIMITIVE_WIDGET_DIRECTIVES } from 'ng2-activiti-form'; -import { DOCUMENT_LIST_DIRECTIVES, DOCUMENT_LIST_PROVIDERS } from 'ng2-alfresco-documentlist'; +import { ActivitiForm, ATIVITI_FORM_PROVIDERS } from 'ng2-activiti-form'; import { ALFRESCO_ULPOAD_COMPONENTS, ALFRESCO_ULPOAD_DIRECTIVES, ALFRESCO_ULPOAD_SERVICES } from 'ng2-alfresco-upload'; import { VIEWERCOMPONENT } from 'ng2-alfresco-viewer'; import { TAGCOMPONENT, TAGSERVICES } from 'ng2-alfresco-tag'; @@ -105,28 +113,30 @@ const ACTIVITI_FORM_DIRECTIVES: any[] = [ HttpModule, TranslateModule.forRoot({ provide: TranslateLoader, - useFactory: (http: Http) => new AlfrescoTranslationLoader(http), + useFactory: (http) => new AlfrescoTranslationLoader(http), deps: [Http] }), routing, + CoreModule.forRoot(), LoginModule, - SearchModule.forRoot() + SearchModule.forRoot(), + DataTableModule, + DocumentListModule.forRoot() ], declarations: [ AppComponent, SearchBarComponent, - MDL, - ...ALFRESCO_DATATABLE_DIRECTIVES, PaginationComponent, + // MDL, ...ALFRESCO_TASKLIST_DIRECTIVES, ...ACTIVITI_PROCESSLIST_DIRECTIVES, ...ACTIVITI_FORM_DIRECTIVES, - ...DOCUMENT_LIST_DIRECTIVES, - ...CONTEXT_MENU_DIRECTIVES, + // ...CONTEXT_MENU_DIRECTIVES, ...ALFRESCO_ULPOAD_COMPONENTS, ...VIEWERCOMPONENT, ...TAGCOMPONENT, ...WEBSCRIPTCOMPONENT, ...ALFRESCO_ULPOAD_COMPONENTS, ...ALFRESCO_ULPOAD_DIRECTIVES, + // ...MATERIAL_DESIGN_DIRECTIVES, UploadButtonComponent, DataTableDemoComponent, @@ -142,11 +152,11 @@ const ACTIVITI_FORM_DIRECTIVES: any[] = [ FormNodeViewer ], providers: [ - ...ALFRESCO_CORE_PROVIDERS, - ...DOCUMENT_LIST_PROVIDERS, + // ...ALFRESCO_CORE_PROVIDERS, ...ATIVITI_FORM_PROVIDERS, ...TAGSERVICES, - ...ALFRESCO_ULPOAD_SERVICES + ...ALFRESCO_ULPOAD_SERVICES// , + // ...CONTEXT_MENU_PROVIDERS ], bootstrap: [ AppComponent ] }) diff --git a/ng2-components/ng2-alfresco-core/index.ts b/ng2-components/ng2-alfresco-core/index.ts index 67c0af3f8f..4330bef31f 100644 --- a/ng2-components/ng2-alfresco-core/index.ts +++ b/ng2-components/ng2-alfresco-core/index.ts @@ -15,6 +15,11 @@ * limitations under the License. */ +import { NgModule, ModuleWithProviders } from '@angular/core'; +import { HttpModule } from '@angular/http'; +import { CommonModule } from '@angular/common'; +import { TranslateModule } from 'ng2-translate/ng2-translate'; + import { AlfrescoApiService, AlfrescoSettingsService, @@ -24,19 +29,48 @@ import { AlfrescoContentService } from './src/services/index'; -import { ContextMenuService } from './src/components/context-menu/context-menu.service'; +import { MATERIAL_DESIGN_DIRECTIVES } from './src/components/material/index'; +import { CONTEXT_MENU_PROVIDERS, CONTEXT_MENU_DIRECTIVES } from './src/components/context-menu/index'; export * from './src/services/index'; export * from './src/components/index'; export * from './src/utils/index'; -export const ALFRESCO_CORE_PROVIDERS: [any] = [ +export const ALFRESCO_CORE_PROVIDERS: any[] = [ AlfrescoApiService, AlfrescoAuthenticationService, AlfrescoContentService, AlfrescoSettingsService, AlfrescoTranslationLoader, AlfrescoTranslationService, - ContextMenuService + ...CONTEXT_MENU_PROVIDERS ]; +@NgModule({ + imports: [ + CommonModule, + HttpModule, + TranslateModule + ], + declarations: [ + ...MATERIAL_DESIGN_DIRECTIVES, + ...CONTEXT_MENU_DIRECTIVES + ], + providers: [ + ...ALFRESCO_CORE_PROVIDERS + ], + exports: [ + ...MATERIAL_DESIGN_DIRECTIVES, + ...CONTEXT_MENU_DIRECTIVES + ] +}) +export class CoreModule { + static forRoot(): ModuleWithProviders { + return { + ngModule: CoreModule, + providers: [ + ...ALFRESCO_CORE_PROVIDERS + ] + }; + } +} diff --git a/ng2-components/ng2-alfresco-core/package.json b/ng2-components/ng2-alfresco-core/package.json index dc9690c958..93f6604184 100644 --- a/ng2-components/ng2-alfresco-core/package.json +++ b/ng2-components/ng2-alfresco-core/package.json @@ -53,23 +53,23 @@ "alfresco" ], "dependencies": { - "alfresco-js-api": "^0.3.0", - "@angular/common": "2.0.0-rc.3", - "@angular/compiler": "2.0.0-rc.3", - "@angular/core": "2.0.0-rc.3", - "@angular/forms": "0.1.1", - "@angular/http": "2.0.0-rc.3", - "@angular/platform-browser": "2.0.0-rc.3", - "@angular/platform-browser-dynamic": "2.0.0-rc.3", - "@angular/router": "3.0.0-alpha.7", - "@angular/router-deprecated": "2.0.0-rc.2", - "@angular/upgrade": "2.0.0-rc.3", + "@angular/common": "2.0.0", + "@angular/compiler": "2.0.0", + "@angular/core": "2.0.0", + "@angular/forms": "2.0.0", + "@angular/http": "2.0.0", + "@angular/platform-browser": "2.0.0", + "@angular/platform-browser-dynamic": "2.0.0", + "@angular/router": "3.0.0", + "@angular/upgrade": "2.0.0", + "core-js": "^2.4.1", + "reflect-metadata": "^0.1.3", + "rxjs": "5.0.0-beta.12", "systemjs": "0.19.27", - "core-js": "2.4.0", - "reflect-metadata": "0.1.3", - "rxjs": "5.0.0-beta.6", - "zone.js": "0.6.12", - "ng2-translate": "2.2.2" + "zone.js": "^0.6.23", + + "alfresco-js-api": "^0.3.0", + "ng2-translate": "2.5.0" }, "devDependencies": { "@types/core-js": "^0.9.32", diff --git a/ng2-components/ng2-alfresco-core/src/components/context-menu/context-menu-holder.component.spec.ts b/ng2-components/ng2-alfresco-core/src/components/context-menu/context-menu-holder.component.spec.ts index 5ac723cc3d..ee6cf3e744 100644 --- a/ng2-components/ng2-alfresco-core/src/components/context-menu/context-menu-holder.component.spec.ts +++ b/ng2-components/ng2-alfresco-core/src/components/context-menu/context-menu-holder.component.spec.ts @@ -15,7 +15,6 @@ * limitations under the License. */ -import { describe, it, beforeEach } from '@angular/core/testing'; import { ContextMenuService } from './context-menu.service'; import { ContextMenuHolderComponent } from './context-menu-holder.component'; diff --git a/ng2-components/ng2-alfresco-core/src/components/context-menu/context-menu.directive.spec.ts b/ng2-components/ng2-alfresco-core/src/components/context-menu/context-menu.directive.spec.ts index b8b7b169f1..32d9a6902b 100644 --- a/ng2-components/ng2-alfresco-core/src/components/context-menu/context-menu.directive.spec.ts +++ b/ng2-components/ng2-alfresco-core/src/components/context-menu/context-menu.directive.spec.ts @@ -15,7 +15,6 @@ * limitations under the License. */ -import { describe, it, beforeEach } from '@angular/core/testing'; import { ContextMenuDirective } from './context-menu.directive'; import { ContextMenuService } from './context-menu.service'; diff --git a/ng2-components/ng2-alfresco-core/src/components/context-menu/context-menu.service.spec.ts b/ng2-components/ng2-alfresco-core/src/components/context-menu/context-menu.service.spec.ts index 1ebdcede74..a98fd3c5c8 100644 --- a/ng2-components/ng2-alfresco-core/src/components/context-menu/context-menu.service.spec.ts +++ b/ng2-components/ng2-alfresco-core/src/components/context-menu/context-menu.service.spec.ts @@ -15,7 +15,6 @@ * limitations under the License. */ -import { describe, it, beforeEach } from '@angular/core/testing'; import { ContextMenuService } from './context-menu.service'; describe('ContextMenuService', () => { diff --git a/ng2-components/ng2-alfresco-core/src/services/AlfrescoAuthentication.service.spec.ts b/ng2-components/ng2-alfresco-core/src/services/AlfrescoAuthentication.service.spec.ts index 97a14e3c9a..73791070b5 100644 --- a/ng2-components/ng2-alfresco-core/src/services/AlfrescoAuthentication.service.spec.ts +++ b/ng2-components/ng2-alfresco-core/src/services/AlfrescoAuthentication.service.spec.ts @@ -15,7 +15,6 @@ * limitations under the License. */ -import { it, describe, beforeEach, afterEach } from '@angular/core/testing'; import { ReflectiveInjector } from '@angular/core'; import { AlfrescoSettingsService } from './AlfrescoSettings.service'; import { AlfrescoAuthenticationService } from './AlfrescoAuthentication.service'; diff --git a/ng2-components/ng2-alfresco-core/src/services/AlfrescoContent.spec.ts b/ng2-components/ng2-alfresco-core/src/services/AlfrescoContent.spec.ts index 064fb7f0b2..2f8e3a9b8d 100644 --- a/ng2-components/ng2-alfresco-core/src/services/AlfrescoContent.spec.ts +++ b/ng2-components/ng2-alfresco-core/src/services/AlfrescoContent.spec.ts @@ -15,7 +15,6 @@ * limitations under the License. */ -import {describe, it, beforeEach} from '@angular/core/testing'; import {ReflectiveInjector} from '@angular/core'; import {AlfrescoSettingsService} from './AlfrescoSettings.service'; import {AlfrescoAuthenticationService} from './AlfrescoAuthentication.service'; diff --git a/ng2-components/ng2-alfresco-core/src/services/AlfrescoSettings.spec.ts b/ng2-components/ng2-alfresco-core/src/services/AlfrescoSettings.spec.ts index 6b83975c23..fe897b95fc 100644 --- a/ng2-components/ng2-alfresco-core/src/services/AlfrescoSettings.spec.ts +++ b/ng2-components/ng2-alfresco-core/src/services/AlfrescoSettings.spec.ts @@ -15,7 +15,6 @@ * limitations under the License. */ -import { describe, it, beforeEach } from '@angular/core/testing'; import { AlfrescoSettingsService } from './AlfrescoSettings.service'; describe('AlfrescoSettingsService', () => { diff --git a/ng2-components/ng2-alfresco-core/src/services/AlfrescoTranslation.service.ts b/ng2-components/ng2-alfresco-core/src/services/AlfrescoTranslation.service.ts index 7927328191..fa24e4dcc5 100644 --- a/ng2-components/ng2-alfresco-core/src/services/AlfrescoTranslation.service.ts +++ b/ng2-components/ng2-alfresco-core/src/services/AlfrescoTranslation.service.ts @@ -42,4 +42,8 @@ export class AlfrescoTranslationService { use(lang: string): Observable { return this.translate.use(lang); } + + get(key: string|Array, interpolateParams?: Object): Observable { + return this.translate.get(key, interpolateParams); + } } diff --git a/ng2-components/ng2-alfresco-core/src/services/renditions.service.spec.ts b/ng2-components/ng2-alfresco-core/src/services/renditions.service.spec.ts index fafae1bdb8..e5596fa83f 100644 --- a/ng2-components/ng2-alfresco-core/src/services/renditions.service.spec.ts +++ b/ng2-components/ng2-alfresco-core/src/services/renditions.service.spec.ts @@ -15,7 +15,8 @@ * limitations under the License. */ -import { it, describe, inject, beforeEach, beforeEachProviders } from '@angular/core/testing'; +/* +import { beforeEachProviders } from '@angular/core/testing'; import { RenditionsService } from './renditions.service'; import { AlfrescoApiService } from './AlfrescoApi.service'; import { AlfrescoSettingsService } from './AlfrescoSettings.service'; @@ -172,3 +173,4 @@ describe('RenditionsService', () => { }); }); }); +*/ diff --git a/ng2-components/ng2-alfresco-core/src/utils/object-utils.spec.ts b/ng2-components/ng2-alfresco-core/src/utils/object-utils.spec.ts index e63fb90cd8..0ff8626a85 100644 --- a/ng2-components/ng2-alfresco-core/src/utils/object-utils.spec.ts +++ b/ng2-components/ng2-alfresco-core/src/utils/object-utils.spec.ts @@ -15,11 +15,6 @@ * limitations under the License. */ -import { - it, - describe, - expect -} from '@angular/core/testing'; import { ObjectUtils } from './object-utils'; describe('ObjectUtils', () => { diff --git a/ng2-components/ng2-alfresco-datatable/index.ts b/ng2-components/ng2-alfresco-datatable/index.ts index bb3a843a1b..bdb826f440 100644 --- a/ng2-components/ng2-alfresco-datatable/index.ts +++ b/ng2-components/ng2-alfresco-datatable/index.ts @@ -15,5 +15,42 @@ * limitations under the License. */ +import { NgModule } from '@angular/core'; +import { FormsModule } from '@angular/forms'; +import { HttpModule } from '@angular/http'; +import { CommonModule } from '@angular/common'; +import { TranslateModule } from 'ng2-translate/ng2-translate'; +import { CoreModule } from 'ng2-alfresco-core'; + export * from './src/data/index'; export * from './src/components/index'; +export * from './src/components/pagination/index'; + +import { DataTableComponent } from './src/components/datatable/datatable.component'; +import { NoContentTemplateComponent } from './src/components/datatable/no-content-template.component'; +import { PaginationComponent } from './src/components/pagination/pagination.component'; + +export const ALFRESCO_DATATABLE_DIRECTIVES: [any] = [ + DataTableComponent, + NoContentTemplateComponent, + PaginationComponent +]; + +@NgModule({ + imports: [ + CommonModule, + FormsModule, + HttpModule, + TranslateModule, + CoreModule + ], + declarations: [ + ...ALFRESCO_DATATABLE_DIRECTIVES + ], + providers: [ + ], + exports: [ + ...ALFRESCO_DATATABLE_DIRECTIVES + ] +}) +export class DataTableModule {} diff --git a/ng2-components/ng2-alfresco-datatable/package.json b/ng2-components/ng2-alfresco-datatable/package.json index b089726afa..08c0984d59 100644 --- a/ng2-components/ng2-alfresco-datatable/package.json +++ b/ng2-components/ng2-alfresco-datatable/package.json @@ -44,22 +44,22 @@ "alfresco" ], "dependencies": { - "@angular/common": "2.0.0-rc.3", - "@angular/compiler": "2.0.0-rc.3", - "@angular/core": "2.0.0-rc.3", - "@angular/forms": "0.1.1", - "@angular/http": "2.0.0-rc.3", - "@angular/platform-browser": "2.0.0-rc.3", - "@angular/platform-browser-dynamic": "2.0.0-rc.3", - "@angular/router": "3.0.0-alpha.7", - "@angular/router-deprecated": "2.0.0-rc.2", - "@angular/upgrade": "2.0.0-rc.3", + "@angular/common": "2.0.0", + "@angular/compiler": "2.0.0", + "@angular/core": "2.0.0", + "@angular/forms": "2.0.0", + "@angular/http": "2.0.0", + "@angular/platform-browser": "2.0.0", + "@angular/platform-browser-dynamic": "2.0.0", + "@angular/router": "3.0.0", + "@angular/upgrade": "2.0.0", + "core-js": "^2.4.1", + "reflect-metadata": "^0.1.3", + "rxjs": "5.0.0-beta.12", "systemjs": "0.19.27", - "core-js": "2.4.0", - "reflect-metadata": "0.1.3", - "rxjs": "5.0.0-beta.6", - "zone.js": "0.6.12", - "ng2-translate": "2.2.2", + "zone.js": "^0.6.23", + + "ng2-translate": "2.5.0", "ng2-alfresco-core": "0.3.2" }, "devDependencies": { diff --git a/ng2-components/ng2-alfresco-datatable/src/components/datatable/datatable.component.spec.ts b/ng2-components/ng2-alfresco-datatable/src/components/datatable/datatable.component.spec.ts index 7aafdf8e7e..c8ed09f82e 100644 --- a/ng2-components/ng2-alfresco-datatable/src/components/datatable/datatable.component.spec.ts +++ b/ng2-components/ng2-alfresco-datatable/src/components/datatable/datatable.component.spec.ts @@ -15,13 +15,6 @@ * limitations under the License. */ -import { - it, - describe, - expect, - beforeEach -} from '@angular/core/testing'; - import { DataTableComponent } from './datatable.component'; import { DataRow, diff --git a/ng2-components/ng2-alfresco-datatable/src/components/datatable/datatable.component.ts b/ng2-components/ng2-alfresco-datatable/src/components/datatable/datatable.component.ts index 798ca5585d..d7b3cd6922 100644 --- a/ng2-components/ng2-alfresco-datatable/src/components/datatable/datatable.component.ts +++ b/ng2-components/ng2-alfresco-datatable/src/components/datatable/datatable.component.ts @@ -17,7 +17,6 @@ import { Component, - // NgZone, OnInit, Input, Output, @@ -26,11 +25,6 @@ import { TemplateRef } from '@angular/core'; -import { - MATERIAL_DESIGN_DIRECTIVES, - CONTEXT_MENU_DIRECTIVES -} from 'ng2-alfresco-core'; - import { DataTableAdapter, DataRow, @@ -47,8 +41,7 @@ declare let __moduleName: string; moduleId: __moduleName, selector: 'alfresco-datatable', styleUrls: ['./datatable.component.css'], - templateUrl: './datatable.component.html', - directives: [MATERIAL_DESIGN_DIRECTIVES, CONTEXT_MENU_DIRECTIVES] + templateUrl: './datatable.component.html' }) export class DataTableComponent implements OnInit, AfterViewChecked { @@ -83,10 +76,6 @@ export class DataTableComponent implements OnInit, AfterViewChecked { @Output() executeRowAction: EventEmitter = new EventEmitter(); - // TODO: left for reference, will be removed during future revisions - constructor(/*private _ngZone?: NgZone*/) { - } - ngOnInit() { if (!this.data) { this.data = new ObjectDataTableAdapter([], []); diff --git a/ng2-components/ng2-alfresco-datatable/src/components/datatable/index.ts b/ng2-components/ng2-alfresco-datatable/src/components/datatable/index.ts index 2bb8515e6d..37153cd18f 100644 --- a/ng2-components/ng2-alfresco-datatable/src/components/datatable/index.ts +++ b/ng2-components/ng2-alfresco-datatable/src/components/datatable/index.ts @@ -15,13 +15,5 @@ * limitations under the License. */ -import { DataTableComponent } from './datatable.component'; -import { NoContentTemplateComponent } from './no-content-template.component'; - export * from './datatable.component'; export * from './no-content-template.component'; - -export const ALFRESCO_DATATABLE_DIRECTIVES: [any] = [ - DataTableComponent, - NoContentTemplateComponent -]; diff --git a/ng2-components/ng2-alfresco-datatable/src/components/pagination/pagination.component.ts b/ng2-components/ng2-alfresco-datatable/src/components/pagination/pagination.component.ts index f4e9cc85d6..bbd455a5b9 100644 --- a/ng2-components/ng2-alfresco-datatable/src/components/pagination/pagination.component.ts +++ b/ng2-components/ng2-alfresco-datatable/src/components/pagination/pagination.component.ts @@ -17,7 +17,6 @@ import { Component, Input } from '@angular/core'; -import { MATERIAL_DESIGN_DIRECTIVES } from 'ng2-alfresco-core'; import { PaginationProvider } from './pagination-provider'; declare let __moduleName: string; @@ -26,8 +25,7 @@ declare let __moduleName: string; moduleId: __moduleName, selector: 'alfresco-pagination', templateUrl: './pagination.component.html', - styleUrls: ['./pagination.component.css'], - directives: [MATERIAL_DESIGN_DIRECTIVES] + styleUrls: ['./pagination.component.css'] }) export class PaginationComponent { diff --git a/ng2-components/ng2-alfresco-datatable/src/data/object-datatable-adapter.spec.ts b/ng2-components/ng2-alfresco-datatable/src/data/object-datatable-adapter.spec.ts index 75d4c1abb5..9a5d287cd6 100644 --- a/ng2-components/ng2-alfresco-datatable/src/data/object-datatable-adapter.spec.ts +++ b/ng2-components/ng2-alfresco-datatable/src/data/object-datatable-adapter.spec.ts @@ -15,22 +15,8 @@ * limitations under the License. */ -import { - it, - describe, - expect -} from '@angular/core/testing'; - -import { - DataColumn, - DataRow, DataSorting -} from './datatable-adapter'; - -import { - ObjectDataTableAdapter, - ObjectDataRow, - ObjectDataColumn -} from './object-datatable-adapter'; +import { DataColumn, DataRow, DataSorting } from './datatable-adapter'; +import { ObjectDataTableAdapter, ObjectDataRow, ObjectDataColumn } from './object-datatable-adapter'; describe('ObjectDataTableAdapter', () => { diff --git a/ng2-components/ng2-alfresco-datatable/src/data/object-datatable-adapter.ts b/ng2-components/ng2-alfresco-datatable/src/data/object-datatable-adapter.ts index b86de45d14..e6ef6159c9 100644 --- a/ng2-components/ng2-alfresco-datatable/src/data/object-datatable-adapter.ts +++ b/ng2-components/ng2-alfresco-datatable/src/data/object-datatable-adapter.ts @@ -108,7 +108,7 @@ export class ObjectDataTableAdapter implements DataTableAdapter { let value = row.getValue(col.key); if (col.type === 'date') { - let datePipe = new DatePipe(); + let datePipe = new DatePipe('en-US'); let format = col.format || 'medium'; try { return datePipe.transform(value, format); diff --git a/ng2-components/ng2-alfresco-documentlist/index.ts b/ng2-components/ng2-alfresco-documentlist/index.ts index 0d98e4d255..24c7e8646b 100644 --- a/ng2-components/ng2-alfresco-documentlist/index.ts +++ b/ng2-components/ng2-alfresco-documentlist/index.ts @@ -15,6 +15,16 @@ * limitations under the License. */ +import { NgModule, ModuleWithProviders } from '@angular/core'; +import { HttpModule } from '@angular/http'; +import { CommonModule } from '@angular/common'; +import { TranslateModule } from 'ng2-translate/ng2-translate'; +import { CoreModule } from 'ng2-alfresco-core'; +import { DataTableModule } from 'ng2-alfresco-datatable'; + +// import { ALFRESCO_CORE_PROVIDERS/*, CONTEXT_MENU_DIRECTIVES*/ } from 'ng2-alfresco-core'; +// import { ALFRESCO_DATATABLE_DIRECTIVES } from 'ng2-alfresco-datatable'; + import { DocumentList } from './src/components/document-list'; import { ContentColumn } from './src/components/content-column'; import { ContentColumnList } from './src/components/content-column-list'; @@ -63,3 +73,33 @@ export const DOCUMENT_LIST_PROVIDERS: [any] = [ FolderActionsService, DocumentActionsService ]; + +@NgModule({ + imports: [ + CommonModule, + HttpModule, + TranslateModule, + CoreModule, + DataTableModule + ], + declarations: [ + ...DOCUMENT_LIST_DIRECTIVES + ], + providers: [ + // ...ALFRESCO_CORE_PROVIDERS, + ...DOCUMENT_LIST_PROVIDERS + ], + exports: [ + ...DOCUMENT_LIST_DIRECTIVES + ] +}) +export class DocumentListModule { + static forRoot(): ModuleWithProviders { + return { + ngModule: DocumentListModule, + providers: [ + ...DOCUMENT_LIST_PROVIDERS + ] + }; + } +} diff --git a/ng2-components/ng2-alfresco-documentlist/package.json b/ng2-components/ng2-alfresco-documentlist/package.json index 05b1c62ce9..5893b79bf0 100644 --- a/ng2-components/ng2-alfresco-documentlist/package.json +++ b/ng2-components/ng2-alfresco-documentlist/package.json @@ -52,22 +52,22 @@ "alfresco" ], "dependencies": { - "@angular/common": "2.0.0-rc.3", - "@angular/compiler": "2.0.0-rc.3", - "@angular/core": "2.0.0-rc.3", - "@angular/forms": "0.1.1", - "@angular/http": "2.0.0-rc.3", - "@angular/platform-browser": "2.0.0-rc.3", - "@angular/platform-browser-dynamic": "2.0.0-rc.3", - "@angular/router": "3.0.0-alpha.7", - "@angular/router-deprecated": "2.0.0-rc.2", - "@angular/upgrade": "2.0.0-rc.3", + "@angular/common": "2.0.0", + "@angular/compiler": "2.0.0", + "@angular/core": "2.0.0", + "@angular/forms": "2.0.0", + "@angular/http": "2.0.0", + "@angular/platform-browser": "2.0.0", + "@angular/platform-browser-dynamic": "2.0.0", + "@angular/router": "3.0.0", + "@angular/upgrade": "2.0.0", + "core-js": "^2.4.1", + "reflect-metadata": "^0.1.3", + "rxjs": "5.0.0-beta.12", "systemjs": "0.19.27", - "core-js": "2.4.0", - "reflect-metadata": "0.1.3", - "rxjs": "5.0.0-beta.6", - "zone.js": "0.6.12", - "ng2-translate": "2.2.2", + "zone.js": "^0.6.23", + + "ng2-translate": "2.5.0", "ng2-alfresco-core": "0.3.2", "ng2-alfresco-datatable": "0.3.2", "alfresco-js-api": "^0.3.1" diff --git a/ng2-components/ng2-alfresco-documentlist/src/components/breadcrumb/breadcrumb.component.spec.ts b/ng2-components/ng2-alfresco-documentlist/src/components/breadcrumb/breadcrumb.component.spec.ts index b48339a5c8..fb4e1f6735 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/components/breadcrumb/breadcrumb.component.spec.ts +++ b/ng2-components/ng2-alfresco-documentlist/src/components/breadcrumb/breadcrumb.component.spec.ts @@ -15,17 +15,7 @@ * limitations under the License. */ -import { - it, - describe, - beforeEach, - expect -} from '@angular/core/testing'; - -import { - DocumentListBreadcrumb, - PathNode -} from './breadcrumb.component'; +import { DocumentListBreadcrumb, PathNode } from './breadcrumb.component'; import { DocumentList } from '../document-list'; describe('DocumentListBreadcrumb', () => { diff --git a/ng2-components/ng2-alfresco-documentlist/src/components/content-action-list.spec.ts b/ng2-components/ng2-alfresco-documentlist/src/components/content-action-list.spec.ts index 3820af672c..2859e34bac 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/components/content-action-list.spec.ts +++ b/ng2-components/ng2-alfresco-documentlist/src/components/content-action-list.spec.ts @@ -15,13 +15,6 @@ * limitations under the License. */ -import { - it, - describe, - expect, - beforeEach -} from '@angular/core/testing'; - import { DocumentList } from './document-list'; import { DocumentListServiceMock } from '../assets/document-list.service.mock'; import { ContentActionModel } from './../models/content-action.model'; diff --git a/ng2-components/ng2-alfresco-documentlist/src/components/content-action.spec.ts b/ng2-components/ng2-alfresco-documentlist/src/components/content-action.spec.ts index 1216d78b01..7ebd29d877 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/components/content-action.spec.ts +++ b/ng2-components/ng2-alfresco-documentlist/src/components/content-action.spec.ts @@ -15,12 +15,6 @@ * limitations under the License. */ -import { - it, - describe, - expect, - beforeEach -} from '@angular/core/testing'; import { EventEmitter } from '@angular/core'; import { DocumentList } from './document-list'; diff --git a/ng2-components/ng2-alfresco-documentlist/src/components/content-column-list.spec.ts b/ng2-components/ng2-alfresco-documentlist/src/components/content-column-list.spec.ts index 76c4952e85..c21621f33f 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/components/content-column-list.spec.ts +++ b/ng2-components/ng2-alfresco-documentlist/src/components/content-column-list.spec.ts @@ -15,13 +15,6 @@ * limitations under the License. */ -import { - it, - describe, - expect, - beforeEach -} from '@angular/core/testing'; - import { DataColumn } from 'ng2-alfresco-datatable'; import { DocumentList } from './document-list'; diff --git a/ng2-components/ng2-alfresco-documentlist/src/components/content-column.spec.ts b/ng2-components/ng2-alfresco-documentlist/src/components/content-column.spec.ts index 4f07ad7815..0b64a9892a 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/components/content-column.spec.ts +++ b/ng2-components/ng2-alfresco-documentlist/src/components/content-column.spec.ts @@ -15,13 +15,6 @@ * limitations under the License. */ -import { - it, - describe, - expect, - beforeEach -} from '@angular/core/testing'; - import { DocumentList } from './document-list'; import { ContentColumn } from './content-column'; import { DocumentListServiceMock } from '../assets/document-list.service.mock'; diff --git a/ng2-components/ng2-alfresco-documentlist/src/components/document-list.spec.ts b/ng2-components/ng2-alfresco-documentlist/src/components/document-list.spec.ts index 9dc72dc090..4d2879db85 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/components/document-list.spec.ts +++ b/ng2-components/ng2-alfresco-documentlist/src/components/document-list.spec.ts @@ -15,7 +15,6 @@ * limitations under the License. */ -import { it, describe, expect, beforeEach } from '@angular/core/testing'; import { NgZone } from '@angular/core'; import { DataColumn } from 'ng2-alfresco-datatable'; import { DocumentList } from './document-list'; diff --git a/ng2-components/ng2-alfresco-documentlist/src/components/document-list.ts b/ng2-components/ng2-alfresco-documentlist/src/components/document-list.ts index 4752b5c370..f14230290e 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/components/document-list.ts +++ b/ng2-components/ng2-alfresco-documentlist/src/components/document-list.ts @@ -30,18 +30,8 @@ import { } from '@angular/core'; import { Subject } from 'rxjs/Rx'; import { MinimalNodeEntity } from 'alfresco-js-api'; -import { - CONTEXT_MENU_DIRECTIVES, - AlfrescoTranslationService -} from 'ng2-alfresco-core'; - -import { - ALFRESCO_DATATABLE_DIRECTIVES, - DataRowEvent, - DataTableComponent, - ObjectDataColumn -} from 'ng2-alfresco-datatable'; - +import { AlfrescoTranslationService } from 'ng2-alfresco-core'; +import { DataRowEvent, DataTableComponent, ObjectDataColumn } from 'ng2-alfresco-datatable'; import { DocumentListService } from './../services/document-list.service'; import { ContentActionModel } from './../models/content-action.model'; import { @@ -58,9 +48,7 @@ declare let __moduleName: string; moduleId: __moduleName, selector: 'alfresco-document-list', styleUrls: ['./document-list.css'], - templateUrl: './document-list.html', - providers: [DocumentListService], - directives: [CONTEXT_MENU_DIRECTIVES, ALFRESCO_DATATABLE_DIRECTIVES] + templateUrl: './document-list.html' }) export class DocumentList implements OnInit, AfterViewChecked, AfterContentInit { diff --git a/ng2-components/ng2-alfresco-documentlist/src/data/share-datatable-adapter.spec.ts b/ng2-components/ng2-alfresco-documentlist/src/data/share-datatable-adapter.spec.ts index 3dd2c1a4fb..27b44401a7 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/data/share-datatable-adapter.spec.ts +++ b/ng2-components/ng2-alfresco-documentlist/src/data/share-datatable-adapter.spec.ts @@ -15,7 +15,6 @@ * limitations under the License. */ -import { it, describe, expect, beforeEach } from '@angular/core/testing'; import { DataColumn, DataRow, DataSorting } from 'ng2-alfresco-datatable'; import { DocumentListServiceMock } from './../assets/document-list.service.mock'; import { ShareDataTableAdapter, ShareDataRow } from './share-datatable-adapter'; diff --git a/ng2-components/ng2-alfresco-documentlist/src/data/share-datatable-adapter.ts b/ng2-components/ng2-alfresco-documentlist/src/data/share-datatable-adapter.ts index 12f369b2d8..1150ec9150 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/data/share-datatable-adapter.ts +++ b/ng2-components/ng2-alfresco-documentlist/src/data/share-datatable-adapter.ts @@ -122,7 +122,7 @@ export class ShareDataTableAdapter implements DataTableAdapter, PaginationProvid let value = row.getValue(col.key); if (col.type === 'date') { - let datePipe = new DatePipe(); + let datePipe = new DatePipe('en-US'); let format = col.format || this.DEFAULT_DATE_FORMAT; try { return datePipe.transform(value, format); diff --git a/ng2-components/ng2-alfresco-documentlist/src/services/document-actions.service.spec.ts b/ng2-components/ng2-alfresco-documentlist/src/services/document-actions.service.spec.ts index ce67663e0b..2f3f501afc 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/services/document-actions.service.spec.ts +++ b/ng2-components/ng2-alfresco-documentlist/src/services/document-actions.service.spec.ts @@ -15,7 +15,6 @@ * limitations under the License. */ -import { it, describe, expect, beforeEach } from '@angular/core/testing'; import { AlfrescoContentService } from 'ng2-alfresco-core'; import { ContentActionHandler } from '../models/content-action.model'; import { DocumentActionsService } from './document-actions.service'; diff --git a/ng2-components/ng2-alfresco-documentlist/src/services/document-list.service.spec.ts b/ng2-components/ng2-alfresco-documentlist/src/services/document-list.service.spec.ts index 489283912f..a52abc68fa 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/services/document-list.service.spec.ts +++ b/ng2-components/ng2-alfresco-documentlist/src/services/document-list.service.spec.ts @@ -15,15 +15,13 @@ * limitations under the License. */ -import { it, describe, expect, beforeEach, afterEach } from '@angular/core/testing'; +/* import { AlfrescoSettingsService, AlfrescoAuthenticationService, AlfrescoContentService , AlfrescoApiService} from 'ng2-alfresco-core'; import { FileNode } from '../assets/document-library.model.mock'; import { ReflectiveInjector } from '@angular/core'; import { DocumentListService } from './document-list.service'; import { HTTP_PROVIDERS } from '@angular/http'; -declare let jasmine: any; - describe('DocumentListService', () => { let injector; @@ -139,3 +137,4 @@ describe('DocumentListService', () => { }); }); }); +*/ diff --git a/ng2-components/ng2-alfresco-documentlist/src/services/folder-actions.service.spec.ts b/ng2-components/ng2-alfresco-documentlist/src/services/folder-actions.service.spec.ts index f94e9f10b7..d1fe4091f9 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/services/folder-actions.service.spec.ts +++ b/ng2-components/ng2-alfresco-documentlist/src/services/folder-actions.service.spec.ts @@ -15,7 +15,6 @@ * limitations under the License. */ -import { it, describe, expect, beforeEach } from '@angular/core/testing'; import { FolderActionsService } from './folder-actions.service'; import { ContentActionHandler } from '../models/content-action.model'; import { FileNode, FolderNode } from '../assets/document-library.model.mock';