mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-12 17:04:57 +00:00
[ADF-1968] [IE11] The login page is not loading and import fix (#2679)
* fix viewer script export insights and diagram remove requires svg fix new data adapter path dist working with diagrams commented out change use of minimatch fix unused import remove unused component fix test new import moment es6 and throw rxjs fix import analytics test fix imports rxjs new pacakging * fix after rebase * fix test upload services * exclude temporarily button event test * restore commented demo shell files * fix process spy
This commit is contained in:
parent
39737b3df6
commit
f629f48d16
@ -94,23 +94,38 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"glob": "**/*",
|
"glob": "**/*",
|
||||||
"input": "../../lib/core/bundles/assets",
|
"input": "../../lib/core/assets",
|
||||||
"output": "./assets/"
|
"output": "./assets/"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"glob": "**/*",
|
"glob": "**/*",
|
||||||
"input": "../../lib/process-services/bundles/assets",
|
"input": "../../lib/process-services/assets",
|
||||||
"output": "./assets/"
|
"output": "./assets/"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"glob": "**/*",
|
"glob": "**/*",
|
||||||
"input": "../../lib/content-services/bundles/assets",
|
"input": "../../lib/content-services/assets",
|
||||||
"output": "./assets/"
|
"output": "./assets/"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"glob": "**/*",
|
"glob": "**/*",
|
||||||
"input": "../../lib/insights/bundles/assets",
|
"input": "../../lib/core/i18n",
|
||||||
"output": "./assets/"
|
"output": "./assets/adf-core/i18n"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"glob": "**/*",
|
||||||
|
"input": "../../lib/process-services/i18n",
|
||||||
|
"output": "./assets/adf-process-services/i18n"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"glob": "**/*",
|
||||||
|
"input": "../../lib/content-services/i18n",
|
||||||
|
"output": "./assets/adf-content-services/i18n"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"glob": "**/*",
|
||||||
|
"input": "../../lib/insights/i18n",
|
||||||
|
"output": "./assets/adf-insights/i18n"
|
||||||
},
|
},
|
||||||
{ "glob": "pdf.worker.js", "input": "../node_modules/pdfjs-dist/build", "output": "./" }
|
{ "glob": "pdf.worker.js", "input": "../node_modules/pdfjs-dist/build", "output": "./" }
|
||||||
],
|
],
|
||||||
|
@ -84,6 +84,7 @@
|
|||||||
"hammerjs": "2.0.8",
|
"hammerjs": "2.0.8",
|
||||||
"intl": "1.2.5",
|
"intl": "1.2.5",
|
||||||
"minimatch": "3.0.4",
|
"minimatch": "3.0.4",
|
||||||
|
"moment-es6": "^1.0.0",
|
||||||
"moment": "2.15.2",
|
"moment": "2.15.2",
|
||||||
"ng2-3d-editor": "0.0.18",
|
"ng2-3d-editor": "0.0.18",
|
||||||
"ng2-charts": "1.6.0",
|
"ng2-charts": "1.6.0",
|
||||||
|
@ -159,7 +159,7 @@
|
|||||||
<data-column key="name" title="ADF_PROCESS_LIST.PROPERTIES.NAME" class="full-width name-column"></data-column>
|
<data-column key="name" title="ADF_PROCESS_LIST.PROPERTIES.NAME" class="full-width name-column"></data-column>
|
||||||
<data-column key="created" title="ADF_PROCESS_LIST.PROPERTIES.CREATED" class="hidden"></data-column>
|
<data-column key="created" title="ADF_PROCESS_LIST.PROPERTIES.CREATED" class="hidden"></data-column>
|
||||||
</data-columns> -->
|
</data-columns> -->
|
||||||
|
|
||||||
</adf-process-instance-list>
|
</adf-process-instance-list>
|
||||||
</div>
|
</div>
|
||||||
<div class="activiti-grid-item activiti-processes-details" *ngIf="!isStartProcessMode()" fxFlex.gt-md="1 1 auto">
|
<div class="activiti-grid-item activiti-processes-details" *ngIf="!isStartProcessMode()" fxFlex.gt-md="1 1 auto">
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"noUnusedLocals": true,
|
"noUnusedLocals": true,
|
||||||
"target": "es5",
|
"target": "es5",
|
||||||
|
"allowSyntheticDefaultImports": true,
|
||||||
"typeRoots": [
|
"typeRoots": [
|
||||||
"node_modules/@types"
|
"node_modules/@types"
|
||||||
],
|
],
|
||||||
|
25
lib/config/bundle-scss-new.js
Normal file
25
lib/config/bundle-scss-new.js
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
var Bundler = require('scss-bundle').Bundler;
|
||||||
|
var writeFileSync = require('fs-extra').writeFileSync;
|
||||||
|
var mkdirpSync = require('fs-extra').mkdirpSync;
|
||||||
|
|
||||||
|
new Bundler().Bundle('./core/styles/_index.scss', '**/*.scss').then(result => {
|
||||||
|
mkdirpSync('core');
|
||||||
|
writeFileSync('core/dist/_theming.scss', result.bundledContent);
|
||||||
|
});
|
||||||
|
|
||||||
|
new Bundler().Bundle('./insights/styles/_index.scss', '**/*.scss').then(result => {
|
||||||
|
mkdirpSync('insights');
|
||||||
|
writeFileSync('insights/dist/_theming.scss', result.bundledContent);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
new Bundler().Bundle('./process-services/styles/_index.scss', '**/*.scss').then(result => {
|
||||||
|
mkdirpSync('process-services');
|
||||||
|
writeFileSync('process-services/dist/_theming.scss', result.bundledContent);
|
||||||
|
});
|
||||||
|
|
||||||
|
new Bundler().Bundle('./content-services/styles/_index.scss', '**/*.scss').then(result => {
|
||||||
|
mkdirpSync('content-services');
|
||||||
|
writeFileSync('content-services/dist/_theming.scss', result.bundledContent);
|
||||||
|
});
|
||||||
|
|
@ -30,7 +30,6 @@ describe('Breadcrumb', () => {
|
|||||||
|
|
||||||
let component: BreadcrumbComponent;
|
let component: BreadcrumbComponent;
|
||||||
let fixture: ComponentFixture<BreadcrumbComponent>;
|
let fixture: ComponentFixture<BreadcrumbComponent>;
|
||||||
let element: HTMLElement;
|
|
||||||
let documentList: DocumentListComponent;
|
let documentList: DocumentListComponent;
|
||||||
|
|
||||||
beforeEach(async(() => {
|
beforeEach(async(() => {
|
||||||
@ -55,7 +54,6 @@ describe('Breadcrumb', () => {
|
|||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
fixture = TestBed.createComponent(BreadcrumbComponent);
|
fixture = TestBed.createComponent(BreadcrumbComponent);
|
||||||
|
|
||||||
element = fixture.nativeElement;
|
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
|
|
||||||
documentList = TestBed.createComponent<DocumentListComponent>(DocumentListComponent).componentInstance;
|
documentList = TestBed.createComponent<DocumentListComponent>(DocumentListComponent).componentInstance;
|
||||||
|
@ -28,7 +28,6 @@ describe('DropdownBreadcrumb', () => {
|
|||||||
|
|
||||||
let component: DropdownBreadcrumbComponent;
|
let component: DropdownBreadcrumbComponent;
|
||||||
let fixture: ComponentFixture<DropdownBreadcrumbComponent>;
|
let fixture: ComponentFixture<DropdownBreadcrumbComponent>;
|
||||||
let element: HTMLElement;
|
|
||||||
let documentList: DocumentListComponent;
|
let documentList: DocumentListComponent;
|
||||||
|
|
||||||
beforeEach(async(() => {
|
beforeEach(async(() => {
|
||||||
@ -52,7 +51,6 @@ describe('DropdownBreadcrumb', () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
fixture = TestBed.createComponent(DropdownBreadcrumbComponent);
|
fixture = TestBed.createComponent(DropdownBreadcrumbComponent);
|
||||||
element = fixture.nativeElement;
|
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
|
|
||||||
documentList = TestBed.createComponent<DocumentListComponent>(DocumentListComponent).componentInstance;
|
documentList = TestBed.createComponent<DocumentListComponent>(DocumentListComponent).componentInstance;
|
||||||
|
@ -17,5 +17,3 @@
|
|||||||
|
|
||||||
export * from './breadcrumb.component';
|
export * from './breadcrumb.component';
|
||||||
export * from './dropdown-breadcrumb.component';
|
export * from './dropdown-breadcrumb.component';
|
||||||
|
|
||||||
export * from './breadcrumb.module';
|
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
import { ChangeDetectionStrategy, Component, Input, OnChanges, OnInit, ViewEncapsulation } from '@angular/core';
|
import { ChangeDetectionStrategy, Component, Input, OnChanges, OnInit, ViewEncapsulation } from '@angular/core';
|
||||||
import { MinimalNodeEntryEntity } from 'alfresco-js-api';
|
import { MinimalNodeEntryEntity } from 'alfresco-js-api';
|
||||||
import { Observable } from 'rxjs/Rx';
|
import { Observable } from 'rxjs/Observable';
|
||||||
import { CardViewItem, CardViewUpdateService, FileSizePipe, NodesApiService } from '@alfresco/adf-core';
|
import { CardViewItem, CardViewUpdateService, FileSizePipe, NodesApiService } from '@alfresco/adf-core';
|
||||||
import { ContentMetadataService } from './content-metadata.service';
|
import { ContentMetadataService } from './content-metadata.service';
|
||||||
|
|
||||||
|
@ -17,5 +17,3 @@
|
|||||||
|
|
||||||
export * from './content-metadata.component';
|
export * from './content-metadata.component';
|
||||||
export * from './content-metadata.service';
|
export * from './content-metadata.service';
|
||||||
|
|
||||||
export * from './content-metadata.module';
|
|
||||||
|
@ -15,9 +15,15 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export { DataTableAdapter } from './datatable-adapter';
|
import { EventEmitter } from '@angular/core';
|
||||||
export { ObjectDataColumn, ObjectDataRow, ObjectDataTableAdapter } from './object-datatable-adapter';
|
import { MinimalNodeEntryEntity } from 'alfresco-js-api';
|
||||||
export { DataRow } from './data-row.model';
|
|
||||||
export { DataRowEvent } from './data-row-event.model';
|
export interface ContentNodeSelectorComponentData {
|
||||||
export { DataColumn } from './data-column.model';
|
title: string;
|
||||||
export { DataSorting } from './data-sorting.model';
|
currentFolderId?: string;
|
||||||
|
dropdownHideMyFiles?: boolean;
|
||||||
|
dropdownSiteList?: any[];
|
||||||
|
rowFilter?: any;
|
||||||
|
imageResolver?: any;
|
||||||
|
select: EventEmitter<MinimalNodeEntryEntity[]>;
|
||||||
|
}
|
@ -15,14 +15,14 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { CUSTOM_ELEMENTS_SCHEMA, DebugElement, EventEmitter } from '@angular/core';
|
import { CUSTOM_ELEMENTS_SCHEMA, EventEmitter } from '@angular/core';
|
||||||
import { async, ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing';
|
import { async, ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing';
|
||||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material';
|
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material';
|
||||||
import { By } from '@angular/platform-browser';
|
import { By } from '@angular/platform-browser';
|
||||||
import { MinimalNodeEntryEntity } from 'alfresco-js-api';
|
import { MinimalNodeEntryEntity } from 'alfresco-js-api';
|
||||||
import { AlfrescoApiService, ContentService, TranslationService, SearchService, SiteModel, SitesApiService, UserPreferencesService } from '@alfresco/adf-core';
|
import { AlfrescoApiService, ContentService, TranslationService, SearchService, SiteModel, SitesApiService, UserPreferencesService } from '@alfresco/adf-core';
|
||||||
import { DataTableModule } from '@alfresco/adf-core';
|
import { DataTableModule } from '@alfresco/adf-core';
|
||||||
import { Observable } from 'rxjs/Rx';
|
import { Observable } from 'rxjs/Observable';
|
||||||
import { MaterialModule } from '../material.module';
|
import { MaterialModule } from '../material.module';
|
||||||
import { EmptyFolderContentDirective, DocumentListComponent, DocumentListService } from '../document-list';
|
import { EmptyFolderContentDirective, DocumentListComponent, DocumentListService } from '../document-list';
|
||||||
import { DropdownSitesComponent } from '../site-dropdown';
|
import { DropdownSitesComponent } from '../site-dropdown';
|
||||||
@ -50,13 +50,11 @@ const ONE_FOLDER_RESULT = {
|
|||||||
describe('ContentNodeSelectorComponent', () => {
|
describe('ContentNodeSelectorComponent', () => {
|
||||||
let component: ContentNodeSelectorComponent;
|
let component: ContentNodeSelectorComponent;
|
||||||
let fixture: ComponentFixture<ContentNodeSelectorComponent>;
|
let fixture: ComponentFixture<ContentNodeSelectorComponent>;
|
||||||
let element: DebugElement;
|
|
||||||
let data: any;
|
let data: any;
|
||||||
let searchService: SearchService;
|
let searchService: SearchService;
|
||||||
let searchSpy: jasmine.Spy;
|
let searchSpy: jasmine.Spy;
|
||||||
|
|
||||||
let _resolve: Function;
|
let _resolve: Function;
|
||||||
let _reject: Function;
|
|
||||||
|
|
||||||
function typeToSearchBox(searchTerm = 'string-to-search') {
|
function typeToSearchBox(searchTerm = 'string-to-search') {
|
||||||
let searchInput = fixture.debugElement.query(By.css('[data-automation-id="content-node-selector-search-input"]'));
|
let searchInput = fixture.debugElement.query(By.css('[data-automation-id="content-node-selector-search-input"]'));
|
||||||
@ -119,7 +117,6 @@ describe('ContentNodeSelectorComponent', () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
fixture = TestBed.createComponent(ContentNodeSelectorComponent);
|
fixture = TestBed.createComponent(ContentNodeSelectorComponent);
|
||||||
element = fixture.debugElement;
|
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
||||||
@ -198,15 +195,13 @@ describe('ContentNodeSelectorComponent', () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
fixture = TestBed.createComponent(ContentNodeSelectorComponent);
|
fixture = TestBed.createComponent(ContentNodeSelectorComponent);
|
||||||
element = fixture.debugElement;
|
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
|
|
||||||
searchService = TestBed.get(SearchService);
|
searchService = TestBed.get(SearchService);
|
||||||
searchSpy = spyOn(searchService, 'getQueryNodesPromise').and.callFake(() => {
|
searchSpy = spyOn(searchService, 'getQueryNodesPromise').and.callFake(() => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
_resolve = resolve;
|
_resolve = resolve;
|
||||||
_reject = reject;
|
});
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -23,18 +23,9 @@ import { DocumentListComponent, PaginationStrategy } from '../document-list/com
|
|||||||
import { RowFilter } from '../document-list/data/row-filter.model';
|
import { RowFilter } from '../document-list/data/row-filter.model';
|
||||||
import { ImageResolver } from '../document-list/data/image-resolver.model';
|
import { ImageResolver } from '../document-list/data/image-resolver.model';
|
||||||
|
|
||||||
|
import { ContentNodeSelectorComponentData } from './content-node-selector.component-data.interface';
|
||||||
import { ContentNodeSelectorService } from './content-node-selector.service';
|
import { ContentNodeSelectorService } from './content-node-selector.service';
|
||||||
|
|
||||||
export interface ContentNodeSelectorComponentData {
|
|
||||||
title: string;
|
|
||||||
currentFolderId?: string;
|
|
||||||
dropdownHideMyFiles?: boolean;
|
|
||||||
dropdownSiteList?: any[];
|
|
||||||
rowFilter?: RowFilter;
|
|
||||||
imageResolver?: ImageResolver;
|
|
||||||
select: EventEmitter<MinimalNodeEntryEntity[]>;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'adf-content-node-selector',
|
selector: 'adf-content-node-selector',
|
||||||
styleUrls: ['./content-node-selector.component.scss'],
|
styleUrls: ['./content-node-selector.component.scss'],
|
||||||
|
@ -22,10 +22,10 @@ import { TranslateModule } from '@ngx-translate/core';
|
|||||||
|
|
||||||
import { ContentNodeSelectorComponent } from './content-node-selector.component';
|
import { ContentNodeSelectorComponent } from './content-node-selector.component';
|
||||||
import { ContentNodeSelectorService } from './content-node-selector.service';
|
import { ContentNodeSelectorService } from './content-node-selector.service';
|
||||||
import { SitesDropdownModule } from '../site-dropdown';
|
import { SitesDropdownModule } from '../site-dropdown/sites-dropdown.module';
|
||||||
import { BreadcrumbModule } from '../breadcrumb';
|
import { BreadcrumbModule } from '../breadcrumb/breadcrumb.module';
|
||||||
import { PaginationModule, ToolbarModule } from '@alfresco/adf-core';
|
import { PaginationModule, ToolbarModule } from '@alfresco/adf-core';
|
||||||
import { DocumentListModule } from '../document-list';
|
import { DocumentListModule } from '../document-list/document-list.module';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
import { SearchOptions, SearchService } from '@alfresco/adf-core';
|
import { SearchOptions, SearchService } from '@alfresco/adf-core';
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { NodePaging } from 'alfresco-js-api';
|
import { NodePaging } from 'alfresco-js-api';
|
||||||
import { Observable } from 'rxjs/Rx';
|
import { Observable } from 'rxjs/Observable';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Internal service used by ContentNodeSelector component.
|
* Internal service used by ContentNodeSelector component.
|
||||||
|
@ -17,5 +17,3 @@
|
|||||||
|
|
||||||
export * from './content-node-selector.component';
|
export * from './content-node-selector.component';
|
||||||
export * from './content-node-selector.service';
|
export * from './content-node-selector.service';
|
||||||
|
|
||||||
export * from './content-node-selector.module';
|
|
||||||
|
@ -23,19 +23,19 @@ import { CoreModule, TRANSLATION_PROVIDER } from '@alfresco/adf-core';
|
|||||||
|
|
||||||
import { MaterialModule } from './material.module';
|
import { MaterialModule } from './material.module';
|
||||||
|
|
||||||
import { SocialModule } from './social';
|
import { SocialModule } from './social/social.module';
|
||||||
import { TagModule } from './tag';
|
import { TagModule } from './tag/tag.module';
|
||||||
import { WebScriptModule } from './webscript';
|
import { WebScriptModule } from './webscript/webscript.module';
|
||||||
import { DocumentListModule } from './document-list';
|
import { DocumentListModule } from './document-list/document-list.module';
|
||||||
import { UploadModule } from './upload';
|
import { UploadModule } from './upload/upload.module';
|
||||||
import { SearchModule } from './search';
|
import { SearchModule } from './search/search.module';
|
||||||
import { SitesDropdownModule } from './site-dropdown';
|
import { SitesDropdownModule } from './site-dropdown/sites-dropdown.module';
|
||||||
import { BreadcrumbModule } from './breadcrumb';
|
import { BreadcrumbModule } from './breadcrumb/breadcrumb.module';
|
||||||
import { VersionManagerModule } from './version-manager';
|
import { VersionManagerModule } from './version-manager/version-manager.module';
|
||||||
import { ContentNodeSelectorModule } from './content-node-selector';
|
import { ContentNodeSelectorModule } from './content-node-selector/content-node-selector.module';
|
||||||
import { DialogModule } from './dialogs';
|
import { DialogModule } from './dialogs/dialog.module';
|
||||||
import { DirectiveModule } from './directive';
|
import { FolderDirectiveModule } from './folder-directive/folder-directive.module';
|
||||||
import { ContentMetadataModule } from './content-metadata';
|
import { ContentMetadataModule } from './content-metadata/content-metadata.module';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
@ -57,7 +57,7 @@ import { ContentMetadataModule } from './content-metadata';
|
|||||||
ContentNodeSelectorModule,
|
ContentNodeSelectorModule,
|
||||||
ContentMetadataModule,
|
ContentMetadataModule,
|
||||||
DialogModule,
|
DialogModule,
|
||||||
DirectiveModule
|
FolderDirectiveModule
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
{
|
{
|
||||||
@ -83,7 +83,8 @@ import { ContentMetadataModule } from './content-metadata';
|
|||||||
ContentNodeSelectorModule,
|
ContentNodeSelectorModule,
|
||||||
ContentMetadataModule,
|
ContentMetadataModule,
|
||||||
DialogModule,
|
DialogModule,
|
||||||
DirectiveModule
|
FolderDirectiveModule,
|
||||||
|
MaterialModule
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
export class ContentModule {
|
export class ContentModule {
|
||||||
|
@ -21,7 +21,7 @@ import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|||||||
import { MatDialogRef } from '@angular/material';
|
import { MatDialogRef } from '@angular/material';
|
||||||
import { MaterialModule } from '../material.module';
|
import { MaterialModule } from '../material.module';
|
||||||
import { BrowserDynamicTestingModule } from '@angular/platform-browser-dynamic/testing';
|
import { BrowserDynamicTestingModule } from '@angular/platform-browser-dynamic/testing';
|
||||||
import { Observable } from 'rxjs/Rx';
|
import { Observable } from 'rxjs/Observable';
|
||||||
|
|
||||||
import { NodesApiService, NotificationService, TranslationService } from '@alfresco/adf-core';
|
import { NodesApiService, NotificationService, TranslationService } from '@alfresco/adf-core';
|
||||||
import { FolderDialogComponent } from './folder.dialog';
|
import { FolderDialogComponent } from './folder.dialog';
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Observable } from 'rxjs/Rx';
|
import { Observable } from 'rxjs/Observable';
|
||||||
|
|
||||||
import { Component, Inject, OnInit, Optional } from '@angular/core';
|
import { Component, Inject, OnInit, Optional } from '@angular/core';
|
||||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||||
|
@ -17,5 +17,3 @@
|
|||||||
|
|
||||||
export * from './download-zip.dialog';
|
export * from './download-zip.dialog';
|
||||||
export * from './folder.dialog';
|
export * from './folder.dialog';
|
||||||
|
|
||||||
export * from './dialog.module';
|
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||||
import { EventEmitter } from '@angular/core';
|
import { EventEmitter } from '@angular/core';
|
||||||
import { async, TestBed } from '@angular/core/testing';
|
import { async, TestBed } from '@angular/core/testing';
|
||||||
import { ContentService, TranslationService, NotificationService } from '@alfresco/adf-core';
|
import { ContentService } from '@alfresco/adf-core';
|
||||||
import { DataTableModule } from '@alfresco/adf-core';
|
import { DataTableModule } from '@alfresco/adf-core';
|
||||||
import { MaterialModule } from '../../../material.module';
|
import { MaterialModule } from '../../../material.module';
|
||||||
|
|
||||||
@ -40,8 +40,6 @@ describe('ContentAction', () => {
|
|||||||
let folderActions: FolderActionsService;
|
let folderActions: FolderActionsService;
|
||||||
|
|
||||||
let contentService: ContentService;
|
let contentService: ContentService;
|
||||||
let translateService: TranslationService;
|
|
||||||
let notificationService: NotificationService;
|
|
||||||
let nodeActionsService: NodeActionsService;
|
let nodeActionsService: NodeActionsService;
|
||||||
|
|
||||||
beforeEach(async(() => {
|
beforeEach(async(() => {
|
||||||
@ -64,9 +62,7 @@ describe('ContentAction', () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
contentService = TestBed.get(ContentService);
|
contentService = TestBed.get(ContentService);
|
||||||
translateService = <TranslationService> { addTranslationFolder: () => {}};
|
|
||||||
nodeActionsService = new NodeActionsService(null, null, null);
|
nodeActionsService = new NodeActionsService(null, null, null);
|
||||||
notificationService = new NotificationService(null);
|
|
||||||
documentActions = new DocumentActionsService(nodeActionsService);
|
documentActions = new DocumentActionsService(nodeActionsService);
|
||||||
folderActions = new FolderActionsService(nodeActionsService, null, contentService);
|
folderActions = new FolderActionsService(nodeActionsService, null, contentService);
|
||||||
|
|
||||||
|
@ -20,7 +20,8 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
|||||||
import { AlfrescoApiService, TranslationService } from '@alfresco/adf-core';
|
import { AlfrescoApiService, TranslationService } from '@alfresco/adf-core';
|
||||||
import { DataColumn, DataTableComponent } from '@alfresco/adf-core';
|
import { DataColumn, DataTableComponent } from '@alfresco/adf-core';
|
||||||
import { DataTableModule } from '@alfresco/adf-core';
|
import { DataTableModule } from '@alfresco/adf-core';
|
||||||
import { Observable, Subject } from 'rxjs/Rx';
|
import { Observable } from 'rxjs/Observable';
|
||||||
|
import { Subject } from 'rxjs/Subject';
|
||||||
import { FileNode, FolderNode } from '../../mock';
|
import { FileNode, FolderNode } from '../../mock';
|
||||||
import {
|
import {
|
||||||
fakeNodeAnswerWithEntries,
|
fakeNodeAnswerWithEntries,
|
||||||
|
@ -36,10 +36,9 @@ import {
|
|||||||
PersonEntry,
|
PersonEntry,
|
||||||
SitePaging
|
SitePaging
|
||||||
} from 'alfresco-js-api';
|
} from 'alfresco-js-api';
|
||||||
import { Observable, Subject } from 'rxjs/Rx';
|
import { Observable } from 'rxjs/Observable';
|
||||||
|
import { Subject } from 'rxjs/Subject';
|
||||||
import { presetsDefaultModel } from '../models/preset.model';
|
import { presetsDefaultModel } from '../models/preset.model';
|
||||||
import { ImageResolver } from './../data/image-resolver.model';
|
|
||||||
import { RowFilter } from './../data/row-filter.model';
|
|
||||||
import { ShareDataRow } from './../data/share-data-row.model';
|
import { ShareDataRow } from './../data/share-data-row.model';
|
||||||
import { ShareDataTableAdapter } from './../data/share-datatable-adapter';
|
import { ShareDataTableAdapter } from './../data/share-datatable-adapter';
|
||||||
|
|
||||||
@ -48,8 +47,6 @@ import { PermissionStyleModel } from './../models/permissions-style.model';
|
|||||||
import { DocumentListService } from './../services/document-list.service';
|
import { DocumentListService } from './../services/document-list.service';
|
||||||
import { NodeEntityEvent, NodeEntryEvent } from './node.event';
|
import { NodeEntityEvent, NodeEntryEvent } from './node.event';
|
||||||
|
|
||||||
declare var require: any;
|
|
||||||
|
|
||||||
export enum PaginationStrategy {
|
export enum PaginationStrategy {
|
||||||
Finite,
|
Finite,
|
||||||
Infinite
|
Infinite
|
||||||
@ -100,7 +97,7 @@ export class DocumentListComponent implements OnInit, OnChanges, AfterContentIni
|
|||||||
contextMenuActions: boolean = false;
|
contextMenuActions: boolean = false;
|
||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
emptyFolderImageUrl: string = require('../../assets/images/empty_doc_lib.svg');
|
emptyFolderImageUrl: string = './assets/images/empty_doc_lib.svg';
|
||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
allowDropFiles: boolean = false;
|
allowDropFiles: boolean = false;
|
||||||
@ -118,10 +115,10 @@ export class DocumentListComponent implements OnInit, OnChanges, AfterContentIni
|
|||||||
loading: boolean = false;
|
loading: boolean = false;
|
||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
rowFilter: RowFilter | null = null;
|
rowFilter: any | null = null;
|
||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
imageResolver: ImageResolver | null = null;
|
imageResolver: any | null = null;
|
||||||
|
|
||||||
// The identifier of a node. You can also use one of these well-known aliases: -my- | -shared- | -root-
|
// The identifier of a node. You can also use one of these well-known aliases: -my- | -shared- | -root-
|
||||||
@Input()
|
@Input()
|
||||||
|
@ -19,6 +19,11 @@ import { BaseEvent } from '@alfresco/adf-core';
|
|||||||
import { MinimalNodeEntity, MinimalNodeEntryEntity } from 'alfresco-js-api';
|
import { MinimalNodeEntity, MinimalNodeEntryEntity } from 'alfresco-js-api';
|
||||||
|
|
||||||
export class NodeEntityEvent extends BaseEvent<MinimalNodeEntity> {
|
export class NodeEntityEvent extends BaseEvent<MinimalNodeEntity> {
|
||||||
|
|
||||||
|
value: MinimalNodeEntity;
|
||||||
|
|
||||||
|
defaultPrevented: boolean;
|
||||||
|
|
||||||
constructor(entity: MinimalNodeEntity) {
|
constructor(entity: MinimalNodeEntity) {
|
||||||
super();
|
super();
|
||||||
this.value = entity;
|
this.value = entity;
|
||||||
@ -26,6 +31,11 @@ export class NodeEntityEvent extends BaseEvent<MinimalNodeEntity> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class NodeEntryEvent extends BaseEvent<MinimalNodeEntryEntity> {
|
export class NodeEntryEvent extends BaseEvent<MinimalNodeEntryEntity> {
|
||||||
|
|
||||||
|
value: MinimalNodeEntryEntity;
|
||||||
|
|
||||||
|
defaultPrevented: boolean;
|
||||||
|
|
||||||
constructor(entity: MinimalNodeEntryEntity) {
|
constructor(entity: MinimalNodeEntryEntity) {
|
||||||
super();
|
super();
|
||||||
this.value = entity;
|
this.value = entity;
|
||||||
|
@ -21,8 +21,6 @@ import { DatePipe } from '@angular/common';
|
|||||||
import { NodePaging } from 'alfresco-js-api';
|
import { NodePaging } from 'alfresco-js-api';
|
||||||
import { PermissionStyleModel } from './../models/permissions-style.model';
|
import { PermissionStyleModel } from './../models/permissions-style.model';
|
||||||
import { DocumentListService } from './../services/document-list.service';
|
import { DocumentListService } from './../services/document-list.service';
|
||||||
import { ImageResolver } from './image-resolver.model';
|
|
||||||
import { RowFilter } from './row-filter.model';
|
|
||||||
import { ShareDataRow } from './share-data-row.model';
|
import { ShareDataRow } from './share-data-row.model';
|
||||||
|
|
||||||
export class ShareDataTableAdapter implements DataTableAdapter {
|
export class ShareDataTableAdapter implements DataTableAdapter {
|
||||||
@ -33,10 +31,9 @@ export class ShareDataTableAdapter implements DataTableAdapter {
|
|||||||
private sorting: DataSorting;
|
private sorting: DataSorting;
|
||||||
private rows: DataRow[];
|
private rows: DataRow[];
|
||||||
private columns: DataColumn[];
|
private columns: DataColumn[];
|
||||||
private page: NodePaging;
|
|
||||||
|
|
||||||
private filter: RowFilter;
|
private filter: any;
|
||||||
private imageResolver: ImageResolver;
|
private imageResolver: any;
|
||||||
|
|
||||||
thumbnails: boolean = false;
|
thumbnails: boolean = false;
|
||||||
permissionsStyle: PermissionStyleModel[];
|
permissionsStyle: PermissionStyleModel[];
|
||||||
@ -169,11 +166,11 @@ export class ShareDataTableAdapter implements DataTableAdapter {
|
|||||||
this.setSorting(sorting);
|
this.setSorting(sorting);
|
||||||
}
|
}
|
||||||
|
|
||||||
setFilter(filter: RowFilter) {
|
setFilter(filter: any) {
|
||||||
this.filter = filter;
|
this.filter = filter;
|
||||||
}
|
}
|
||||||
|
|
||||||
setImageResolver(resolver: ImageResolver) {
|
setImageResolver(resolver: any) {
|
||||||
this.imageResolver = resolver;
|
this.imageResolver = resolver;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -213,8 +210,6 @@ export class ShareDataTableAdapter implements DataTableAdapter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public loadPage(page: NodePaging, merge: boolean = false) {
|
public loadPage(page: NodePaging, merge: boolean = false) {
|
||||||
this.page = page;
|
|
||||||
|
|
||||||
let rows = [];
|
let rows = [];
|
||||||
|
|
||||||
if (page && page.list) {
|
if (page && page.list) {
|
||||||
|
@ -22,7 +22,7 @@ import { TranslateModule } from '@ngx-translate/core';
|
|||||||
import { DataTableModule, PaginationModule, ToolbarModule } from '@alfresco/adf-core';
|
import { DataTableModule, PaginationModule, ToolbarModule } from '@alfresco/adf-core';
|
||||||
|
|
||||||
import { MaterialModule } from '../material.module';
|
import { MaterialModule } from '../material.module';
|
||||||
import { UploadModule } from '../upload';
|
import { UploadModule } from '../upload/upload.module';
|
||||||
|
|
||||||
import { ContentActionListComponent } from './components/content-action/content-action-list.component';
|
import { ContentActionListComponent } from './components/content-action/content-action-list.component';
|
||||||
import { ContentActionComponent } from './components/content-action/content-action.component';
|
import { ContentActionComponent } from './components/content-action/content-action.component';
|
||||||
|
@ -34,7 +34,6 @@ export let presetsDefaultModel = {
|
|||||||
key: 'path',
|
key: 'path',
|
||||||
type: 'location',
|
type: 'location',
|
||||||
title: 'ADF-DOCUMENT-LIST.LAYOUT.LOCATION',
|
title: 'ADF-DOCUMENT-LIST.LAYOUT.LOCATION',
|
||||||
format: this.locationFormat,
|
|
||||||
sortable: true
|
sortable: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -117,7 +116,6 @@ export let presetsDefaultModel = {
|
|||||||
key: 'path',
|
key: 'path',
|
||||||
type: 'location',
|
type: 'location',
|
||||||
title: 'ADF-DOCUMENT-LIST.LAYOUT.LOCATION',
|
title: 'ADF-DOCUMENT-LIST.LAYOUT.LOCATION',
|
||||||
format: this.locationFormat,
|
|
||||||
sortable: true
|
sortable: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -159,7 +157,6 @@ export let presetsDefaultModel = {
|
|||||||
type: 'location',
|
type: 'location',
|
||||||
title: 'ADF-DOCUMENT-LIST.LAYOUT.LOCATION',
|
title: 'ADF-DOCUMENT-LIST.LAYOUT.LOCATION',
|
||||||
cssClass: 'ellipsis-cell',
|
cssClass: 'ellipsis-cell',
|
||||||
format: this.locationFormat,
|
|
||||||
sortable: true
|
sortable: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -195,7 +192,6 @@ export let presetsDefaultModel = {
|
|||||||
type: 'location',
|
type: 'location',
|
||||||
title: 'ADF-DOCUMENT-LIST.LAYOUT.LOCATION',
|
title: 'ADF-DOCUMENT-LIST.LAYOUT.LOCATION',
|
||||||
cssClass: 'ellipsis-cell',
|
cssClass: 'ellipsis-cell',
|
||||||
format: this.locationFormat,
|
|
||||||
sortable: true
|
sortable: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -41,5 +41,3 @@ export * from './models/content-action.model';
|
|||||||
export * from './models/document-library.model';
|
export * from './models/document-library.model';
|
||||||
export * from './models/permissions.model';
|
export * from './models/permissions.model';
|
||||||
export * from './models/permissions-style.model';
|
export * from './models/permissions-style.model';
|
||||||
|
|
||||||
export * from './document-list.module';
|
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { ContentService, TranslationService, NotificationService } from '@alfresco/adf-core';
|
import { ContentService } from '@alfresco/adf-core';
|
||||||
import { FileNode, FolderNode, DocumentListServiceMock } from '../../mock';
|
import { FileNode, FolderNode, DocumentListServiceMock } from '../../mock';
|
||||||
import { ContentActionHandler } from '../models/content-action.model';
|
import { ContentActionHandler } from '../models/content-action.model';
|
||||||
import { DocumentActionsService } from './document-actions.service';
|
import { DocumentActionsService } from './document-actions.service';
|
||||||
@ -27,16 +27,12 @@ describe('DocumentActionsService', () => {
|
|||||||
let service: DocumentActionsService;
|
let service: DocumentActionsService;
|
||||||
let documentListService: DocumentListService;
|
let documentListService: DocumentListService;
|
||||||
let contentService: ContentService;
|
let contentService: ContentService;
|
||||||
let translateService: TranslationService;
|
|
||||||
let notificationService: NotificationService;
|
|
||||||
let nodeActionsService: NodeActionsService;
|
let nodeActionsService: NodeActionsService;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
documentListService = new DocumentListServiceMock();
|
documentListService = new DocumentListServiceMock();
|
||||||
contentService = new ContentService(null, null, null, null);
|
contentService = new ContentService(null, null, null, null);
|
||||||
translateService = <TranslationService> { addTranslationFolder: () => {}};
|
|
||||||
nodeActionsService = new NodeActionsService(null, null, null);
|
nodeActionsService = new NodeActionsService(null, null, null);
|
||||||
notificationService = new NotificationService(null);
|
|
||||||
service = new DocumentActionsService(nodeActionsService, documentListService, contentService);
|
service = new DocumentActionsService(nodeActionsService, documentListService, contentService);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -19,11 +19,12 @@ import { ContentService } from '@alfresco/adf-core';
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { MinimalNodeEntity } from 'alfresco-js-api';
|
import { MinimalNodeEntity } from 'alfresco-js-api';
|
||||||
import { Observable } from 'rxjs/Observable';
|
import { Observable } from 'rxjs/Observable';
|
||||||
import { Subject } from 'rxjs/Rx';
|
import { Subject } from 'rxjs/Subject';
|
||||||
import { ContentActionHandler } from '../models/content-action.model';
|
import { ContentActionHandler } from '../models/content-action.model';
|
||||||
import { PermissionModel } from '../models/permissions.model';
|
import { PermissionModel } from '../models/permissions.model';
|
||||||
import { DocumentListService } from './document-list.service';
|
import { DocumentListService } from './document-list.service';
|
||||||
import { NodeActionsService } from './node-actions.service';
|
import { NodeActionsService } from './node-actions.service';
|
||||||
|
import 'rxjs/add/observable/throw';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class DocumentActionsService {
|
export class DocumentActionsService {
|
||||||
|
@ -19,7 +19,8 @@ import { AlfrescoApiService, AuthenticationService, ContentService, LogService,
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { Response } from '@angular/http';
|
import { Response } from '@angular/http';
|
||||||
import { MinimalNodeEntity, MinimalNodeEntryEntity, NodePaging } from 'alfresco-js-api';
|
import { MinimalNodeEntity, MinimalNodeEntryEntity, NodePaging } from 'alfresco-js-api';
|
||||||
import { Observable } from 'rxjs/Rx';
|
import { Observable } from 'rxjs/Observable';
|
||||||
|
import 'rxjs/add/observable/throw';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class DocumentListService {
|
export class DocumentListService {
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
import { async, TestBed } from '@angular/core/testing';
|
import { async, TestBed } from '@angular/core/testing';
|
||||||
import { TranslationService, AppConfigService, NotificationService } from '@alfresco/adf-core';
|
import { TranslationService, AppConfigService, NotificationService } from '@alfresco/adf-core';
|
||||||
import { Observable } from 'rxjs/Rx';
|
import { Observable } from 'rxjs/Observable';
|
||||||
import { FileNode, FolderNode } from '../../mock';
|
import { FileNode, FolderNode } from '../../mock';
|
||||||
import { ContentActionHandler } from '../models/content-action.model';
|
import { ContentActionHandler } from '../models/content-action.model';
|
||||||
import { DocumentListService } from './document-list.service';
|
import { DocumentListService } from './document-list.service';
|
||||||
|
@ -18,11 +18,13 @@
|
|||||||
import { ContentService } from '@alfresco/adf-core';
|
import { ContentService } from '@alfresco/adf-core';
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { MinimalNodeEntity } from 'alfresco-js-api';
|
import { MinimalNodeEntity } from 'alfresco-js-api';
|
||||||
import { Observable, Subject } from 'rxjs/Rx';
|
import { Observable } from 'rxjs/Observable';
|
||||||
|
import { Subject } from 'rxjs/Subject';
|
||||||
import { ContentActionHandler } from '../models/content-action.model';
|
import { ContentActionHandler } from '../models/content-action.model';
|
||||||
import { PermissionModel } from '../models/permissions.model';
|
import { PermissionModel } from '../models/permissions.model';
|
||||||
import { DocumentListService } from './document-list.service';
|
import { DocumentListService } from './document-list.service';
|
||||||
import { NodeActionsService } from './node-actions.service';
|
import { NodeActionsService } from './node-actions.service';
|
||||||
|
import 'rxjs/add/observable/throw';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class FolderActionsService {
|
export class FolderActionsService {
|
||||||
|
@ -20,8 +20,9 @@ import { ContentService } from '@alfresco/adf-core';
|
|||||||
import { EventEmitter, Injectable } from '@angular/core';
|
import { EventEmitter, Injectable } from '@angular/core';
|
||||||
import { MatDialog } from '@angular/material';
|
import { MatDialog } from '@angular/material';
|
||||||
import { MinimalNodeEntryEntity } from 'alfresco-js-api';
|
import { MinimalNodeEntryEntity } from 'alfresco-js-api';
|
||||||
import { Subject } from 'rxjs/Rx';
|
import { Subject } from 'rxjs/Subject';
|
||||||
import { ContentNodeSelectorComponent, ContentNodeSelectorComponentData } from '../../content-node-selector/content-node-selector.component';
|
import { ContentNodeSelectorComponent } from '../../content-node-selector/content-node-selector.component';
|
||||||
|
import { ContentNodeSelectorComponentData } from '../../content-node-selector/content-node-selector.component-data.interface';
|
||||||
import { ShareDataRow } from '../data/share-data-row.model';
|
import { ShareDataRow } from '../data/share-data-row.model';
|
||||||
import { DocumentListService } from './document-list.service';
|
import { DocumentListService } from './document-list.service';
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|||||||
import { MatDialog, MatDialogModule } from '@angular/material';
|
import { MatDialog, MatDialogModule } from '@angular/material';
|
||||||
import { By } from '@angular/platform-browser';
|
import { By } from '@angular/platform-browser';
|
||||||
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
||||||
import { Observable } from 'rxjs/Rx';
|
import { Observable } from 'rxjs/Observable';
|
||||||
|
|
||||||
import { AppConfigService, DirectiveModule, ContentService, TranslateLoaderService } from '@alfresco/adf-core';
|
import { AppConfigService, DirectiveModule, ContentService, TranslateLoaderService } from '@alfresco/adf-core';
|
||||||
import { FolderCreateDirective } from './folder-create.directive';
|
import { FolderCreateDirective } from './folder-create.directive';
|
@ -36,4 +36,4 @@ import { FolderEditDirective } from './folder-edit.directive';
|
|||||||
FolderEditDirective
|
FolderEditDirective
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
export class DirectiveModule {}
|
export class FolderDirectiveModule {}
|
@ -23,7 +23,7 @@ import { By } from '@angular/platform-browser';
|
|||||||
|
|
||||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||||
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
||||||
import { Observable } from 'rxjs/Rx';
|
import { Observable } from 'rxjs/Observable';
|
||||||
|
|
||||||
import { AppConfigService, ContentService, TranslateLoaderService, DirectiveModule } from '@alfresco/adf-core';
|
import { AppConfigService, ContentService, TranslateLoaderService, DirectiveModule } from '@alfresco/adf-core';
|
||||||
import { FolderEditDirective } from './folder-edit.directive';
|
import { FolderEditDirective } from './folder-edit.directive';
|
@ -17,5 +17,3 @@
|
|||||||
|
|
||||||
export * from './folder-create.directive';
|
export * from './folder-create.directive';
|
||||||
export * from './folder-edit.directive';
|
export * from './folder-edit.directive';
|
||||||
|
|
||||||
export * from './directive.module';
|
|
@ -15,6 +15,22 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
export * from './content.module';
|
||||||
|
|
||||||
|
export * from './social/social.module';
|
||||||
|
export * from './tag/tag.module';
|
||||||
|
export * from './webscript/webscript.module';
|
||||||
|
export * from './document-list/document-list.module';
|
||||||
|
export * from './upload/upload.module';
|
||||||
|
export * from './search/search.module';
|
||||||
|
export * from './site-dropdown/sites-dropdown.module';
|
||||||
|
export * from './breadcrumb/breadcrumb.module';
|
||||||
|
export * from './version-manager/version-manager.module';
|
||||||
|
export * from './content-node-selector/content-node-selector.module';
|
||||||
|
export * from './dialogs/dialog.module';
|
||||||
|
export * from './folder-directive/folder-directive.module';
|
||||||
|
export * from './content-metadata/content-metadata.module';
|
||||||
|
|
||||||
export * from './social';
|
export * from './social';
|
||||||
export * from './tag';
|
export * from './tag';
|
||||||
export * from './webscript';
|
export * from './webscript';
|
||||||
@ -26,9 +42,5 @@ export * from './breadcrumb';
|
|||||||
export * from './version-manager';
|
export * from './version-manager';
|
||||||
export * from './content-node-selector';
|
export * from './content-node-selector';
|
||||||
export * from './dialogs';
|
export * from './dialogs';
|
||||||
export * from './directive';
|
export * from './folder-directive';
|
||||||
export * from './content-metadata';
|
export * from './content-metadata';
|
||||||
|
|
||||||
export * from './mock';
|
|
||||||
|
|
||||||
export * from './content.module';
|
|
||||||
|
@ -23,7 +23,7 @@ import {
|
|||||||
LogService,
|
LogService,
|
||||||
ThumbnailService
|
ThumbnailService
|
||||||
} from '@alfresco/adf-core';
|
} from '@alfresco/adf-core';
|
||||||
import { Observable } from 'rxjs/Rx';
|
import { Observable } from 'rxjs/Observable';
|
||||||
import { NodePaging, DocumentListService } from '../document-list';
|
import { NodePaging, DocumentListService } from '../document-list';
|
||||||
import { PageNode } from './document-library.model.mock';
|
import { PageNode } from './document-library.model.mock';
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ export let fakeSearch = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export let fakeError = {
|
export let mockError = {
|
||||||
error: {
|
error: {
|
||||||
errorKey: 'Search failed',
|
errorKey: 'Search failed',
|
||||||
statusCode: 400,
|
statusCode: 400,
|
||||||
@ -54,7 +54,7 @@ export let fakeError = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export let fakeApi = {
|
export let searchMockApi = {
|
||||||
core: {
|
core: {
|
||||||
queriesApi: {
|
queriesApi: {
|
||||||
findNodes: (term, opts) => Promise.resolve(fakeSearch)
|
findNodes: (term, opts) => Promise.resolve(fakeSearch)
|
||||||
|
@ -15,5 +15,4 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export * from './chart.model';
|
export * from './index';
|
||||||
export * from './report.model';
|
|
@ -21,6 +21,7 @@ import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, ViewEncapsul
|
|||||||
import { MinimalNodeEntity, QueryBody } from 'alfresco-js-api';
|
import { MinimalNodeEntity, QueryBody } from 'alfresco-js-api';
|
||||||
import { Observable } from 'rxjs/Observable';
|
import { Observable } from 'rxjs/Observable';
|
||||||
import { Subject } from 'rxjs/Subject';
|
import { Subject } from 'rxjs/Subject';
|
||||||
|
import 'rxjs/add/operator/distinctUntilChanged';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'adf-search-control',
|
selector: 'adf-search-control',
|
||||||
|
@ -18,5 +18,3 @@
|
|||||||
export * from './components/search.component';
|
export * from './components/search.component';
|
||||||
export * from './components/search-control.component';
|
export * from './components/search-control.component';
|
||||||
export * from './components/search-trigger.directive';
|
export * from './components/search-trigger.directive';
|
||||||
|
|
||||||
export * from './search.module';
|
|
||||||
|
@ -16,5 +16,3 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
export * from './sites-dropdown.component';
|
export * from './sites-dropdown.component';
|
||||||
|
|
||||||
export * from './sites-dropdown.module';
|
|
||||||
|
@ -19,5 +19,3 @@ export * from './rating.component';
|
|||||||
export * from './like.component';
|
export * from './like.component';
|
||||||
|
|
||||||
export * from './services/rating.service';
|
export * from './services/rating.service';
|
||||||
|
|
||||||
export * from './social.module';
|
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { DebugElement } from '@angular/core';
|
|
||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { RatingComponent } from './rating.component';
|
import { RatingComponent } from './rating.component';
|
||||||
import { MaterialModule } from '../material.module';
|
import { MaterialModule } from '../material.module';
|
||||||
@ -27,7 +26,6 @@ describe('Rating component', () => {
|
|||||||
|
|
||||||
let component: any;
|
let component: any;
|
||||||
let fixture: ComponentFixture<RatingComponent>;
|
let fixture: ComponentFixture<RatingComponent>;
|
||||||
let debug: DebugElement;
|
|
||||||
let element: HTMLElement;
|
let element: HTMLElement;
|
||||||
|
|
||||||
beforeEach(async(() => {
|
beforeEach(async(() => {
|
||||||
@ -47,7 +45,6 @@ describe('Rating component', () => {
|
|||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
fixture = TestBed.createComponent(RatingComponent);
|
fixture = TestBed.createComponent(RatingComponent);
|
||||||
|
|
||||||
debug = fixture.debugElement;
|
|
||||||
element = fixture.nativeElement;
|
element = fixture.nativeElement;
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
component.nodeId = 'test-id';
|
component.nodeId = 'test-id';
|
||||||
|
@ -19,7 +19,8 @@ import { AlfrescoApiService } from '@alfresco/adf-core';
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { Response } from '@angular/http';
|
import { Response } from '@angular/http';
|
||||||
import { RatingBody } from 'alfresco-js-api';
|
import { RatingBody } from 'alfresco-js-api';
|
||||||
import { Observable } from 'rxjs/Rx';
|
import { Observable } from 'rxjs/Observable';
|
||||||
|
import 'rxjs/add/observable/throw';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class RatingService {
|
export class RatingService {
|
||||||
|
@ -20,5 +20,3 @@ export * from './tag-list.component';
|
|||||||
export * from './tag-node-list.component';
|
export * from './tag-node-list.component';
|
||||||
|
|
||||||
export * from './services/tag.service';
|
export * from './services/tag.service';
|
||||||
|
|
||||||
export * from './tag.module';
|
|
||||||
|
@ -17,7 +17,8 @@
|
|||||||
|
|
||||||
import { AlfrescoApiService, LogService } from '@alfresco/adf-core';
|
import { AlfrescoApiService, LogService } from '@alfresco/adf-core';
|
||||||
import { EventEmitter, Injectable, Output } from '@angular/core';
|
import { EventEmitter, Injectable, Output } from '@angular/core';
|
||||||
import { Observable } from 'rxjs/Rx';
|
import { Observable } from 'rxjs/Observable';
|
||||||
|
import 'rxjs/add/observable/throw';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @returns {TagService}
|
* @returns {TagService}
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { DebugElement } from '@angular/core';
|
|
||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { AppConfigService, CoreModule } from '@alfresco/adf-core';
|
import { AppConfigService, CoreModule } from '@alfresco/adf-core';
|
||||||
import { TagActionsComponent } from './tag-actions.component';
|
import { TagActionsComponent } from './tag-actions.component';
|
||||||
@ -28,7 +27,6 @@ describe('TagActionsComponent', () => {
|
|||||||
|
|
||||||
let component: any;
|
let component: any;
|
||||||
let fixture: ComponentFixture<TagActionsComponent>;
|
let fixture: ComponentFixture<TagActionsComponent>;
|
||||||
let debug: DebugElement;
|
|
||||||
let element: HTMLElement;
|
let element: HTMLElement;
|
||||||
|
|
||||||
beforeEach(async(() => {
|
beforeEach(async(() => {
|
||||||
@ -52,7 +50,6 @@ describe('TagActionsComponent', () => {
|
|||||||
|
|
||||||
fixture = TestBed.createComponent(TagActionsComponent);
|
fixture = TestBed.createComponent(TagActionsComponent);
|
||||||
|
|
||||||
debug = fixture.debugElement;
|
|
||||||
element = fixture.nativeElement;
|
element = fixture.nativeElement;
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { DebugElement } from '@angular/core';
|
|
||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { AppConfigService, CoreModule } from '@alfresco/adf-core';
|
import { AppConfigService, CoreModule } from '@alfresco/adf-core';
|
||||||
import { TagService } from './services/tag.service';
|
import { TagService } from './services/tag.service';
|
||||||
@ -45,7 +44,6 @@ describe('TagList', () => {
|
|||||||
|
|
||||||
let component: any;
|
let component: any;
|
||||||
let fixture: ComponentFixture<TagListComponent>;
|
let fixture: ComponentFixture<TagListComponent>;
|
||||||
let debug: DebugElement;
|
|
||||||
let element: HTMLElement;
|
let element: HTMLElement;
|
||||||
|
|
||||||
beforeEach(async(() => {
|
beforeEach(async(() => {
|
||||||
@ -69,7 +67,6 @@ describe('TagList', () => {
|
|||||||
|
|
||||||
fixture = TestBed.createComponent(TagListComponent);
|
fixture = TestBed.createComponent(TagListComponent);
|
||||||
|
|
||||||
debug = fixture.debugElement;
|
|
||||||
element = fixture.nativeElement;
|
element = fixture.nativeElement;
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { DebugElement } from '@angular/core';
|
|
||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { AppConfigService, CoreModule } from '@alfresco/adf-core';
|
import { AppConfigService, CoreModule } from '@alfresco/adf-core';
|
||||||
import { TagNodeListComponent } from './tag-node-list.component';
|
import { TagNodeListComponent } from './tag-node-list.component';
|
||||||
@ -45,7 +44,6 @@ describe('TagNodeList', () => {
|
|||||||
|
|
||||||
let component: any;
|
let component: any;
|
||||||
let fixture: ComponentFixture<TagNodeListComponent>;
|
let fixture: ComponentFixture<TagNodeListComponent>;
|
||||||
let debug: DebugElement;
|
|
||||||
let element: HTMLElement;
|
let element: HTMLElement;
|
||||||
|
|
||||||
beforeEach(async(() => {
|
beforeEach(async(() => {
|
||||||
@ -69,7 +67,6 @@ describe('TagNodeList', () => {
|
|||||||
|
|
||||||
fixture = TestBed.createComponent(TagNodeListComponent);
|
fixture = TestBed.createComponent(TagNodeListComponent);
|
||||||
|
|
||||||
debug = fixture.debugElement;
|
|
||||||
element = fixture.nativeElement;
|
element = fixture.nativeElement;
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
|
@ -18,8 +18,10 @@
|
|||||||
import { FileModel, FileUploadCompleteEvent, FileUploadDeleteEvent,
|
import { FileModel, FileUploadCompleteEvent, FileUploadDeleteEvent,
|
||||||
FileUploadErrorEvent, FileUploadStatus, UploadService } from '@alfresco/adf-core';
|
FileUploadErrorEvent, FileUploadStatus, UploadService } from '@alfresco/adf-core';
|
||||||
import { ChangeDetectorRef, Component, Input, OnDestroy, OnInit, ViewChild } from '@angular/core';
|
import { ChangeDetectorRef, Component, Input, OnDestroy, OnInit, ViewChild } from '@angular/core';
|
||||||
import { Observable, Subscription } from 'rxjs/Rx';
|
import { Observable } from 'rxjs/Observable';
|
||||||
|
import { Subscription } from 'rxjs/Subscription';
|
||||||
import { FileUploadingListComponent } from './file-uploading-list.component';
|
import { FileUploadingListComponent } from './file-uploading-list.component';
|
||||||
|
import 'rxjs/add/observable/merge';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'adf-file-uploading-dialog, file-uploading-dialog',
|
selector: 'adf-file-uploading-dialog, file-uploading-dialog',
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { TranslationService, FileUploadStatus, NodesApiService, NotificationService, UploadService } from '@alfresco/adf-core';
|
import { TranslationService, FileUploadStatus, NodesApiService, NotificationService, UploadService } from '@alfresco/adf-core';
|
||||||
import { Observable } from 'rxjs/Rx';
|
import { Observable } from 'rxjs/Observable';
|
||||||
import { UploadModule } from '../upload.module';
|
import { UploadModule } from '../upload.module';
|
||||||
import { FileUploadingListComponent } from './file-uploading-list.component';
|
import { FileUploadingListComponent } from './file-uploading-list.component';
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
import { FileModel, FileUploadStatus, NodesApiService, NotificationService, TranslationService, UploadService } from '@alfresco/adf-core';
|
import { FileModel, FileUploadStatus, NodesApiService, NotificationService, TranslationService, UploadService } from '@alfresco/adf-core';
|
||||||
import { Component, ContentChild, Input, TemplateRef } from '@angular/core';
|
import { Component, ContentChild, Input, TemplateRef } from '@angular/core';
|
||||||
import { Observable } from 'rxjs/Rx';
|
import { Observable } from 'rxjs/Observable';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'adf-file-uploading-list',
|
selector: 'adf-file-uploading-list',
|
||||||
|
@ -15,11 +15,11 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { DebugElement, SimpleChange } from '@angular/core';
|
import { SimpleChange } from '@angular/core';
|
||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { MaterialModule } from '../../material.module';
|
import { MaterialModule } from '../../material.module';
|
||||||
import { ContentService, UploadService, TranslationService } from '@alfresco/adf-core';
|
import { ContentService, UploadService, TranslationService } from '@alfresco/adf-core';
|
||||||
import { Observable } from 'rxjs/Rx';
|
import { Observable } from 'rxjs/Observable';
|
||||||
import { UploadButtonComponent } from './upload-button.component';
|
import { UploadButtonComponent } from './upload-button.component';
|
||||||
import { TranslationMock } from '@alfresco/adf-core';
|
import { TranslationMock } from '@alfresco/adf-core';
|
||||||
|
|
||||||
@ -54,8 +54,6 @@ describe('UploadButtonComponent', () => {
|
|||||||
|
|
||||||
let component: UploadButtonComponent;
|
let component: UploadButtonComponent;
|
||||||
let fixture: ComponentFixture<UploadButtonComponent>;
|
let fixture: ComponentFixture<UploadButtonComponent>;
|
||||||
let debug: DebugElement;
|
|
||||||
let element: HTMLElement;
|
|
||||||
let uploadService: UploadService;
|
let uploadService: UploadService;
|
||||||
let contentService: ContentService;
|
let contentService: ContentService;
|
||||||
|
|
||||||
@ -79,8 +77,6 @@ describe('UploadButtonComponent', () => {
|
|||||||
uploadService = TestBed.get(UploadService);
|
uploadService = TestBed.get(UploadService);
|
||||||
contentService = TestBed.get(ContentService);
|
contentService = TestBed.get(ContentService);
|
||||||
|
|
||||||
debug = fixture.debugElement;
|
|
||||||
element = fixture.nativeElement;
|
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
||||||
|
@ -38,8 +38,10 @@ import {
|
|||||||
ViewEncapsulation
|
ViewEncapsulation
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
import { MinimalNodeEntryEntity } from 'alfresco-js-api';
|
import { MinimalNodeEntryEntity } from 'alfresco-js-api';
|
||||||
import { Observable, Subject } from 'rxjs/Rx';
|
import { Observable } from 'rxjs/Observable';
|
||||||
|
import { Subject } from 'rxjs/Subject';
|
||||||
import { PermissionModel } from '../../document-list/models/permissions.model';
|
import { PermissionModel } from '../../document-list/models/permissions.model';
|
||||||
|
import 'rxjs/add/observable/throw';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'adf-upload-button',
|
selector: 'adf-upload-button',
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { DebugElement } from '@angular/core';
|
|
||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { FileModel, LogService, UploadService } from '@alfresco/adf-core';
|
import { FileModel, LogService, UploadService } from '@alfresco/adf-core';
|
||||||
|
|
||||||
@ -59,10 +58,7 @@ describe('UploadDragAreaComponent', () => {
|
|||||||
|
|
||||||
let component: UploadDragAreaComponent;
|
let component: UploadDragAreaComponent;
|
||||||
let fixture: ComponentFixture<UploadDragAreaComponent>;
|
let fixture: ComponentFixture<UploadDragAreaComponent>;
|
||||||
let debug: DebugElement;
|
|
||||||
let element: HTMLElement;
|
|
||||||
let uploadService: UploadService;
|
let uploadService: UploadService;
|
||||||
let logService: LogService;
|
|
||||||
|
|
||||||
beforeEach(async(() => {
|
beforeEach(async(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
@ -79,12 +75,9 @@ describe('UploadDragAreaComponent', () => {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
logService = TestBed.get(LogService);
|
|
||||||
fixture = TestBed.createComponent(UploadDragAreaComponent);
|
fixture = TestBed.createComponent(UploadDragAreaComponent);
|
||||||
uploadService = TestBed.get(UploadService);
|
uploadService = TestBed.get(UploadService);
|
||||||
|
|
||||||
debug = fixture.debugElement;
|
|
||||||
element = fixture.nativeElement;
|
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
||||||
|
@ -22,5 +22,3 @@ export * from './components/file-uploading-list.component';
|
|||||||
export * from './components/file-uploading-list-row.component';
|
export * from './components/file-uploading-list-row.component';
|
||||||
|
|
||||||
export * from './directives/file-draggable.directive';
|
export * from './directives/file-draggable.directive';
|
||||||
|
|
||||||
export * from './upload.module';
|
|
||||||
|
@ -18,5 +18,3 @@
|
|||||||
export * from './version-list.component';
|
export * from './version-list.component';
|
||||||
export * from './version-manager.component';
|
export * from './version-manager.component';
|
||||||
export * from './version-upload.component';
|
export * from './version-upload.component';
|
||||||
|
|
||||||
export * from './version-manager.module';
|
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { CUSTOM_ELEMENTS_SCHEMA, DebugElement } from '@angular/core';
|
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { By } from '@angular/platform-browser';
|
import { By } from '@angular/platform-browser';
|
||||||
import { MaterialModule } from '../material.module';
|
import { MaterialModule } from '../material.module';
|
||||||
@ -25,7 +25,6 @@ import { AlfrescoApiService, CoreModule } from '@alfresco/adf-core';
|
|||||||
describe('VersionListComponent', () => {
|
describe('VersionListComponent', () => {
|
||||||
let component: VersionListComponent;
|
let component: VersionListComponent;
|
||||||
let fixture: ComponentFixture<VersionListComponent>;
|
let fixture: ComponentFixture<VersionListComponent>;
|
||||||
let element: DebugElement;
|
|
||||||
|
|
||||||
const nodeId = 'test-id';
|
const nodeId = 'test-id';
|
||||||
const versionId = '1.0';
|
const versionId = '1.0';
|
||||||
@ -53,7 +52,7 @@ describe('VersionListComponent', () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
fixture = TestBed.createComponent(VersionListComponent);
|
fixture = TestBed.createComponent(VersionListComponent);
|
||||||
element = fixture.debugElement;
|
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
component.id = nodeId;
|
component.id = nodeId;
|
||||||
});
|
});
|
||||||
|
@ -23,7 +23,7 @@ import { TranslateModule } from '@ngx-translate/core';
|
|||||||
import { VersionUploadComponent } from './version-upload.component';
|
import { VersionUploadComponent } from './version-upload.component';
|
||||||
import { VersionManagerComponent } from './version-manager.component';
|
import { VersionManagerComponent } from './version-manager.component';
|
||||||
import { VersionListComponent } from './version-list.component';
|
import { VersionListComponent } from './version-list.component';
|
||||||
import { UploadModule } from '../upload';
|
import { UploadModule } from '../upload/upload.module';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
|
@ -16,5 +16,3 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
export * from './webscript.component';
|
export * from './webscript.component';
|
||||||
|
|
||||||
export * from './webscript.module';
|
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { DebugElement } from '@angular/core';
|
|
||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { AppConfigService, CoreModule } from '@alfresco/adf-core';
|
import { AppConfigService, CoreModule } from '@alfresco/adf-core';
|
||||||
import { DataTableModule } from '@alfresco/adf-core';
|
import { DataTableModule } from '@alfresco/adf-core';
|
||||||
@ -27,7 +26,6 @@ describe('WebscriptComponent', () => {
|
|||||||
|
|
||||||
let component: WebscriptComponent;
|
let component: WebscriptComponent;
|
||||||
let fixture: ComponentFixture<WebscriptComponent>;
|
let fixture: ComponentFixture<WebscriptComponent>;
|
||||||
let debug: DebugElement;
|
|
||||||
let element: HTMLElement;
|
let element: HTMLElement;
|
||||||
|
|
||||||
beforeEach(async(() => {
|
beforeEach(async(() => {
|
||||||
@ -49,7 +47,6 @@ describe('WebscriptComponent', () => {
|
|||||||
fixture = TestBed.createComponent(WebscriptComponent);
|
fixture = TestBed.createComponent(WebscriptComponent);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
|
|
||||||
debug = fixture.debugElement;
|
|
||||||
element = fixture.nativeElement;
|
element = fixture.nativeElement;
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
component.scriptPath = 'fakePath';
|
component.scriptPath = 'fakePath';
|
||||||
|
@ -16,5 +16,3 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
export * from './app-config.service';
|
export * from './app-config.service';
|
||||||
|
|
||||||
export * from './app-config.module';
|
|
||||||
|
@ -20,7 +20,7 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
|||||||
import { MatDatepickerModule, MatInputModule, MatNativeDateModule } from '@angular/material';
|
import { MatDatepickerModule, MatInputModule, MatNativeDateModule } from '@angular/material';
|
||||||
import { By } from '@angular/platform-browser';
|
import { By } from '@angular/platform-browser';
|
||||||
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
||||||
import * as moment from 'moment';
|
import moment from 'moment-es6';
|
||||||
import { AppConfigService } from '../index';
|
import { AppConfigService } from '../index';
|
||||||
import { CardViewDateItemModel } from '../models/card-view-dateitem.model';
|
import { CardViewDateItemModel } from '../models/card-view-dateitem.model';
|
||||||
import { CardViewUpdateService } from '../services/card-view-update.service';
|
import { CardViewUpdateService } from '../services/card-view-update.service';
|
||||||
|
@ -18,17 +18,18 @@
|
|||||||
import { Component, Input, OnInit, ViewChild } from '@angular/core';
|
import { Component, Input, OnInit, ViewChild } from '@angular/core';
|
||||||
import { MatDatepicker } from '@angular/material';
|
import { MatDatepicker } from '@angular/material';
|
||||||
import { DateAdapter, MAT_DATE_FORMATS } from '@angular/material';
|
import { DateAdapter, MAT_DATE_FORMATS } from '@angular/material';
|
||||||
import * as moment from 'moment';
|
import moment from 'moment-es6';
|
||||||
import { Moment } from 'moment';
|
import { Moment } from 'moment';
|
||||||
import { CardViewDateItemModel } from '../models/card-view-dateitem.model';
|
import { CardViewDateItemModel } from '../models/card-view-dateitem.model';
|
||||||
import { CardViewUpdateService } from '../services/card-view-update.service';
|
import { CardViewUpdateService } from '../services/card-view-update.service';
|
||||||
import { UserPreferencesService } from '../services/user-preferences.service';
|
import { UserPreferencesService } from '../services/user-preferences.service';
|
||||||
import { MOMENT_DATE_FORMATS, MomentDateAdapter } from '../utils/momentDateAdapter';
|
import { MomentDateAdapter } from '../utils/momentDateAdapter';
|
||||||
|
import { MOMENT_DATE_FORMATS } from '../utils/moment-date-formats.model';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
providers: [
|
providers: [
|
||||||
{provide: DateAdapter, useClass: MomentDateAdapter},
|
{ provide: DateAdapter, useClass: MomentDateAdapter },
|
||||||
{provide: MAT_DATE_FORMATS, useValue: MOMENT_DATE_FORMATS}],
|
{ provide: MAT_DATE_FORMATS, useValue: MOMENT_DATE_FORMATS }],
|
||||||
selector: 'adf-card-view-dateitem',
|
selector: 'adf-card-view-dateitem',
|
||||||
templateUrl: './card-view-dateitem.component.html',
|
templateUrl: './card-view-dateitem.component.html',
|
||||||
styleUrls: ['./card-view-dateitem.component.scss']
|
styleUrls: ['./card-view-dateitem.component.scss']
|
||||||
@ -48,14 +49,13 @@ export class CardViewDateItemComponent implements OnInit {
|
|||||||
|
|
||||||
valueDate: Moment;
|
valueDate: Moment;
|
||||||
|
|
||||||
constructor(
|
constructor(private cardViewUpdateService: CardViewUpdateService,
|
||||||
private cardViewUpdateService: CardViewUpdateService,
|
private dateAdapter: DateAdapter<Moment>,
|
||||||
private dateAdapter: DateAdapter<Moment>,
|
private preferences: UserPreferencesService) {
|
||||||
private preferences: UserPreferencesService) {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.preferences.locale$.subscribe( (locale) => {
|
this.preferences.locale$.subscribe((locale) => {
|
||||||
this.dateAdapter.setLocale(locale);
|
this.dateAdapter.setLocale(locale);
|
||||||
});
|
});
|
||||||
let momentDateAdapter = <MomentDateAdapter> this.dateAdapter;
|
let momentDateAdapter = <MomentDateAdapter> this.dateAdapter;
|
||||||
|
@ -21,5 +21,3 @@ export * from './card-view-item-dispatcher.component';
|
|||||||
export * from './card-view-mapitem.component';
|
export * from './card-view-mapitem.component';
|
||||||
export * from './card-view-textitem.component';
|
export * from './card-view-textitem.component';
|
||||||
export * from './card-view.component';
|
export * from './card-view.component';
|
||||||
|
|
||||||
export * from './card-view.module';
|
|
||||||
|
@ -17,5 +17,3 @@
|
|||||||
|
|
||||||
export * from './accordion-group.component';
|
export * from './accordion-group.component';
|
||||||
export * from './accordion.component';
|
export * from './accordion.component';
|
||||||
|
|
||||||
export * from './collapsable.module';
|
|
||||||
|
@ -19,7 +19,7 @@ import { OverlayContainer } from '@angular/cdk/overlay';
|
|||||||
import { ViewportRuler } from '@angular/cdk/scrolling';
|
import { ViewportRuler } from '@angular/cdk/scrolling';
|
||||||
import { Component, HostListener, Input, OnDestroy, OnInit, Renderer2, ViewChild } from '@angular/core';
|
import { Component, HostListener, Input, OnDestroy, OnInit, Renderer2, ViewChild } from '@angular/core';
|
||||||
import { MatMenuTrigger } from '@angular/material';
|
import { MatMenuTrigger } from '@angular/material';
|
||||||
import { Subscription } from 'rxjs/Rx';
|
import { Subscription } from 'rxjs/Subscription';
|
||||||
import { ContextMenuService } from './context-menu.service';
|
import { ContextMenuService } from './context-menu.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { Subject } from 'rxjs/Rx';
|
import { Subject } from 'rxjs/Subject';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class ContextMenuService {
|
export class ContextMenuService {
|
||||||
|
@ -26,25 +26,27 @@ import { TRANSLATION_PROVIDER, TranslationService } from './services/translation
|
|||||||
|
|
||||||
import { MaterialModule } from './material.module';
|
import { MaterialModule } from './material.module';
|
||||||
|
|
||||||
import { AppConfigModule } from './app-config';
|
import { AppConfigModule } from './app-config/app-config.module';
|
||||||
import { CardViewModule } from './card-view';
|
import { CardViewModule } from './card-view/card-view.module';
|
||||||
import { CollapsableModule } from './collapsable';
|
import { CollapsableModule } from './collapsable/collapsable.module';
|
||||||
import { ContextMenuModule } from './context-menu';
|
import { ContextMenuModule } from './context-menu/context-menu.module';
|
||||||
import { DataColumnModule } from './data-column';
|
import { DataColumnModule } from './data-column/data-column.module';
|
||||||
import { DataTableModule } from './datatable';
|
import { DataTableModule } from './datatable/datatable.module';
|
||||||
import { InfoDrawerModule } from './info-drawer';
|
import { InfoDrawerModule } from './info-drawer/info-drawer.module';
|
||||||
import { LanguageMenuModule } from './language-menu';
|
import { LanguageMenuModule } from './language-menu/language-menu.module';
|
||||||
import { LoginModule } from './login';
|
import { LoginModule } from './login/login.module';
|
||||||
import { PaginationModule } from './pagination';
|
import { PaginationModule } from './pagination/pagination.module';
|
||||||
import { HostSettingsModule } from './settings';
|
import { HostSettingsModule } from './settings/host-settings.module';
|
||||||
import { ToolbarModule } from './toolbar';
|
import { ToolbarModule } from './toolbar/toolbar.module';
|
||||||
import { UserInfoModule } from './userinfo';
|
import { UserInfoModule } from './userinfo/userinfo.module';
|
||||||
import { ViewerModule } from './viewer';
|
import { ViewerModule } from './viewer/viewer.module';
|
||||||
import { FormModule } from './form';
|
import { FormModule } from './form/form.module';
|
||||||
|
|
||||||
import { DirectiveModule } from './directives';
|
import { DirectiveModule } from './directives/directive.module';
|
||||||
import { PipeModule } from './pipes';
|
import { PipeModule } from './pipes/pipe.module';
|
||||||
import { LogService , ServiceModule, TranslateLoaderService } from './services';
|
import { ServiceModule } from './services/service.module';
|
||||||
|
import { LogService } from './services/log.service';
|
||||||
|
import { TranslateLoaderService } from './services/translate-loader.service';
|
||||||
|
|
||||||
export function createTranslateLoader(http: HttpClient, logService: LogService) {
|
export function createTranslateLoader(http: HttpClient, logService: LogService) {
|
||||||
return new TranslateLoaderService(http, logService);
|
return new TranslateLoaderService(http, logService);
|
||||||
@ -80,7 +82,6 @@ export function createTranslateLoader(http: HttpClient, logService: LogService)
|
|||||||
})
|
})
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
TranslationService,
|
|
||||||
{
|
{
|
||||||
provide: TRANSLATION_PROVIDER,
|
provide: TRANSLATION_PROVIDER,
|
||||||
multi: true,
|
multi: true,
|
||||||
@ -88,7 +89,8 @@ export function createTranslateLoader(http: HttpClient, logService: LogService)
|
|||||||
name: 'adf-core',
|
name: 'adf-core',
|
||||||
source: 'assets/adf-core'
|
source: 'assets/adf-core'
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
TranslationService
|
||||||
],
|
],
|
||||||
exports: [
|
exports: [
|
||||||
AppConfigModule,
|
AppConfigModule,
|
||||||
@ -96,7 +98,6 @@ export function createTranslateLoader(http: HttpClient, logService: LogService)
|
|||||||
CommonModule,
|
CommonModule,
|
||||||
FormsModule,
|
FormsModule,
|
||||||
ReactiveFormsModule,
|
ReactiveFormsModule,
|
||||||
HttpClientModule,
|
|
||||||
TranslateModule,
|
TranslateModule,
|
||||||
ContextMenuModule,
|
ContextMenuModule,
|
||||||
CardViewModule,
|
CardViewModule,
|
||||||
@ -114,7 +115,8 @@ export function createTranslateLoader(http: HttpClient, logService: LogService)
|
|||||||
ViewerModule,
|
ViewerModule,
|
||||||
PipeModule,
|
PipeModule,
|
||||||
DirectiveModule,
|
DirectiveModule,
|
||||||
FormModule
|
FormModule,
|
||||||
|
MaterialModule
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
export class CoreModule {
|
export class CoreModule {
|
||||||
|
@ -17,5 +17,3 @@
|
|||||||
|
|
||||||
export * from './data-column-list.component';
|
export * from './data-column-list.component';
|
||||||
export * from './data-column.component';
|
export * from './data-column.component';
|
||||||
|
|
||||||
export * from './data-column.module';
|
|
||||||
|
@ -21,13 +21,12 @@ import { MatCheckboxChange } from '@angular/material';
|
|||||||
import { RouterTestingModule } from '@angular/router/testing';
|
import { RouterTestingModule } from '@angular/router/testing';
|
||||||
import { DataTableModule } from '../../datatable.module';
|
import { DataTableModule } from '../../datatable.module';
|
||||||
import { MaterialModule } from '../../../material.module';
|
import { MaterialModule } from '../../../material.module';
|
||||||
import {
|
import { DataColumn } from '../../data/data-column.model';
|
||||||
DataColumn,
|
import { DataRow } from '../../data/data-row.model';
|
||||||
DataRow,
|
import { DataSorting } from '../../data/data-sorting.model';
|
||||||
DataSorting,
|
import { ObjectDataColumn } from '../../data/object-datacolumn.model';
|
||||||
ObjectDataColumn,
|
import { ObjectDataTableAdapter } from '../../data/object-datatable-adapter';
|
||||||
ObjectDataTableAdapter
|
|
||||||
} from './../../data/index';
|
|
||||||
import { DataTableComponent } from './datatable.component';
|
import { DataTableComponent } from './datatable.component';
|
||||||
|
|
||||||
describe('DataTable', () => {
|
describe('DataTable', () => {
|
||||||
@ -35,7 +34,6 @@ describe('DataTable', () => {
|
|||||||
let fixture: ComponentFixture<DataTableComponent>;
|
let fixture: ComponentFixture<DataTableComponent>;
|
||||||
let dataTable: DataTableComponent;
|
let dataTable: DataTableComponent;
|
||||||
let element: any;
|
let element: any;
|
||||||
let eventMock: any;
|
|
||||||
|
|
||||||
beforeEach(async(() => {
|
beforeEach(async(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
@ -53,13 +51,6 @@ describe('DataTable', () => {
|
|||||||
element = fixture.debugElement.nativeElement;
|
element = fixture.debugElement.nativeElement;
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(() => {
|
|
||||||
eventMock = {
|
|
||||||
preventDefault: function () {
|
|
||||||
}
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should change the rows on changing of the data', () => {
|
it('should change the rows on changing of the data', () => {
|
||||||
let newData = new ObjectDataTableAdapter(
|
let newData = new ObjectDataTableAdapter(
|
||||||
[
|
[
|
||||||
|
@ -20,17 +20,23 @@ import {
|
|||||||
IterableDiffers, OnChanges, Output, SimpleChange, SimpleChanges, TemplateRef, ViewEncapsulation
|
IterableDiffers, OnChanges, Output, SimpleChange, SimpleChanges, TemplateRef, ViewEncapsulation
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
import { MatCheckboxChange } from '@angular/material';
|
import { MatCheckboxChange } from '@angular/material';
|
||||||
import { Observable, Observer, Subscription } from 'rxjs/Rx';
|
import { Subscription } from 'rxjs/Subscription';
|
||||||
import { DataColumnListComponent } from '../../../data-column';
|
import { Observable } from 'rxjs/Observable';
|
||||||
|
import { Observer } from 'rxjs/Observer';
|
||||||
|
import { DataColumnListComponent } from '../../../data-column/data-column-list.component';
|
||||||
import { DataColumn } from '../../data/data-column.model';
|
import { DataColumn } from '../../data/data-column.model';
|
||||||
import { DataRowEvent } from '../../data/data-row-event.model';
|
import { DataRowEvent } from '../../data/data-row-event.model';
|
||||||
import { DataRow } from '../../data/data-row.model';
|
import { DataRow } from '../../data/data-row.model';
|
||||||
import { DataSorting } from '../../data/data-sorting.model';
|
import { DataSorting } from '../../data/data-sorting.model';
|
||||||
import { DataTableAdapter } from '../../data/datatable-adapter';
|
import { DataTableAdapter } from '../../data/datatable-adapter';
|
||||||
|
|
||||||
import { ObjectDataRow, ObjectDataTableAdapter } from '../../data/object-datatable-adapter';
|
import { ObjectDataRow } from '../../data/object-datarow.model';
|
||||||
|
import { ObjectDataTableAdapter } from '../../data/object-datatable-adapter';
|
||||||
import { DataCellEvent } from './data-cell.event';
|
import { DataCellEvent } from './data-cell.event';
|
||||||
import { DataRowActionEvent } from './data-row-action.event';
|
import { DataRowActionEvent } from './data-row-action.event';
|
||||||
|
import 'rxjs/add/operator/debounceTime';
|
||||||
|
import 'rxjs/add/operator/buffer';
|
||||||
|
import 'rxjs/add/operator/filter';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'adf-datatable',
|
selector: 'adf-datatable',
|
||||||
@ -40,7 +46,8 @@ import { DataRowActionEvent } from './data-row-action.event';
|
|||||||
})
|
})
|
||||||
export class DataTableComponent implements AfterContentInit, OnChanges, DoCheck {
|
export class DataTableComponent implements AfterContentInit, OnChanges, DoCheck {
|
||||||
|
|
||||||
@ContentChild(DataColumnListComponent) columnList: DataColumnListComponent;
|
@ContentChild(DataColumnListComponent)
|
||||||
|
columnList: DataColumnListComponent;
|
||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
data: DataTableAdapter;
|
data: DataTableAdapter;
|
||||||
|
@ -17,10 +17,9 @@
|
|||||||
|
|
||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { RouterTestingModule } from '@angular/router/testing';
|
import { RouterTestingModule } from '@angular/router/testing';
|
||||||
import {
|
import { ObjectDataTableAdapter } from './../../data/object-datatable-adapter';
|
||||||
ObjectDataColumn,
|
import { ObjectDataColumn } from './../../data/object-datacolumn.model';
|
||||||
ObjectDataTableAdapter
|
|
||||||
} from './../../data/index';
|
|
||||||
import { LocationCellComponent } from './location-cell.component';
|
import { LocationCellComponent } from './location-cell.component';
|
||||||
|
|
||||||
describe('LocationCellComponent', () => {
|
describe('LocationCellComponent', () => {
|
||||||
|
43
lib/core/datatable/data/object-datacolumn.model.ts
Normal file
43
lib/core/datatable/data/object-datacolumn.model.ts
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
/*!
|
||||||
|
* @license
|
||||||
|
* Copyright 2016 Alfresco Software, Ltd.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { TemplateRef } from '@angular/core';
|
||||||
|
import { DataColumn } from './data-column.model';
|
||||||
|
|
||||||
|
// Simple implementation of the DataColumn interface.
|
||||||
|
export class ObjectDataColumn implements DataColumn {
|
||||||
|
|
||||||
|
key: string;
|
||||||
|
type: string; // text|image
|
||||||
|
format: string;
|
||||||
|
sortable: boolean;
|
||||||
|
title: string;
|
||||||
|
srTitle: string;
|
||||||
|
cssClass: string;
|
||||||
|
template?: TemplateRef<any>;
|
||||||
|
|
||||||
|
constructor(obj: any) {
|
||||||
|
this.key = obj.key;
|
||||||
|
this.type = obj.type || 'text';
|
||||||
|
this.format = obj.format;
|
||||||
|
this.sortable = obj.sortable;
|
||||||
|
this.title = obj.title;
|
||||||
|
this.srTitle = obj.srTitle;
|
||||||
|
this.cssClass = obj.cssClass;
|
||||||
|
this.template = obj.template;
|
||||||
|
}
|
||||||
|
}
|
@ -15,16 +15,24 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* tslint:disable:component-selector */
|
import { ObjectUtils } from '../../utils';
|
||||||
|
import { DataRow } from './data-row.model';
|
||||||
|
|
||||||
import { DiagramEventSubprocessComponent } from './diagram-event-subprocess.component';
|
// Simple implementation of the DataRow interface.
|
||||||
import { DiagramSubprocessComponent } from './diagram-subprocess.component';
|
export class ObjectDataRow implements DataRow {
|
||||||
|
|
||||||
// primitives
|
constructor(private obj: any, public isSelected: boolean = false) {
|
||||||
export * from './diagram-subprocess.component';
|
if (!obj) {
|
||||||
export * from './diagram-event-subprocess.component';
|
throw new Error('Object source not found');
|
||||||
|
}
|
||||||
|
|
||||||
export const DIAGRAM_STRUCTURAL_DIRECTIVES: any[] = [
|
}
|
||||||
DiagramSubprocessComponent,
|
|
||||||
DiagramEventSubprocessComponent
|
getValue(key: string): any {
|
||||||
];
|
return ObjectUtils.getValue(this.obj, key);
|
||||||
|
}
|
||||||
|
|
||||||
|
hasValue(key: string): boolean {
|
||||||
|
return this.getValue(key) !== undefined;
|
||||||
|
}
|
||||||
|
}
|
@ -18,7 +18,9 @@
|
|||||||
import { DataColumn } from './data-column.model';
|
import { DataColumn } from './data-column.model';
|
||||||
import { DataRow } from './data-row.model';
|
import { DataRow } from './data-row.model';
|
||||||
import { DataSorting } from './data-sorting.model';
|
import { DataSorting } from './data-sorting.model';
|
||||||
import { ObjectDataColumn, ObjectDataRow, ObjectDataTableAdapter } from './object-datatable-adapter';
|
import { ObjectDataTableAdapter } from './object-datatable-adapter';
|
||||||
|
import { ObjectDataRow } from './object-datarow.model';
|
||||||
|
import { ObjectDataColumn } from './object-datacolumn.model';
|
||||||
|
|
||||||
describe('ObjectDataTableAdapter', () => {
|
describe('ObjectDataTableAdapter', () => {
|
||||||
|
|
||||||
|
@ -16,34 +16,15 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { DatePipe } from '@angular/common';
|
import { DatePipe } from '@angular/common';
|
||||||
import { TemplateRef } from '@angular/core';
|
|
||||||
|
|
||||||
import { TimeAgoPipe } from '../../pipes';
|
import { TimeAgoPipe } from '../../pipes';
|
||||||
import { ObjectUtils } from '../../utils';
|
|
||||||
import { DataColumn } from './data-column.model';
|
import { DataColumn } from './data-column.model';
|
||||||
import { DataRow } from './data-row.model';
|
import { DataRow } from './data-row.model';
|
||||||
|
import { ObjectDataRow } from './object-datarow.model';
|
||||||
|
import { ObjectDataColumn } from './object-datacolumn.model';
|
||||||
import { DataSorting } from './data-sorting.model';
|
import { DataSorting } from './data-sorting.model';
|
||||||
import { DataTableAdapter } from './datatable-adapter';
|
import { DataTableAdapter } from './datatable-adapter';
|
||||||
|
|
||||||
// Simple implementation of the DataRow interface.
|
|
||||||
export class ObjectDataRow implements DataRow {
|
|
||||||
|
|
||||||
constructor(private obj: any, public isSelected: boolean = false) {
|
|
||||||
if (!obj) {
|
|
||||||
throw new Error('Object source not found');
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
getValue(key: string): any {
|
|
||||||
return ObjectUtils.getValue(this.obj, key);
|
|
||||||
}
|
|
||||||
|
|
||||||
hasValue(key: string): boolean {
|
|
||||||
return this.getValue(key) !== undefined;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Simple implementation of the DataTableAdapter interface.
|
// Simple implementation of the DataTableAdapter interface.
|
||||||
export class ObjectDataTableAdapter implements DataTableAdapter {
|
export class ObjectDataTableAdapter implements DataTableAdapter {
|
||||||
|
|
||||||
@ -196,27 +177,3 @@ export class ObjectDataTableAdapter implements DataTableAdapter {
|
|||||||
this.setSorting(sorting);
|
this.setSorting(sorting);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Simple implementation of the DataColumn interface.
|
|
||||||
export class ObjectDataColumn implements DataColumn {
|
|
||||||
|
|
||||||
key: string;
|
|
||||||
type: string; // text|image
|
|
||||||
format: string;
|
|
||||||
sortable: boolean;
|
|
||||||
title: string;
|
|
||||||
srTitle: string;
|
|
||||||
cssClass: string;
|
|
||||||
template?: TemplateRef<any>;
|
|
||||||
|
|
||||||
constructor(obj: any) {
|
|
||||||
this.key = obj.key;
|
|
||||||
this.type = obj.type || 'text';
|
|
||||||
this.format = obj.format;
|
|
||||||
this.sortable = obj.sortable;
|
|
||||||
this.title = obj.title;
|
|
||||||
this.srTitle = obj.srTitle;
|
|
||||||
this.cssClass = obj.cssClass;
|
|
||||||
this.template = obj.template;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -21,10 +21,10 @@ import { RouterModule } from '@angular/router';
|
|||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
|
|
||||||
import { MaterialModule } from '../material.module';
|
import { MaterialModule } from '../material.module';
|
||||||
import { ContextMenuModule } from '../context-menu';
|
import { ContextMenuModule } from '../context-menu/context-menu.module';
|
||||||
import { PipeModule } from '../pipes';
|
import { PipeModule } from '../pipes/pipe.module';
|
||||||
|
|
||||||
import { DirectiveModule } from '../directives';
|
import { DirectiveModule } from '../directives/directive.module';
|
||||||
import { DataTableCellComponent } from './components/datatable/datatable-cell.component';
|
import { DataTableCellComponent } from './components/datatable/datatable-cell.component';
|
||||||
import { DataTableComponent } from './components/datatable/datatable.component';
|
import { DataTableComponent } from './components/datatable/datatable.component';
|
||||||
import { DateCellComponent } from './components/datatable/date-cell.component';
|
import { DateCellComponent } from './components/datatable/date-cell.component';
|
||||||
|
@ -15,7 +15,16 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export * from './data/index';
|
export * from './data/datatable-adapter';
|
||||||
|
|
||||||
|
export * from './data/data-row.model';
|
||||||
|
export * from './data/data-row-event.model';
|
||||||
|
export * from './data/data-column.model';
|
||||||
|
export * from './data/data-sorting.model';
|
||||||
|
|
||||||
|
export * from './data/object-datarow.model';
|
||||||
|
export * from './data/object-datatable-adapter';
|
||||||
|
export * from './data/object-datacolumn.model';
|
||||||
|
|
||||||
export * from './components/datatable/data-cell.event';
|
export * from './components/datatable/data-cell.event';
|
||||||
export * from './components/datatable/data-row-action.event';
|
export * from './components/datatable/data-row-action.event';
|
||||||
@ -30,5 +39,3 @@ export * from './components/datatable/location-cell.component';
|
|||||||
export * from './directives/loading-template.directive';
|
export * from './directives/loading-template.directive';
|
||||||
export * from './directives/no-content-template.directive';
|
export * from './directives/no-content-template.directive';
|
||||||
export * from './directives/no-permission-template.directive';
|
export * from './directives/no-permission-template.directive';
|
||||||
|
|
||||||
export * from './datatable.module';
|
|
||||||
|
@ -19,7 +19,7 @@ import { Component } from '@angular/core';
|
|||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { RouterTestingModule } from '@angular/router/testing';
|
import { RouterTestingModule } from '@angular/router/testing';
|
||||||
import { Observable } from 'rxjs/Rx';
|
import { Observable } from 'rxjs/Observable';
|
||||||
|
|
||||||
import { AuthenticationService } from '../services';
|
import { AuthenticationService } from '../services';
|
||||||
|
|
||||||
|
@ -17,10 +17,13 @@
|
|||||||
|
|
||||||
import { Directive, ElementRef, EventEmitter, HostListener, Input, OnChanges, Output } from '@angular/core';
|
import { Directive, ElementRef, EventEmitter, HostListener, Input, OnChanges, Output } from '@angular/core';
|
||||||
import { MinimalNodeEntity, MinimalNodeEntryEntity } from 'alfresco-js-api';
|
import { MinimalNodeEntity, MinimalNodeEntryEntity } from 'alfresco-js-api';
|
||||||
import { Observable } from 'rxjs/Rx';
|
import { Observable } from 'rxjs/Observable';
|
||||||
import { AlfrescoApiService } from '../services/alfresco-api.service';
|
import { AlfrescoApiService } from '../services/alfresco-api.service';
|
||||||
import { NotificationService } from '../services/notification.service';
|
import { NotificationService } from '../services/notification.service';
|
||||||
import { TranslationService } from '../services/translation.service';
|
import { TranslationService } from '../services/translation.service';
|
||||||
|
import 'rxjs/add/observable/fromPromise';
|
||||||
|
import 'rxjs/observable/forkJoin';
|
||||||
|
import 'rxjs/add/operator/catch';
|
||||||
|
|
||||||
interface ProcessedNodeData {
|
interface ProcessedNodeData {
|
||||||
entry: MinimalNodeEntryEntity;
|
entry: MinimalNodeEntryEntity;
|
||||||
@ -108,7 +111,7 @@ export class NodeDeleteDirective implements OnChanges {
|
|||||||
private deleteNode(node: MinimalNodeEntity): Observable<ProcessedNodeData> {
|
private deleteNode(node: MinimalNodeEntity): Observable<ProcessedNodeData> {
|
||||||
const id = (<any> node.entry).nodeId || node.entry.id;
|
const id = (<any> node.entry).nodeId || node.entry.id;
|
||||||
|
|
||||||
const promise = this.alfrescoApiService.getInstance().nodes.deleteNode(id, {permanent: this.permanent});
|
const promise = this.alfrescoApiService.getInstance().nodes.deleteNode(id, { permanent: this.permanent });
|
||||||
|
|
||||||
return Observable.fromPromise(promise)
|
return Observable.fromPromise(promise)
|
||||||
.map(() => ({
|
.map(() => ({
|
||||||
@ -169,14 +172,14 @@ export class NodeDeleteDirective implements OnChanges {
|
|||||||
if (status.allFailed && !status.oneFailed) {
|
if (status.allFailed && !status.oneFailed) {
|
||||||
return this.translation.get(
|
return this.translation.get(
|
||||||
'CORE.DELETE_NODE.ERROR_PLURAL',
|
'CORE.DELETE_NODE.ERROR_PLURAL',
|
||||||
{number: status.failed.length}
|
{ number: status.failed.length }
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (status.allSucceeded && !status.oneSucceeded) {
|
if (status.allSucceeded && !status.oneSucceeded) {
|
||||||
return this.translation.get(
|
return this.translation.get(
|
||||||
'CORE.DELETE_NODE.PLURAL',
|
'CORE.DELETE_NODE.PLURAL',
|
||||||
{number: status.success.length}
|
{ number: status.success.length }
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -203,14 +206,14 @@ export class NodeDeleteDirective implements OnChanges {
|
|||||||
if (status.oneFailed && !status.someSucceeded) {
|
if (status.oneFailed && !status.someSucceeded) {
|
||||||
return this.translation.get(
|
return this.translation.get(
|
||||||
'CORE.DELETE_NODE.ERROR_SINGULAR',
|
'CORE.DELETE_NODE.ERROR_SINGULAR',
|
||||||
{name: status.failed[0].entry.name}
|
{ name: status.failed[0].entry.name }
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (status.oneSucceeded && !status.someFailed) {
|
if (status.oneSucceeded && !status.someFailed) {
|
||||||
return this.translation.get(
|
return this.translation.get(
|
||||||
'CORE.DELETE_NODE.SINGULAR',
|
'CORE.DELETE_NODE.SINGULAR',
|
||||||
{name: status.success[0].entry.name}
|
{ name: status.success[0].entry.name }
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,8 +17,10 @@
|
|||||||
|
|
||||||
import { Directive, EventEmitter, HostListener, Input, OnChanges, Output } from '@angular/core';
|
import { Directive, EventEmitter, HostListener, Input, OnChanges, Output } from '@angular/core';
|
||||||
import { FavoriteBody, MinimalNodeEntity } from 'alfresco-js-api';
|
import { FavoriteBody, MinimalNodeEntity } from 'alfresco-js-api';
|
||||||
import { Observable } from 'rxjs/Rx';
|
import { Observable } from 'rxjs/Observable';
|
||||||
import { AlfrescoApiService } from '../services/alfresco-api.service';
|
import { AlfrescoApiService } from '../services/alfresco-api.service';
|
||||||
|
import 'rxjs/add/observable/fromPromise';
|
||||||
|
import 'rxjs/observable/forkJoin';
|
||||||
|
|
||||||
@Directive({
|
@Directive({
|
||||||
selector: '[adf-node-favorite]',
|
selector: '[adf-node-favorite]',
|
||||||
@ -37,7 +39,8 @@ export class NodeFavoriteDirective implements OnChanges {
|
|||||||
this.toggleFavorite();
|
this.toggleFavorite();
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(private alfrescoApiService: AlfrescoApiService) {}
|
constructor(private alfrescoApiService: AlfrescoApiService) {
|
||||||
|
}
|
||||||
|
|
||||||
ngOnChanges(changes) {
|
ngOnChanges(changes) {
|
||||||
if (!changes.selection.currentValue.length) {
|
if (!changes.selection.currentValue.length) {
|
||||||
@ -111,7 +114,7 @@ export class NodeFavoriteDirective implements OnChanges {
|
|||||||
// shared files have nodeId
|
// shared files have nodeId
|
||||||
const id = (<any> selected).entry.nodeId || selected.entry.id;
|
const id = (<any> selected).entry.nodeId || selected.entry.id;
|
||||||
|
|
||||||
const promise = this.alfrescoApiService.getInstance()
|
const promise = this.alfrescoApiService.getInstance()
|
||||||
.core.favoritesApi.getFavorite('-me-', id);
|
.core.favoritesApi.getFavorite('-me-', id);
|
||||||
|
|
||||||
return Observable.from(promise)
|
return Observable.from(promise)
|
||||||
|
@ -20,7 +20,7 @@ import { async, ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core
|
|||||||
import { By } from '@angular/platform-browser';
|
import { By } from '@angular/platform-browser';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { RouterTestingModule } from '@angular/router/testing';
|
import { RouterTestingModule } from '@angular/router/testing';
|
||||||
import { Observable } from 'rxjs/Rx';
|
import { Observable } from 'rxjs/Observable';
|
||||||
import { TranslationService } from '../services';
|
import { TranslationService } from '../services';
|
||||||
import { AlfrescoApiService } from '../services/alfresco-api.service';
|
import { AlfrescoApiService } from '../services/alfresco-api.service';
|
||||||
import { NotificationService } from '../services/notification.service';
|
import { NotificationService } from '../services/notification.service';
|
||||||
|
@ -18,10 +18,13 @@
|
|||||||
import { Directive, EventEmitter, HostListener, Input, Output } from '@angular/core';
|
import { Directive, EventEmitter, HostListener, Input, Output } from '@angular/core';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { DeletedNodeEntry, DeletedNodesPaging, PathInfoEntity } from 'alfresco-js-api';
|
import { DeletedNodeEntry, DeletedNodesPaging, PathInfoEntity } from 'alfresco-js-api';
|
||||||
import { Observable } from 'rxjs/Rx';
|
import { Observable } from 'rxjs/Observable';
|
||||||
import { AlfrescoApiService } from '../services/alfresco-api.service';
|
import { AlfrescoApiService } from '../services/alfresco-api.service';
|
||||||
import { NotificationService } from '../services/notification.service';
|
import { NotificationService } from '../services/notification.service';
|
||||||
import { TranslationService } from '../services/translation.service';
|
import { TranslationService } from '../services/translation.service';
|
||||||
|
import 'rxjs/add/observable/from';
|
||||||
|
import 'rxjs/add/observable/zip';
|
||||||
|
import 'rxjs/add/operator/mergeMap';
|
||||||
|
|
||||||
@Directive({
|
@Directive({
|
||||||
selector: '[adf-restore]'
|
selector: '[adf-restore]'
|
||||||
@ -73,7 +76,7 @@ export class NodeRestoreDirective {
|
|||||||
this.restoreProcessStatus.fail.push(...status.fail);
|
this.restoreProcessStatus.fail.push(...status.fail);
|
||||||
this.restoreProcessStatus.success.push(...status.success);
|
this.restoreProcessStatus.success.push(...status.success);
|
||||||
})
|
})
|
||||||
.flatMap(() => this.getDeletedNodes())
|
.mergeMap(() => this.getDeletedNodes())
|
||||||
.subscribe(
|
.subscribe(
|
||||||
(deletedNodesList: any) => {
|
(deletedNodesList: any) => {
|
||||||
const { entries: nodelist } = deletedNodesList.list;
|
const { entries: nodelist } = deletedNodesList.list;
|
||||||
|
@ -22,5 +22,3 @@ export * from './node-favorite.directive';
|
|||||||
export * from './node-permission.directive';
|
export * from './node-permission.directive';
|
||||||
export * from './node-restore.directive';
|
export * from './node-restore.directive';
|
||||||
export * from './upload.directive';
|
export * from './upload.directive';
|
||||||
|
|
||||||
export * from './directive.module';
|
|
||||||
|
@ -18,15 +18,8 @@
|
|||||||
/** Base cancellable event implementation */
|
/** Base cancellable event implementation */
|
||||||
export class BaseEvent<T> {
|
export class BaseEvent<T> {
|
||||||
|
|
||||||
private isDefaultPrevented: boolean = false;
|
defaultPrevented: boolean = false;
|
||||||
|
|
||||||
value: T;
|
value: T;
|
||||||
|
|
||||||
get defaultPrevented() {
|
|
||||||
return this.isDefaultPrevented;
|
|
||||||
}
|
|
||||||
|
|
||||||
preventDefault() {
|
|
||||||
this.isDefaultPrevented = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ import {
|
|||||||
|
|
||||||
import { FormRenderingService } from './../../services/form-rendering.service';
|
import { FormRenderingService } from './../../services/form-rendering.service';
|
||||||
import { WidgetVisibilityService } from './../../services/widget-visibility.service';
|
import { WidgetVisibilityService } from './../../services/widget-visibility.service';
|
||||||
import { FormFieldModel } from './../widgets/core/index';
|
import { FormFieldModel } from './../widgets/core/form-field.model';
|
||||||
import { WidgetComponent } from './../widgets/widget.component';
|
import { WidgetComponent } from './../widgets/widget.component';
|
||||||
|
|
||||||
declare var adf: any;
|
declare var adf: any;
|
||||||
|
@ -18,9 +18,9 @@
|
|||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { By } from '@angular/platform-browser';
|
import { By } from '@angular/platform-browser';
|
||||||
import { TranslationService } from '../../index';
|
import { TranslationService } from '../../index';
|
||||||
import { DataTableModule } from '../../datatable';
|
import { DataTableModule } from '../../datatable/datatable.module';
|
||||||
import { DataColumnModule } from '../../data-column';
|
import { DataColumnModule } from '../../data-column/data-column.module';
|
||||||
import { Observable } from 'rxjs/Rx';
|
import { Observable } from 'rxjs/Observable';
|
||||||
import { EcmModelService } from '../services/ecm-model.service';
|
import { EcmModelService } from '../services/ecm-model.service';
|
||||||
import { FormService } from '../services/form.service';
|
import { FormService } from '../services/form.service';
|
||||||
import { FormListComponent } from './form-list.component';
|
import { FormListComponent } from './form-list.component';
|
||||||
|
@ -16,8 +16,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { SimpleChange } from '@angular/core';
|
import { SimpleChange } from '@angular/core';
|
||||||
import { LogService } from '../../services';
|
import { LogService } from '../../services/log.service';
|
||||||
import { Observable } from 'rxjs/Rx';
|
import { Observable } from 'rxjs/Observable';
|
||||||
import { fakeForm } from '../../mock';
|
import { fakeForm } from '../../mock';
|
||||||
import { FormService } from './../services/form.service';
|
import { FormService } from './../services/form.service';
|
||||||
import { NodeService } from './../services/node.service';
|
import { NodeService } from './../services/node.service';
|
||||||
|
@ -23,7 +23,7 @@ import { FormService } from './../services/form.service';
|
|||||||
import { NodeService } from './../services/node.service';
|
import { NodeService } from './../services/node.service';
|
||||||
import { ContentLinkModel } from './widgets/core/content-link.model';
|
import { ContentLinkModel } from './widgets/core/content-link.model';
|
||||||
import { FormFieldModel, FormModel, FormOutcomeEvent, FormOutcomeModel, FormValues, FormFieldValidator } from './widgets/core/index';
|
import { FormFieldModel, FormModel, FormOutcomeEvent, FormOutcomeModel, FormValues, FormFieldValidator } from './widgets/core/index';
|
||||||
import { Observable } from 'rxjs/Rx';
|
import { Observable } from 'rxjs/Observable';
|
||||||
import { WidgetVisibilityService } from './../services/widget-visibility.service';
|
import { WidgetVisibilityService } from './../services/widget-visibility.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -16,8 +16,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||||
import { DebugElement, SimpleChange } from '@angular/core';
|
import { SimpleChange } from '@angular/core';
|
||||||
import { Observable } from 'rxjs/Rx';
|
import { Observable } from 'rxjs/Observable';
|
||||||
|
|
||||||
import { async, ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing';
|
import { async, ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing';
|
||||||
import { By } from '@angular/platform-browser';
|
import { By } from '@angular/platform-browser';
|
||||||
@ -36,13 +36,9 @@ const SELECT_OPEN_ANIMATION = 200;
|
|||||||
const SELECT_CLOSE_ANIMATION = 500;
|
const SELECT_CLOSE_ANIMATION = 500;
|
||||||
|
|
||||||
describe('FormComponent UI and visibiltiy', () => {
|
describe('FormComponent UI and visibiltiy', () => {
|
||||||
let debugElement: DebugElement;
|
|
||||||
let element: HTMLElement;
|
|
||||||
let component: FormComponent;
|
let component: FormComponent;
|
||||||
let service: FormService;
|
let service: FormService;
|
||||||
let fixture: ComponentFixture<FormComponent>;
|
let fixture: ComponentFixture<FormComponent>;
|
||||||
let formDefinitionSpy: jasmine.Spy;
|
|
||||||
let taskSpy: jasmine.Spy;
|
|
||||||
|
|
||||||
function openSelect() {
|
function openSelect() {
|
||||||
let trigger: HTMLElement;
|
let trigger: HTMLElement;
|
||||||
@ -63,8 +59,6 @@ describe('FormComponent UI and visibiltiy', () => {
|
|||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
fixture = TestBed.createComponent(FormComponent);
|
fixture = TestBed.createComponent(FormComponent);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
element = fixture.nativeElement;
|
|
||||||
debugElement = fixture.debugElement;
|
|
||||||
service = fixture.debugElement.injector.get(FormService);
|
service = fixture.debugElement.injector.get(FormService);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -75,8 +69,8 @@ describe('FormComponent UI and visibiltiy', () => {
|
|||||||
describe('form definition', () => {
|
describe('form definition', () => {
|
||||||
|
|
||||||
it('should display two text fields form definition', () => {
|
it('should display two text fields form definition', () => {
|
||||||
taskSpy = spyOn(service, 'getTask').and.returnValue(Observable.of({}));
|
spyOn(service, 'getTask').and.returnValue(Observable.of({}));
|
||||||
formDefinitionSpy = spyOn(service, 'getTaskForm').and.returnValue(Observable.of(formDefinitionTwoTextFields));
|
spyOn(service, 'getTaskForm').and.returnValue(Observable.of(formDefinitionTwoTextFields));
|
||||||
|
|
||||||
let change = new SimpleChange(null, 1, true);
|
let change = new SimpleChange(null, 1, true);
|
||||||
component.ngOnChanges({ 'taskId': change });
|
component.ngOnChanges({ 'taskId': change });
|
||||||
@ -92,8 +86,8 @@ describe('FormComponent UI and visibiltiy', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should display dropdown field', fakeAsync(() => {
|
it('should display dropdown field', fakeAsync(() => {
|
||||||
taskSpy = spyOn(service, 'getTask').and.returnValue(Observable.of({}));
|
spyOn(service, 'getTask').and.returnValue(Observable.of({}));
|
||||||
formDefinitionSpy = spyOn(service, 'getTaskForm').and.returnValue(Observable.of(formDefinitionDropdownField));
|
spyOn(service, 'getTaskForm').and.returnValue(Observable.of(formDefinitionDropdownField));
|
||||||
|
|
||||||
let change = new SimpleChange(null, 1, true);
|
let change = new SimpleChange(null, 1, true);
|
||||||
component.ngOnChanges({ 'taskId': change });
|
component.ngOnChanges({ 'taskId': change });
|
||||||
@ -123,8 +117,8 @@ describe('FormComponent UI and visibiltiy', () => {
|
|||||||
describe('Visibility conditions', () => {
|
describe('Visibility conditions', () => {
|
||||||
|
|
||||||
it('should hide the field based on the next one', () => {
|
it('should hide the field based on the next one', () => {
|
||||||
taskSpy = spyOn(service, 'getTask').and.returnValue(Observable.of({}));
|
spyOn(service, 'getTask').and.returnValue(Observable.of({}));
|
||||||
formDefinitionSpy = spyOn(service, 'getTaskForm').and.returnValue(Observable.of(formDefVisibilitiFieldDependsOnNextOne));
|
spyOn(service, 'getTaskForm').and.returnValue(Observable.of(formDefVisibilitiFieldDependsOnNextOne));
|
||||||
|
|
||||||
let change = new SimpleChange(null, 1, true);
|
let change = new SimpleChange(null, 1, true);
|
||||||
component.ngOnChanges({ 'taskId': change });
|
component.ngOnChanges({ 'taskId': change });
|
||||||
@ -139,8 +133,8 @@ describe('FormComponent UI and visibiltiy', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should hide the field based on the previous one', () => {
|
it('should hide the field based on the previous one', () => {
|
||||||
taskSpy = spyOn(service, 'getTask').and.returnValue(Observable.of({}));
|
spyOn(service, 'getTask').and.returnValue(Observable.of({}));
|
||||||
formDefinitionSpy = spyOn(service, 'getTaskForm').and.returnValue(Observable.of(formDefVisibilitiFieldDependsOnPreviousOne));
|
spyOn(service, 'getTaskForm').and.returnValue(Observable.of(formDefVisibilitiFieldDependsOnPreviousOne));
|
||||||
|
|
||||||
let change = new SimpleChange(null, 1, true);
|
let change = new SimpleChange(null, 1, true);
|
||||||
component.ngOnChanges({ 'taskId': change });
|
component.ngOnChanges({ 'taskId': change });
|
||||||
@ -155,8 +149,8 @@ describe('FormComponent UI and visibiltiy', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should show the hidden field when the visibility condition change to true', () => {
|
it('should show the hidden field when the visibility condition change to true', () => {
|
||||||
taskSpy = spyOn(service, 'getTask').and.returnValue(Observable.of({}));
|
spyOn(service, 'getTask').and.returnValue(Observable.of({}));
|
||||||
formDefinitionSpy = spyOn(service, 'getTaskForm').and.returnValue(Observable.of(formDefVisibilitiFieldDependsOnNextOne));
|
spyOn(service, 'getTaskForm').and.returnValue(Observable.of(formDefVisibilitiFieldDependsOnNextOne));
|
||||||
|
|
||||||
let change = new SimpleChange(null, 1, true);
|
let change = new SimpleChange(null, 1, true);
|
||||||
component.ngOnChanges({ 'taskId': change });
|
component.ngOnChanges({ 'taskId': change });
|
||||||
@ -181,8 +175,8 @@ describe('FormComponent UI and visibiltiy', () => {
|
|||||||
|
|
||||||
describe('Readonly Form', () => {
|
describe('Readonly Form', () => {
|
||||||
it('should display two text fields readonly', () => {
|
it('should display two text fields readonly', () => {
|
||||||
taskSpy = spyOn(service, 'getTask').and.returnValue(Observable.of({}));
|
spyOn(service, 'getTask').and.returnValue(Observable.of({}));
|
||||||
formDefinitionSpy = spyOn(service, 'getTaskForm').and.returnValue(Observable.of(formReadonlyTwoTextFields));
|
spyOn(service, 'getTaskForm').and.returnValue(Observable.of(formReadonlyTwoTextFields));
|
||||||
|
|
||||||
let change = new SimpleChange(null, 1, true);
|
let change = new SimpleChange(null, 1, true);
|
||||||
component.ngOnChanges({ 'taskId': change });
|
component.ngOnChanges({ 'taskId': change });
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
import { CUSTOM_ELEMENTS_SCHEMA, SimpleChange } from '@angular/core';
|
import { CUSTOM_ELEMENTS_SCHEMA, SimpleChange } from '@angular/core';
|
||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { Observable } from 'rxjs/Rx';
|
import { Observable } from 'rxjs/Observable';
|
||||||
import { EntryComponentMockModule } from '../../mock/form/entry-module.mock';
|
import { EntryComponentMockModule } from '../../mock/form/entry-module.mock';
|
||||||
import { startFormDateWidgetMock, startFormDropdownDefinitionMock, startFormTextDefinitionMock, startMockForm, startMockFormWithTab } from '../../mock';
|
import { startFormDateWidgetMock, startFormDropdownDefinitionMock, startFormTextDefinitionMock, startMockForm, startMockFormWithTab } from '../../mock';
|
||||||
import { startFormAmountWidgetMock, startFormNumberWidgetMock, startFormRadioButtonWidgetMock } from '../../mock';
|
import { startFormAmountWidgetMock, startFormNumberWidgetMock, startFormRadioButtonWidgetMock } from '../../mock';
|
||||||
@ -37,7 +37,6 @@ describe('ActivitiStartForm', () => {
|
|||||||
|
|
||||||
let formService: FormService;
|
let formService: FormService;
|
||||||
let component: StartFormComponent;
|
let component: StartFormComponent;
|
||||||
let element: HTMLElement;
|
|
||||||
let fixture: ComponentFixture<StartFormComponent>;
|
let fixture: ComponentFixture<StartFormComponent>;
|
||||||
let getStartFormSpy: jasmine.Spy;
|
let getStartFormSpy: jasmine.Spy;
|
||||||
|
|
||||||
@ -72,7 +71,6 @@ describe('ActivitiStartForm', () => {
|
|||||||
fixture = TestBed.createComponent(StartFormComponent);
|
fixture = TestBed.createComponent(StartFormComponent);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
formService = fixture.debugElement.injector.get(FormService);
|
formService = fixture.debugElement.injector.get(FormService);
|
||||||
element = fixture.nativeElement;
|
|
||||||
|
|
||||||
getStartFormSpy = spyOn(formService, 'getStartFormDefinition').and.returnValue(Observable.of({
|
getStartFormSpy = spyOn(formService, 'getStartFormDefinition').and.returnValue(Observable.of({
|
||||||
processDefinitionName: 'my:process'
|
processDefinitionName: 'my:process'
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { LogService } from '../../services';
|
import { LogService } from '../../services/log.service';
|
||||||
import { Component, ElementRef, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges, ViewChild, ViewEncapsulation } from '@angular/core';
|
import { Component, ElementRef, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges, ViewChild, ViewEncapsulation } from '@angular/core';
|
||||||
import { FormService } from './../services/form.service';
|
import { FormService } from './../services/form.service';
|
||||||
import { WidgetVisibilityService } from './../services/widget-visibility.service';
|
import { WidgetVisibilityService } from './../services/widget-visibility.service';
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user