mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-864] codelyzer form component (#2076)
This commit is contained in:
@@ -18,11 +18,11 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import {
|
||||
AlfrescoTranslationService,
|
||||
AlfrescoAuthenticationService,
|
||||
AlfrescoSettingsService,
|
||||
StorageService,
|
||||
LogService
|
||||
AlfrescoTranslationService,
|
||||
LogService,
|
||||
StorageService
|
||||
} from 'ng2-alfresco-core';
|
||||
|
||||
declare var document: any;
|
||||
|
@@ -18,54 +18,54 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
|
||||
import { CoreModule, AppConfigService } 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 { UploadModule } from 'ng2-alfresco-upload';
|
||||
import { TagModule } from 'ng2-alfresco-tag';
|
||||
import { SocialModule } from 'ng2-alfresco-social';
|
||||
import { WebScriptModule } from 'ng2-alfresco-webscript';
|
||||
import { ViewerModule } from 'ng2-alfresco-viewer';
|
||||
import { ActivitiFormModule } from 'ng2-activiti-form';
|
||||
import { ActivitiTaskListModule } from 'ng2-activiti-tasklist';
|
||||
import { ActivitiProcessListModule } from 'ng2-activiti-processlist';
|
||||
import { UserInfoComponentModule } from 'ng2-alfresco-userinfo';
|
||||
import { AnalyticsModule } from 'ng2-activiti-analytics';
|
||||
import { DiagramsModule } from 'ng2-activiti-diagrams';
|
||||
import { ActivitiFormModule } from 'ng2-activiti-form';
|
||||
import { ActivitiProcessListModule } from 'ng2-activiti-processlist';
|
||||
import { ActivitiTaskListModule } from 'ng2-activiti-tasklist';
|
||||
import { AppConfigService, CoreModule } from 'ng2-alfresco-core';
|
||||
import { DataTableModule } from 'ng2-alfresco-datatable';
|
||||
import { DocumentListModule } from 'ng2-alfresco-documentlist';
|
||||
import { LoginModule } from 'ng2-alfresco-login';
|
||||
import { SearchModule } from 'ng2-alfresco-search';
|
||||
import { SocialModule } from 'ng2-alfresco-social';
|
||||
import { TagModule } from 'ng2-alfresco-tag';
|
||||
import { UploadModule } from 'ng2-alfresco-upload';
|
||||
import { UserInfoComponentModule } from 'ng2-alfresco-userinfo';
|
||||
import { ViewerModule } from 'ng2-alfresco-viewer';
|
||||
import { WebScriptModule } from 'ng2-alfresco-webscript';
|
||||
|
||||
import { MaterialModule } from './material.module';
|
||||
import { Editor3DModule } from 'ng2-3d-editor';
|
||||
import { ChartsModule } from 'ng2-charts';
|
||||
import { AppComponent } from './app.component';
|
||||
import { routing } from './app.routes';
|
||||
import { CustomEditorsModule } from './components/activiti/custom-editor/custom-editor.component';
|
||||
import { Editor3DModule } from 'ng2-3d-editor';
|
||||
import { ChartsModule } from 'ng2-charts';
|
||||
import { CreateFolderDialog } from './dialogs/create-folder.dialog';
|
||||
import { CreateFolderDialogComponent } from './dialogs/create-folder.dialog';
|
||||
import { MaterialModule } from './material.module';
|
||||
import { DebugAppConfigService } from './services/debug-app-config.service';
|
||||
|
||||
import { FormListDemoComponent } from './components/form/form-list-demo.component';
|
||||
|
||||
import {
|
||||
HomeComponent,
|
||||
DataTableDemoComponent,
|
||||
SearchComponent,
|
||||
SearchBarComponent,
|
||||
LoginDemoComponent,
|
||||
AboutComponent,
|
||||
ActivitiAppsViewComponent,
|
||||
ActivitiDemoComponent,
|
||||
ActivitiTaskAttachmentsComponent,
|
||||
ActivitiProcessAttachmentsComponent,
|
||||
ActivitiShowDiagramComponent,
|
||||
ActivitiAppsView,
|
||||
FormViewer,
|
||||
WebscriptComponent,
|
||||
TagComponent,
|
||||
SocialComponent,
|
||||
AboutComponent,
|
||||
ActivitiTaskAttachmentsComponent,
|
||||
DataTableDemoComponent,
|
||||
FilesComponent,
|
||||
FormNodeViewer,
|
||||
FormDemoComponent,
|
||||
FormNodeViewerComponent,
|
||||
FormViewerComponent,
|
||||
HomeComponent,
|
||||
LoginDemoComponent,
|
||||
SearchBarComponent,
|
||||
SearchComponent,
|
||||
SettingsComponent,
|
||||
FormDemoComponent
|
||||
SocialComponent,
|
||||
TagComponent,
|
||||
WebscriptComponent
|
||||
} from './components/index';
|
||||
|
||||
let appConfigFile = 'app.config-dev.json';
|
||||
@@ -111,15 +111,15 @@ if (process.env.ENV === 'production') {
|
||||
ActivitiTaskAttachmentsComponent,
|
||||
ActivitiProcessAttachmentsComponent,
|
||||
ActivitiShowDiagramComponent,
|
||||
ActivitiAppsView,
|
||||
FormViewer,
|
||||
ActivitiAppsViewComponent,
|
||||
FormViewerComponent,
|
||||
WebscriptComponent,
|
||||
TagComponent,
|
||||
SocialComponent,
|
||||
AboutComponent,
|
||||
FilesComponent,
|
||||
FormNodeViewer,
|
||||
CreateFolderDialog,
|
||||
FormNodeViewerComponent,
|
||||
CreateFolderDialogComponent,
|
||||
SettingsComponent,
|
||||
FormDemoComponent,
|
||||
FormListDemoComponent
|
||||
@@ -129,7 +129,7 @@ if (process.env.ENV === 'production') {
|
||||
],
|
||||
bootstrap: [ AppComponent ],
|
||||
entryComponents: [
|
||||
CreateFolderDialog
|
||||
CreateFolderDialogComponent
|
||||
]
|
||||
})
|
||||
export class AppModule { }
|
||||
|
@@ -15,27 +15,27 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ModuleWithProviders } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
import { AuthGuard, AuthGuardEcm, AuthGuardBpm } from 'ng2-alfresco-core';
|
||||
import { ModuleWithProviders } from '@angular/core';
|
||||
import { RouterModule, Routes } from '@angular/router';
|
||||
import { AuthGuard, AuthGuardBpm, AuthGuardEcm } from 'ng2-alfresco-core';
|
||||
|
||||
import {
|
||||
HomeComponent,
|
||||
FilesComponent,
|
||||
DataTableDemoComponent,
|
||||
SearchComponent,
|
||||
LoginDemoComponent,
|
||||
AboutComponent,
|
||||
ActivitiAppsViewComponent,
|
||||
ActivitiDemoComponent,
|
||||
ActivitiShowDiagramComponent,
|
||||
ActivitiAppsView,
|
||||
WebscriptComponent,
|
||||
TagComponent,
|
||||
SocialComponent,
|
||||
AboutComponent,
|
||||
FormViewer,
|
||||
FormNodeViewer,
|
||||
DataTableDemoComponent,
|
||||
FilesComponent,
|
||||
FormDemoComponent,
|
||||
FormNodeViewerComponent,
|
||||
FormViewerComponent,
|
||||
HomeComponent,
|
||||
LoginDemoComponent,
|
||||
SearchComponent,
|
||||
SettingsComponent,
|
||||
FormDemoComponent
|
||||
SocialComponent,
|
||||
TagComponent,
|
||||
WebscriptComponent
|
||||
} from './components/index';
|
||||
|
||||
import { UploadButtonComponent } from 'ng2-alfresco-upload';
|
||||
@@ -80,12 +80,12 @@ export const appRoutes: Routes = [
|
||||
},
|
||||
{
|
||||
path: 'activiti',
|
||||
component: ActivitiAppsView,
|
||||
component: ActivitiAppsViewComponent,
|
||||
canActivate: [AuthGuardBpm]
|
||||
},
|
||||
{
|
||||
path: 'activiti/apps',
|
||||
component: ActivitiAppsView,
|
||||
component: ActivitiAppsViewComponent,
|
||||
canActivate: [AuthGuardBpm]
|
||||
},
|
||||
{
|
||||
@@ -107,13 +107,13 @@ export const appRoutes: Routes = [
|
||||
// TODO: check if needed
|
||||
{
|
||||
path: 'activiti/tasks/:id',
|
||||
component: FormViewer,
|
||||
component: FormViewerComponent,
|
||||
canActivate: [AuthGuardBpm]
|
||||
},
|
||||
// TODO: check if needed
|
||||
{
|
||||
path: 'activiti/tasksnode/:id',
|
||||
component: FormNodeViewer,
|
||||
component: FormNodeViewerComponent,
|
||||
canActivate: [AuthGuardBpm]
|
||||
},
|
||||
{
|
||||
|
@@ -17,8 +17,8 @@
|
||||
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Http } from '@angular/http';
|
||||
import { AppConfigService, LogService } from 'ng2-alfresco-core';
|
||||
import { ObjectDataTableAdapter } from 'ng2-alfresco-datatable';
|
||||
import { LogService, AppConfigService } from 'ng2-alfresco-core';
|
||||
|
||||
@Component({
|
||||
selector: 'about-page',
|
||||
|
@@ -15,33 +15,33 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { AfterViewInit, Component, ElementRef, Input, ViewChild } from '@angular/core';
|
||||
import { AfterViewInit, Component, ElementRef, Input, OnDestroy, OnInit, ViewChild } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { AnalyticsReportListComponent } from 'ng2-activiti-analytics';
|
||||
import { FormEvent, FormFieldEvent, FormRenderingService, FormService } from 'ng2-activiti-form';
|
||||
import {
|
||||
ActivitiApps,
|
||||
ActivitiFilters,
|
||||
ActivitiTaskList,
|
||||
ActivitiTaskDetails,
|
||||
FilterRepresentationModel,
|
||||
TaskDetailsEvent
|
||||
} from 'ng2-activiti-tasklist';
|
||||
import {
|
||||
ActivitiProcessFilters,
|
||||
ActivitiProcessInstanceDetails,
|
||||
ActivitiProcessFiltersComponent,
|
||||
ActivitiProcessInstanceDetailsComponent,
|
||||
ActivitiProcessInstanceListComponent,
|
||||
ActivitiStartProcessInstance,
|
||||
ActivitiStartProcessInstanceComponent,
|
||||
FilterProcessRepresentationModel,
|
||||
ProcessInstance
|
||||
} from 'ng2-activiti-processlist';
|
||||
import { AnalyticsReportListComponent } from 'ng2-activiti-analytics';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { Subscription } from 'rxjs/Rx';
|
||||
import {
|
||||
ObjectDataTableAdapter,
|
||||
ObjectDataRow,
|
||||
DataSorting
|
||||
} from 'ng2-alfresco-datatable';
|
||||
ActivitiAppsComponent,
|
||||
ActivitiFiltersComponent,
|
||||
ActivitiTaskDetailsComponent,
|
||||
ActivitiTaskListComponent,
|
||||
FilterRepresentationModel,
|
||||
TaskDetailsEvent
|
||||
} from 'ng2-activiti-tasklist';
|
||||
import { AlfrescoApiService } from 'ng2-alfresco-core';
|
||||
import { FormService, FormRenderingService, FormEvent, FormFieldEvent } from 'ng2-activiti-form';
|
||||
import {
|
||||
DataSorting,
|
||||
ObjectDataRow,
|
||||
ObjectDataTableAdapter
|
||||
} from 'ng2-alfresco-datatable';
|
||||
import { Subscription } from 'rxjs/Rx';
|
||||
import { /*CustomEditorComponent*/ CustomStencil01 } from './custom-editor/custom-editor.component';
|
||||
|
||||
declare var componentHandler;
|
||||
@@ -53,28 +53,28 @@ const currentProcessIdNew = '__NEW__';
|
||||
templateUrl: './activiti-demo.component.html',
|
||||
styleUrls: ['./activiti-demo.component.css']
|
||||
})
|
||||
export class ActivitiDemoComponent implements AfterViewInit {
|
||||
export class ActivitiDemoComponent implements AfterViewInit, OnDestroy, OnInit {
|
||||
|
||||
@ViewChild(ActivitiFilters)
|
||||
activitifilter: ActivitiFilters;
|
||||
@ViewChild(ActivitiFiltersComponent)
|
||||
activitifilter: ActivitiFiltersComponent;
|
||||
|
||||
@ViewChild(ActivitiTaskList)
|
||||
taskList: ActivitiTaskList;
|
||||
@ViewChild(ActivitiTaskListComponent)
|
||||
taskList: ActivitiTaskListComponent;
|
||||
|
||||
@ViewChild(ActivitiProcessFilters)
|
||||
activitiprocessfilter: ActivitiProcessFilters;
|
||||
@ViewChild(ActivitiProcessFiltersComponent)
|
||||
activitiprocessfilter: ActivitiProcessFiltersComponent;
|
||||
|
||||
@ViewChild(ActivitiProcessInstanceListComponent)
|
||||
processList: ActivitiProcessInstanceListComponent;
|
||||
|
||||
@ViewChild(ActivitiProcessInstanceDetails)
|
||||
activitiprocessdetails: ActivitiProcessInstanceDetails;
|
||||
@ViewChild(ActivitiProcessInstanceDetailsComponent)
|
||||
activitiprocessdetails: ActivitiProcessInstanceDetailsComponent;
|
||||
|
||||
@ViewChild(ActivitiTaskDetails)
|
||||
activitidetails: ActivitiTaskDetails;
|
||||
@ViewChild(ActivitiTaskDetailsComponent)
|
||||
activitidetails: ActivitiTaskDetailsComponent;
|
||||
|
||||
@ViewChild(ActivitiStartProcessInstance)
|
||||
activitiStartProcess: ActivitiStartProcessInstance;
|
||||
@ViewChild(ActivitiStartProcessInstanceComponent)
|
||||
activitiStartProcess: ActivitiStartProcessInstanceComponent;
|
||||
|
||||
@ViewChild(AnalyticsReportListComponent)
|
||||
analyticsreportlist: AnalyticsReportListComponent;
|
||||
@@ -159,7 +159,7 @@ export class ActivitiDemoComponent implements AfterViewInit {
|
||||
this.processFilter = null;
|
||||
this.currentProcessInstanceId = null;
|
||||
});
|
||||
this.layoutType = ActivitiApps.LAYOUT_GRID;
|
||||
this.layoutType = ActivitiAppsComponent.LAYOUT_GRID;
|
||||
|
||||
}
|
||||
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Component, ViewChild, Input } from '@angular/core';
|
||||
import { Component, Input, OnInit, ViewChild } from '@angular/core';
|
||||
import { ActivitiProcessAttachmentListComponent, ProcessUploadService } from 'ng2-activiti-processlist';
|
||||
import { UploadService } from 'ng2-alfresco-core';
|
||||
|
||||
@@ -28,7 +28,7 @@ import { UploadService } from 'ng2-alfresco-core';
|
||||
]
|
||||
})
|
||||
|
||||
export class ActivitiProcessAttachmentsComponent {
|
||||
export class ActivitiProcessAttachmentsComponent implements OnInit {
|
||||
|
||||
@Input()
|
||||
processId: string;
|
||||
|
@@ -15,17 +15,17 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Component } from '@angular/core';
|
||||
import { Subscription } from 'rxjs/Rx';
|
||||
import { Location } from '@angular/common';
|
||||
import { Component, OnDestroy } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import {Location} from '@angular/common';
|
||||
import { Subscription } from 'rxjs/Rx';
|
||||
|
||||
@Component({
|
||||
selector: 'activiti-show-diagram',
|
||||
templateUrl: './activiti-show-diagram.component.html',
|
||||
styleUrls: ['./activiti-show-diagram.component.css']
|
||||
})
|
||||
export class ActivitiShowDiagramComponent {
|
||||
export class ActivitiShowDiagramComponent implements OnDestroy {
|
||||
|
||||
sub: Subscription;
|
||||
processDefinitionId: string;
|
||||
|
@@ -15,8 +15,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Component, ViewChild, Input } from '@angular/core';
|
||||
import { TaskAttachmentListComponent, ProcessUploadService } from 'ng2-activiti-tasklist';
|
||||
import { Component, Input, OnInit, ViewChild } from '@angular/core';
|
||||
import { ProcessUploadService, TaskAttachmentListComponent } from 'ng2-activiti-tasklist';
|
||||
import { UploadService } from 'ng2-alfresco-core';
|
||||
|
||||
@Component({
|
||||
@@ -28,7 +28,7 @@ import { UploadService } from 'ng2-alfresco-core';
|
||||
]
|
||||
})
|
||||
|
||||
export class ActivitiTaskAttachmentsComponent {
|
||||
export class ActivitiTaskAttachmentsComponent implements OnInit {
|
||||
|
||||
@Input()
|
||||
taskId: string;
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { Component } from '@angular/core';
|
||||
import { Router, ActivatedRoute } from '@angular/router';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { AppDefinitionRepresentationModel } from 'ng2-activiti-tasklist';
|
||||
|
||||
@Component({
|
||||
@@ -25,7 +25,7 @@ import { AppDefinitionRepresentationModel } from 'ng2-activiti-tasklist';
|
||||
<activiti-apps (appClick)="onAppClicked($event)"></activiti-apps>
|
||||
`
|
||||
})
|
||||
export class ActivitiAppsView {
|
||||
export class ActivitiAppsViewComponent {
|
||||
|
||||
constructor(private router: Router, private route: ActivatedRoute) {
|
||||
}
|
||||
|
@@ -15,7 +15,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { NgModule, Component } from '@angular/core';
|
||||
/* tslint:disable */
|
||||
|
||||
import { Component, NgModule } from '@angular/core';
|
||||
import { WidgetComponent } from 'ng2-activiti-form';
|
||||
|
||||
@Component({
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Component, OnInit, OnDestroy, AfterViewChecked } from '@angular/core';
|
||||
import { AfterViewChecked, Component, OnDestroy, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { Subscription } from 'rxjs/Rx';
|
||||
|
||||
@@ -26,7 +26,7 @@ declare var componentHandler;
|
||||
templateUrl: './form-node-viewer.component.html',
|
||||
styleUrls: ['./form-node-viewer.component.css']
|
||||
})
|
||||
export class FormNodeViewer implements OnInit, OnDestroy, AfterViewChecked {
|
||||
export class FormNodeViewerComponent implements OnInit, OnDestroy, AfterViewChecked {
|
||||
|
||||
nodeId: string;
|
||||
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Component, OnInit, OnDestroy, AfterViewChecked } from '@angular/core';
|
||||
import { AfterViewChecked, Component, OnDestroy, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { Subscription } from 'rxjs/Rx';
|
||||
|
||||
@@ -26,7 +26,7 @@ declare var componentHandler;
|
||||
templateUrl: './form-viewer.component.html',
|
||||
styleUrls: ['./form-viewer.component.css']
|
||||
})
|
||||
export class FormViewer implements OnInit, OnDestroy, AfterViewChecked {
|
||||
export class FormViewerComponent implements OnInit, OnDestroy, AfterViewChecked {
|
||||
|
||||
taskId: string;
|
||||
|
||||
|
@@ -16,8 +16,8 @@
|
||||
*/
|
||||
|
||||
import { Component, Input } from '@angular/core';
|
||||
import { ObjectDataTableAdapter, DataSorting, ObjectDataRow, ObjectDataColumn, DataCellEvent, DataRowActionEvent } from 'ng2-alfresco-datatable';
|
||||
import { AlfrescoApiService } from 'ng2-alfresco-core';
|
||||
import { DataCellEvent, DataRowActionEvent, DataSorting, ObjectDataColumn, ObjectDataRow, ObjectDataTableAdapter } from 'ng2-alfresco-datatable';
|
||||
import { Observable } from 'rxjs/Rx';
|
||||
|
||||
@Component({
|
||||
|
@@ -15,13 +15,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Component, Input, OnInit, Optional, ViewChild, ChangeDetectorRef } from '@angular/core';
|
||||
import { ActivatedRoute, Params } from '@angular/router';
|
||||
import { ChangeDetectorRef, Component, Input, OnInit, Optional, ViewChild } from '@angular/core';
|
||||
import { MdDialog } from '@angular/material';
|
||||
import { AlfrescoContentService, FolderCreatedEvent, NotificationService, FileUploadCompleteEvent, UploadService } from 'ng2-alfresco-core';
|
||||
import { ActivatedRoute, Params } from '@angular/router';
|
||||
import { AlfrescoContentService, FileUploadCompleteEvent, FolderCreatedEvent, NotificationService, UploadService } from 'ng2-alfresco-core';
|
||||
import { DocumentListComponent } from 'ng2-alfresco-documentlist';
|
||||
|
||||
import { CreateFolderDialog } from '../../dialogs/create-folder.dialog';
|
||||
import { CreateFolderDialogComponent } from '../../dialogs/create-folder.dialog';
|
||||
|
||||
import { CreateFolderDialog } from '../../dialogs/create-folder.dialog';
|
||||
|
||||
@@ -133,7 +133,7 @@ export class FilesComponent implements OnInit {
|
||||
}
|
||||
|
||||
onCreateFolderClicked(event: Event) {
|
||||
let dialogRef = this.dialog.open(CreateFolderDialog);
|
||||
let dialogRef = this.dialog.open(CreateFolderDialogComponent);
|
||||
dialogRef.afterClosed().subscribe(folderName => {
|
||||
if (folderName) {
|
||||
this.contentService.createFolder('', folderName, this.documentList.currentFolderId).subscribe(
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Component, ViewChild } from '@angular/core';
|
||||
import { AfterViewInit, Component, ViewChild } from '@angular/core';
|
||||
import { FormModel, FormService } from 'ng2-activiti-form';
|
||||
import { ActivitiForm } from 'ng2-activiti-form';
|
||||
|
||||
@@ -44,7 +44,7 @@ declare var componentHandler;
|
||||
}
|
||||
`]
|
||||
})
|
||||
export class FormListDemoComponent {
|
||||
export class FormListDemoComponent implements AfterViewInit {
|
||||
|
||||
@ViewChild(ActivitiForm)
|
||||
activitiForm: ActivitiForm;
|
||||
|
@@ -24,13 +24,13 @@ export { ActivitiDemoComponent } from './activiti/activiti-demo.component';
|
||||
export { ActivitiTaskAttachmentsComponent } from './activiti/activiti-task-attachments.component';
|
||||
export { ActivitiProcessAttachmentsComponent } from './activiti/activiti-process-attachments.component';
|
||||
export { ActivitiShowDiagramComponent } from './activiti/activiti-show-diagram.component';
|
||||
export { FormViewer } from './activiti/form-viewer.component';
|
||||
export { FormViewerComponent } from './activiti/form-viewer.component';
|
||||
export { WebscriptComponent } from './webscript/webscript.component';
|
||||
export { TagComponent } from './tag/tag.component';
|
||||
export { SocialComponent } from './social/social.component';
|
||||
export { AboutComponent } from './about/about.component';
|
||||
export { FilesComponent } from './files/files.component';
|
||||
export { FormNodeViewer } from './activiti/form-node-viewer.component';
|
||||
export { ActivitiAppsView } from './activiti/apps.view';
|
||||
export { FormNodeViewerComponent } from './activiti/form-node-viewer.component';
|
||||
export { ActivitiAppsViewComponent } from './activiti/apps.view';
|
||||
export { SettingsComponent } from './settings/settings.component';
|
||||
export { FormDemoComponent } from './form/form-demo.component';
|
||||
|
@@ -15,10 +15,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Component, ViewChild, OnInit } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { Validators } from '@angular/forms';
|
||||
import { StorageService, LogService } from 'ng2-alfresco-core';
|
||||
import { Router } from '@angular/router';
|
||||
import { LogService, StorageService } from 'ng2-alfresco-core';
|
||||
|
||||
@Component({
|
||||
selector: 'login-demo',
|
||||
|
@@ -17,8 +17,8 @@
|
||||
|
||||
import { Component, EventEmitter, Output } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { AlfrescoAuthenticationService } from 'ng2-alfresco-core';
|
||||
import { MinimalNodeEntity } from 'alfresco-js-api';
|
||||
import { AlfrescoAuthenticationService } from 'ng2-alfresco-core';
|
||||
|
||||
@Component({
|
||||
selector: 'search-bar',
|
||||
|
@@ -15,8 +15,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Component, AfterViewChecked } from '@angular/core';
|
||||
import { AlfrescoSettingsService, StorageService, LogService } from 'ng2-alfresco-core';
|
||||
import { AfterViewChecked, Component } from '@angular/core';
|
||||
import { AlfrescoSettingsService, LogService, StorageService } from 'ng2-alfresco-core';
|
||||
|
||||
declare var componentHandler: any;
|
||||
|
||||
|
@@ -39,6 +39,6 @@ import { Component } from '@angular/core';
|
||||
`
|
||||
]
|
||||
})
|
||||
export class CreateFolderDialog {
|
||||
export class CreateFolderDialogComponent {
|
||||
value: string = '';
|
||||
}
|
||||
|
@@ -15,8 +15,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||
import { enableProdMode } from '@angular/core';
|
||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||
import { AppModule } from './app.module';
|
||||
|
||||
if (process.env.ENV === 'production') {
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { NgModule } from '@angular/core';
|
||||
import { MdSlideToggleModule, MdInputModule, MdSelectModule, MdDialogModule } from '@angular/material';
|
||||
import { MdDialogModule, MdInputModule, MdSelectModule, MdSlideToggleModule } from '@angular/material';
|
||||
|
||||
const MATERIAL_MODULES = [
|
||||
MdSlideToggleModule,
|
||||
|
@@ -1,3 +1,5 @@
|
||||
/* tslint:disable */
|
||||
|
||||
import 'core-js/es6';
|
||||
import 'core-js/es7/reflect';
|
||||
import 'intl';
|
||||
|
@@ -16,10 +16,10 @@
|
||||
*/
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs/Rx';
|
||||
import { EcmModelService, FormFieldOption, FormService } from 'ng2-activiti-form';
|
||||
import { AlfrescoApiService, LogService } from 'ng2-alfresco-core';
|
||||
import { FormService, EcmModelService, FormFieldOption } from 'ng2-activiti-form';
|
||||
import { AppConfigService } from 'ng2-alfresco-core';
|
||||
import { Observable } from 'rxjs/Rx';
|
||||
|
||||
interface ActivitiData {
|
||||
rest: {
|
||||
|
@@ -1,9 +1,11 @@
|
||||
/* tslint:disable */
|
||||
|
||||
// Angular
|
||||
import '@angular/common';
|
||||
import '@angular/core';
|
||||
import '@angular/http';
|
||||
import '@angular/platform-browser';
|
||||
import '@angular/platform-browser-dynamic';
|
||||
import '@angular/core';
|
||||
import '@angular/common';
|
||||
import '@angular/http';
|
||||
import '@angular/router';
|
||||
|
||||
// RxJS
|
||||
@@ -14,22 +16,22 @@ import 'hammerjs';
|
||||
|
||||
// Alfresco
|
||||
import 'alfresco-js-api';
|
||||
import 'ng2-alfresco-core';
|
||||
import 'ng2-alfresco-datatable';
|
||||
import 'ng2-activiti-diagrams';
|
||||
import 'ng2-activiti-analytics';
|
||||
import 'ng2-activiti-diagrams';
|
||||
import 'ng2-activiti-form';
|
||||
import 'ng2-activiti-processlist';
|
||||
import 'ng2-activiti-tasklist';
|
||||
import 'ng2-alfresco-core';
|
||||
import 'ng2-alfresco-datatable';
|
||||
import 'ng2-alfresco-documentlist';
|
||||
import 'ng2-alfresco-login';
|
||||
import 'ng2-alfresco-search';
|
||||
import 'ng2-alfresco-tag';
|
||||
import 'ng2-alfresco-social';
|
||||
import 'ng2-alfresco-tag';
|
||||
import 'ng2-alfresco-upload';
|
||||
import 'ng2-alfresco-userinfo';
|
||||
import 'ng2-alfresco-viewer';
|
||||
import 'ng2-alfresco-webscript';
|
||||
import 'ng2-alfresco-userinfo';
|
||||
|
||||
// Polyfill(s) for dialogs
|
||||
require('script-loader!dialog-polyfill/dialog-polyfill');
|
||||
@@ -39,18 +41,18 @@ import 'dialog-polyfill/dialog-polyfill.css';
|
||||
import '@angular/material/prebuilt-themes/indigo-pink.css';
|
||||
|
||||
// Google Material Design Lite
|
||||
import 'material-design-lite/material.js';
|
||||
import 'material-design-lite/dist/material.orange-blue.min.css';
|
||||
import 'material-design-icons/iconfont/material-icons.css';
|
||||
import 'material-design-lite/dist/material.orange-blue.min.css';
|
||||
import 'material-design-lite/material.js';
|
||||
|
||||
import '../public/css/app.css';
|
||||
import '../public/css/muli-font.css';
|
||||
|
||||
import 'ng2-activiti-form/stencils/runtime.ng1';
|
||||
import 'ng2-activiti-form/stencils/runtime.adf';
|
||||
import 'ng2-activiti-form/stencils/runtime.ng1';
|
||||
|
||||
import 'ng2-charts';
|
||||
import 'chart.js';
|
||||
import 'ng2-charts';
|
||||
require('script-loader!raphael/raphael.min.js');
|
||||
|
||||
require('script-loader!moment/min/moment.min.js');
|
||||
@@ -73,5 +75,5 @@ require('pdfjs-dist/web/pdf_viewer.js');
|
||||
require('three/build/three.min.js');
|
||||
|
||||
// 3D viewer
|
||||
import 'three';
|
||||
import 'ng2-3d-editor';
|
||||
import 'three';
|
||||
|
@@ -33,7 +33,8 @@ module.exports = {
|
||||
loader: 'tslint-loader',
|
||||
include: [helpers.root('app')],
|
||||
options: {
|
||||
emitErrors: true
|
||||
emitErrors: true,
|
||||
fix: true
|
||||
},
|
||||
exclude: [/node_modules/, /public/, /resources/, /dist/]
|
||||
},
|
||||
|
@@ -1,118 +1,157 @@
|
||||
{
|
||||
"rules": {
|
||||
"align": [
|
||||
true,
|
||||
"parameters",
|
||||
"statements"
|
||||
"rulesDirectory": [
|
||||
"node_modules/codelyzer"
|
||||
],
|
||||
"ban": false,
|
||||
"class-name": true,
|
||||
"comment-format": [
|
||||
true,
|
||||
"check-space"
|
||||
],
|
||||
"curly": true,
|
||||
"eofline": true,
|
||||
"forin": true,
|
||||
"indent": [
|
||||
true,
|
||||
"spaces"
|
||||
],
|
||||
"interface-name": false,
|
||||
"jsdoc-format": true,
|
||||
"label-position": true,
|
||||
"max-line-length": [
|
||||
true,
|
||||
180
|
||||
],
|
||||
"member-ordering": [
|
||||
true,
|
||||
"static-before-instance",
|
||||
"variables-before-functions"
|
||||
],
|
||||
"no-any": false,
|
||||
"no-arg": true,
|
||||
"no-bitwise": false,
|
||||
"no-conditional-assignment": true,
|
||||
"no-consecutive-blank-lines": true,
|
||||
"no-console": [
|
||||
true,
|
||||
"debug",
|
||||
"info",
|
||||
"time",
|
||||
"timeEnd",
|
||||
"trace"
|
||||
],
|
||||
"no-construct": true,
|
||||
"no-constructor-vars": false,
|
||||
"no-debugger": true,
|
||||
"no-duplicate-variable": true,
|
||||
"no-empty": false,
|
||||
"no-eval": true,
|
||||
"no-inferrable-types": false,
|
||||
"no-internal-module": true,
|
||||
"no-require-imports": false,
|
||||
"no-shadowed-variable": true,
|
||||
"no-switch-case-fall-through": true,
|
||||
"no-trailing-whitespace": true,
|
||||
"no-unused-expression": true,
|
||||
"no-unused-variable": true,
|
||||
"no-use-before-declare": true,
|
||||
"no-var-keyword": true,
|
||||
"no-var-requires": false,
|
||||
"object-literal-sort-keys": false,
|
||||
"one-line": [
|
||||
true,
|
||||
"check-open-brace",
|
||||
"check-catch",
|
||||
"check-else",
|
||||
"check-whitespace"
|
||||
],
|
||||
"quotemark": [
|
||||
true,
|
||||
"single",
|
||||
"avoid-escape"
|
||||
],
|
||||
"radix": true,
|
||||
"semicolon": true,
|
||||
"switch-default": true,
|
||||
"trailing-comma": [
|
||||
true,
|
||||
{
|
||||
"multiline": "never",
|
||||
"singleline": "never"
|
||||
}
|
||||
],
|
||||
"triple-equals": [
|
||||
true,
|
||||
"allow-null-check"
|
||||
],
|
||||
"typedef": false,
|
||||
"typedef-whitespace": [
|
||||
true,
|
||||
{
|
||||
"call-signature": "nospace",
|
||||
"index-signature": "nospace",
|
||||
"parameter": "nospace",
|
||||
"property-declaration": "nospace",
|
||||
"variable-declaration": "nospace"
|
||||
}
|
||||
],
|
||||
"use-strict": false,
|
||||
"variable-name": [
|
||||
true,
|
||||
"check-format",
|
||||
"allow-leading-underscore",
|
||||
"ban-keywords"
|
||||
],
|
||||
"whitespace": [
|
||||
true,
|
||||
"check-branch",
|
||||
"check-operator",
|
||||
"check-separator",
|
||||
"check-type",
|
||||
"check-module",
|
||||
"check-decl"
|
||||
]
|
||||
}
|
||||
"rules": {
|
||||
"align": [
|
||||
true,
|
||||
"parameters",
|
||||
"statements"
|
||||
],
|
||||
"ban": false,
|
||||
"class-name": true,
|
||||
"comment-format": [
|
||||
true,
|
||||
"check-space"
|
||||
],
|
||||
"curly": true,
|
||||
"eofline": true,
|
||||
"forin": true,
|
||||
"indent": [
|
||||
true,
|
||||
"spaces"
|
||||
],
|
||||
"interface-name": false,
|
||||
"jsdoc-format": true,
|
||||
"label-position": true,
|
||||
"max-line-length": [
|
||||
true,
|
||||
180
|
||||
],
|
||||
"member-ordering": [
|
||||
true,
|
||||
"static-before-instance",
|
||||
"variables-before-functions"
|
||||
],
|
||||
"no-any": false,
|
||||
"no-arg": true,
|
||||
"no-bitwise": false,
|
||||
"no-conditional-assignment": true,
|
||||
"no-consecutive-blank-lines": true,
|
||||
"no-console": [
|
||||
true,
|
||||
"debug",
|
||||
"info",
|
||||
"time",
|
||||
"timeEnd",
|
||||
"trace"
|
||||
],
|
||||
"no-construct": true,
|
||||
"no-constructor-vars": false,
|
||||
"no-debugger": true,
|
||||
"no-duplicate-variable": true,
|
||||
"no-empty": false,
|
||||
"no-eval": true,
|
||||
"no-inferrable-types": false,
|
||||
"no-internal-module": true,
|
||||
"no-require-imports": false,
|
||||
"no-shadowed-variable": true,
|
||||
"no-switch-case-fall-through": true,
|
||||
"no-trailing-whitespace": true,
|
||||
"no-unused-expression": true,
|
||||
"no-unused-variable": true,
|
||||
"no-use-before-declare": true,
|
||||
"no-var-keyword": true,
|
||||
"no-var-requires": true,
|
||||
"object-literal-sort-keys": false,
|
||||
"one-line": [
|
||||
true,
|
||||
"check-open-brace",
|
||||
"check-catch",
|
||||
"check-else",
|
||||
"check-whitespace"
|
||||
],
|
||||
"quotemark": [
|
||||
true,
|
||||
"single",
|
||||
"avoid-escape"
|
||||
],
|
||||
"radix": true,
|
||||
"semicolon": true,
|
||||
"switch-default": true,
|
||||
"trailing-comma": [
|
||||
true,
|
||||
{
|
||||
"multiline": "never",
|
||||
"singleline": "never"
|
||||
}
|
||||
],
|
||||
"triple-equals": [
|
||||
true,
|
||||
"allow-null-check"
|
||||
],
|
||||
"typedef": false,
|
||||
"typedef-whitespace": [
|
||||
true,
|
||||
{
|
||||
"call-signature": "nospace",
|
||||
"index-signature": "nospace",
|
||||
"parameter": "nospace",
|
||||
"property-declaration": "nospace",
|
||||
"variable-declaration": "nospace"
|
||||
}
|
||||
],
|
||||
"use-strict": false,
|
||||
"variable-name": [
|
||||
true,
|
||||
"check-format",
|
||||
"allow-leading-underscore",
|
||||
"ban-keywords"
|
||||
],
|
||||
"callable-types": true,
|
||||
"import-blacklist": [
|
||||
true,
|
||||
"rxjs"
|
||||
],
|
||||
"import-spacing": true,
|
||||
"interface-over-type-literal": true,
|
||||
"member-access": false,
|
||||
"no-empty-interface": true,
|
||||
"no-string-literal": false,
|
||||
"no-string-throw": true,
|
||||
"prefer-const": false,
|
||||
"typeof-compare": true,
|
||||
"unified-signatures": true,
|
||||
"whitespace": [
|
||||
true,
|
||||
"check-branch",
|
||||
"check-decl",
|
||||
"check-operator",
|
||||
"check-separator",
|
||||
"check-type"
|
||||
],
|
||||
"directive-selector": [
|
||||
true,
|
||||
"attribute",
|
||||
"app",
|
||||
"camelCase"
|
||||
],
|
||||
"component-selector": [
|
||||
true,
|
||||
"element",
|
||||
"app",
|
||||
"kebab-case"
|
||||
],
|
||||
"ordered-imports": true,
|
||||
"use-input-property-decorator": true,
|
||||
"use-output-property-decorator": true,
|
||||
"use-host-property-decorator": true,
|
||||
"use-life-cycle-interface": true,
|
||||
"use-pipe-transform-interface": true,
|
||||
"component-class-suffix": true,
|
||||
"directive-class-suffix": true,
|
||||
"no-access-missing-member": false,
|
||||
"templates-use-public": true,
|
||||
"invoke-injectable": true
|
||||
}
|
||||
}
|
||||
|
@@ -42,7 +42,8 @@ module.exports = {
|
||||
loader: 'tslint-loader',
|
||||
options: {
|
||||
emitErrors: true,
|
||||
failOnHint: true
|
||||
failOnHint: true,
|
||||
fix: true
|
||||
},
|
||||
exclude: [/node_modules/, /bundles/, /dist/, /demo/]
|
||||
},
|
||||
|
@@ -57,7 +57,7 @@ let customResolver: ComponentTypeResolver = (field: FormFieldModel): Type<{}> =>
|
||||
if (field) {
|
||||
let params = field.params;
|
||||
}
|
||||
return UnknownWidget;
|
||||
return UnknownWidgetComponent;
|
||||
};
|
||||
formRenderingService.setComponentTypeResolver('text', customResolver, true);
|
||||
```
|
||||
@@ -66,25 +66,25 @@ formRenderingService.setComponentTypeResolver('text', customResolver, true);
|
||||
|
||||
Stencil Name | Field Type | Component Type |
|
||||
| --- | --- | --- |
|
||||
| Text | text | TextWidget |
|
||||
| Number | integer | NumberWidget |
|
||||
| Multi-line text | multi-line-text | MultilineTextWidget |
|
||||
| Checkbox | boolean | CheckboxWidget |
|
||||
| Dropdown | dropdown | DropdownWidget |
|
||||
| Date | date | DateWidget |
|
||||
| Amount | amount | AmountWidget |
|
||||
| Radio buttons | radio-buttons | RadioButtonsWidget |
|
||||
| Hyperlink | hyperlink | HyperlinkWidget |
|
||||
| Display value | readonly | DisplayValueWidget |
|
||||
| Display text | readonly-text | DisplayTextWidget |
|
||||
| Typeahead | typeahead | TypeaheadWidget |
|
||||
| People | people | PeopleWidget |
|
||||
| Group of people | functional-group | FunctionalGroupWidget |
|
||||
| Dynamic table | dynamic-table | DynamicTableWidget |
|
||||
| N/A | container | ContainerWidget (layout component) |
|
||||
| Header | group | ContainerWidget |
|
||||
| Attach | upload | AttachWidget or UploadWidget (based on metadata) |
|
||||
| N/A | N/A | UnknownWidget |
|
||||
| Text | text | TextWidgetComponent |
|
||||
| Number | integer | NumberWidgetComponent |
|
||||
| Multi-line text | multi-line-text | MultilineTextWidgetComponentComponent |
|
||||
| Checkbox | boolean | CheckboxWidgetComponent |
|
||||
| Dropdown | dropdown | DropdownWidgetComponent |
|
||||
| Date | date | DateWidgetComponent |
|
||||
| Amount | amount | AmountWidgetComponent |
|
||||
| Radio buttons | radio-buttons | RadioButtonsWidgetComponent |
|
||||
| Hyperlink | hyperlink | HyperlinkWidgetComponent |
|
||||
| Display value | readonly | DisplayValueWidgetComponent |
|
||||
| Display text | readonly-text | DisplayTextWidgetComponentComponent |
|
||||
| Typeahead | typeahead | TypeaheadWidgetComponent |
|
||||
| People | people | PeopleWidgetComponent |
|
||||
| Group of people | functional-group | FunctionalGroupWidgetComponent |
|
||||
| Dynamic table | dynamic-table | DynamicTableWidgetComponent |
|
||||
| N/A | container | ContainerWidgetComponent (layout component) |
|
||||
| Header | group | ContainerWidgetComponent |
|
||||
| Attach | upload | AttachWidgetComponent or UploadWidgetComponent (based on metadata) |
|
||||
| N/A | N/A | UnknownWidgetComponent |
|
||||
|
||||
|
||||
|
||||
|
@@ -20,10 +20,10 @@ import { HttpModule } from '@angular/http';
|
||||
import { MdButtonModule, MdCardModule, MdCheckboxModule, MdIconModule, MdInputModule, MdSlideToggleModule, MdTabsModule } from '@angular/material';
|
||||
import { CoreModule } from 'ng2-alfresco-core';
|
||||
import { DataTableModule } from 'ng2-alfresco-datatable';
|
||||
import { ActivitiContent } from './src/components/activiti-content.component';
|
||||
import { ActivitiContentComponent } from './src/components/activiti-content.component';
|
||||
import { ActivitiForm } from './src/components/activiti-form.component';
|
||||
import { ActivitiStartForm } from './src/components/activiti-start-form.component';
|
||||
import { ADFFormList } from './src/components/adf-form-list.component';
|
||||
import { ActivitiStartFormComponent } from './src/components/activiti-start-form.component';
|
||||
import { ADFFormListComponent } from './src/components/adf-form-list.component';
|
||||
import { FormFieldComponent } from './src/components/form-field/form-field.component';
|
||||
import { MASK_DIRECTIVE, WIDGET_DIRECTIVES } from './src/components/widgets/index';
|
||||
import { ActivitiAlfrescoContentService } from './src/services/activiti-alfresco.service';
|
||||
@@ -48,9 +48,9 @@ export * from './src/events/index';
|
||||
|
||||
export const ACTIVITI_FORM_DIRECTIVES: any[] = [
|
||||
ActivitiForm,
|
||||
ADFFormList,
|
||||
ActivitiContent,
|
||||
ActivitiStartForm,
|
||||
ADFFormListComponent,
|
||||
ActivitiContentComponent,
|
||||
ActivitiStartFormComponent,
|
||||
FormFieldComponent,
|
||||
...WIDGET_DIRECTIVES
|
||||
];
|
||||
|
@@ -24,15 +24,15 @@ import { Observable } from 'rxjs/Rx';
|
||||
|
||||
import { FormService } from '../services/form.service';
|
||||
import { EcmModelService } from './../services/ecm-model.service';
|
||||
import { ActivitiContent } from './activiti-content.component';
|
||||
import { ActivitiContentComponent } from './activiti-content.component';
|
||||
import { ContentLinkModel } from './widgets/index';
|
||||
|
||||
declare let jasmine: any;
|
||||
|
||||
describe('ActivitiContent', () => {
|
||||
describe('ActivitiContentComponent', () => {
|
||||
|
||||
let component: ActivitiContent;
|
||||
let fixture: ComponentFixture<ActivitiContent>;
|
||||
let component: ActivitiContentComponent;
|
||||
let fixture: ComponentFixture<ActivitiContentComponent>;
|
||||
let debug: DebugElement;
|
||||
let element: HTMLElement;
|
||||
|
||||
@@ -71,7 +71,7 @@ describe('ActivitiContent', () => {
|
||||
CoreModule.forRoot()
|
||||
],
|
||||
declarations: [
|
||||
ActivitiContent
|
||||
ActivitiContentComponent
|
||||
],
|
||||
providers: [
|
||||
FormService,
|
||||
@@ -96,7 +96,7 @@ describe('ActivitiContent', () => {
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(ActivitiContent);
|
||||
fixture = TestBed.createComponent(ActivitiContentComponent);
|
||||
component = fixture.componentInstance;
|
||||
debug = fixture.debugElement;
|
||||
element = fixture.nativeElement;
|
||||
|
@@ -26,7 +26,7 @@ import { ContentLinkModel } from './widgets/core/content-link.model';
|
||||
templateUrl: './activiti-content.component.html',
|
||||
styleUrls: ['./activiti-content.component.css']
|
||||
})
|
||||
export class ActivitiContent implements OnChanges {
|
||||
export class ActivitiContentComponent implements OnChanges {
|
||||
|
||||
@Input()
|
||||
id: string;
|
||||
|
@@ -653,7 +653,7 @@ describe('ActivitiForm', () => {
|
||||
/*
|
||||
it('should update the visibility when the container raise the change event', (valueChanged) => {
|
||||
spyOn(formComponent, 'checkVisibility').and.callThrough();
|
||||
let widget = new ContainerWidget();
|
||||
let widget = new ContainerWidgetComponent();
|
||||
let fakeForm = new FormModel();
|
||||
let fakeField = new FormFieldModel(fakeForm, {id: 'fakeField', value: 'fakeValue'});
|
||||
widget.formValueChanged.subscribe(field => { valueChanged(); });
|
||||
|
@@ -15,6 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/* tslint:disable */
|
||||
import { AfterViewChecked, Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core';
|
||||
import { LogService } from 'ng2-alfresco-core';
|
||||
import { FormErrorEvent, FormEvent } from './../events/index';
|
||||
|
@@ -26,8 +26,8 @@ import { TranslationMock } from './../assets/translation.service.mock';
|
||||
import { EcmModelService } from './../services/ecm-model.service';
|
||||
import { FormService } from './../services/form.service';
|
||||
import { WidgetVisibilityService } from './../services/widget-visibility.service';
|
||||
import { ActivitiContent } from './activiti-content.component';
|
||||
import { ActivitiStartForm } from './activiti-start-form.component';
|
||||
import { ActivitiContentComponent } from './activiti-content.component';
|
||||
import { ActivitiStartFormComponent } from './activiti-start-form.component';
|
||||
import { FormFieldComponent } from './form-field/form-field.component';
|
||||
import { MASK_DIRECTIVE } from './widgets/index';
|
||||
import { WIDGET_DIRECTIVES } from './widgets/index';
|
||||
@@ -36,8 +36,8 @@ describe('ActivitiStartForm', () => {
|
||||
|
||||
let componentHandler: any;
|
||||
let formService: FormService;
|
||||
let component: ActivitiStartForm;
|
||||
let fixture: ComponentFixture<ActivitiStartForm>;
|
||||
let component: ActivitiStartFormComponent;
|
||||
let fixture: ComponentFixture<ActivitiStartFormComponent>;
|
||||
let getStartFormSpy: jasmine.Spy;
|
||||
|
||||
const exampleId1 = 'my:process1';
|
||||
@@ -50,9 +50,9 @@ describe('ActivitiStartForm', () => {
|
||||
MdInputModule,
|
||||
CoreModule.forRoot()],
|
||||
declarations: [
|
||||
ActivitiStartForm,
|
||||
ActivitiStartFormComponent,
|
||||
FormFieldComponent,
|
||||
ActivitiContent,
|
||||
ActivitiContentComponent,
|
||||
...WIDGET_DIRECTIVES,
|
||||
...MASK_DIRECTIVE
|
||||
],
|
||||
@@ -67,7 +67,7 @@ describe('ActivitiStartForm', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
fixture = TestBed.createComponent(ActivitiStartForm);
|
||||
fixture = TestBed.createComponent(ActivitiStartFormComponent);
|
||||
component = fixture.componentInstance;
|
||||
formService = fixture.debugElement.injector.get(FormService);
|
||||
|
||||
|
@@ -15,20 +15,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {
|
||||
AfterViewChecked,
|
||||
Component,
|
||||
ElementRef,
|
||||
EventEmitter,
|
||||
Input,
|
||||
OnChanges,
|
||||
Output,
|
||||
SimpleChanges,
|
||||
ViewChild
|
||||
} from '@angular/core';
|
||||
import { Component, ElementRef, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges, ViewChild } from '@angular/core';
|
||||
import { AlfrescoTranslationService, LogService } from 'ng2-alfresco-core';
|
||||
import { FormService } from './../services/form.service';
|
||||
import { WidgetVisibilityService } from './../services/widget-visibility.service';
|
||||
import { WidgetVisibilityService } from './../services/widget-visibility.service';
|
||||
import { ActivitiForm } from './activiti-form.component';
|
||||
import { ContentLinkModel } from './widgets/core/content-link.model';
|
||||
import { FormOutcomeModel } from './widgets/core/index';
|
||||
@@ -55,7 +45,7 @@ import { FormOutcomeModel } from './widgets/core/index';
|
||||
templateUrl: './activiti-start-form.component.html',
|
||||
styleUrls: ['./activiti-form.component.css']
|
||||
})
|
||||
export class ActivitiStartForm extends ActivitiForm implements AfterViewChecked, OnChanges {
|
||||
export class ActivitiStartFormComponent extends ActivitiForm implements OnChanges, OnInit {
|
||||
|
||||
@Input()
|
||||
processDefinitionId: string;
|
||||
|
@@ -22,14 +22,14 @@ import { DataTableModule } from 'ng2-alfresco-datatable';
|
||||
import { Observable } from 'rxjs/Rx';
|
||||
import { EcmModelService } from '../services/ecm-model.service';
|
||||
import { FormService } from '../services/form.service';
|
||||
import { ADFFormList } from './adf-form-list.component';
|
||||
import { ADFFormListComponent } from './adf-form-list.component';
|
||||
|
||||
declare let jasmine: any;
|
||||
|
||||
describe('TaskAttachmentList', () => {
|
||||
|
||||
let component: ADFFormList;
|
||||
let fixture: ComponentFixture<ADFFormList>;
|
||||
let component: ADFFormListComponent;
|
||||
let fixture: ComponentFixture<ADFFormListComponent>;
|
||||
let service: FormService;
|
||||
let componentHandler: any;
|
||||
|
||||
@@ -40,7 +40,7 @@ describe('TaskAttachmentList', () => {
|
||||
DataTableModule
|
||||
],
|
||||
declarations: [
|
||||
ADFFormList
|
||||
ADFFormListComponent
|
||||
],
|
||||
providers: [
|
||||
FormService,
|
||||
@@ -63,7 +63,7 @@ describe('TaskAttachmentList', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
|
||||
fixture = TestBed.createComponent(ADFFormList);
|
||||
fixture = TestBed.createComponent(ADFFormListComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
service = TestBed.get(FormService);
|
||||
|
@@ -24,7 +24,7 @@ import { FormService } from './../services/form.service';
|
||||
templateUrl: './adf-form-list.component.html',
|
||||
styleUrls: ['./adf-form-list.component.css']
|
||||
})
|
||||
export class ADFFormList implements OnChanges {
|
||||
export class ADFFormListComponent implements OnChanges {
|
||||
|
||||
@Input()
|
||||
forms: any [] = [];
|
||||
|
@@ -19,10 +19,10 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { CoreModule } from 'ng2-alfresco-core';
|
||||
import { FormRenderingService } from './../../services/form-rendering.service';
|
||||
import { WidgetVisibilityService } from './../../services/widget-visibility.service';
|
||||
import { CheckboxWidget } from './../widgets/checkbox/checkbox.widget';
|
||||
import { CheckboxWidgetComponent } from './../widgets/checkbox/checkbox.widget';
|
||||
import { FormFieldModel, FormFieldTypes, FormModel } from './../widgets/core/index';
|
||||
import { InputMaskDirective } from './../widgets/text/text-mask.component';
|
||||
import { TextWidget } from './../widgets/text/text.widget';
|
||||
import { TextWidgetComponent } from './../widgets/text/text.widget';
|
||||
import { FormFieldComponent } from './form-field.component';
|
||||
|
||||
describe('FormFieldComponent', () => {
|
||||
@@ -37,7 +37,7 @@ describe('FormFieldComponent', () => {
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreModule],
|
||||
declarations: [FormFieldComponent, TextWidget, CheckboxWidget, InputMaskDirective],
|
||||
declarations: [FormFieldComponent, TextWidgetComponent, CheckboxWidgetComponent, InputMaskDirective],
|
||||
providers: [
|
||||
FormRenderingService,
|
||||
WidgetVisibilityService
|
||||
@@ -68,7 +68,7 @@ describe('FormFieldComponent', () => {
|
||||
fixture.detectChanges();
|
||||
|
||||
expect(component.componentRef).toBeDefined();
|
||||
expect(component.componentRef.componentType).toBe(TextWidget);
|
||||
expect(component.componentRef.componentType).toBe(TextWidgetComponent);
|
||||
});
|
||||
|
||||
xit('should create custom component instance', () => {
|
||||
@@ -76,12 +76,12 @@ describe('FormFieldComponent', () => {
|
||||
type: FormFieldTypes.TEXT
|
||||
});
|
||||
|
||||
formRenderingService.setComponentTypeResolver(FormFieldTypes.TEXT, () => CheckboxWidget, true);
|
||||
formRenderingService.setComponentTypeResolver(FormFieldTypes.TEXT, () => CheckboxWidgetComponent, true);
|
||||
component.field = field;
|
||||
fixture.detectChanges();
|
||||
|
||||
expect(component.componentRef).toBeDefined();
|
||||
expect(component.componentRef.componentType).toBe(CheckboxWidget);
|
||||
expect(component.componentRef.componentType).toBe(CheckboxWidgetComponent);
|
||||
});
|
||||
|
||||
it('should require field to create component', () => {
|
||||
|
@@ -22,12 +22,12 @@ import { ActivitiAlfrescoContentService } from '../../../services/activiti-alfre
|
||||
import { EcmModelService } from './../../../services/ecm-model.service';
|
||||
import { FormService } from './../../../services/form.service';
|
||||
import { FormFieldModel } from './../core/form-field.model';
|
||||
import { AmountWidget } from './amount.widget';
|
||||
import { AmountWidgetComponent } from './amount.widget';
|
||||
|
||||
describe('AmountWidget', () => {
|
||||
describe('AmountWidgetComponent', () => {
|
||||
|
||||
let widget: AmountWidget;
|
||||
let fixture: ComponentFixture<AmountWidget>;
|
||||
let widget: AmountWidgetComponent;
|
||||
let fixture: ComponentFixture<AmountWidgetComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
@@ -36,7 +36,7 @@ describe('AmountWidget', () => {
|
||||
MdInputModule
|
||||
],
|
||||
declarations: [
|
||||
AmountWidget
|
||||
AmountWidgetComponent
|
||||
],
|
||||
providers: [
|
||||
FormService,
|
||||
@@ -47,7 +47,7 @@ describe('AmountWidget', () => {
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(AmountWidget);
|
||||
fixture = TestBed.createComponent(AmountWidgetComponent);
|
||||
|
||||
widget = fixture.componentInstance;
|
||||
});
|
||||
@@ -65,7 +65,7 @@ describe('AmountWidget', () => {
|
||||
it('should setup default currency', () => {
|
||||
widget.field = null;
|
||||
widget.ngOnInit();
|
||||
expect(widget.currency).toBe(AmountWidget.DEFAULT_CURRENCY);
|
||||
expect(widget.currency).toBe(AmountWidgetComponent.DEFAULT_CURRENCY);
|
||||
});
|
||||
|
||||
});
|
||||
|
@@ -25,11 +25,11 @@ import { baseHost , WidgetComponent } from './../widget.component';
|
||||
styleUrls: ['./amount.widget.css'],
|
||||
host: baseHost
|
||||
})
|
||||
export class AmountWidget extends WidgetComponent implements OnInit {
|
||||
export class AmountWidgetComponent extends WidgetComponent implements OnInit {
|
||||
|
||||
static DEFAULT_CURRENCY: string = '$';
|
||||
|
||||
currency: string = AmountWidget.DEFAULT_CURRENCY;
|
||||
currency: string = AmountWidgetComponent.DEFAULT_CURRENCY;
|
||||
|
||||
constructor(public formService: FormService) {
|
||||
super(formService);
|
||||
|
@@ -25,12 +25,12 @@ import { FormFieldTypes } from '../core/form-field-types';
|
||||
import { EcmModelService } from './../../../services/ecm-model.service';
|
||||
import { FormService } from './../../../services/form.service';
|
||||
import { FormFieldModel } from './../core/form-field.model';
|
||||
import { AttachWidget } from './attach.widget';
|
||||
import { AttachWidgetComponent } from './attach.widget';
|
||||
|
||||
describe('AttachWidget', () => {
|
||||
describe('AttachWidgetComponent', () => {
|
||||
|
||||
let widget: AttachWidget;
|
||||
let fixture: ComponentFixture<AttachWidget>;
|
||||
let widget: AttachWidgetComponent;
|
||||
let fixture: ComponentFixture<AttachWidgetComponent>;
|
||||
let element: HTMLElement;
|
||||
let contentService: ActivitiAlfrescoContentService;
|
||||
let dialogPolyfill: any;
|
||||
@@ -41,7 +41,7 @@ describe('AttachWidget', () => {
|
||||
CoreModule.forRoot()
|
||||
],
|
||||
declarations: [
|
||||
AttachWidget
|
||||
AttachWidgetComponent
|
||||
],
|
||||
providers: [
|
||||
FormService,
|
||||
@@ -52,7 +52,7 @@ describe('AttachWidget', () => {
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(AttachWidget);
|
||||
fixture = TestBed.createComponent(AttachWidgetComponent);
|
||||
contentService = TestBed.get(ActivitiAlfrescoContentService);
|
||||
|
||||
element = fixture.nativeElement;
|
||||
|
@@ -31,7 +31,7 @@ declare let dialogPolyfill: any;
|
||||
templateUrl: './attach.widget.html',
|
||||
styleUrls: ['./attach.widget.css'], host: baseHost
|
||||
})
|
||||
export class AttachWidget extends WidgetComponent implements OnInit {
|
||||
export class AttachWidgetComponent extends WidgetComponent implements OnInit {
|
||||
|
||||
selectedFolderPathId: string;
|
||||
selectedFolderSiteId: string;
|
||||
|
@@ -25,7 +25,7 @@ import { baseHost , WidgetComponent} from './../widget.component';
|
||||
templateUrl: './checkbox.widget.html',
|
||||
host: baseHost
|
||||
})
|
||||
export class CheckboxWidget extends WidgetComponent {
|
||||
export class CheckboxWidgetComponent extends WidgetComponent {
|
||||
|
||||
constructor(private visibilityService: WidgetVisibilityService, public formService: FormService) {
|
||||
super(formService);
|
||||
|
@@ -18,19 +18,19 @@
|
||||
import { FormFieldTypes } from './../core/form-field-types';
|
||||
import { FormFieldModel } from './../core/form-field.model';
|
||||
import { FormModel } from './../core/form.model';
|
||||
import { ContainerWidgetModel } from './container.widget.model';
|
||||
import { ContainerWidgetComponentModel } from './container.widget.model';
|
||||
|
||||
describe('ContainerWidgetModel', () => {
|
||||
describe('ContainerWidgetComponentModel', () => {
|
||||
|
||||
it('should store the form reference', () => {
|
||||
let form = new FormModel();
|
||||
let field = new FormFieldModel(form);
|
||||
let model = new ContainerWidgetModel(field);
|
||||
let model = new ContainerWidgetComponentModel(field);
|
||||
expect(model.form).toBe(form);
|
||||
});
|
||||
|
||||
it('should be expanded by default', () => {
|
||||
let container = new ContainerWidgetModel(null);
|
||||
let container = new ContainerWidgetComponentModel(null);
|
||||
expect(container.isExpanded).toBeTruthy();
|
||||
});
|
||||
|
||||
@@ -60,7 +60,7 @@ describe('ContainerWidgetModel', () => {
|
||||
|
||||
let field = new FormFieldModel(form, json);
|
||||
|
||||
let container = new ContainerWidgetModel(field);
|
||||
let container = new ContainerWidgetComponentModel(field);
|
||||
expect(container.columns.length).toBe(3);
|
||||
|
||||
let col1 = container.columns[0];
|
||||
@@ -77,7 +77,7 @@ describe('ContainerWidgetModel', () => {
|
||||
});
|
||||
|
||||
it('should allow collapsing only when of a group type', () => {
|
||||
let container = new ContainerWidgetModel(new FormFieldModel(new FormModel(), {
|
||||
let container = new ContainerWidgetComponentModel(new FormFieldModel(new FormModel(), {
|
||||
type: FormFieldTypes.CONTAINER,
|
||||
params: {
|
||||
allowCollapse: true
|
||||
@@ -85,7 +85,7 @@ describe('ContainerWidgetModel', () => {
|
||||
}));
|
||||
|
||||
expect(container.isCollapsible()).toBeFalsy();
|
||||
container = new ContainerWidgetModel(new FormFieldModel(new FormModel(), {
|
||||
container = new ContainerWidgetComponentModel(new FormFieldModel(new FormModel(), {
|
||||
type: FormFieldTypes.GROUP,
|
||||
params: {
|
||||
allowCollapse: true
|
||||
@@ -95,13 +95,13 @@ describe('ContainerWidgetModel', () => {
|
||||
});
|
||||
|
||||
it('should allow collapsing only when explicitly defined in params', () => {
|
||||
let container = new ContainerWidgetModel(new FormFieldModel(new FormModel(), {
|
||||
let container = new ContainerWidgetComponentModel(new FormFieldModel(new FormModel(), {
|
||||
type: FormFieldTypes.GROUP,
|
||||
params: {}
|
||||
}));
|
||||
expect(container.isCollapsible()).toBeFalsy();
|
||||
|
||||
container = new ContainerWidgetModel(new FormFieldModel(new FormModel(), {
|
||||
container = new ContainerWidgetComponentModel(new FormFieldModel(new FormModel(), {
|
||||
type: FormFieldTypes.GROUP,
|
||||
params: {
|
||||
allowCollapse: true
|
||||
@@ -111,7 +111,7 @@ describe('ContainerWidgetModel', () => {
|
||||
});
|
||||
|
||||
it('should be collapsed by default', () => {
|
||||
let container = new ContainerWidgetModel(new FormFieldModel(new FormModel(), {
|
||||
let container = new ContainerWidgetComponentModel(new FormFieldModel(new FormModel(), {
|
||||
type: FormFieldTypes.GROUP,
|
||||
params: {
|
||||
allowCollapse: true,
|
||||
|
@@ -20,7 +20,7 @@ import { ContainerModel } from './../core/container.model';
|
||||
import { FormFieldTypes } from './../core/form-field-types';
|
||||
import { FormFieldModel } from './../core/form-field.model';
|
||||
|
||||
export class ContainerWidgetModel extends ContainerModel {
|
||||
export class ContainerWidgetComponentModel extends ContainerModel {
|
||||
|
||||
columns: ContainerColumnModel[] = [];
|
||||
isExpanded: boolean = true;
|
||||
|
@@ -24,18 +24,18 @@ import { WIDGET_DIRECTIVES } from '../index';
|
||||
import { MASK_DIRECTIVE } from '../index';
|
||||
import { EcmModelService } from './../../../services/ecm-model.service';
|
||||
import { FormService } from './../../../services/form.service';
|
||||
import { ActivitiContent } from './../../activiti-content.component';
|
||||
import { ActivitiContentComponent } from './../../activiti-content.component';
|
||||
import { FormFieldComponent } from './../../form-field/form-field.component';
|
||||
import { FormFieldTypes } from './../core/form-field-types';
|
||||
import { FormFieldModel } from './../core/form-field.model';
|
||||
import { FormModel } from './../core/form.model';
|
||||
import { ContainerWidget } from './container.widget';
|
||||
import { ContainerWidgetModel } from './container.widget.model';
|
||||
import { ContainerWidgetComponent } from './container.widget';
|
||||
import { ContainerWidgetComponentModel } from './container.widget.model';
|
||||
|
||||
describe('ContainerWidget', () => {
|
||||
describe('ContainerWidgetComponent', () => {
|
||||
|
||||
let widget: ContainerWidget;
|
||||
let fixture: ComponentFixture<ContainerWidget>;
|
||||
let widget: ContainerWidgetComponent;
|
||||
let fixture: ComponentFixture<ContainerWidgetComponent>;
|
||||
let element: HTMLElement;
|
||||
let contentService: ActivitiAlfrescoContentService;
|
||||
let componentHandler;
|
||||
@@ -48,7 +48,7 @@ describe('ContainerWidget', () => {
|
||||
MdTabsModule,
|
||||
MdInputModule
|
||||
],
|
||||
declarations: [FormFieldComponent, ActivitiContent, WIDGET_DIRECTIVES, MASK_DIRECTIVE],
|
||||
declarations: [FormFieldComponent, ActivitiContentComponent, WIDGET_DIRECTIVES, MASK_DIRECTIVE],
|
||||
providers: [
|
||||
FormService,
|
||||
EcmModelService,
|
||||
@@ -58,7 +58,7 @@ describe('ContainerWidget', () => {
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(ContainerWidget);
|
||||
fixture = TestBed.createComponent(ContainerWidgetComponent);
|
||||
contentService = TestBed.get(ActivitiAlfrescoContentService);
|
||||
|
||||
element = fixture.nativeElement;
|
||||
@@ -98,7 +98,7 @@ describe('ContainerWidget', () => {
|
||||
});
|
||||
|
||||
it('should toggle underlying group container', () => {
|
||||
let container = new ContainerWidgetModel(new FormFieldModel(new FormModel(), {
|
||||
let container = new ContainerWidgetComponentModel(new FormFieldModel(new FormModel(), {
|
||||
type: FormFieldTypes.GROUP,
|
||||
params: {
|
||||
allowCollapse: true
|
||||
@@ -115,7 +115,7 @@ describe('ContainerWidget', () => {
|
||||
});
|
||||
|
||||
it('should toggle only collapsible container', () => {
|
||||
let container = new ContainerWidgetModel(new FormFieldModel(new FormModel(), {
|
||||
let container = new ContainerWidgetComponentModel(new FormFieldModel(new FormModel(), {
|
||||
type: FormFieldTypes.GROUP
|
||||
}));
|
||||
|
||||
@@ -128,7 +128,7 @@ describe('ContainerWidget', () => {
|
||||
|
||||
it('should toggle only group container', () => {
|
||||
|
||||
let container = new ContainerWidgetModel(new FormFieldModel(new FormModel(), {
|
||||
let container = new ContainerWidgetComponentModel(new FormFieldModel(new FormModel(), {
|
||||
type: FormFieldTypes.CONTAINER,
|
||||
params: {
|
||||
allowCollapse: true
|
||||
@@ -162,13 +162,13 @@ describe('ContainerWidget', () => {
|
||||
beforeEach(() => {
|
||||
componentHandler = jasmine.createSpyObj('componentHandler', ['upgradeAllRegistered', 'upgradeElement']);
|
||||
window['componentHandler'] = componentHandler;
|
||||
fakeContainerVisible = new ContainerWidgetModel(new FormFieldModel(new FormModel(fakeFormJson), {
|
||||
fakeContainerVisible = new ContainerWidgetComponentModel(new FormFieldModel(new FormModel(fakeFormJson), {
|
||||
fieldType: FormFieldTypes.GROUP,
|
||||
id: 'fake-cont-id-1',
|
||||
name: 'fake-cont-1-name',
|
||||
type: FormFieldTypes.GROUP
|
||||
}));
|
||||
fakeContainerInvisible = new ContainerWidgetModel(new FormFieldModel(new FormModel(fakeFormJson), {
|
||||
fakeContainerInvisible = new ContainerWidgetComponentModel(new FormFieldModel(new FormModel(fakeFormJson), {
|
||||
fieldType: FormFieldTypes.GROUP,
|
||||
id: 'fake-cont-id-2',
|
||||
name: 'fake-cont-2-name',
|
||||
|
@@ -18,7 +18,7 @@
|
||||
import { AfterViewInit, Component, OnInit } from '@angular/core';
|
||||
import { FormService } from './../../../services/form.service';
|
||||
import { baseHost , WidgetComponent } from './../widget.component';
|
||||
import { ContainerWidgetModel } from './container.widget.model';
|
||||
import { ContainerWidgetComponentModel } from './container.widget.model';
|
||||
|
||||
declare var componentHandler: any;
|
||||
|
||||
@@ -28,9 +28,9 @@ declare var componentHandler: any;
|
||||
styleUrls: ['./container.widget.css'],
|
||||
host: baseHost
|
||||
})
|
||||
export class ContainerWidget extends WidgetComponent implements OnInit, AfterViewInit {
|
||||
export class ContainerWidgetComponent extends WidgetComponent implements OnInit, AfterViewInit {
|
||||
|
||||
content: ContainerWidgetModel;
|
||||
content: ContainerWidgetComponentModel;
|
||||
|
||||
constructor(public formService: FormService) {
|
||||
super(formService);
|
||||
@@ -44,7 +44,7 @@ export class ContainerWidget extends WidgetComponent implements OnInit, AfterVie
|
||||
|
||||
ngOnInit() {
|
||||
if (this.field) {
|
||||
this.content = new ContainerWidgetModel(this.field);
|
||||
this.content = new ContainerWidgetComponentModel(this.field);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -15,6 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/* tslint:disable */
|
||||
import { FormFieldMetadata } from './form-field-metadata';
|
||||
|
||||
export interface FormValues extends FormFieldMetadata {
|
||||
|
@@ -24,12 +24,12 @@ import { EcmModelService } from './../../../services/ecm-model.service';
|
||||
import { FormService } from './../../../services/form.service';
|
||||
import { FormFieldModel } from './../core/form-field.model';
|
||||
import { FormModel } from './../core/form.model';
|
||||
import { DateWidget } from './date.widget';
|
||||
import { DateWidgetComponent } from './date.widget';
|
||||
|
||||
describe('DateWidget', () => {
|
||||
describe('DateWidgetComponent', () => {
|
||||
|
||||
let widget: DateWidget;
|
||||
let fixture: ComponentFixture<DateWidget>;
|
||||
let widget: DateWidgetComponent;
|
||||
let fixture: ComponentFixture<DateWidgetComponent>;
|
||||
let componentHandler;
|
||||
let nativeElement: any;
|
||||
let element: HTMLElement;
|
||||
@@ -40,7 +40,7 @@ describe('DateWidget', () => {
|
||||
CoreModule.forRoot()
|
||||
],
|
||||
declarations: [
|
||||
DateWidget
|
||||
DateWidgetComponent
|
||||
],
|
||||
providers: [
|
||||
FormService,
|
||||
@@ -57,7 +57,7 @@ describe('DateWidget', () => {
|
||||
}
|
||||
};
|
||||
|
||||
fixture = TestBed.createComponent(DateWidget);
|
||||
fixture = TestBed.createComponent(DateWidgetComponent);
|
||||
|
||||
element = fixture.nativeElement;
|
||||
widget = fixture.componentInstance;
|
||||
|
@@ -29,7 +29,7 @@ declare var componentHandler: any;
|
||||
styleUrls: ['./date.widget.css'],
|
||||
host: baseHost
|
||||
})
|
||||
export class DateWidget extends WidgetComponent implements OnInit, AfterViewChecked {
|
||||
export class DateWidgetComponent extends WidgetComponent implements OnInit, AfterViewChecked {
|
||||
|
||||
datePicker: any;
|
||||
|
||||
|
@@ -25,7 +25,7 @@ import { baseHost , WidgetComponent } from './../widget.component';
|
||||
styleUrls: ['./display-text.widget.css'],
|
||||
host: baseHost
|
||||
})
|
||||
export class DisplayTextWidget extends WidgetComponent {
|
||||
export class DisplayTextWidgetComponentComponent extends WidgetComponent {
|
||||
|
||||
constructor(public formService: FormService) {
|
||||
super(formService);
|
||||
|
@@ -20,18 +20,18 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { CoreModule } from 'ng2-alfresco-core';
|
||||
import { Observable } from 'rxjs/Rx';
|
||||
import { WidgetVisibilityService } from '../../../services/widget-visibility.service';
|
||||
import { ActivitiContent } from '../../activiti-content.component';
|
||||
import { ActivitiContentComponent } from '../../activiti-content.component';
|
||||
import { FormFieldTypes } from '../core/form-field-types';
|
||||
import { FormModel } from '../core/form.model';
|
||||
import { EcmModelService } from './../../../services/ecm-model.service';
|
||||
import { FormService } from './../../../services/form.service';
|
||||
import { FormFieldModel } from './../core/form-field.model';
|
||||
import { DisplayValueWidget } from './display-value.widget';
|
||||
import { DisplayValueWidgetComponent } from './display-value.widget';
|
||||
|
||||
describe('DisplayValueWidget', () => {
|
||||
describe('DisplayValueWidgetComponent', () => {
|
||||
|
||||
let widget: DisplayValueWidget;
|
||||
let fixture: ComponentFixture<DisplayValueWidget>;
|
||||
let widget: DisplayValueWidgetComponent;
|
||||
let fixture: ComponentFixture<DisplayValueWidgetComponent>;
|
||||
let element: HTMLElement;
|
||||
let formService: FormService;
|
||||
|
||||
@@ -41,8 +41,8 @@ describe('DisplayValueWidget', () => {
|
||||
CoreModule.forRoot()
|
||||
],
|
||||
declarations: [
|
||||
DisplayValueWidget,
|
||||
ActivitiContent
|
||||
DisplayValueWidgetComponent,
|
||||
ActivitiContentComponent
|
||||
],
|
||||
providers: [
|
||||
FormService,
|
||||
@@ -54,7 +54,7 @@ describe('DisplayValueWidget', () => {
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(DisplayValueWidget);
|
||||
fixture = TestBed.createComponent(DisplayValueWidgetComponent);
|
||||
formService = TestBed.get(FormService);
|
||||
|
||||
element = fixture.nativeElement;
|
||||
|
@@ -30,7 +30,7 @@ import { baseHost , WidgetComponent } from './../widget.component';
|
||||
styleUrls: ['./display-value.widget.css'],
|
||||
host: baseHost
|
||||
})
|
||||
export class DisplayValueWidget extends WidgetComponent implements OnInit {
|
||||
export class DisplayValueWidgetComponent extends WidgetComponent implements OnInit {
|
||||
|
||||
@Output()
|
||||
error: EventEmitter<any> = new EventEmitter<any>();
|
||||
|
@@ -24,18 +24,18 @@ import { WidgetVisibilityService } from '../../../services/widget-visibility.ser
|
||||
import { FormFieldOption } from './../core/form-field-option';
|
||||
import { FormFieldModel } from './../core/form-field.model';
|
||||
import { FormModel } from './../core/form.model';
|
||||
import { DropdownWidget } from './dropdown.widget';
|
||||
import { DropdownWidgetComponent } from './dropdown.widget';
|
||||
|
||||
describe('DropdownWidget', () => {
|
||||
describe('DropdownWidgetComponent', () => {
|
||||
|
||||
let formService: FormService;
|
||||
let widget: DropdownWidget;
|
||||
let widget: DropdownWidgetComponent;
|
||||
let visibilityService: WidgetVisibilityService;
|
||||
|
||||
beforeEach(() => {
|
||||
formService = new FormService(null, null, null);
|
||||
visibilityService = new WidgetVisibilityService(null, null);
|
||||
widget = new DropdownWidget(formService, visibilityService, null);
|
||||
widget = new DropdownWidgetComponent(formService, visibilityService, null);
|
||||
widget.field = new FormFieldModel(new FormModel());
|
||||
});
|
||||
|
||||
@@ -100,8 +100,8 @@ describe('DropdownWidget', () => {
|
||||
});
|
||||
|
||||
describe('when template is ready', () => {
|
||||
let dropDownWidget: DropdownWidget;
|
||||
let fixture: ComponentFixture<DropdownWidget>;
|
||||
let dropdownWidgetComponent: DropdownWidgetComponent;
|
||||
let fixture: ComponentFixture<DropdownWidgetComponent>;
|
||||
let element: HTMLElement;
|
||||
let componentHandler;
|
||||
let stubFormService;
|
||||
@@ -118,11 +118,11 @@ describe('DropdownWidget', () => {
|
||||
window['componentHandler'] = componentHandler;
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreModule],
|
||||
declarations: [DropdownWidget],
|
||||
declarations: [DropdownWidgetComponent],
|
||||
providers: [FormService, EcmModelService, WidgetVisibilityService]
|
||||
}).compileComponents().then(() => {
|
||||
fixture = TestBed.createComponent(DropdownWidget);
|
||||
dropDownWidget = fixture.componentInstance;
|
||||
fixture = TestBed.createComponent(DropdownWidgetComponent);
|
||||
dropdownWidgetComponent = fixture.componentInstance;
|
||||
element = fixture.nativeElement;
|
||||
});
|
||||
}));
|
||||
@@ -134,15 +134,15 @@ describe('DropdownWidget', () => {
|
||||
visibilityService = fixture.debugElement.injector.get(WidgetVisibilityService);
|
||||
spyOn(visibilityService, 'refreshVisibility').and.stub();
|
||||
spyOn(stubFormService, 'getRestFieldValues').and.returnValue(Observable.of(fakeOptionList));
|
||||
dropDownWidget.field = new FormFieldModel(new FormModel({ taskId: 'fake-task-id' }), {
|
||||
dropdownWidgetComponent.field = new FormFieldModel(new FormModel({ taskId: 'fake-task-id' }), {
|
||||
id: 'dropdown-id',
|
||||
name: 'date-name',
|
||||
type: 'dropdown',
|
||||
readOnly: 'false',
|
||||
restUrl: 'fake-rest-url'
|
||||
});
|
||||
dropDownWidget.field.emptyOption = { id: 'empty', name: 'Choose one...' };
|
||||
dropDownWidget.field.isVisible = true;
|
||||
dropdownWidgetComponent.field.emptyOption = { id: 'empty', name: 'Choose one...' };
|
||||
dropdownWidgetComponent.field.isVisible = true;
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
|
||||
@@ -155,7 +155,7 @@ describe('DropdownWidget', () => {
|
||||
}));
|
||||
|
||||
it('should select the default value when an option is chosen as default', async(() => {
|
||||
dropDownWidget.field.value = 'option_2';
|
||||
dropdownWidgetComponent.field.value = 'option_2';
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable()
|
||||
.then(() => {
|
||||
@@ -168,7 +168,7 @@ describe('DropdownWidget', () => {
|
||||
}));
|
||||
|
||||
it('should select the empty value when no default is chosen', async(() => {
|
||||
dropDownWidget.field.value = 'empty';
|
||||
dropdownWidgetComponent.field.value = 'empty';
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable()
|
||||
.then(() => {
|
||||
@@ -180,7 +180,7 @@ describe('DropdownWidget', () => {
|
||||
}));
|
||||
|
||||
it('should be not visibile when isVisible is false', async(() => {
|
||||
dropDownWidget.field.isVisible = false;
|
||||
dropdownWidgetComponent.field.isVisible = false;
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable()
|
||||
.then(() => {
|
||||
@@ -190,10 +190,10 @@ describe('DropdownWidget', () => {
|
||||
}));
|
||||
|
||||
it('should became visibile when isVisible is true', async(() => {
|
||||
dropDownWidget.field.isVisible = false;
|
||||
dropdownWidgetComponent.field.isVisible = false;
|
||||
fixture.detectChanges();
|
||||
expect(element.querySelector('#dropdown-id')).toBeNull();
|
||||
dropDownWidget.field.isVisible = true;
|
||||
dropdownWidgetComponent.field.isVisible = true;
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable()
|
||||
.then(() => {
|
||||
@@ -209,15 +209,15 @@ describe('DropdownWidget', () => {
|
||||
visibilityService = fixture.debugElement.injector.get(WidgetVisibilityService);
|
||||
spyOn(visibilityService, 'refreshVisibility').and.stub();
|
||||
spyOn(stubFormService, 'getRestFieldValuesByProcessId').and.returnValue(Observable.of(fakeOptionList));
|
||||
dropDownWidget.field = new FormFieldModel(new FormModel({ processDefinitionId: 'fake-process-id' }), {
|
||||
dropdownWidgetComponent.field = new FormFieldModel(new FormModel({ processDefinitionId: 'fake-process-id' }), {
|
||||
id: 'dropdown-id',
|
||||
name: 'date-name',
|
||||
type: 'dropdown',
|
||||
readOnly: 'false',
|
||||
restUrl: 'fake-rest-url'
|
||||
});
|
||||
dropDownWidget.field.emptyOption = { id: 'empty', name: 'Choose one...' };
|
||||
dropDownWidget.field.isVisible = true;
|
||||
dropdownWidgetComponent.field.emptyOption = { id: 'empty', name: 'Choose one...' };
|
||||
dropdownWidgetComponent.field.isVisible = true;
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
|
||||
@@ -230,7 +230,7 @@ describe('DropdownWidget', () => {
|
||||
}));
|
||||
|
||||
it('should select the default value when an option is chosen as default', async(() => {
|
||||
dropDownWidget.field.value = 'option_2';
|
||||
dropdownWidgetComponent.field.value = 'option_2';
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable()
|
||||
.then(() => {
|
||||
@@ -243,7 +243,7 @@ describe('DropdownWidget', () => {
|
||||
}));
|
||||
|
||||
it('should select the empty value when no default is chosen', async(() => {
|
||||
dropDownWidget.field.value = 'empty';
|
||||
dropdownWidgetComponent.field.value = 'empty';
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable()
|
||||
.then(() => {
|
||||
@@ -255,7 +255,7 @@ describe('DropdownWidget', () => {
|
||||
}));
|
||||
|
||||
it('should be disabled when the field is readonly', async(() => {
|
||||
dropDownWidget.field = new FormFieldModel(new FormModel({ processDefinitionId: 'fake-process-id' }), {
|
||||
dropdownWidgetComponent.field = new FormFieldModel(new FormModel({ processDefinitionId: 'fake-process-id' }), {
|
||||
id: 'dropdown-id',
|
||||
name: 'date-name',
|
||||
type: 'dropdown',
|
||||
|
@@ -28,7 +28,7 @@ import { baseHost , WidgetComponent } from './../widget.component';
|
||||
styleUrls: ['./dropdown.widget.css'],
|
||||
host: baseHost
|
||||
})
|
||||
export class DropdownWidget extends WidgetComponent implements OnInit {
|
||||
export class DropdownWidgetComponent extends WidgetComponent implements OnInit {
|
||||
|
||||
constructor(public formService: FormService,
|
||||
private visibilityService: WidgetVisibilityService,
|
||||
|
@@ -23,7 +23,7 @@ import { WidgetVisibilityService } from '../../../services/widget-visibility.ser
|
||||
import { EcmModelService } from './../../../services/ecm-model.service';
|
||||
import { FormService } from './../../../services/form.service';
|
||||
import { FormFieldModel, FormFieldTypes, FormModel } from './../core/index';
|
||||
import { DynamicTableWidget } from './dynamic-table.widget';
|
||||
import { DynamicTableWidgetComponent } from './dynamic-table.widget';
|
||||
import { DynamicTableColumn, DynamicTableModel, DynamicTableRow } from './dynamic-table.widget.model';
|
||||
import { BooleanEditorComponent } from './editors/boolean/boolean.editor';
|
||||
import { DateEditorComponent } from './editors/date/date.editor';
|
||||
@@ -127,10 +127,10 @@ let fakeFormField = {
|
||||
]
|
||||
};
|
||||
|
||||
describe('DynamicTableWidget', () => {
|
||||
describe('DynamicTableWidgetComponent', () => {
|
||||
|
||||
let widget: DynamicTableWidget;
|
||||
let fixture: ComponentFixture<DynamicTableWidget>;
|
||||
let widget: DynamicTableWidgetComponent;
|
||||
let fixture: ComponentFixture<DynamicTableWidgetComponent>;
|
||||
let element: HTMLElement;
|
||||
let table: DynamicTableModel;
|
||||
let logService: LogService;
|
||||
@@ -141,7 +141,7 @@ describe('DynamicTableWidget', () => {
|
||||
imports: [
|
||||
CoreModule.forRoot()
|
||||
],
|
||||
declarations: [DynamicTableWidget, RowEditorComponent,
|
||||
declarations: [DynamicTableWidgetComponent, RowEditorComponent,
|
||||
DropdownEditorComponent, DateEditorComponent, BooleanEditorComponent, TextEditorComponent],
|
||||
providers: [
|
||||
FormService,
|
||||
@@ -163,7 +163,7 @@ describe('DynamicTableWidget', () => {
|
||||
let elementRefSpy = jasmine.createSpyObj('elementRef', ['']);
|
||||
elementRefSpy.nativeElement = nativeElementSpy;
|
||||
|
||||
fixture = TestBed.createComponent(DynamicTableWidget);
|
||||
fixture = TestBed.createComponent(DynamicTableWidgetComponent);
|
||||
element = fixture.nativeElement;
|
||||
widget = fixture.componentInstance;
|
||||
widget.content = table;
|
||||
|
@@ -29,7 +29,7 @@ import { DynamicTableColumn, DynamicTableModel, DynamicTableRow } from './dynami
|
||||
styleUrls: ['./dynamic-table.widget.css'],
|
||||
host: baseHost
|
||||
})
|
||||
export class DynamicTableWidget extends WidgetComponent implements OnInit {
|
||||
export class DynamicTableWidgetComponent extends WidgetComponent implements OnInit {
|
||||
|
||||
ERROR_MODEL_NOT_FOUND = 'Table model not found';
|
||||
|
||||
|
@@ -21,14 +21,14 @@ import { FormService } from '../../../services/form.service';
|
||||
import { FormFieldModel } from '../core/form-field.model';
|
||||
import { FormModel } from '../core/form.model';
|
||||
import { GroupModel } from '../core/group.model';
|
||||
import { FunctionalGroupWidget } from './functional-group.widget';
|
||||
import { FunctionalGroupWidgetComponent } from './functional-group.widget';
|
||||
|
||||
describe('FunctionalGroupWidget', () => {
|
||||
describe('FunctionalGroupWidgetComponent', () => {
|
||||
|
||||
let componentHandler;
|
||||
let formService: FormService;
|
||||
let elementRef: ElementRef;
|
||||
let widget: FunctionalGroupWidget;
|
||||
let widget: FunctionalGroupWidgetComponent;
|
||||
|
||||
beforeEach(() => {
|
||||
componentHandler = jasmine.createSpyObj('componentHandler', [
|
||||
@@ -38,7 +38,7 @@ describe('FunctionalGroupWidget', () => {
|
||||
|
||||
formService = new FormService(null, null, null);
|
||||
elementRef = new ElementRef(null);
|
||||
widget = new FunctionalGroupWidget(formService, elementRef);
|
||||
widget = new FunctionalGroupWidgetComponent(formService, elementRef);
|
||||
widget.field = new FormFieldModel(new FormModel());
|
||||
});
|
||||
|
||||
@@ -245,11 +245,11 @@ describe('FunctionalGroupWidget', () => {
|
||||
});
|
||||
|
||||
it('should require element reference to setup textfield', () => {
|
||||
let w = new FunctionalGroupWidget(formService, null);
|
||||
let w = new FunctionalGroupWidgetComponent(formService, null);
|
||||
w.value = '<value>';
|
||||
expect(w.setupMaterialComponents(componentHandler)).toBeFalsy();
|
||||
|
||||
w = new FunctionalGroupWidget(formService, elementRef);
|
||||
w = new FunctionalGroupWidgetComponent(formService, elementRef);
|
||||
w.value = '<value>';
|
||||
expect(w.setupMaterialComponents(componentHandler)).toBeTruthy();
|
||||
});
|
||||
|
@@ -26,7 +26,7 @@ import { baseHost , WidgetComponent } from './../widget.component';
|
||||
styleUrls: ['./functional-group.widget.css'],
|
||||
host: baseHost
|
||||
})
|
||||
export class FunctionalGroupWidget extends WidgetComponent implements OnInit {
|
||||
export class FunctionalGroupWidgetComponent extends WidgetComponent implements OnInit {
|
||||
|
||||
value: string;
|
||||
popupVisible: boolean = false;
|
||||
|
@@ -18,14 +18,14 @@
|
||||
import { FormFieldModel } from './../core/form-field.model';
|
||||
import { FormModel } from './../core/form.model';
|
||||
import { WidgetComponent } from './../widget.component';
|
||||
import { HyperlinkWidget } from './hyperlink.widget';
|
||||
import { HyperlinkWidgetComponent } from './hyperlink.widget';
|
||||
|
||||
describe('HyperlinkWidget', () => {
|
||||
describe('HyperlinkWidgetComponent', () => {
|
||||
|
||||
let widget: HyperlinkWidget;
|
||||
let widget: HyperlinkWidgetComponent;
|
||||
|
||||
beforeEach(() => {
|
||||
widget = new HyperlinkWidget(null);
|
||||
widget = new HyperlinkWidgetComponent(null);
|
||||
});
|
||||
|
||||
it('should get link text from field display text', () => {
|
||||
|
@@ -25,7 +25,7 @@ import { baseHost , WidgetComponent } from './../widget.component';
|
||||
styleUrls: ['./hyperlink.widget.css'],
|
||||
host: baseHost
|
||||
})
|
||||
export class HyperlinkWidget extends WidgetComponent implements OnInit {
|
||||
export class HyperlinkWidgetComponent extends WidgetComponent implements OnInit {
|
||||
|
||||
linkUrl: string = WidgetComponent.DEFAULT_HYPERLINK_URL;
|
||||
linkText: string = null;
|
||||
|
@@ -15,33 +15,33 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ContainerWidget } from './container/container.widget';
|
||||
import { TabsWidget } from './tabs/tabs.widget';
|
||||
import { UnknownWidget } from './unknown/unknown.widget';
|
||||
import { ContainerWidgetComponent } from './container/container.widget';
|
||||
import { TabsWidgetComponent } from './tabs/tabs.widget';
|
||||
import { UnknownWidgetComponent } from './unknown/unknown.widget';
|
||||
|
||||
import { AmountWidget } from './amount/amount.widget';
|
||||
import { AttachWidget } from './attach/attach.widget';
|
||||
import { CheckboxWidget } from './checkbox/checkbox.widget';
|
||||
import { DateWidget } from './date/date.widget';
|
||||
import { DisplayTextWidget } from './display-text/display-text.widget';
|
||||
import { DisplayValueWidget } from './display-value/display-value.widget';
|
||||
import { DropdownWidget } from './dropdown/dropdown.widget';
|
||||
import { DynamicTableWidget } from './dynamic-table/dynamic-table.widget';
|
||||
import { AmountWidgetComponent } from './amount/amount.widget';
|
||||
import { AttachWidgetComponent } from './attach/attach.widget';
|
||||
import { CheckboxWidgetComponent } from './checkbox/checkbox.widget';
|
||||
import { DateWidgetComponent } from './date/date.widget';
|
||||
import { DisplayTextWidgetComponentComponent } from './display-text/display-text.widget';
|
||||
import { DisplayValueWidgetComponent } from './display-value/display-value.widget';
|
||||
import { DropdownWidgetComponent } from './dropdown/dropdown.widget';
|
||||
import { DynamicTableWidgetComponent } from './dynamic-table/dynamic-table.widget';
|
||||
import { BooleanEditorComponent } from './dynamic-table/editors/boolean/boolean.editor';
|
||||
import { DateEditorComponent } from './dynamic-table/editors/date/date.editor';
|
||||
import { DropdownEditorComponent } from './dynamic-table/editors/dropdown/dropdown.editor';
|
||||
import { RowEditorComponent } from './dynamic-table/editors/row.editor';
|
||||
import { TextEditorComponent } from './dynamic-table/editors/text/text.editor';
|
||||
import { FunctionalGroupWidget } from './functional-group/functional-group.widget';
|
||||
import { HyperlinkWidget } from './hyperlink/hyperlink.widget';
|
||||
import { MultilineTextWidget } from './multiline-text/multiline-text.widget';
|
||||
import { NumberWidget } from './number/number.widget';
|
||||
import { PeopleWidget } from './people/people.widget';
|
||||
import { RadioButtonsWidget } from './radio-buttons/radio-buttons.widget';
|
||||
import { FunctionalGroupWidgetComponent } from './functional-group/functional-group.widget';
|
||||
import { HyperlinkWidgetComponent } from './hyperlink/hyperlink.widget';
|
||||
import { MultilineTextWidgetComponentComponent } from './multiline-text/multiline-text.widget';
|
||||
import { NumberWidgetComponent } from './number/number.widget';
|
||||
import { PeopleWidgetComponent } from './people/people.widget';
|
||||
import { RadioButtonsWidgetComponent } from './radio-buttons/radio-buttons.widget';
|
||||
import { InputMaskDirective } from './text/text-mask.component';
|
||||
import { TextWidget } from './text/text.widget';
|
||||
import { TypeaheadWidget } from './typeahead/typeahead.widget';
|
||||
import { UploadWidget } from './upload/upload.widget';
|
||||
import { TextWidgetComponent } from './text/text.widget';
|
||||
import { TypeaheadWidgetComponent } from './typeahead/typeahead.widget';
|
||||
import { UploadWidgetComponent } from './upload/upload.widget';
|
||||
|
||||
// core
|
||||
export * from './widget.component';
|
||||
@@ -80,27 +80,27 @@ export * from './dynamic-table/editors/text/text.editor';
|
||||
export * from './text/text-mask.component';
|
||||
|
||||
export const WIDGET_DIRECTIVES: any[] = [
|
||||
UnknownWidget,
|
||||
TabsWidget,
|
||||
ContainerWidget,
|
||||
TextWidget,
|
||||
NumberWidget,
|
||||
CheckboxWidget,
|
||||
MultilineTextWidget,
|
||||
DropdownWidget,
|
||||
HyperlinkWidget,
|
||||
RadioButtonsWidget,
|
||||
DisplayValueWidget,
|
||||
DisplayTextWidget,
|
||||
UploadWidget,
|
||||
AttachWidget,
|
||||
TypeaheadWidget,
|
||||
FunctionalGroupWidget,
|
||||
PeopleWidget,
|
||||
DateWidget,
|
||||
AmountWidget,
|
||||
UnknownWidgetComponent,
|
||||
TabsWidgetComponent,
|
||||
ContainerWidgetComponent,
|
||||
TextWidgetComponent,
|
||||
NumberWidgetComponent,
|
||||
CheckboxWidgetComponent,
|
||||
MultilineTextWidgetComponentComponent,
|
||||
DropdownWidgetComponent,
|
||||
HyperlinkWidgetComponent,
|
||||
RadioButtonsWidgetComponent,
|
||||
DisplayValueWidgetComponent,
|
||||
DisplayTextWidgetComponentComponent,
|
||||
UploadWidgetComponent,
|
||||
AttachWidgetComponent,
|
||||
TypeaheadWidgetComponent,
|
||||
FunctionalGroupWidgetComponent,
|
||||
PeopleWidgetComponent,
|
||||
DateWidgetComponent,
|
||||
AmountWidgetComponent,
|
||||
|
||||
DynamicTableWidget,
|
||||
DynamicTableWidgetComponent,
|
||||
DateEditorComponent,
|
||||
DropdownEditorComponent,
|
||||
BooleanEditorComponent,
|
||||
|
@@ -15,14 +15,14 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { MultilineTextWidget } from './multiline-text.widget';
|
||||
import { MultilineTextWidgetComponentComponent } from './multiline-text.widget';
|
||||
|
||||
describe('MultilineTextWidget', () => {
|
||||
describe('MultilineTextWidgetComponentComponent', () => {
|
||||
|
||||
let widget: MultilineTextWidget;
|
||||
let widget: MultilineTextWidgetComponentComponent;
|
||||
|
||||
beforeEach(() => {
|
||||
widget = new MultilineTextWidget(null);
|
||||
widget = new MultilineTextWidgetComponentComponent(null);
|
||||
});
|
||||
|
||||
it('should exist', () => {
|
||||
|
@@ -25,7 +25,7 @@ import { baseHost , WidgetComponent } from './../widget.component';
|
||||
styleUrls: ['./multiline-text.widget.css'],
|
||||
host: baseHost
|
||||
})
|
||||
export class MultilineTextWidget extends WidgetComponent {
|
||||
export class MultilineTextWidgetComponentComponent extends WidgetComponent {
|
||||
|
||||
constructor(public formService: FormService) {
|
||||
super(formService);
|
||||
|
@@ -15,14 +15,14 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { NumberWidget } from './number.widget';
|
||||
import { NumberWidgetComponent } from './number.widget';
|
||||
|
||||
describe('NumberWidget', () => {
|
||||
describe('NumberWidgetComponent', () => {
|
||||
|
||||
let widget: NumberWidget;
|
||||
let widget: NumberWidgetComponent;
|
||||
|
||||
beforeEach(() => {
|
||||
widget = new NumberWidget(null);
|
||||
widget = new NumberWidgetComponent(null);
|
||||
});
|
||||
|
||||
it('should exist', () => {
|
||||
|
@@ -25,7 +25,7 @@ import { baseHost , WidgetComponent } from './../widget.component';
|
||||
styleUrls: ['./number.widget.css'],
|
||||
host: baseHost
|
||||
})
|
||||
export class NumberWidget extends WidgetComponent {
|
||||
export class NumberWidgetComponent extends WidgetComponent {
|
||||
|
||||
constructor(public formService: FormService) {
|
||||
super(formService);
|
||||
|
@@ -21,14 +21,14 @@ import { FormService } from '../../../services/form.service';
|
||||
import { FormFieldModel } from '../core/form-field.model';
|
||||
import { FormModel } from '../core/form.model';
|
||||
import { GroupUserModel } from '../core/group-user.model';
|
||||
import { PeopleWidget } from './people.widget';
|
||||
import { PeopleWidgetComponent } from './people.widget';
|
||||
|
||||
describe('PeopleWidget', () => {
|
||||
describe('PeopleWidgetComponent', () => {
|
||||
|
||||
let componentHandler;
|
||||
let elementRef: ElementRef;
|
||||
let formService: FormService;
|
||||
let widget: PeopleWidget;
|
||||
let widget: PeopleWidgetComponent;
|
||||
|
||||
beforeEach(() => {
|
||||
componentHandler = jasmine.createSpyObj('componentHandler', [
|
||||
@@ -38,7 +38,7 @@ describe('PeopleWidget', () => {
|
||||
|
||||
formService = new FormService(null, null, null);
|
||||
elementRef = new ElementRef(null);
|
||||
widget = new PeopleWidget(formService, elementRef);
|
||||
widget = new PeopleWidgetComponent(formService, elementRef);
|
||||
widget.field = new FormFieldModel(new FormModel());
|
||||
});
|
||||
|
||||
@@ -253,11 +253,11 @@ describe('PeopleWidget', () => {
|
||||
});
|
||||
|
||||
it('should require element reference to setup textfield', () => {
|
||||
let w = new PeopleWidget(formService, null);
|
||||
let w = new PeopleWidgetComponent(formService, null);
|
||||
w.value = '<value>';
|
||||
expect(w.setupMaterialComponents(componentHandler)).toBeFalsy();
|
||||
|
||||
w = new PeopleWidget(formService, elementRef);
|
||||
w = new PeopleWidgetComponent(formService, elementRef);
|
||||
w.value = '<value>';
|
||||
expect(w.setupMaterialComponents(componentHandler)).toBeTruthy();
|
||||
});
|
||||
|
@@ -27,7 +27,7 @@ import { baseHost , WidgetComponent } from './../widget.component';
|
||||
styleUrls: ['./people.widget.css'],
|
||||
host: baseHost
|
||||
})
|
||||
export class PeopleWidget extends WidgetComponent implements OnInit {
|
||||
export class PeopleWidgetComponent extends WidgetComponent implements OnInit {
|
||||
|
||||
popupVisible: boolean = false;
|
||||
minTermLength: number = 1;
|
||||
|
@@ -27,12 +27,12 @@ import { FormFieldTypes } from '../core/form-field-types';
|
||||
import { FormFieldOption } from './../core/form-field-option';
|
||||
import { FormFieldModel } from './../core/form-field.model';
|
||||
import { FormModel } from './../core/form.model';
|
||||
import { RadioButtonsWidget } from './radio-buttons.widget';
|
||||
import { RadioButtonsWidgetComponent } from './radio-buttons.widget';
|
||||
|
||||
describe('RadioButtonsWidget', () => {
|
||||
describe('RadioButtonsWidgetComponent', () => {
|
||||
|
||||
let formService: FormService;
|
||||
let widget: RadioButtonsWidget;
|
||||
let widget: RadioButtonsWidgetComponent;
|
||||
let visibilityService: WidgetVisibilityService;
|
||||
let logService: LogServiceMock;
|
||||
|
||||
@@ -40,7 +40,7 @@ describe('RadioButtonsWidget', () => {
|
||||
logService = new LogServiceMock();
|
||||
formService = new FormService(null, null, logService);
|
||||
visibilityService = new WidgetVisibilityService(null, logService);
|
||||
widget = new RadioButtonsWidget(formService, visibilityService, logService);
|
||||
widget = new RadioButtonsWidgetComponent(formService, visibilityService, logService);
|
||||
widget.field = new FormFieldModel(new FormModel(), { restUrl: '<url>' });
|
||||
});
|
||||
|
||||
@@ -134,8 +134,8 @@ describe('RadioButtonsWidget', () => {
|
||||
});
|
||||
|
||||
describe('when template is ready', () => {
|
||||
let radioButtonWidget: RadioButtonsWidget;
|
||||
let fixture: ComponentFixture<RadioButtonsWidget>;
|
||||
let radioButtonWidget: RadioButtonsWidgetComponent;
|
||||
let fixture: ComponentFixture<RadioButtonsWidgetComponent>;
|
||||
let element: HTMLElement;
|
||||
let componentHandler;
|
||||
let stubFormService: FormService;
|
||||
@@ -150,10 +150,10 @@ describe('RadioButtonsWidget', () => {
|
||||
window['componentHandler'] = componentHandler;
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreModule],
|
||||
declarations: [RadioButtonsWidget],
|
||||
declarations: [RadioButtonsWidgetComponent],
|
||||
providers: [FormService, EcmModelService, WidgetVisibilityService]
|
||||
}).compileComponents().then(() => {
|
||||
fixture = TestBed.createComponent(RadioButtonsWidget);
|
||||
fixture = TestBed.createComponent(RadioButtonsWidgetComponent);
|
||||
radioButtonWidget = fixture.componentInstance;
|
||||
element = fixture.nativeElement;
|
||||
});
|
||||
|
@@ -28,7 +28,7 @@ import { baseHost , WidgetComponent } from './../widget.component';
|
||||
styleUrls: ['./radio-buttons.widget.css'],
|
||||
host: baseHost
|
||||
})
|
||||
export class RadioButtonsWidget extends WidgetComponent implements OnInit {
|
||||
export class RadioButtonsWidgetComponent extends WidgetComponent implements OnInit {
|
||||
|
||||
constructor(public formService: FormService,
|
||||
private visibilityService: WidgetVisibilityService,
|
||||
|
@@ -24,17 +24,17 @@ import { FormModel } from '../core/form.model';
|
||||
import { TabModel } from '../core/tab.model';
|
||||
import { MASK_DIRECTIVE } from '../index';
|
||||
import { WIDGET_DIRECTIVES } from '../index';
|
||||
import { ActivitiContent } from './../../activiti-content.component';
|
||||
import { ActivitiContentComponent } from './../../activiti-content.component';
|
||||
import { FormFieldComponent } from './../../form-field/form-field.component';
|
||||
import { TabsWidget } from './tabs.widget';
|
||||
import { TabsWidgetComponent } from './tabs.widget';
|
||||
|
||||
describe('TabsWidget', () => {
|
||||
describe('TabsWidgetComponent', () => {
|
||||
|
||||
let componentHandler;
|
||||
let widget: TabsWidget;
|
||||
let widget: TabsWidgetComponent;
|
||||
|
||||
beforeEach(() => {
|
||||
widget = new TabsWidget();
|
||||
widget = new TabsWidgetComponent();
|
||||
|
||||
componentHandler = jasmine.createSpyObj('componentHandler', [
|
||||
'upgradeAllRegistered'
|
||||
@@ -97,8 +97,8 @@ describe('TabsWidget', () => {
|
||||
});
|
||||
|
||||
describe('when template is ready', () => {
|
||||
let tabWidgetComponent: TabsWidget;
|
||||
let fixture: ComponentFixture<TabsWidget>;
|
||||
let tabWidgetComponent: TabsWidgetComponent;
|
||||
let fixture: ComponentFixture<TabsWidgetComponent>;
|
||||
let element: HTMLElement;
|
||||
let fakeTabVisible: TabModel;
|
||||
let fakeTabInvisible: TabModel;
|
||||
@@ -106,9 +106,9 @@ describe('TabsWidget', () => {
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreModule, MdTabsModule, MdInputModule],
|
||||
declarations: [FormFieldComponent, ActivitiContent, WIDGET_DIRECTIVES, MASK_DIRECTIVE]
|
||||
declarations: [FormFieldComponent, ActivitiContentComponent, WIDGET_DIRECTIVES, MASK_DIRECTIVE]
|
||||
}).compileComponents().then(() => {
|
||||
fixture = TestBed.createComponent(TabsWidget);
|
||||
fixture = TestBed.createComponent(TabsWidgetComponent);
|
||||
tabWidgetComponent = fixture.componentInstance;
|
||||
element = fixture.nativeElement;
|
||||
});
|
||||
|
@@ -24,7 +24,7 @@ declare var componentHandler: any;
|
||||
selector: 'tabs-widget',
|
||||
templateUrl: './tabs.widget.html'
|
||||
})
|
||||
export class TabsWidget implements AfterContentChecked, AfterViewInit {
|
||||
export class TabsWidgetComponent implements AfterContentChecked, AfterViewInit {
|
||||
|
||||
@Input()
|
||||
tabs: TabModel[] = [];
|
||||
|
@@ -20,17 +20,17 @@ import { FormFieldTypes } from '../core/form-field-types';
|
||||
import { FormFieldModel } from '../core/form-field.model';
|
||||
import { FormModel } from '../core/form.model';
|
||||
import { InputMaskDirective } from './text-mask.component';
|
||||
import { TextWidget } from './text.widget';
|
||||
import { TextWidgetComponent } from './text.widget';
|
||||
|
||||
import { CoreModule } from 'ng2-alfresco-core';
|
||||
import { ActivitiAlfrescoContentService } from '../../../services/activiti-alfresco.service';
|
||||
import { EcmModelService } from './../../../services/ecm-model.service';
|
||||
import { FormService } from './../../../services/form.service';
|
||||
|
||||
describe('TextWidget', () => {
|
||||
describe('TextWidgetComponent', () => {
|
||||
|
||||
let widget: TextWidget;
|
||||
let fixture: ComponentFixture<TextWidget>;
|
||||
let widget: TextWidgetComponent;
|
||||
let fixture: ComponentFixture<TextWidgetComponent>;
|
||||
let componentHandler;
|
||||
let element: HTMLElement;
|
||||
|
||||
@@ -40,7 +40,7 @@ describe('TextWidget', () => {
|
||||
CoreModule.forRoot()
|
||||
],
|
||||
declarations: [
|
||||
TextWidget,
|
||||
TextWidgetComponent,
|
||||
InputMaskDirective
|
||||
],
|
||||
providers: [
|
||||
@@ -52,7 +52,7 @@ describe('TextWidget', () => {
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(TextWidget);
|
||||
fixture = TestBed.createComponent(TextWidgetComponent);
|
||||
|
||||
widget = fixture.componentInstance;
|
||||
element = fixture.nativeElement;
|
||||
|
@@ -25,13 +25,13 @@ import { baseHost , WidgetComponent } from './../widget.component';
|
||||
styleUrls: ['./text.widget.css'],
|
||||
host: baseHost
|
||||
})
|
||||
export class TextWidget extends WidgetComponent implements OnInit {
|
||||
export class TextWidgetComponent extends WidgetComponent implements OnInit {
|
||||
|
||||
private mask;
|
||||
private isMaskReversed;
|
||||
mask;
|
||||
isMaskReversed;
|
||||
|
||||
constructor(public formService: FormService) {
|
||||
super(formService);
|
||||
super(formService);
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
@@ -26,12 +26,12 @@ import { FormFieldOption } from '../core/form-field-option';
|
||||
import { FormFieldTypes } from '../core/form-field-types';
|
||||
import { FormFieldModel } from '../core/form-field.model';
|
||||
import { FormModel } from '../core/form.model';
|
||||
import { TypeaheadWidget } from './typeahead.widget';
|
||||
import { TypeaheadWidgetComponent } from './typeahead.widget';
|
||||
|
||||
describe('TypeaheadWidget', () => {
|
||||
describe('TypeaheadWidgetComponent', () => {
|
||||
|
||||
let formService: FormService;
|
||||
let widget: TypeaheadWidget;
|
||||
let widget: TypeaheadWidgetComponent;
|
||||
let visibilityService: WidgetVisibilityService;
|
||||
let logService: LogServiceMock;
|
||||
|
||||
@@ -39,7 +39,7 @@ describe('TypeaheadWidget', () => {
|
||||
logService = new LogServiceMock();
|
||||
formService = new FormService(null, null, logService);
|
||||
visibilityService = new WidgetVisibilityService(null, logService);
|
||||
widget = new TypeaheadWidget(formService, visibilityService, logService);
|
||||
widget = new TypeaheadWidgetComponent(formService, visibilityService, logService);
|
||||
widget.field = new FormFieldModel(new FormModel({ taskId: 'task-id' }));
|
||||
});
|
||||
|
||||
@@ -373,8 +373,8 @@ describe('TypeaheadWidget', () => {
|
||||
});
|
||||
|
||||
describe('when template is ready', () => {
|
||||
let typeaheadWidget: TypeaheadWidget;
|
||||
let fixture: ComponentFixture<TypeaheadWidget>;
|
||||
let typeaheadWidgetComponent: TypeaheadWidgetComponent;
|
||||
let fixture: ComponentFixture<TypeaheadWidgetComponent>;
|
||||
let element: HTMLElement;
|
||||
let componentHandler;
|
||||
let stubFormService;
|
||||
@@ -391,11 +391,11 @@ describe('TypeaheadWidget', () => {
|
||||
window['componentHandler'] = componentHandler;
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreModule],
|
||||
declarations: [TypeaheadWidget],
|
||||
declarations: [TypeaheadWidgetComponent],
|
||||
providers: [FormService, EcmModelService, WidgetVisibilityService]
|
||||
}).compileComponents().then(() => {
|
||||
fixture = TestBed.createComponent(TypeaheadWidget);
|
||||
typeaheadWidget = fixture.componentInstance;
|
||||
fixture = TestBed.createComponent(TypeaheadWidgetComponent);
|
||||
typeaheadWidgetComponent = fixture.componentInstance;
|
||||
element = fixture.nativeElement;
|
||||
});
|
||||
}));
|
||||
@@ -412,13 +412,13 @@ describe('TypeaheadWidget', () => {
|
||||
visibilityService = fixture.debugElement.injector.get(WidgetVisibilityService);
|
||||
spyOn(visibilityService, 'refreshVisibility').and.stub();
|
||||
spyOn(stubFormService, 'getRestFieldValues').and.returnValue(Observable.of(fakeOptionList));
|
||||
typeaheadWidget.field = new FormFieldModel(new FormModel({ taskId: 'fake-task-id' }), {
|
||||
typeaheadWidgetComponent.field = new FormFieldModel(new FormModel({ taskId: 'fake-task-id' }), {
|
||||
id: 'typeahead-id',
|
||||
name: 'typeahead-name',
|
||||
type: FormFieldTypes.TYPEAHEAD,
|
||||
readOnly: false
|
||||
});
|
||||
typeaheadWidget.field.isVisible = true;
|
||||
typeaheadWidgetComponent.field.isVisible = true;
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
|
||||
@@ -428,8 +428,8 @@ describe('TypeaheadWidget', () => {
|
||||
}));
|
||||
|
||||
it('should show typeahead options', async(() => {
|
||||
typeaheadWidget.value = 'F';
|
||||
typeaheadWidget.onKeyUp(null);
|
||||
typeaheadWidgetComponent.value = 'F';
|
||||
typeaheadWidgetComponent.onKeyUp(null);
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(element.querySelector('#typeahead-id-1')).toBeDefined();
|
||||
@@ -442,7 +442,7 @@ describe('TypeaheadWidget', () => {
|
||||
}));
|
||||
|
||||
it('should hide not visibile typeahead', async(() => {
|
||||
typeaheadWidget.field.isVisible = false;
|
||||
typeaheadWidgetComponent.field.isVisible = false;
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(element.querySelector('#typeahead-id')).toBeNull();
|
||||
@@ -458,14 +458,14 @@ describe('TypeaheadWidget', () => {
|
||||
visibilityService = fixture.debugElement.injector.get(WidgetVisibilityService);
|
||||
spyOn(visibilityService, 'refreshVisibility').and.stub();
|
||||
spyOn(stubFormService, 'getRestFieldValuesByProcessId').and.returnValue(Observable.of(fakeOptionList));
|
||||
typeaheadWidget.field = new FormFieldModel(new FormModel({ processDefinitionId: 'fake-process-id' }), {
|
||||
typeaheadWidgetComponent.field = new FormFieldModel(new FormModel({ processDefinitionId: 'fake-process-id' }), {
|
||||
id: 'typeahead-id',
|
||||
name: 'typeahead-name',
|
||||
type: FormFieldTypes.TYPEAHEAD,
|
||||
readOnly: 'false'
|
||||
});
|
||||
typeaheadWidget.field.emptyOption = { id: 'empty', name: 'Choose one...' };
|
||||
typeaheadWidget.field.isVisible = true;
|
||||
typeaheadWidgetComponent.field.emptyOption = { id: 'empty', name: 'Choose one...' };
|
||||
typeaheadWidgetComponent.field.isVisible = true;
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
|
||||
@@ -475,8 +475,8 @@ describe('TypeaheadWidget', () => {
|
||||
}));
|
||||
|
||||
it('should show typeahead options', async(() => {
|
||||
typeaheadWidget.value = 'F';
|
||||
typeaheadWidget.onKeyUp(null);
|
||||
typeaheadWidgetComponent.value = 'F';
|
||||
typeaheadWidgetComponent.onKeyUp(null);
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
expect(element.querySelector('#typeahead-id-1')).toBeDefined();
|
||||
|
@@ -28,7 +28,7 @@ import { baseHost , WidgetComponent } from './../widget.component';
|
||||
styleUrls: ['./typeahead.widget.css'],
|
||||
host: baseHost
|
||||
})
|
||||
export class TypeaheadWidget extends WidgetComponent implements OnInit {
|
||||
export class TypeaheadWidgetComponent extends WidgetComponent implements OnInit {
|
||||
|
||||
popupVisible: boolean = false;
|
||||
minTermLength: number = 1;
|
||||
|
@@ -29,7 +29,7 @@ import { baseHost , WidgetComponent } from './../widget.component';
|
||||
`,
|
||||
host: baseHost
|
||||
})
|
||||
export class UnknownWidget extends WidgetComponent {
|
||||
export class UnknownWidgetComponent extends WidgetComponent {
|
||||
|
||||
constructor(public formService: FormService) {
|
||||
super(formService);
|
||||
|
@@ -22,17 +22,17 @@ import { FormService } from '../../../services/form.service';
|
||||
import { FormFieldTypes } from '../core/form-field-types';
|
||||
import { FormModel } from '../core/form.model';
|
||||
import { FormFieldModel } from './../core/form-field.model';
|
||||
import { UploadWidget } from './upload.widget';
|
||||
import { UploadWidgetComponent } from './upload.widget';
|
||||
|
||||
describe('UploadWidget', () => {
|
||||
describe('UploadWidgetComponent', () => {
|
||||
|
||||
let componentHandler;
|
||||
let widget: UploadWidget;
|
||||
let widget: UploadWidgetComponent;
|
||||
let formService: FormService;
|
||||
|
||||
beforeEach(() => {
|
||||
formService = new FormService(null, null, null);
|
||||
widget = new UploadWidget(formService, null);
|
||||
widget = new UploadWidgetComponent(formService, null);
|
||||
});
|
||||
|
||||
it('should setup with field data', () => {
|
||||
@@ -85,8 +85,8 @@ describe('UploadWidget', () => {
|
||||
});
|
||||
|
||||
describe('when template is ready', () => {
|
||||
let uploadWidget: UploadWidget;
|
||||
let fixture: ComponentFixture<UploadWidget>;
|
||||
let uploadWidgetComponent: UploadWidgetComponent;
|
||||
let fixture: ComponentFixture<UploadWidgetComponent>;
|
||||
let element: HTMLInputElement;
|
||||
let inputElement: HTMLInputElement;
|
||||
|
||||
@@ -98,11 +98,11 @@ describe('UploadWidget', () => {
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreModule],
|
||||
declarations: [UploadWidget],
|
||||
declarations: [UploadWidgetComponent],
|
||||
providers: [FormService, EcmModelService]
|
||||
}).compileComponents().then(() => {
|
||||
fixture = TestBed.createComponent(UploadWidget);
|
||||
uploadWidget = fixture.componentInstance;
|
||||
fixture = TestBed.createComponent(UploadWidgetComponent);
|
||||
uploadWidgetComponent = fixture.componentInstance;
|
||||
element = fixture.nativeElement;
|
||||
});
|
||||
}));
|
||||
@@ -113,7 +113,7 @@ describe('UploadWidget', () => {
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
uploadWidget.field = new FormFieldModel(new FormModel({ taskId: 'fake-upload-id' }), {
|
||||
uploadWidgetComponent.field = new FormFieldModel(new FormModel({ taskId: 'fake-upload-id' }), {
|
||||
id: 'upload-id',
|
||||
name: 'upload-name',
|
||||
value: '',
|
||||
@@ -123,7 +123,7 @@ describe('UploadWidget', () => {
|
||||
});
|
||||
|
||||
it('should be disabled on readonly forms', async(() => {
|
||||
uploadWidget.field.form.readOnly = true;
|
||||
uploadWidgetComponent.field.form.readOnly = true;
|
||||
fixture.detectChanges();
|
||||
inputElement = <HTMLInputElement>element.querySelector('#upload-id');
|
||||
|
||||
@@ -136,7 +136,7 @@ describe('UploadWidget', () => {
|
||||
}));
|
||||
|
||||
it('should have the multiple attribute when is selected in parameters', async(() => {
|
||||
uploadWidget.field.params.multiple = true;
|
||||
uploadWidgetComponent.field.params.multiple = true;
|
||||
fixture.detectChanges();
|
||||
inputElement = <HTMLInputElement>element.querySelector('#upload-id');
|
||||
|
||||
@@ -149,7 +149,7 @@ describe('UploadWidget', () => {
|
||||
}));
|
||||
|
||||
it('should not have the multiple attribute if multiple is false', async(() => {
|
||||
uploadWidget.field.params.multiple = false;
|
||||
uploadWidgetComponent.field.params.multiple = false;
|
||||
fixture.detectChanges();
|
||||
inputElement = <HTMLInputElement>element.querySelector('#upload-id');
|
||||
|
||||
|
@@ -26,7 +26,7 @@ import { baseHost, WidgetComponent } from './../widget.component';
|
||||
styleUrls: ['./upload.widget.css'],
|
||||
host: baseHost
|
||||
})
|
||||
export class UploadWidget extends WidgetComponent implements OnInit {
|
||||
export class UploadWidgetComponent extends WidgetComponent implements OnInit {
|
||||
|
||||
hasFile: boolean;
|
||||
fileName: string;
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { AlfrescoApi } from 'alfresco-js-api';
|
||||
import { AlfrescoApi } from 'alfresco-js-api';
|
||||
import { AlfrescoApiService, LogService } from 'ng2-alfresco-core';
|
||||
import { Observable } from 'rxjs/Rx';
|
||||
import { ExternalContent } from '../components/widgets/core/external-content';
|
||||
|
@@ -16,11 +16,11 @@
|
||||
*/
|
||||
|
||||
import {
|
||||
AttachWidget,
|
||||
AttachWidgetComponent,
|
||||
FormFieldModel,
|
||||
FormFieldTypes,
|
||||
UnknownWidget,
|
||||
UploadWidget
|
||||
UnknownWidgetComponent,
|
||||
UploadWidgetComponent
|
||||
} from './../components/widgets/index';
|
||||
import { DefaultTypeResolver, FormRenderingService } from './form-rendering.service';
|
||||
|
||||
@@ -40,7 +40,7 @@ describe('FormRenderingService', () => {
|
||||
}
|
||||
});
|
||||
let type = service.resolveComponentType(field);
|
||||
expect(type).toBe(AttachWidget);
|
||||
expect(type).toBe(AttachWidgetComponent);
|
||||
});
|
||||
|
||||
it('should resolve Upload field as Upload widget', () => {
|
||||
@@ -51,44 +51,44 @@ describe('FormRenderingService', () => {
|
||||
}
|
||||
});
|
||||
let type = service.resolveComponentType(field);
|
||||
expect(type).toBe(UploadWidget);
|
||||
expect(type).toBe(UploadWidgetComponent);
|
||||
});
|
||||
|
||||
it('should resolve Unknown widget for Upload field', () => {
|
||||
let resolver = service.getComponentTypeResolver(FormFieldTypes.UPLOAD);
|
||||
let type = resolver(null);
|
||||
expect(type).toBe(UnknownWidget);
|
||||
expect(type).toBe(UnknownWidgetComponent);
|
||||
});
|
||||
|
||||
it('should resolve Uknown widget for unknown field type', () => {
|
||||
let resolver = service.getComponentTypeResolver('missing-type');
|
||||
let type = resolver(null);
|
||||
expect(type).toBe(UnknownWidget);
|
||||
expect(type).toBe(UnknownWidgetComponent);
|
||||
});
|
||||
|
||||
it('shoulld resolve custom value for unknown field type', () => {
|
||||
let resolver = service.getComponentTypeResolver('missing-type', AttachWidget);
|
||||
let resolver = service.getComponentTypeResolver('missing-type', AttachWidgetComponent);
|
||||
let type = resolver(null);
|
||||
expect(type).toBe(AttachWidget);
|
||||
expect(type).toBe(AttachWidgetComponent);
|
||||
});
|
||||
|
||||
it('should fallback to default resolver when field type missing', () => {
|
||||
let resolver = service.getComponentTypeResolver(null);
|
||||
let type = resolver(null);
|
||||
expect(type).toBe(UnknownWidget);
|
||||
expect(type).toBe(UnknownWidgetComponent);
|
||||
});
|
||||
|
||||
it('should fallback to custom resolver when field type missing', () => {
|
||||
let resolver = service.getComponentTypeResolver(null, UploadWidget);
|
||||
let resolver = service.getComponentTypeResolver(null, UploadWidgetComponent);
|
||||
let type = resolver(null);
|
||||
expect(type).toBe(UploadWidget);
|
||||
expect(type).toBe(UploadWidgetComponent);
|
||||
});
|
||||
|
||||
it('should require field type to set resolver for type', () => {
|
||||
expect(
|
||||
() => service.setComponentTypeResolver(
|
||||
null,
|
||||
DefaultTypeResolver.fromType(UnknownWidget)
|
||||
DefaultTypeResolver.fromType(UnknownWidgetComponent)
|
||||
)
|
||||
).toThrowError('fieldType is null or not defined');
|
||||
});
|
||||
@@ -106,23 +106,23 @@ describe('FormRenderingService', () => {
|
||||
expect(
|
||||
() => service.setComponentTypeResolver(
|
||||
FormFieldTypes.TEXT,
|
||||
DefaultTypeResolver.fromType(UnknownWidget)
|
||||
DefaultTypeResolver.fromType(UnknownWidgetComponent)
|
||||
)
|
||||
).toThrowError('already mapped, use override option if you intend replacing existing mapping.');
|
||||
});
|
||||
|
||||
it('should override existing resolver with explicit flag', () => {
|
||||
let customResolver = DefaultTypeResolver.fromType(UnknownWidget);
|
||||
let customResolver = DefaultTypeResolver.fromType(UnknownWidgetComponent);
|
||||
service.setComponentTypeResolver(FormFieldTypes.TEXT, customResolver, true);
|
||||
expect(service.getComponentTypeResolver(FormFieldTypes.TEXT)).toBe(customResolver);
|
||||
});
|
||||
|
||||
it('should return default value when resolving with no field', () => {
|
||||
expect(service.resolveComponentType(null)).toBe(UnknownWidget);
|
||||
expect(service.resolveComponentType(null)).toBe(UnknownWidgetComponent);
|
||||
});
|
||||
|
||||
it('should return custom value when resolving with no field', () => {
|
||||
expect(service.resolveComponentType(null, AttachWidget)).toBe(AttachWidget);
|
||||
expect(service.resolveComponentType(null, AttachWidgetComponent)).toBe(AttachWidgetComponent);
|
||||
});
|
||||
|
||||
});
|
||||
|
@@ -18,49 +18,49 @@
|
||||
import { Injectable, Type } from '@angular/core';
|
||||
|
||||
import {
|
||||
AmountWidget,
|
||||
AttachWidget,
|
||||
CheckboxWidget,
|
||||
ContainerWidget,
|
||||
DateWidget,
|
||||
DisplayTextWidget,
|
||||
DisplayValueWidget,
|
||||
DropdownWidget,
|
||||
DynamicTableWidget,
|
||||
AmountWidgetComponent,
|
||||
AttachWidgetComponent,
|
||||
CheckboxWidgetComponent,
|
||||
ContainerWidgetComponent,
|
||||
DateWidgetComponent,
|
||||
DisplayTextWidgetComponentComponent,
|
||||
DisplayValueWidgetComponent,
|
||||
DropdownWidgetComponent,
|
||||
DynamicTableWidgetComponent,
|
||||
FormFieldModel,
|
||||
FunctionalGroupWidget,
|
||||
HyperlinkWidget,
|
||||
MultilineTextWidget,
|
||||
NumberWidget,
|
||||
PeopleWidget,
|
||||
RadioButtonsWidget,
|
||||
TextWidget,
|
||||
TypeaheadWidget,
|
||||
UnknownWidget,
|
||||
UploadWidget
|
||||
FunctionalGroupWidgetComponent,
|
||||
HyperlinkWidgetComponent,
|
||||
MultilineTextWidgetComponentComponent,
|
||||
NumberWidgetComponent,
|
||||
PeopleWidgetComponent,
|
||||
RadioButtonsWidgetComponent,
|
||||
TextWidgetComponent,
|
||||
TypeaheadWidgetComponent,
|
||||
UnknownWidgetComponent,
|
||||
UploadWidgetComponent
|
||||
} from './../components/widgets/index';
|
||||
|
||||
@Injectable()
|
||||
export class FormRenderingService {
|
||||
|
||||
private types: { [key: string]: ComponentTypeResolver } = {
|
||||
'text': DefaultTypeResolver.fromType(TextWidget),
|
||||
'integer': DefaultTypeResolver.fromType(NumberWidget),
|
||||
'multi-line-text': DefaultTypeResolver.fromType(MultilineTextWidget),
|
||||
'boolean': DefaultTypeResolver.fromType(CheckboxWidget),
|
||||
'dropdown': DefaultTypeResolver.fromType(DropdownWidget),
|
||||
'date': DefaultTypeResolver.fromType(DateWidget),
|
||||
'amount': DefaultTypeResolver.fromType(AmountWidget),
|
||||
'radio-buttons': DefaultTypeResolver.fromType(RadioButtonsWidget),
|
||||
'hyperlink': DefaultTypeResolver.fromType(HyperlinkWidget),
|
||||
'readonly': DefaultTypeResolver.fromType(DisplayValueWidget),
|
||||
'readonly-text': DefaultTypeResolver.fromType(DisplayTextWidget),
|
||||
'typeahead': DefaultTypeResolver.fromType(TypeaheadWidget),
|
||||
'people': DefaultTypeResolver.fromType(PeopleWidget),
|
||||
'functional-group': DefaultTypeResolver.fromType(FunctionalGroupWidget),
|
||||
'dynamic-table': DefaultTypeResolver.fromType(DynamicTableWidget),
|
||||
'container': DefaultTypeResolver.fromType(ContainerWidget),
|
||||
'group': DefaultTypeResolver.fromType(ContainerWidget)
|
||||
'text': DefaultTypeResolver.fromType(TextWidgetComponent),
|
||||
'integer': DefaultTypeResolver.fromType(NumberWidgetComponent),
|
||||
'multi-line-text': DefaultTypeResolver.fromType(MultilineTextWidgetComponentComponent),
|
||||
'boolean': DefaultTypeResolver.fromType(CheckboxWidgetComponent),
|
||||
'dropdown': DefaultTypeResolver.fromType(DropdownWidgetComponent),
|
||||
'date': DefaultTypeResolver.fromType(DateWidgetComponent),
|
||||
'amount': DefaultTypeResolver.fromType(AmountWidgetComponent),
|
||||
'radio-buttons': DefaultTypeResolver.fromType(RadioButtonsWidgetComponent),
|
||||
'hyperlink': DefaultTypeResolver.fromType(HyperlinkWidgetComponent),
|
||||
'readonly': DefaultTypeResolver.fromType(DisplayValueWidgetComponent),
|
||||
'readonly-text': DefaultTypeResolver.fromType(DisplayTextWidgetComponentComponent),
|
||||
'typeahead': DefaultTypeResolver.fromType(TypeaheadWidgetComponent),
|
||||
'people': DefaultTypeResolver.fromType(PeopleWidgetComponent),
|
||||
'functional-group': DefaultTypeResolver.fromType(FunctionalGroupWidgetComponent),
|
||||
'dynamic-table': DefaultTypeResolver.fromType(DynamicTableWidgetComponent),
|
||||
'container': DefaultTypeResolver.fromType(ContainerWidgetComponent),
|
||||
'group': DefaultTypeResolver.fromType(ContainerWidgetComponent)
|
||||
};
|
||||
|
||||
constructor() {
|
||||
@@ -68,15 +68,15 @@ export class FormRenderingService {
|
||||
if (field) {
|
||||
let params = field.params;
|
||||
if (params && params.link) {
|
||||
return AttachWidget;
|
||||
return AttachWidgetComponent;
|
||||
}
|
||||
return UploadWidget;
|
||||
return UploadWidgetComponent;
|
||||
}
|
||||
return UnknownWidget;
|
||||
return UnknownWidgetComponent;
|
||||
};
|
||||
}
|
||||
|
||||
getComponentTypeResolver(fieldType: string, defaultValue: Type<{}> = UnknownWidget): ComponentTypeResolver {
|
||||
getComponentTypeResolver(fieldType: string, defaultValue: Type<{}> = UnknownWidgetComponent): ComponentTypeResolver {
|
||||
if (fieldType) {
|
||||
return this.types[fieldType] || DefaultTypeResolver.fromType(defaultValue);
|
||||
}
|
||||
@@ -100,7 +100,7 @@ export class FormRenderingService {
|
||||
this.types[fieldType] = resolver;
|
||||
}
|
||||
|
||||
resolveComponentType(field: FormFieldModel, defaultValue: Type<{}> = UnknownWidget): Type<{}> {
|
||||
resolveComponentType(field: FormFieldModel, defaultValue: Type<{}> = UnknownWidgetComponent): Type<{}> {
|
||||
if (field) {
|
||||
let resolver = this.getComponentTypeResolver(field.type, defaultValue);
|
||||
return resolver(field);
|
||||
@@ -110,9 +110,7 @@ export class FormRenderingService {
|
||||
|
||||
}
|
||||
|
||||
export interface ComponentTypeResolver {
|
||||
(field: FormFieldModel): Type<{}>;
|
||||
}
|
||||
export type ComponentTypeResolver = (field: FormFieldModel) => Type<{}>;
|
||||
|
||||
export class DefaultTypeResolver {
|
||||
static fromType(type: Type<{}>): ComponentTypeResolver {
|
||||
|
@@ -1,4 +1,7 @@
|
||||
{
|
||||
"rulesDirectory": [
|
||||
"node_modules/codelyzer"
|
||||
],
|
||||
"rules": {
|
||||
"align": [
|
||||
true,
|
||||
@@ -105,14 +108,50 @@
|
||||
"allow-leading-underscore",
|
||||
"ban-keywords"
|
||||
],
|
||||
"callable-types": true,
|
||||
"import-blacklist": [
|
||||
true,
|
||||
"rxjs"
|
||||
],
|
||||
"import-spacing": true,
|
||||
"interface-over-type-literal": true,
|
||||
"member-access": false,
|
||||
"no-empty-interface": true,
|
||||
"no-string-literal": false,
|
||||
"no-string-throw": true,
|
||||
"prefer-const": false,
|
||||
"typeof-compare": true,
|
||||
"unified-signatures": true,
|
||||
"whitespace": [
|
||||
true,
|
||||
"check-branch",
|
||||
"check-decl",
|
||||
"check-operator",
|
||||
"check-separator",
|
||||
"check-type",
|
||||
"check-module",
|
||||
"check-decl"
|
||||
]
|
||||
"check-type"
|
||||
],
|
||||
"directive-selector": [
|
||||
true,
|
||||
"attribute",
|
||||
"app",
|
||||
"camelCase"
|
||||
],
|
||||
"component-selector": [
|
||||
true,
|
||||
"element",
|
||||
"app",
|
||||
"kebab-case"
|
||||
],
|
||||
"ordered-imports": true,
|
||||
"use-input-property-decorator": true,
|
||||
"use-output-property-decorator": true,
|
||||
"use-host-property-decorator": true,
|
||||
"use-life-cycle-interface": true,
|
||||
"use-pipe-transform-interface": true,
|
||||
"component-class-suffix": true,
|
||||
"directive-class-suffix": true,
|
||||
"no-access-missing-member": false,
|
||||
"templates-use-public": true,
|
||||
"invoke-injectable": true
|
||||
}
|
||||
}
|
||||
|
@@ -45,7 +45,8 @@ module.exports = {
|
||||
loader: 'tslint-loader',
|
||||
options: {
|
||||
emitErrors: true,
|
||||
failOnHint: true
|
||||
failOnHint: true,
|
||||
fix: true
|
||||
},
|
||||
exclude: [/node_modules/, /bundles/, /dist/, /demo/]
|
||||
},
|
||||
|
@@ -16,23 +16,23 @@
|
||||
*/
|
||||
|
||||
import { ModuleWithProviders, NgModule } from '@angular/core';
|
||||
import { MdProgressSpinnerModule } from '@angular/material';
|
||||
import { ActivitiFormModule } from 'ng2-activiti-form';
|
||||
import { ActivitiTaskListModule } from 'ng2-activiti-tasklist';
|
||||
import { CoreModule } from 'ng2-alfresco-core';
|
||||
import { DataTableModule } from 'ng2-alfresco-datatable';
|
||||
import { MdProgressSpinnerModule } from '@angular/material';
|
||||
|
||||
import {
|
||||
ActivitiCreateProcessAttachmentComponent,
|
||||
ActivitiProcessAttachmentListComponent,
|
||||
ActivitiProcessComments,
|
||||
ActivitiProcessFilters,
|
||||
ActivitiProcessInstanceDetails,
|
||||
ActivitiProcessInstanceHeader,
|
||||
ActivitiProcessCommentsComponent,
|
||||
ActivitiProcessFiltersComponent,
|
||||
ActivitiProcessInstanceDetailsComponent,
|
||||
ActivitiProcessInstanceHeaderComponent,
|
||||
ActivitiProcessInstanceListComponent,
|
||||
ActivitiProcessInstanceTasks,
|
||||
ActivitiProcessInstanceVariables,
|
||||
ActivitiStartProcessInstance
|
||||
ActivitiProcessInstanceTasksComponent,
|
||||
ActivitiProcessInstanceVariablesComponent,
|
||||
ActivitiStartProcessInstanceComponent
|
||||
} from './src/components/index';
|
||||
|
||||
import { ActivitiProcessService } from './src/services/activiti-process.service';
|
||||
@@ -55,13 +55,13 @@ export * from './src/services/activiti-process.service';
|
||||
|
||||
export const ACTIVITI_PROCESSLIST_DIRECTIVES: [any] = [
|
||||
ActivitiProcessInstanceListComponent,
|
||||
ActivitiProcessFilters,
|
||||
ActivitiProcessInstanceDetails,
|
||||
ActivitiProcessInstanceHeader,
|
||||
ActivitiProcessInstanceTasks,
|
||||
ActivitiProcessInstanceVariables,
|
||||
ActivitiProcessComments,
|
||||
ActivitiStartProcessInstance,
|
||||
ActivitiProcessFiltersComponent,
|
||||
ActivitiProcessInstanceDetailsComponent,
|
||||
ActivitiProcessInstanceHeaderComponent,
|
||||
ActivitiProcessInstanceTasksComponent,
|
||||
ActivitiProcessInstanceVariablesComponent,
|
||||
ActivitiProcessCommentsComponent,
|
||||
ActivitiStartProcessInstanceComponent,
|
||||
ActivitiProcessAttachmentListComponent,
|
||||
ActivitiCreateProcessAttachmentComponent
|
||||
];
|
||||
|
@@ -20,11 +20,11 @@ import { LogServiceMock } from 'ng2-alfresco-core';
|
||||
import { Observable } from 'rxjs/Rx';
|
||||
import { FilterProcessRepresentationModel } from '../models/filter-process.model';
|
||||
import { ActivitiProcessService } from '../services/activiti-process.service';
|
||||
import { ActivitiProcessFilters } from './activiti-filters.component';
|
||||
import { ActivitiProcessFiltersComponent } from './activiti-filters.component';
|
||||
|
||||
describe('ActivitiFilters', () => {
|
||||
|
||||
let filterList: ActivitiProcessFilters;
|
||||
let filterList: ActivitiProcessFiltersComponent;
|
||||
let activitiService: ActivitiProcessService;
|
||||
let logService: LogServiceMock;
|
||||
|
||||
@@ -53,7 +53,7 @@ describe('ActivitiFilters', () => {
|
||||
beforeEach(() => {
|
||||
logService = new LogServiceMock();
|
||||
activitiService = new ActivitiProcessService(null, logService);
|
||||
filterList = new ActivitiProcessFilters(null, activitiService, logService);
|
||||
filterList = new ActivitiProcessFiltersComponent(null, activitiService, logService);
|
||||
});
|
||||
|
||||
it('should return the filter task list', (done) => {
|
||||
|
@@ -28,7 +28,7 @@ declare let componentHandler: any;
|
||||
templateUrl: './activiti-filters.component.html',
|
||||
styleUrls: ['activiti-filters.component.css']
|
||||
})
|
||||
export class ActivitiProcessFilters implements OnInit, OnChanges {
|
||||
export class ActivitiProcessFiltersComponent implements OnInit, OnChanges {
|
||||
|
||||
@Input()
|
||||
filterParam: FilterParamsModel;
|
||||
|
@@ -25,14 +25,14 @@ import { AlfrescoTranslationService, CoreModule } from 'ng2-alfresco-core';
|
||||
|
||||
import { TranslationMock } from './../assets/translation.service.mock';
|
||||
import { ActivitiProcessService } from './../services/activiti-process.service';
|
||||
import { ActivitiProcessComments } from './activiti-process-comments.component';
|
||||
import { ActivitiProcessCommentsComponent } from './activiti-process-comments.component';
|
||||
|
||||
describe('ActivitiProcessInstanceComments', () => {
|
||||
|
||||
let componentHandler: any;
|
||||
let service: ActivitiProcessService;
|
||||
let component: ActivitiProcessComments;
|
||||
let fixture: ComponentFixture<ActivitiProcessComments>;
|
||||
let component: ActivitiProcessCommentsComponent;
|
||||
let fixture: ComponentFixture<ActivitiProcessCommentsComponent>;
|
||||
let getCommentsSpy: jasmine.Spy;
|
||||
let addCommentSpy: jasmine.Spy;
|
||||
|
||||
@@ -43,7 +43,7 @@ describe('ActivitiProcessInstanceComments', () => {
|
||||
ActivitiFormModule
|
||||
],
|
||||
declarations: [
|
||||
ActivitiProcessComments
|
||||
ActivitiProcessCommentsComponent
|
||||
],
|
||||
providers: [
|
||||
{ provide: AlfrescoTranslationService, useClass: TranslationMock },
|
||||
@@ -54,7 +54,7 @@ describe('ActivitiProcessInstanceComments', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
fixture = TestBed.createComponent(ActivitiProcessComments);
|
||||
fixture = TestBed.createComponent(ActivitiProcessCommentsComponent);
|
||||
component = fixture.componentInstance;
|
||||
service = fixture.debugElement.injector.get(ActivitiProcessService);
|
||||
|
||||
|
@@ -31,7 +31,7 @@ declare let dialogPolyfill: any;
|
||||
styleUrls: ['./activiti-process-comments.component.css'],
|
||||
providers: [ActivitiProcessService]
|
||||
})
|
||||
export class ActivitiProcessComments implements OnChanges {
|
||||
export class ActivitiProcessCommentsComponent implements OnChanges {
|
||||
|
||||
@Input()
|
||||
processInstanceId: string;
|
||||
|
@@ -28,15 +28,15 @@ import { ProcessInstance } from '../models/process-instance.model';
|
||||
import { exampleProcess, exampleProcessNoName } from './../assets/activiti-process.model.mock';
|
||||
import { TranslationMock } from './../assets/translation.service.mock';
|
||||
import { ActivitiProcessService } from './../services/activiti-process.service';
|
||||
import { ActivitiProcessInstanceDetails } from './activiti-process-instance-details.component';
|
||||
import { ActivitiProcessInstanceDetailsComponent } from './activiti-process-instance-details.component';
|
||||
|
||||
describe('ActivitiProcessInstanceDetails', () => {
|
||||
describe('ActivitiProcessInstanceDetailsComponent', () => {
|
||||
|
||||
let componentHandler: any;
|
||||
let service: ActivitiProcessService;
|
||||
let formService: FormService;
|
||||
let component: ActivitiProcessInstanceDetails;
|
||||
let fixture: ComponentFixture<ActivitiProcessInstanceDetails>;
|
||||
let component: ActivitiProcessInstanceDetailsComponent;
|
||||
let fixture: ComponentFixture<ActivitiProcessInstanceDetailsComponent>;
|
||||
let getProcessSpy: jasmine.Spy;
|
||||
|
||||
beforeEach(async(() => {
|
||||
@@ -47,7 +47,7 @@ describe('ActivitiProcessInstanceDetails', () => {
|
||||
ActivitiTaskListModule
|
||||
],
|
||||
declarations: [
|
||||
ActivitiProcessInstanceDetails
|
||||
ActivitiProcessInstanceDetailsComponent
|
||||
],
|
||||
providers: [
|
||||
{ provide: AlfrescoTranslationService, useClass: TranslationMock },
|
||||
@@ -59,7 +59,7 @@ describe('ActivitiProcessInstanceDetails', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
fixture = TestBed.createComponent(ActivitiProcessInstanceDetails);
|
||||
fixture = TestBed.createComponent(ActivitiProcessInstanceDetailsComponent);
|
||||
component = fixture.componentInstance;
|
||||
service = fixture.debugElement.injector.get(ActivitiProcessService);
|
||||
formService = fixture.debugElement.injector.get(FormService);
|
||||
|
@@ -22,24 +22,24 @@ import {AlfrescoTranslationService, LogService} from 'ng2-alfresco-core';
|
||||
|
||||
import {ProcessInstance} from '../models/process-instance.model';
|
||||
import {ActivitiProcessService} from './../services/activiti-process.service';
|
||||
import {ActivitiProcessInstanceHeader} from './activiti-process-instance-header.component';
|
||||
import {ActivitiProcessInstanceTasks} from './activiti-process-instance-tasks.component';
|
||||
import {ActivitiProcessInstanceHeaderComponent} from './activiti-process-instance-header.component';
|
||||
import {ActivitiProcessInstanceTasksComponent} from './activiti-process-instance-tasks.component';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-process-instance-details, activiti-process-instance-details',
|
||||
templateUrl: './activiti-process-instance-details.component.html',
|
||||
styleUrls: ['./activiti-process-instance-details.component.css']
|
||||
})
|
||||
export class ActivitiProcessInstanceDetails implements OnChanges {
|
||||
export class ActivitiProcessInstanceDetailsComponent implements OnChanges {
|
||||
|
||||
@Input()
|
||||
processInstanceId: string;
|
||||
|
||||
@ViewChild(ActivitiProcessInstanceHeader)
|
||||
processInstanceHeader: ActivitiProcessInstanceHeader;
|
||||
@ViewChild(ActivitiProcessInstanceHeaderComponent)
|
||||
processInstanceHeader: ActivitiProcessInstanceHeaderComponent;
|
||||
|
||||
@ViewChild(ActivitiProcessInstanceTasks)
|
||||
tasksList: ActivitiProcessInstanceTasks;
|
||||
@ViewChild(ActivitiProcessInstanceTasksComponent)
|
||||
tasksList: ActivitiProcessInstanceTasksComponent;
|
||||
|
||||
@Input()
|
||||
showTitle: boolean = true;
|
||||
|
@@ -22,14 +22,14 @@ import { exampleProcess, processEnded } from './../assets/activiti-process.model
|
||||
import { TranslationMock } from './../assets/translation.service.mock';
|
||||
import { ProcessInstance } from './../models/process-instance.model';
|
||||
import { ActivitiProcessService } from './../services/activiti-process.service';
|
||||
import { ActivitiProcessComments } from './activiti-process-comments.component';
|
||||
import { ActivitiProcessInstanceHeader } from './activiti-process-instance-header.component';
|
||||
import { ActivitiProcessCommentsComponent } from './activiti-process-comments.component';
|
||||
import { ActivitiProcessInstanceHeaderComponent } from './activiti-process-instance-header.component';
|
||||
|
||||
describe('ActivitiProcessInstanceHeader', () => {
|
||||
describe('ActivitiProcessInstanceHeaderComponent', () => {
|
||||
|
||||
let componentHandler: any;
|
||||
let component: ActivitiProcessInstanceHeader;
|
||||
let fixture: ComponentFixture<ActivitiProcessInstanceHeader>;
|
||||
let component: ActivitiProcessInstanceHeaderComponent;
|
||||
let fixture: ComponentFixture<ActivitiProcessInstanceHeaderComponent>;
|
||||
let element: HTMLElement;
|
||||
|
||||
beforeEach(async(() => {
|
||||
@@ -38,8 +38,8 @@ describe('ActivitiProcessInstanceHeader', () => {
|
||||
CoreModule.forRoot()
|
||||
],
|
||||
declarations: [
|
||||
ActivitiProcessInstanceHeader,
|
||||
ActivitiProcessComments
|
||||
ActivitiProcessInstanceHeaderComponent,
|
||||
ActivitiProcessCommentsComponent
|
||||
],
|
||||
providers: [
|
||||
ActivitiProcessService,
|
||||
@@ -50,7 +50,7 @@ describe('ActivitiProcessInstanceHeader', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
fixture = TestBed.createComponent(ActivitiProcessInstanceHeader);
|
||||
fixture = TestBed.createComponent(ActivitiProcessInstanceHeaderComponent);
|
||||
component = fixture.componentInstance;
|
||||
element = fixture.nativeElement;
|
||||
|
||||
|
@@ -27,7 +27,7 @@ declare let componentHandler: any;
|
||||
templateUrl: './activiti-process-instance-header.component.html',
|
||||
styleUrls: ['./activiti-process-instance-header.component.css']
|
||||
})
|
||||
export class ActivitiProcessInstanceHeader {
|
||||
export class ActivitiProcessInstanceHeaderComponent {
|
||||
|
||||
@Input()
|
||||
showDiagram: boolean = true;
|
||||
|
@@ -27,13 +27,13 @@ import { taskDetailsMock } from './../assets/task-details.mock';
|
||||
import { TranslationMock } from './../assets/translation.service.mock';
|
||||
import { ProcessInstance } from './../models/process-instance.model';
|
||||
import { ActivitiProcessService } from './../services/activiti-process.service';
|
||||
import { ActivitiProcessInstanceTasks } from './activiti-process-instance-tasks.component';
|
||||
import { ActivitiProcessInstanceTasksComponent } from './activiti-process-instance-tasks.component';
|
||||
|
||||
describe('ActivitiProcessInstanceTasks', () => {
|
||||
describe('ActivitiProcessInstanceTasksComponent', () => {
|
||||
|
||||
let componentHandler: any;
|
||||
let component: ActivitiProcessInstanceTasks;
|
||||
let fixture: ComponentFixture<ActivitiProcessInstanceTasks>;
|
||||
let component: ActivitiProcessInstanceTasksComponent;
|
||||
let fixture: ComponentFixture<ActivitiProcessInstanceTasksComponent>;
|
||||
let debugElement: DebugElement;
|
||||
let service: ActivitiProcessService;
|
||||
let getProcessTasksSpy: jasmine.Spy;
|
||||
@@ -46,7 +46,7 @@ describe('ActivitiProcessInstanceTasks', () => {
|
||||
CoreModule.forRoot()
|
||||
],
|
||||
declarations: [
|
||||
ActivitiProcessInstanceTasks
|
||||
ActivitiProcessInstanceTasksComponent
|
||||
],
|
||||
providers: [
|
||||
{ provide: AlfrescoTranslationService, useClass: TranslationMock },
|
||||
@@ -58,7 +58,7 @@ describe('ActivitiProcessInstanceTasks', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
fixture = TestBed.createComponent(ActivitiProcessInstanceTasks);
|
||||
fixture = TestBed.createComponent(ActivitiProcessInstanceTasksComponent);
|
||||
component = fixture.componentInstance;
|
||||
debugElement = fixture.debugElement;
|
||||
service = fixture.debugElement.injector.get(ActivitiProcessService);
|
||||
|
@@ -31,7 +31,7 @@ declare let dialogPolyfill: any;
|
||||
templateUrl: './activiti-process-instance-tasks.component.html',
|
||||
styleUrls: ['./activiti-process-instance-tasks.component.css']
|
||||
})
|
||||
export class ActivitiProcessInstanceTasks implements OnInit, OnChanges {
|
||||
export class ActivitiProcessInstanceTasksComponent implements OnInit, OnChanges {
|
||||
|
||||
@Input()
|
||||
processInstanceDetails: ProcessInstance;
|
||||
|
@@ -26,14 +26,14 @@ import { DataTableModule, ObjectDataRow, ObjectDataTableAdapter } from 'ng2-alfr
|
||||
|
||||
import { TranslationMock } from './../assets/translation.service.mock';
|
||||
import { ActivitiProcessService } from './../services/activiti-process.service';
|
||||
import { ActivitiProcessInstanceVariables } from './activiti-process-instance-variables.component';
|
||||
import { ActivitiProcessInstanceVariablesComponent } from './activiti-process-instance-variables.component';
|
||||
|
||||
describe('ActivitiProcessInstanceVariables', () => {
|
||||
describe('ActivitiProcessInstanceVariablesComponent', () => {
|
||||
|
||||
let componentHandler: any;
|
||||
let service: ActivitiProcessService;
|
||||
let component: ActivitiProcessInstanceVariables;
|
||||
let fixture: ComponentFixture<ActivitiProcessInstanceVariables>;
|
||||
let component: ActivitiProcessInstanceVariablesComponent;
|
||||
let fixture: ComponentFixture<ActivitiProcessInstanceVariablesComponent>;
|
||||
let getVariablesSpy: jasmine.Spy;
|
||||
let createOrUpdateProcessInstanceVariablesSpy: jasmine.Spy;
|
||||
let deleteProcessInstanceVariableSpy: jasmine.Spy;
|
||||
@@ -46,7 +46,7 @@ describe('ActivitiProcessInstanceVariables', () => {
|
||||
MdProgressSpinnerModule
|
||||
],
|
||||
declarations: [
|
||||
ActivitiProcessInstanceVariables
|
||||
ActivitiProcessInstanceVariablesComponent
|
||||
],
|
||||
providers: [
|
||||
{ provide: AlfrescoTranslationService, useClass: TranslationMock },
|
||||
@@ -57,7 +57,7 @@ describe('ActivitiProcessInstanceVariables', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
fixture = TestBed.createComponent(ActivitiProcessInstanceVariables);
|
||||
fixture = TestBed.createComponent(ActivitiProcessInstanceVariablesComponent);
|
||||
component = fixture.componentInstance;
|
||||
service = fixture.debugElement.injector.get(ActivitiProcessService);
|
||||
|
||||
|
@@ -31,7 +31,7 @@ declare let dialogPolyfill: any;
|
||||
styleUrls: ['./activiti-process-instance-variables.component.css'],
|
||||
providers: [ActivitiProcessService]
|
||||
})
|
||||
export class ActivitiProcessInstanceVariables implements OnInit, OnChanges {
|
||||
export class ActivitiProcessInstanceVariablesComponent implements OnInit, OnChanges {
|
||||
|
||||
@Input()
|
||||
processInstanceId: string;
|
||||
|
@@ -26,13 +26,13 @@ import { RestVariable } from 'alfresco-js-api';
|
||||
import { ActivitiProcessService } from '../services/activiti-process.service';
|
||||
import { fakeProcessDefs, fakeProcessDefWithForm, newProcess, taskFormMock } from './../assets/activiti-start-process.component.mock';
|
||||
import { TranslationMock } from './../assets/translation.service.mock';
|
||||
import { ActivitiStartProcessInstance } from './activiti-start-process.component';
|
||||
import { ActivitiStartProcessInstanceComponent } from './activiti-start-process.component';
|
||||
|
||||
describe('ActivitiStartProcessInstance', () => {
|
||||
describe('ActivitiStartProcessInstanceComponent', () => {
|
||||
|
||||
let componentHandler: any;
|
||||
let component: ActivitiStartProcessInstance;
|
||||
let fixture: ComponentFixture<ActivitiStartProcessInstance>;
|
||||
let component: ActivitiStartProcessInstanceComponent;
|
||||
let fixture: ComponentFixture<ActivitiStartProcessInstanceComponent>;
|
||||
let processService: ActivitiProcessService;
|
||||
let formService: FormService;
|
||||
let getDefinitionsSpy: jasmine.Spy;
|
||||
@@ -47,7 +47,7 @@ describe('ActivitiStartProcessInstance', () => {
|
||||
ActivitiFormModule.forRoot()
|
||||
],
|
||||
declarations: [
|
||||
ActivitiStartProcessInstance
|
||||
ActivitiStartProcessInstanceComponent
|
||||
],
|
||||
providers: [
|
||||
{provide: AlfrescoTranslationService, useClass: TranslationMock},
|
||||
@@ -59,7 +59,7 @@ describe('ActivitiStartProcessInstance', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
fixture = TestBed.createComponent(ActivitiStartProcessInstance);
|
||||
fixture = TestBed.createComponent(ActivitiStartProcessInstanceComponent);
|
||||
component = fixture.componentInstance;
|
||||
debugElement = fixture.debugElement;
|
||||
processService = fixture.debugElement.injector.get(ActivitiProcessService);
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
import { Component, EventEmitter, Input, OnChanges, Output, SimpleChanges, ViewChild } from '@angular/core';
|
||||
import { RestVariable } from 'alfresco-js-api';
|
||||
import { ActivitiStartForm } from 'ng2-activiti-form';
|
||||
import { ActivitiStartFormComponent } from 'ng2-activiti-form';
|
||||
import { AlfrescoTranslationService } from 'ng2-alfresco-core';
|
||||
import { ProcessDefinitionRepresentation } from './../models/process-definition.model';
|
||||
import { ProcessInstance } from './../models/process-instance.model';
|
||||
@@ -31,7 +31,7 @@ declare let dialogPolyfill: any;
|
||||
templateUrl: './activiti-start-process.component.html',
|
||||
styleUrls: ['./activiti-start-process.component.css']
|
||||
})
|
||||
export class ActivitiStartProcessInstance implements OnChanges {
|
||||
export class ActivitiStartProcessInstanceComponent implements OnChanges {
|
||||
|
||||
@Input()
|
||||
appId: string;
|
||||
@@ -45,8 +45,8 @@ export class ActivitiStartProcessInstance implements OnChanges {
|
||||
@Output()
|
||||
error: EventEmitter<ProcessInstance> = new EventEmitter<ProcessInstance>();
|
||||
|
||||
@ViewChild(ActivitiStartForm)
|
||||
startForm: ActivitiStartForm;
|
||||
@ViewChild(ActivitiStartFormComponent)
|
||||
startForm: ActivitiStartFormComponent;
|
||||
|
||||
processDefinitions: ProcessDefinitionRepresentation[] = [];
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user