Refactor demo shell as CLI project (#2501)

* split interfaces

* angular cli demo refactoring

* fix test import

* fix demo script

* fix demo script

* fix demo script

* fix demo script
This commit is contained in:
Mario Romano
2017-10-22 00:02:41 +01:00
committed by Eugenio Romano
parent 9ac0c06acd
commit 167336f245
184 changed files with 3898 additions and 3832 deletions

View File

@@ -0,0 +1,292 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"project": {
"name": "myapp"
},
"apps": [
{
"root": "src",
"outDir": "dist",
"assets": [
"assets",
"favicon.ico",
"app.config.json",
{
"glob": "**/*",
"input": "../resources",
"output": "./resources"
},
{
"glob": "**/*",
"input": "../node_modules/ng2-alfresco-core/prebuilt-themes",
"output": "./prebuilt-themes"
},
{
"glob": "**/*",
"input": "../node_modules/ng2-alfresco-core/bundles/assets",
"output": "./assets/"
},
{
"glob": "**/*",
"input": "../node_modules/ng2-alfresco-login/bundles/assets",
"output": "./assets/"
},
{
"glob": "**/*",
"input": "../node_modules/ng2-alfresco-userinfo/bundles/assets",
"output": "./assets/"
},
{
"glob": "**/*",
"input": "../node_modules/ng2-alfresco-upload/bundles/assets",
"output": "./assets/"
},
{
"glob": "**/*",
"input": "../node_modules/ng2-alfresco-search/bundles/assets",
"output": "./assets/"
},
{
"glob": "**/*",
"input": "../node_modules/ng2-alfresco-datatable/bundles/assets",
"output": "./assets/"
},
{
"glob": "**/*",
"input": "../node_modules/ng2-alfresco-documentlist/bundles/assets",
"output": "./assets/"
},
{
"glob": "**/*",
"input": "../node_modules/ng2-alfresco-viewer/bundles/assets",
"output": "./assets/"
},
{
"glob": "**/*",
"input": "../node_modules/ng2-alfresco-social/bundles/assets",
"output": "./assets/"
},
{
"glob": "**/*",
"input": "../node_modules/ng2-alfresco-tag/bundles/assets",
"output": "./assets/"
},
{
"glob": "**/*",
"input": "../node_modules/ng2-alfresco-webscript/bundles/assets",
"output": "./assets/"
},
{
"glob": "**/*",
"input": "../node_modules/ng2-activiti-analytics/bundles/assets",
"output": "./assets/"
},
{
"glob": "**/*",
"input": "../node_modules/ng2-activiti-diagrams/bundles/assets",
"output": "./assets/"
},
{
"glob": "**/*",
"input": "../node_modules/ng2-activiti-form/bundles/assets",
"output": "./assets/"
},
{
"glob": "**/*",
"input": "../node_modules/ng2-activiti-processlist/bundles/assets",
"output": "./assets/"
},
{
"glob": "**/*",
"input": "../node_modules/ng2-activiti-tasklist/bundles/assets",
"output": "./assets/"
}
],
"index": "index.html",
"main": "main.ts",
"polyfills": "polyfills.ts",
"test": "test.ts",
"tsconfig": "tsconfig.app.json",
"testTsconfig": "tsconfig.spec.json",
"prefix": "app",
"styles": [
"styles.css",
"../node_modules/ng2-alfresco-core/prebuilt-themes/adf-blue-orange.css",
"../node_modules/material-design-lite/dist/material.orange-blue.min.css",
"../node_modules/dialog-polyfill/dialog-polyfill.css",
"custom-style.scss"
],
"scripts": [
"../node_modules/material-design-lite/material.min.js",
"../node_modules/pdfjs-dist/build/pdf.js",
"../node_modules/pdfjs-dist/web/compatibility.js",
"../node_modules/pdfjs-dist/web/pdf_viewer.js",
"../node_modules/dialog-polyfill/dialog-polyfill",
"../node_modules/raphael/raphael.min.js",
"../node_modules/moment/min/moment.min.js",
"../node_modules/three/build/three.min.js"
],
"environmentSource": "environments/environment.ts",
"environments": {
"dev": "environments/environment.ts",
"prod": "environments/environment.prod.ts"
}
},
{
"root": "src",
"outDir": "dist",
"assets": [
"assets",
"app.config.json",
{
"glob": "**/*",
"input": "../resources",
"output": "./resources"
},
{
"glob": "**/*",
"input": "../../ng2-components/ng2-alfresco-core/prebuilt-themes",
"output": "./prebuilt-themes"
},
{
"glob": "**/*",
"input": "../../ng2-components/ng2-alfresco-core/bundles/assets",
"output": "./assets/"
},
{
"glob": "**/*",
"input": "../../ng2-components/ng2-alfresco-login/bundles/assets",
"output": "./assets/"
},
{
"glob": "**/*",
"input": "../../ng2-components/ng2-alfresco-userinfo/bundles/assets",
"output": "./assets/"
},
{
"glob": "**/*",
"input": "../../ng2-components/ng2-alfresco-upload/bundles/assets",
"output": "./assets/"
},
{
"glob": "**/*",
"input": "../../ng2-components/ng2-alfresco-search/bundles/assets",
"output": "./assets/"
},
{
"glob": "**/*",
"input": "../../ng2-components/ng2-alfresco-datatable/bundles/assets",
"output": "./assets/"
},
{
"glob": "**/*",
"input": "../../ng2-components/ng2-alfresco-documentlist/bundles/assets",
"output": "./assets/"
},
{
"glob": "**/*",
"input": "../../ng2-components/ng2-alfresco-viewer/bundles/assets",
"output": "./assets/"
},
{
"glob": "**/*",
"input": "../../ng2-components/ng2-alfresco-social/bundles/assets",
"output": "./assets/"
},
{
"glob": "**/*",
"input": "../../ng2-components/ng2-alfresco-tag/bundles/assets",
"output": "./assets/"
},
{
"glob": "**/*",
"input": "../../ng2-components/ng2-alfresco-webscript/bundles/assets",
"output": "./assets/"
},
{
"glob": "**/*",
"input": "../../ng2-components/ng2-activiti-analytics/bundles/assets",
"output": "./assets/"
},
{
"glob": "**/*",
"input": "../../ng2-components/ng2-activiti-diagrams/bundles/assets",
"output": "./assets/"
},
{
"glob": "**/*",
"input": "../../ng2-components/ng2-activiti-form/bundles/assets",
"output": "./assets/"
},
{
"glob": "**/*",
"input": "../../ng2-components/ng2-activiti-processlist/bundles/assets",
"output": "./assets/"
},
{
"glob": "**/*",
"input": "../../ng2-components/ng2-activiti-tasklist/bundles/assets",
"output": "./assets/"
}
],
"index": "index.html",
"main": "main.ts",
"polyfills": "polyfills.ts",
"test": "test.ts",
"tsconfig": "tsconfig.dev.json",
"testTsconfig": "tsconfig.spec.json",
"prefix": "app-dev",
"styles": [
"styles.css",
"../node_modules/ng2-alfresco-core/prebuilt-themes/adf-blue-orange.css",
"../node_modules/material-design-lite/dist/material.orange-blue.min.css",
"../node_modules/dialog-polyfill/dialog-polyfill.css",
"custom-style.scss"
],
"scripts": [
"../node_modules/material-design-lite/material.min.js",
"../node_modules/pdfjs-dist/build/pdf.js",
"../node_modules/pdfjs-dist/web/compatibility.js",
"../node_modules/pdfjs-dist/web/pdf_viewer.js",
"../node_modules/dialog-polyfill/dialog-polyfill",
"../node_modules/raphael/raphael.min.js",
"../node_modules/moment/min/moment.min.js",
"../node_modules/three/build/three.min.js"
],
"environmentSource": "environments/environment.ts",
"environments": {
"dev": "environments/environment.ts",
"prod": "environments/environment.prod.ts"
}
}
],
"e2e": {
"protractor": {
"config": "./protractor.conf.js"
}
},
"lint": [
{
"project": "src/tsconfig.app.json"
},
{
"project": "src/tsconfig.spec.json"
},
{
"project": "e2e/tsconfig.e2e.json"
}
],
"test": {
"karma": {
"config": "./karma.conf.js"
}
},
"defaults": {
"styleExt": "scss",
"component": {
}
}
}

View File

@@ -1,18 +0,0 @@
files:
"/opt/elasticbeanstalk/hooks/appdeploy/pre/50npm.sh" :
mode: "000775"
owner: root
group: root
content: |
#!/bin/bash
function error_exit
{
eventHelper.py --msg "$1" --severity ERROR
exit $2
}
export HOME=/home/ec2-user
echo "export home"
sudo curl -sL https://rpm.nodesource.com/setup_6.x | sudo -E bash -
sudo yum install -y nodejs

View File

@@ -1,19 +1,13 @@
# http://editorconfig.org
# Editor configuration, see http://editorconfig.org
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 4
end_of_line = lf
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true
[package.json]
indent_style = space
indent_size = 2
[*.md]
insert_final_newline = false
max_line_length = off
trim_trailing_whitespace = false

View File

@@ -1,3 +1,47 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.
# compiled output
/dist
/tmp
/out-tsc
# dependencies
/node_modules
# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace
# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
# misc
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
testem.log
/typings
# e2e
/e2e/*.js
/e2e/*.map
# System Files
.DS_Store
Thumbs.db
typings/
node_modules/
bower_components/

View File

@@ -1,302 +0,0 @@
{
"ecmHost": "http://{hostname}",
"bpmHost": "http://{hostname}",
"application": {
"name": "Alfresco ADF Appplication"
},
"languages": [
{
"key": "en",
"label": "English"
},
{
"key": "fr",
"label": "French"
},
{
"key": "de",
"label": "German"
},
{
"key": "it",
"label": "Italian"
},
{
"key": "es",
"label": "Spanish"
},
{
"key": "ja",
"label": "Japanese"
},
{
"key": "nl",
"label": "Dutch"
},
{
"key": "pt-BR",
"label": "Brazilian Portuguese"
},
{
"key": "nb",
"label": "Norwegian"
},
{
"key": "ru",
"label": "Russian"
},
{
"key": "zh-CN",
"label": "Simplified Chinese"
}
],
"pagination": {
"size": 25
},
"files": {
"excluded": [".DS_Store", "desktop.ini", ".git"]
},
"logLevel" : "silent",
"activiti": {
"rest": {
"fields": [
{
"processId": "0",
"taskId": "7501",
"fieldId": "label10",
"values": [
{ "id": "f1", "name": "Field 1" },
{ "id": "f2", "name": "Field 2" },
{ "id": "f3", "name": "Field 3" }
]
}
]
}
},
"document-list": {
"supportedPageSizes": [5, 10, 15, 20],
"presets": {
"-trashcan-": [
{
"key": "$thumbnail",
"type": "image",
"srTitle": "ADF-DOCUMENT-LIST.LAYOUT.THUMBNAIL",
"sortable": false
},
{
"key": "name",
"type": "text",
"title": "ADF-DOCUMENT-LIST.LAYOUT.NAME",
"cssClass": "full-width ellipsis-cell",
"sortable": true
},
{
"key": "path",
"type": "location",
"title": "ADF-DOCUMENT-LIST.LAYOUT.LOCATION",
"format": "/files",
"sortable": true
},
{
"key": "content.sizeInBytes",
"type": "fileSize",
"title": "ADF-DOCUMENT-LIST.LAYOUT.SIZE",
"sortable": true
},
{
"key": "archivedAt",
"type": "date",
"title": "ADF-DOCUMENT-LIST.LAYOUT.DELETED_ON",
"format": "timeAgo",
"sortable": true
},
{
"key": "archivedByUser.displayName",
"type": "text",
"title": "ADF-DOCUMENT-LIST.LAYOUT.DELETED_BY",
"sortable": true
}
],
"-sites-": [
{
"key": "$thumbnail",
"type": "image",
"srTitle": "ADF-DOCUMENT-LIST.LAYOUT.THUMBNAIL",
"sortable": false
},
{
"key": "title",
"type": "text",
"title": "ADF-DOCUMENT-LIST.LAYOUT.NAME",
"cssClass": "full-width ellipsis-cell",
"sortable": true
},
{
"key": "visibility",
"type": "text",
"title": "ADF-DOCUMENT-LIST.LAYOUT.STATUS",
"sortable": true
}
],
"-favorites-": [
{
"key": "$thumbnail",
"type": "image",
"srTitle": "ADF-DOCUMENT-LIST.LAYOUT.THUMBNAIL",
"sortable": false
},
{
"key": "name",
"type": "text",
"title": "ADF-DOCUMENT-LIST.LAYOUT.NAME",
"cssClass": "full-width ellipsis-cell",
"sortable": true
},
{
"key": "path",
"type": "location",
"title": "ADF-DOCUMENT-LIST.LAYOUT.LOCATION",
"format": "/files",
"sortable": true
},
{
"key": "content.sizeInBytes",
"type": "fileSize",
"title": "ADF-DOCUMENT-LIST.LAYOUT.SIZE",
"sortable": true
},
{
"key": "modifiedAt",
"type": "date",
"title": "ADF-DOCUMENT-LIST.LAYOUT.MODIFIED_ON",
"format": "timeAgo",
"sortable": true
},
{
"key": "modifiedByUser.displayName",
"type": "text",
"title": "ADF-DOCUMENT-LIST.LAYOUT.MODIFIED_BY",
"sortable": true
}
],
"-recent-": [
{
"key": "$thumbnail",
"type": "image",
"srTitle": "ADF-DOCUMENT-LIST.LAYOUT.THUMBNAIL",
"sortable": false
},
{
"key": "name",
"type": "text",
"title": "ADF-DOCUMENT-LIST.LAYOUT.NAME",
"cssClass": "full-width ellipsis-cell",
"sortable": true
},
{
"key": "path",
"type": "location",
"title": "ADF-DOCUMENT-LIST.LAYOUT.LOCATION",
"cssClass": "ellipsis-cell",
"format": "/files",
"sortable": true
},
{
"key": "content.sizeInBytes",
"type": "fileSize",
"title": "ADF-DOCUMENT-LIST.LAYOUT.SIZE",
"sortable": true
},
{
"key": "modifiedAt",
"type": "date",
"title": "ADF-DOCUMENT-LIST.LAYOUT.MODIFIED_ON",
"format": "timeAgo",
"sortable": true
}
],
"-sharedlinks-": [
{
"key": "$thumbnail",
"type": "image",
"srTitle": "ADF-DOCUMENT-LIST.LAYOUT.THUMBNAIL",
"sortable": false
},
{
"key": "name",
"type": "text",
"title": "ADF-DOCUMENT-LIST.LAYOUT.NAME",
"cssClass": "full-width ellipsis-cell",
"sortable": true
},
{
"key": "path",
"type": "location",
"title": "ADF-DOCUMENT-LIST.LAYOUT.LOCATION",
"cssClass": "ellipsis-cell",
"format": "/files",
"sortable": true
},
{
"key": "content.sizeInBytes",
"type": "fileSize",
"title": "ADF-DOCUMENT-LIST.LAYOUT.SIZE",
"sortable": true
},
{
"key": "modifiedAt",
"type": "date",
"title": "ADF-DOCUMENT-LIST.LAYOUT.MODIFIED_ON",
"format": "timeAgo",
"sortable": true
},
{
"key": "modifiedByUser.displayName",
"type": "text",
"title": "ADF-DOCUMENT-LIST.LAYOUT.MODIFIED_BY",
"sortable": true
},
{
"key": "sharedByUser.displayName",
"type": "text",
"title": "ADF-DOCUMENT-LIST.LAYOUT.SHARED_BY",
"sortable": true
}
],
"default": [
{
"key": "$thumbnail",
"type": "image",
"srTitle": "ADF-DOCUMENT-LIST.LAYOUT.THUMBNAIL",
"sortable": false
},
{
"key": "name",
"type": "text",
"title": "ADF-DOCUMENT-LIST.LAYOUT.NAME",
"cssClass": "full-width ellipsis-cell",
"sortable": true
},
{
"key": "content.sizeInBytes",
"type": "fileSize",
"title": "ADF-DOCUMENT-LIST.LAYOUT.SIZE",
"sortable": true
},
{
"key": "modifiedAt",
"type": "date",
"title": "ADF-DOCUMENT-LIST.LAYOUT.MODIFIED_ON",
"format": "timeAgo",
"sortable": true
},
{
"key": "modifiedByUser.displayName",
"type": "text",
"title": "ADF-DOCUMENT-LIST.LAYOUT.MODIFIED_BY",
"sortable": true
}
]
}
}
}

View File

@@ -1,6 +1,6 @@
{
"ecmHost": "http://{hostname}:{port}/ecm",
"bpmHost": "http://{hostname}:{port}/bpm",
"ecmHost": "http://{hostname}:{port}",
"bpmHost": "http://{hostname}:{port}",
"application": {
"name": "Alfresco ADF Appplication"
},

View File

@@ -1 +0,0 @@
<router-outlet></router-outlet>

View File

@@ -1,141 +0,0 @@
/*!
* @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 { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AnalyticsModule } from 'ng2-activiti-analytics';
import { DiagramsModule } from 'ng2-activiti-diagrams';
import { ActivitiFormModule } from 'ng2-activiti-form';
import { ActivitiProcessListModule } from 'ng2-activiti-processlist';
import { ActivitiTaskListModule } from 'ng2-activiti-tasklist';
import { AppConfigService, CoreModule, TRANSLATION_PROVIDER } from 'ng2-alfresco-core';
import { DataTableModule } from 'ng2-alfresco-datatable';
import { DocumentListModule } from 'ng2-alfresco-documentlist';
import { LoginModule } from 'ng2-alfresco-login';
import { SearchModule } from 'ng2-alfresco-search';
import { SocialModule } from 'ng2-alfresco-social';
import { TagModule } from 'ng2-alfresco-tag';
import { UploadModule } from 'ng2-alfresco-upload';
import { UserInfoModule } from 'ng2-alfresco-userinfo';
import { ViewerModule } from 'ng2-alfresco-viewer';
import { WebScriptModule } from 'ng2-alfresco-webscript';
import { FlexLayoutModule } from '@angular/flex-layout';
import { Editor3DModule } from 'ng2-3d-editor';
import { ChartsModule } from 'ng2-charts';
import { AppComponent } from './app.component';
import { routing } from './app.routes';
import { CustomEditorsModule } from './components/activiti/custom-editor/custom-editor.component';
import { AppLayoutComponent } from './components/app-layout/app-layout.component';
import { FileViewComponent } from './components/file-view/file-view.component';
import { FormListDemoComponent } from './components/form/form-list-demo.component';
import { ThemePickerModule } from './components/theme-picker/theme-picker';
import { MaterialModule } from './material.module';
import { DebugAppConfigService } from './services/debug-app-config.service';
import { CustomSourcesComponent } from './components/files/custom-sources.component';
import {
AboutComponent,
ActivitiAppsViewComponent,
ActivitiDemoComponent,
ActivitiProcessAttachmentsComponent,
ActivitiShowDiagramComponent,
ActivitiTaskAttachmentsComponent,
DataTableDemoComponent,
FilesComponent,
FormDemoComponent,
FormNodeViewerComponent,
FormViewerComponent,
HomeComponent,
LoginDemoComponent,
SearchBarComponent,
SearchComponent,
SettingsComponent,
SocialComponent,
TagComponent,
WebscriptComponent
} from './components/index';
@NgModule({
imports: [
BrowserModule,
routing,
CoreModule,
MaterialModule,
LoginModule,
SearchModule,
DataTableModule,
DocumentListModule,
UploadModule,
TagModule,
SocialModule,
WebScriptModule,
ViewerModule,
ActivitiFormModule,
ActivitiTaskListModule,
ActivitiProcessListModule,
UserInfoModule,
AnalyticsModule,
DiagramsModule,
CustomEditorsModule,
Editor3DModule,
ChartsModule,
ThemePickerModule,
FlexLayoutModule
],
declarations: [
AppComponent,
HomeComponent,
DataTableDemoComponent,
SearchComponent,
SearchBarComponent,
LoginDemoComponent,
ActivitiDemoComponent,
ActivitiTaskAttachmentsComponent,
ActivitiProcessAttachmentsComponent,
ActivitiShowDiagramComponent,
ActivitiAppsViewComponent,
FormViewerComponent,
WebscriptComponent,
TagComponent,
SocialComponent,
AboutComponent,
FilesComponent,
FormNodeViewerComponent,
SettingsComponent,
FormDemoComponent,
FormListDemoComponent,
CustomSourcesComponent,
FileViewComponent,
AppLayoutComponent
],
providers: [
{ provide: AppConfigService, useClass: DebugAppConfigService },
{
provide: TRANSLATION_PROVIDER,
multi: true,
useValue: {
name: 'app',
source: 'resources'
}
}
],
bootstrap: [ AppComponent ]
})
export class AppModule { }

View File

@@ -1,57 +0,0 @@
@mixin adf-app-layout-theme($theme) {
$primary: map-get($theme, primary);
$minimumAppWidth: 320px;
$toolbarHeight: 64px;
.adf-app-layout {
display: block;
min-width: $minimumAppWidth;
height: 100%;
.adf-nav-container {
display: block;
min-width: $minimumAppWidth;
height: 100%;
}
.adf-sidenav-link {
&.active {
color: mat-color($primary);
}
}
&-user-profile {
margin-right: 10px;
}
&-menu-spacer {
flex: 1 1 auto;
}
&-toolbar {
height: $toolbarHeight;
line-height: $toolbarHeight;
overflow: hidden;
mat-toolbar-row {
height: $toolbarHeight;
align-items: stretch;
justify-content: space-between;
}
.adf-toolbar-link {
min-width: 0;
line-height: $toolbarHeight;
&.active {
background-color: rgba(0,0,0,.12);
}
}
}
}
@media ($mat-small) {
.adf-userinfo-name{display: none;
}
}
}

View File

@@ -1,9 +0,0 @@
<ng-container *ngIf="nodeId">
<adf-viewer [fileNodeId]="nodeId">
<extension-viewer [supportedExtensions]="['obj','3DS']" #extension>
<ng-template let-urlFileContent="urlFileContent" let-extension="extension" >
<threed-viewer [urlFile]="urlFileContent" [extension]="extension" ></threed-viewer>
</ng-template>
</extension-viewer>
</adf-viewer>
</ng-container>

View File

@@ -1,36 +0,0 @@
/*!
* @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.
*/
export { HomeComponent } from './home/home.component';
export { DataTableDemoComponent } from './datatable/datatable-demo.component';
export { SearchComponent } from './search/search.component';
export { SearchBarComponent } from './search/search-bar.component';
export { LoginDemoComponent } from './login/login-demo.component';
export { ActivitiDemoComponent } from './activiti/activiti-demo.component';
export { ActivitiTaskAttachmentsComponent } from './activiti/activiti-task-attachments.component';
export { ActivitiProcessAttachmentsComponent } from './activiti/activiti-process-attachments.component';
export { ActivitiShowDiagramComponent } from './activiti/activiti-show-diagram.component';
export { FormViewerComponent } from './activiti/form-viewer.component';
export { WebscriptComponent } from './webscript/webscript.component';
export { TagComponent } from './tag/tag.component';
export { SocialComponent } from './social/social.component';
export { AboutComponent } from './about/about.component';
export { FilesComponent } from './files/files.component';
export { FormNodeViewerComponent } from './activiti/form-node-viewer.component';
export { ActivitiAppsViewComponent } from './activiti/apps.view';
export { SettingsComponent } from './settings/settings.component';
export { FormDemoComponent } from './form/form-demo.component';

View File

@@ -1,3 +0,0 @@
.mat-form-field input.mat-input-element {
line-height: normal;
}

View File

@@ -1,71 +0,0 @@
/*!
* @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.
*/
/* tslint:disable */
// Angular
import '@angular/common';
import '@angular/core';
import '@angular/http';
import '@angular/platform-browser';
import '@angular/platform-browser-dynamic';
import '@angular/router';
// RxJS
import 'rxjs';
// hammerjs
import 'hammerjs';
// Alfresco
import 'alfresco-js-api';
import 'ng2-activiti-analytics';
import 'ng2-activiti-diagrams';
import 'ng2-activiti-form';
import 'ng2-activiti-processlist';
import 'ng2-activiti-tasklist';
import 'ng2-alfresco-core';
import 'ng2-alfresco-datatable';
import 'ng2-alfresco-documentlist';
import 'ng2-alfresco-login';
import 'ng2-alfresco-search';
import 'ng2-alfresco-social';
import 'ng2-alfresco-tag';
import 'ng2-alfresco-upload';
import 'ng2-alfresco-userinfo';
import 'ng2-alfresco-viewer';
import 'ng2-alfresco-webscript';
import 'chart.js';
import 'ng2-charts';
require('script-loader!raphael/raphael.min.js');
require('script-loader!moment/min/moment.min.js');
require('pdfjs-dist/web/compatibility.js');
// Setting worker path to worker bundle.
let pdfjsLib = require('pdfjs-dist');
pdfjsLib.PDFJS.workerSrc = 'pdf.worker.js';
require('pdfjs-dist/web/pdf_viewer.js');
// 3D viewer
require('three/build/three.min.js');
import 'ng2-3d-editor';
import 'three';

View File

@@ -1,10 +0,0 @@
var path = require('path');
var _root = path.resolve(__dirname, '..');
function root(args) {
args = Array.prototype.slice.call(arguments, 0);
return path.join.apply(path, [_root].concat(args));
}
exports.root = root;

View File

@@ -1,21 +0,0 @@
Error.stackTraceLimit = Infinity;
require('core-js/es6');
require('core-js/es7/reflect');
require('zone.js/dist/zone');
require('zone.js/dist/long-stack-trace-zone');
require('zone.js/dist/proxy');
require('zone.js/dist/sync-test');
require('zone.js/dist/jasmine-patch');
require('zone.js/dist/async-test');
require('zone.js/dist/fake-async-test');
var appContext = require.context('../app', true, /\.spec\.ts/);
appContext.keys().forEach(appContext);
var testing = require('@angular/core/testing');
var browser = require('@angular/platform-browser-dynamic/testing');
testing.TestBed.initTestEnvironment(browser.BrowserDynamicTestingModule, browser.platformBrowserDynamicTesting());

View File

@@ -1,73 +0,0 @@
var webpackConfig = require('./webpack.test');
module.exports = function (config) {
var _config = {
basePath: '',
frameworks: ['jasmine'],
files: [
'./node_modules/hammerjs/hammer.js',
{ pattern: './config/karma-test-shim.js', watched: false }
],
preprocessors: {
'./config/karma-test-shim.js': ['webpack', 'sourcemap']
},
webpack: webpackConfig,
webpackMiddleware: {
stats: 'errors-only'
},
port: 9876,
// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,
colors: true,
autoWatch: true,
captureTimeout: 180000,
browserDisconnectTimeout: 180000,
browserDisconnectTolerance: 3,
browserNoActivityTimeout: 300000,
browsers: ['Chrome'],
customLaunchers: {
Chrome_travis_ci: {
base: 'Chrome',
flags: ['--no-sandbox']
}
},
// Karma plugins loaded
plugins: [
require('../node_modules/karma-jasmine'),
require('../node_modules/karma-coverage'),
require('../node_modules/karma-sourcemap-loader'),
require('../node_modules/karma-chrome-launcher'),
require('../node_modules/karma-mocha-reporter'),
require('../node_modules/karma-webpack'),
require('../node_modules/karma-jasmine-html-reporter')
],
webpackServer: {
noInfo: true
},
reporters: ['mocha']
};
if (process.env.TRAVIS) {
config.browsers = ['Chrome_travis_ci'];
}
config.set(_config);
};

View File

@@ -1,5 +0,0 @@
module.exports = function(source) {
this.cacheable();
console.log(this.resource);
return source;
}

View File

@@ -1,67 +0,0 @@
var path = require('path');
var loaderUtils = require('loader-utils');
var fs = require('fs');
var licenseFileUtf8Store = undefined;
function readLicenseHeaderFile(licenseFilePath) {
if (licenseFileUtf8Store) {
return licenseFileUtf8Store;
}
if (fs.existsSync(licenseFilePath)) {
licenseFileUtf8Store = fs.readFileSync(licenseFilePath, 'utf8').split(/\r?\n/);
return licenseFileUtf8Store;
}
throw new Error('The license header file path is wrong ' + licenseFilePath);
}
function isFileEmpty(fileContents) {
return fileContents.toString('utf8').trim() === '';
}
function readCurrentFile(fileContent) {
return fileContent.toString('utf8').split(/\r?\n/);
}
function isLicenseHeaderPresent(currentFileContent, licenseFilePath) {
if (!isFileEmpty(currentFileContent)) {
var currentFileUtf8 = readCurrentFile(currentFileContent),
licenseFileUtf8 = readLicenseHeaderFile(licenseFilePath);
skipStrict = 0;
if(currentFileUtf8[0] === '"use strict";' ) {
skipStrict = 1;
}
for (var i = skipStrict; i < licenseFileUtf8.length; i++) {
if (currentFileUtf8[i + skipStrict] !== licenseFileUtf8[i]) {
return false;
}
}
}
return true;
}
function report(hasHeader, emitter, filename) {
if (hasHeader) return;
emitter('Missing license header file : ' + filename);
}
function licenseCheck(webpackInstance, input, options) {
var isLicensePresent = isLicenseHeaderPresent(input, options.licenseFile);
var emitter = options.emitErrors ? webpackInstance.emitError : webpackInstance.emitWarning;
report(isLicensePresent, emitter, webpackInstance.resourcePath);
}
module.exports = function(input, map) {
this.cacheable && this.cacheable();
var callback = this.async();
var options = loaderUtils.getOptions(this);
licenseCheck(this, input, options);
callback(null, input, map);
};

View File

@@ -1,27 +0,0 @@
const moduleIdRegex = /moduleId: module.id,/g;
const moduleNameRegex = /moduleId: __moduleName,/g;
const moduleIdPath = /module.id.replace/g;
module.exports = function(source) {
this.cacheable();
if (moduleIdRegex.test(source)) {
source = source.replace(moduleIdRegex, (match) => {
return `// ${match}`;
});
}
if (moduleNameRegex.test(source)) {
source = source.replace(moduleNameRegex, (match) => {
return `// ${match}`;
});
}
if (moduleIdPath.test(source)) {
source = source.replace(moduleIdPath, (match) => {
return `''.replace`;
});
}
return source;
}

View File

@@ -1,191 +0,0 @@
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const helpers = require('./helpers');
const path = require('path');
module.exports = {
entry: {
'polyfills': './app/polyfills.ts',
'vendor': './app/vendor.ts',
'app': './app/main.ts'
},
resolveLoader: {
alias: {
"license-check": path.resolve(__dirname, "./loaders/license-check")
}
},
module: {
rules: [
{
enforce: 'pre',
test: /\.js$/,
include: [helpers.root('app'), helpers.root('../ng2-components')],
loader: 'source-map-loader',
exclude: [/node_modules/, /public/, /resources/, /dist/]
},
{
enforce: 'pre',
test: /\.ts$/,
loader: 'tslint-loader',
include: [helpers.root('app')],
options: {
emitErrors: true,
fix: true
},
exclude: [/node_modules/, /public/, /resources/, /dist/]
},
{
enforce: 'pre',
test: /\.ts$/,
use: 'source-map-loader',
exclude: [/public/, /resources/, /dist/]
},
{
test: /\.html$/,
include: [helpers.root('app'), helpers.root('../ng2-components')],
loader: 'html-loader',
exclude: [/node_modules/, /public/, /resources/, /dist/]
},
{
test: /\.css$/,
exclude: [helpers.root('app'), helpers.root('../ng2-components')],
loader: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: 'css-loader?sourceMap'
})
},
{
test: /\.css$/,
include: [helpers.root('app'), helpers.root('../ng2-components')],
loader: 'raw-loader'
},
{
test: /\.(png|jpe?g|gif|svg|woff|woff2|ttf|eot|ico)$/,
loader: 'file-loader?name=assets/[name].[hash].[ext]'
},
{
enforce: 'pre',
test: /\.ts$/,
loader: 'license-check',
include: helpers.root('app'),
options: {
emitErrors: true,
licenseFile: path.resolve(__dirname, '../assets/license_header.txt')
},
exclude: [/theme-picker/]
}
]
},
plugins: [
new webpack.ContextReplacementPlugin(
// The (\\|\/) piece accounts for path separators in *nix and Windows
/angular(\\|\/)core(\\|\/)@angular/,
helpers.root('./app'), // location of your src
{} // a map of your routes
),
new HtmlWebpackPlugin({
template: './index.html'
}),
new CopyWebpackPlugin([
{
context: 'resources/i18n',
from: '**/*.json',
to: 'resources/i18n'
},
{
from: 'favicon-96x96.png'
},
{
from: 'node_modules/pdfjs-dist/build/pdf.worker.js',
to: 'pdf.worker.js'
},
{
from: 'node_modules/web-animations-js/web-animations.min.js',
to: 'js/web-animations.min.js'
},
{
from: 'node_modules/core-js/client/core.min.js',
to: 'js/core.min.js'
},
{
from: 'node_modules/custom-event-polyfill/custom-event-polyfill.js',
to: 'js/custom-event-polyfill.js'
},
{
from: 'node_modules/intl/dist/Intl.min.js',
to: 'js/Intl.min.js'
},
{
context: 'public',
from: '',
to: ''
},
{
from: 'versions.json'
}
]),
new webpack.optimize.CommonsChunkPlugin({
name: ['app', 'vendor', 'polyfills']
})
],
devServer: {
contentBase: helpers.root('dist'),
compress: true,
port: 3000,
historyApiFallback: true,
host: '0.0.0.0',
inline: true,
proxy: {
'/ecm': {
target: {
host: "0.0.0.0",
protocol: 'http:',
port: 8080
},
pathRewrite: {
'^/ecm': ''
},
secure: false,
changeOrigin: true,
// workaround for REPO-2260
onProxyRes: function (proxyRes, req, res) {
const header = proxyRes.headers['www-authenticate'];
if (header && header.startsWith('Basic')) {
proxyRes.headers['www-authenticate'] = 'x' + header;
}
}
},
'/bpm': {
target: {
host: "0.0.0.0",
protocol: 'http:',
port: 9999
},
pathRewrite: {
'^/bpm': ''
},
secure: false,
changeOrigin: true,
// workaround
onProxyRes: function (proxyRes, req, res) {
const header = proxyRes.headers['www-authenticate'];
if (header && header.startsWith('Basic')) {
proxyRes.headers['www-authenticate'] = 'x' + header;
}
}
}
}
},
node: {
fs: 'empty'
}
};

View File

@@ -1,148 +0,0 @@
const webpack = require('webpack');
const webpackMerge = require('webpack-merge');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const commonConfig = require('./webpack.common.js');
const helpers = require('./helpers');
const path = require('path');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const HappyPack = require('happypack');
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
const alfrescoLibs = [
'ng2-activiti-analytics',
'ng2-activiti-diagrams',
'ng2-activiti-form',
'ng2-activiti-processlist',
'ng2-activiti-tasklist',
'ng2-alfresco-core',
'ng2-alfresco-datatable',
'ng2-alfresco-documentlist',
'ng2-alfresco-login',
'ng2-alfresco-search',
'ng2-alfresco-tag',
'ng2-alfresco-upload',
'ng2-alfresco-userinfo',
'ng2-alfresco-viewer',
'ng2-alfresco-webscript'
];
module.exports = webpackMerge(commonConfig, {
devtool: 'cheap-module-source-map',
output: {
path: helpers.root('dist'),
filename: '[name].js',
chunkFilename: '[id].chunk.js'
},
module: {
rules: [
{
test: /\.ts$/,
include: [helpers.root('app'), helpers.root('../ng2-components')],
loader: [
'happypack/loader?id=ts','angular2-template-loader'
],
exclude: [/node_modules/, /public/, /resources/, /dist/]
},
{
test: /\.scss$/,
use: [{
loader: "to-string-loader"
}, {
loader: "raw-loader"
}, {
loader: "sass-loader",
options: {
includePaths: [path.resolve(__dirname, '../../ng2-components/ng2-alfresco-core/styles')]
}
}]
}
]
},
resolve: {
alias: {
"ng2-alfresco-core$": path.resolve(__dirname, '../../ng2-components/ng2-alfresco-core/index.ts'),
"ng2-alfresco-core": path.resolve(__dirname, '../../ng2-components/ng2-alfresco-core'),
"ng2-alfresco-datatable$": path.resolve(__dirname, '../../ng2-components/ng2-alfresco-datatable/index.ts'),
"ng2-alfresco-datatable": path.resolve(__dirname, '../../ng2-components/ng2-alfresco-datatable'),
"ng2-activiti-form/stencils/runtime.ng1$": path.resolve(__dirname, '../../ng2-components/ng2-activiti-form/stencils/runtime.ng1'),
"ng2-activiti-form/stencils/runtime.adf$": path.resolve(__dirname, '../../ng2-components/ng2-activiti-form/stencils/runtime.adf'),
"ng2-activiti-diagrams$": path.resolve(__dirname, '../../ng2-components/ng2-activiti-diagrams/index.ts'),
"ng2-activiti-diagrams": path.resolve(__dirname, '../../ng2-components/ng2-activiti-diagrams'),
"ng2-activiti-analytics$": path.resolve(__dirname, '../../ng2-components/ng2-activiti-analytics/index.ts'),
"ng2-activiti-analytics": path.resolve(__dirname, '../../ng2-components/ng2-activiti-analytics'),
"ng2-activiti-form$": path.resolve(__dirname, '../../ng2-components/ng2-activiti-form/index.ts'),
"ng2-activiti-form": path.resolve(__dirname, '../../ng2-components/ng2-activiti-form'),
"ng2-activiti-tasklist$": path.resolve(__dirname, '../../ng2-components/ng2-activiti-tasklist/index.ts'),
"ng2-activiti-tasklist": path.resolve(__dirname, '../../ng2-components/ng2-activiti-tasklist'),
"ng2-activiti-processlist$": path.resolve(__dirname, '../../ng2-components/ng2-activiti-processlist/index.ts'),
"ng2-activiti-processlist": path.resolve(__dirname, '../../ng2-components/ng2-activiti-processlist'),
"ng2-alfresco-documentlist$": path.resolve(__dirname, '../../ng2-components/ng2-alfresco-documentlist/index.ts'),
"ng2-alfresco-documentlist": path.resolve(__dirname, '../../ng2-components/ng2-alfresco-documentlist'),
"ng2-alfresco-login$": path.resolve(__dirname, '../../ng2-components/ng2-alfresco-login/index.ts'),
"ng2-alfresco-login": path.resolve(__dirname, '../../ng2-components/ng2-alfresco-login'),
"ng2-alfresco-search$": path.resolve(__dirname, '../../ng2-components/ng2-alfresco-search/index.ts'),
"ng2-alfresco-search": path.resolve(__dirname, '../../ng2-components/ng2-alfresco-search'),
"ng2-alfresco-social$": path.resolve(__dirname, '../../ng2-components/ng2-alfresco-social/index.ts'),
"ng2-alfresco-social": path.resolve(__dirname, '../../ng2-components/ng2-alfresco-social'),
"ng2-alfresco-tag$": path.resolve(__dirname, '../../ng2-components/ng2-alfresco-tag/index.ts'),
"ng2-alfresco-tag": path.resolve(__dirname, '../../ng2-components/ng2-alfresco-tag'),
"ng2-alfresco-upload$": path.resolve(__dirname, '../../ng2-components/ng2-alfresco-upload/index.ts'),
"ng2-alfresco-upload": path.resolve(__dirname, '../../ng2-components/ng2-alfresco-upload'),
"ng2-alfresco-viewer$": path.resolve(__dirname, '../../ng2-components/ng2-alfresco-viewer/index.ts'),
"ng2-alfresco-viewer": path.resolve(__dirname, '../../ng2-components/ng2-alfresco-viewer'),
"ng2-alfresco-webscript$": path.resolve(__dirname, '../../ng2-components/ng2-alfresco-webscript/index.ts'),
"ng2-alfresco-webscript": path.resolve(__dirname, '../../ng2-components/ng2-alfresco-webscript'),
"ng2-alfresco-userinfo$": path.resolve(__dirname, '../../ng2-components/ng2-alfresco-userinfo/index.ts'),
"ng2-alfresco-userinfo": path.resolve(__dirname, '../../ng2-components/ng2-alfresco-userinfo')
},
extensions: ['.ts', '.js'],
modules: [path.resolve(__dirname, '../node_modules')]
},
plugins: [
new ForkTsCheckerWebpackPlugin({tsconfig: "tsconfig.dev.json"}),
new HappyPack({
id: 'ts',
threads: 8,
loaders: [
{
path: 'ts-loader',
query: {happyPackMode: true}
}
]
}),
new webpack.NoEmitOnErrorsPlugin(),
new ExtractTextPlugin('[name].[hash].css'),
new webpack.LoaderOptionsPlugin({
htmlLoader: {
minimize: false // workaround for ng2
}
}),
new CopyWebpackPlugin([
... alfrescoLibs.map(lib => {
return {
context: `../ng2-components/${lib}/src/i18n/`,
from: '**/*',
to: `assets/${lib}/i18n/`
}
}),
{
from: 'app.config-dev.json',
to: 'app.config.json'
}
]),
new CopyWebpackPlugin([
{
context: `../ng2-components/ng2-alfresco-core/prebuilt-themes/`,
from: '**/*.css',
to: 'prebuilt-themes'
}
])
]
});

View File

@@ -1,134 +0,0 @@
const webpack = require('webpack');
const webpackMerge = require('webpack-merge');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const commonConfig = require('./webpack.common.js');
const helpers = require('./helpers');
const CopyWebpackPlugin = require('copy-webpack-plugin');
var HappyPack = require('happypack');
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
const path = require('path');
const ENV = process.env.NODE_ENV = process.env.ENV = 'production';
const alfrescoLibs = [
'ng2-activiti-analytics',
'ng2-activiti-diagrams',
'ng2-activiti-form',
'ng2-activiti-processlist',
'ng2-activiti-tasklist',
'ng2-alfresco-core',
'ng2-alfresco-datatable',
'ng2-alfresco-documentlist',
'ng2-alfresco-login',
'ng2-alfresco-search',
'ng2-alfresco-tag',
'ng2-alfresco-upload',
'ng2-alfresco-userinfo',
'ng2-alfresco-viewer',
'ng2-alfresco-webscript'
];
module.exports = webpackMerge(commonConfig, {
devtool: 'eval',
output: {
path: helpers.root('dist'),
publicPath: '/',
filename: '[name].[hash].js',
chunkFilename: '[id].[hash].chunk.js'
},
resolve: {
extensions: ['.ts', '.js'],
modules: [helpers.root('node_modules')]
},
module: {
rules: [
{
test: /\.ts$/,
include: [helpers.root('app'), helpers.root('../ng2-components')],
use: ['happypack/loader?id=ts', 'angular2-template-loader'],
exclude: [/node_modules/, /public/, /resources/, /dist/]
},
{
test: /\.scss$/,
use: [{
loader: "to-string-loader"
}, {
loader: "raw-loader"
}, {
loader: "sass-loader",
options: {
includePaths: [path.resolve(__dirname, helpers.root('node_modules') + '/ng2-alfresco-core/styles')]
}
}]
},
]
},
plugins: [
new ForkTsCheckerWebpackPlugin(),
new HappyPack({
id: 'ts',
threads: 4,
loaders: [
{
path: 'ts-loader',
query: {
happyPackMode: true,
"compilerOptions": {
"paths": {}
}
}
}
]
}),
new CopyWebpackPlugin([
... alfrescoLibs.map(lib => {
return {
context: `node_modules/${lib}/bundles/assets/`,
from: '**/*',
to: `assets/`
}
})
]),
new CopyWebpackPlugin([
{
context: `node_modules/ng2-alfresco-core/prebuilt-themes/`,
from: '**/*.css',
to: 'prebuilt-themes'
},
{
from: 'app.config-prod.json',
to: 'app.config.json'
}
]),
new webpack.NoEmitOnErrorsPlugin(),
new webpack.optimize.UglifyJsPlugin({ // https://github.com/angular/angular/issues/10618
mangle: {
keep_fnames: true
},
compress: {
warnings: false
},
output: {
comments: false
},
sourceMap: true
}),
new ExtractTextPlugin('[name].[hash].css'),
new webpack.DefinePlugin({
'process.env': {
'ENV': JSON.stringify(ENV)
}
}),
new webpack.LoaderOptionsPlugin({
htmlLoader: {
minimize: false // workaround for ng2
}
})
]
});

View File

@@ -1,37 +0,0 @@
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const path = require('path');
const extractScss = new ExtractTextPlugin('../ng2-components/ng2-alfresco-core/prebuilt-themes/[name].css');
module.exports = {
entry: {
'adf-blue-orange': '../ng2-components/ng2-alfresco-core/styles/prebuilt/adf-blue-orange.scss',
'adf-blue-purple': '../ng2-components/ng2-alfresco-core/styles/prebuilt/adf-blue-purple.scss',
'adf-cyan-orange': '../ng2-components/ng2-alfresco-core/styles/prebuilt/adf-cyan-orange.scss',
'adf-cyan-purple': '../ng2-components/ng2-alfresco-core/styles/prebuilt/adf-cyan-purple.scss',
'adf-green-purple': '../ng2-components/ng2-alfresco-core/styles/prebuilt/adf-green-purple.scss',
'adf-green-orange': '../ng2-components/ng2-alfresco-core/styles/prebuilt/adf-green-orange.scss',
'adf-pink-bluegrey': '../ng2-components/ng2-alfresco-core/styles/prebuilt/adf-pink-bluegrey.scss',
'adf-indigo-pink': '../ng2-components/ng2-alfresco-core/styles/prebuilt/adf-indigo-pink.scss',
'adf-purple-green': '../ng2-components/ng2-alfresco-core/styles/prebuilt/adf-purple-green.scss'
},
output: {
filename: '../dist/[name].js'
},
module: {
rules: [{
test: /\.scss$/,
use: extractScss.extract([{
loader: "raw-loader"
}, {
loader: "sass-loader"
}])
}]
},
plugins: [
extractScss
]
};

View File

@@ -1,58 +0,0 @@
const webpack = require('webpack');
const helpers= require('./helpers');
var HappyPack = require('happypack');
module.exports = {
devtool: 'inline-source-map',
resolve: {
extensions: ['.ts', '.js'],
modules: [helpers.root('../ng2-components'), helpers.root('node_modules')]
},
module: {
rules: [
{
test: /\.ts$/,
loaders: ['happypack/loader?id=ts', 'angular2-template-loader'],
exclude: [ /public/, /resources/, /dist/]
},
{
test: /\.html$/,
loader: 'html-loader',
exclude: [ /public/, /resources/, /dist/]
},
{
test: /\.(png|jpe?g|gif|svg|woff|woff2|ttf|eot|ico)$/,
loader: 'null-loader'
},
{
test: /\.css$/,
loader: ['to-string-loader', 'css-loader'],
exclude: [ /public/, /resources/, /dist/]
}
]
},
plugins: [
new HappyPack({
id: 'ts',
threads: 4,
loaders: [
{
path: 'ts-loader',
query: {happyPackMode: true}
}
]
}),
new webpack.ContextReplacementPlugin(
// The (\\|\/) piece accounts for path separators in *nix and Windows
/angular(\\|\/)core(\\|\/)(esm(\\|\/)src|src)(\\|\/)linker/,
helpers.root('./src'), // location of your src
{} // a map of your routes
)
]
}

View File

@@ -0,0 +1,14 @@
import { MyappPage } from './app.po';
describe('myapp App', () => {
let page: MyappPage;
beforeEach(() => {
page = new MyappPage();
});
it('should display message saying app works', () => {
page.navigateTo();
expect(page.getParagraphText()).toEqual('app works!');
});
});

View File

@@ -0,0 +1,11 @@
import { browser, element, by } from 'protractor';
export class MyappPage {
navigateTo() {
return browser.get('/');
}
getParagraphText() {
return element(by.css('app-root h1')).getText();
}
}

View File

@@ -0,0 +1,12 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/e2e",
"module": "commonjs",
"target": "es5",
"types":[
"jasmine",
"node"
]
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.6 KiB

View File

@@ -1,68 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<base href="/">
<title>Demo Application - Angular 2</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/png" href="favicon-96x96.png" sizes="96x96">
<link href="https://fonts.googleapis.com/css?family=Muli" rel="stylesheet">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<script src=js/Blob.js></script>
<script src=js/core.min.js></script>
<script src=js/Intl.min.js></script>
<script src=js/classList.js></script>
<script src=js/web-animations.min.js></script>
<script src=js/formdata.js></script>
<script src=js/typedarray.js></script>
<script src=js/custom-event-polyfill.js></script>
<style>
body, html {
height: 100%;
font-family: 'Muli', "Helvetica", "Arial", sans-serif !important;
}
body {
margin: 0;
}
.loader-container {
display: -webkit-box; /* OLD - iOS 6-, Safari 3.1-6 */
display: -moz-box; /* OLD - Firefox 19- (buggy but mostly works) */
display: -webkit-flex; /* NEW - Chrome */
display: flex; /* NEW, Spec - Opera 12.1, Firefox 20+ */
-webkit-box-flex-direction: row;
-moz-box-flex-direction: row;
-webkit-flex-direction: row;
flex-direction: row;
height:100%;
}
.loader-item {
margin: auto;
max-height:100px;
max-width:300px;
}
.loader-text{
white-space: nowrap;
text-align: center;
position: relative;
}
</style>
</head>
<!-- 3. Display the application -->
<body class="adf-background-color">
<adf-app>
<div id="loader-container" class="loader-container">
<div class="loader-item">
<div id="loader-text" class="loader-text">Loading Demo Shell..</div>
</div>
</div>
</adf-app>
</body>
</html>

View File

@@ -1 +1,44 @@
module.exports = require('./config/karma.conf.js');
// Karma configuration file, see link for more information
// https://karma-runner.github.io/0.13/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular/cli'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular/cli/plugins/karma')
],
client:{
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
files: [
{ pattern: './src/test.ts', watched: false }
],
preprocessors: {
'./src/test.ts': ['@angular/cli']
},
mime: {
'text/x-typescript': ['ts','tsx']
},
coverageIstanbulReporter: {
reports: [ 'html', 'lcovonly' ],
fixWebpackSourcePaths: true
},
angularCli: {
environment: 'dev'
},
reporters: config.angularCli && config.angularCli.codeCoverage
? ['progress', 'coverage-istanbul']
: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false
});
};

View File

@@ -1,66 +1,28 @@
{
"name": "Alfresco-Angular2-Demo",
"description": "Demo shell for Alfresco Angular2 components",
"version": "1.9.0",
"author": "Alfresco Software, Ltd.",
"name": "myapp",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"build": "npm run server-versions && rimraf dist && npm run webpack -- --config config/webpack.prod.js --progress --profile --bail",
"build:dev": "npm run server-versions && rimraf dist && npm run style:dev && npm run webpack -- --config config/webpack.dev.js --progress --profile --bail",
"style:dev": "npm run webpack -- --config config/webpack.style.js --progress --profile --bail",
"start:dist": "npm run server-versions && wsrv -s dist/ -p 3000 -a 0.0.0.0",
"start": "npm run server-versions && npm run webpack-dev-server -- --config config/webpack.prod.js --progress --content-base app/ ",
"start:dev": "npm run server-versions && npm run style:dev && npm run webpack-dev-server -- --config config/webpack.dev.js --progress --content-base ",
"test": "rimraf coverage && karma start --single-run",
"ng": "ng",
"start": "npm run server-versions && rimraf dist && ng serve --app=0 --open",
"start:dev": "npm run server-versions && rimraf dist && ng serve --app=1 pp-dev --proxy-config proxy.conf.json --open",
"start:prod": "npm run server-versions && rimraf dist && ng serve --prod --app=0 pp-dev --proxy-config proxy.conf.json --open",
"build": "npm run server-versions && rimraf dist && ng build -app=0",
"build:dev": "npm run server-versions && rimraf dist && ng build -app=1",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"server-versions": "rimraf versions.json && npm list --depth=0 --json=true --prod=true > versions.json || exit 0",
"clean": "npm run clean-build && rimraf dist node_modules typings dist",
"clean-build": "rimraf 'app/{,**/}**.js' 'app/{,**/}**.js.map' 'app/{,**/}**.d.ts'",
"clean-lock": "rimraf package-lock.json",
"server-versions": "rimraf versions.json && npm list --depth=0 --json=true --prod=true > versions.json || exit 0",
"webpack-dev-server": "node node_modules/webpack-dev-server/bin/webpack-dev-server.js",
"webpack": "node node_modules/webpack/bin/webpack.js",
"aws": "node app.js"
"clean-lock": "rimraf package-lock.json"
},
"repository": {
"type": "git",
"url": "https://github.com/Alfresco/alfresco-ng2-components.git"
},
"bugs": {
"url": "https://github.com/Alfresco/alfresco-ng2-components/issues"
},
"license": "Apache-2.0",
"contributors": [
{
"name": "Denys Vuika",
"email": "denis.vuyka@gmail.com"
},
{
"name": "Mario Romano",
"email": "mario.romano83@gmail.com"
},
{
"name": "Will Abson",
"email": "will.abson@alfresco.com"
},
{
"name": "Eugenio Romano",
"email": "eugenio.romano@alfresco.com"
},
{
"name": "Maurizio Vitale",
"email": "maurizio.vitale@alfresco.com"
}
],
"keywords": [
"ng2",
"angular",
"angular2",
"alfresco"
],
"private": true,
"dependencies": {
"@angular/animations": "4.4.5",
"@angular/cdk": "2.0.0-beta.12",
"@angular/common": "4.4.5",
"@angular/compiler": "4.4.5",
"@angular/compiler-cli": "4.4.5",
"@angular/core": "4.4.5",
"@angular/flex-layout": "2.0.0-beta.9",
"@angular/forms": "4.4.5",
@@ -70,19 +32,22 @@
"@angular/platform-browser-dynamic": "4.4.5",
"@angular/router": "4.4.5",
"@ngx-translate/core": "7.0.0",
"alfresco-js-api": "1.9.0",
"chart.js": "2.5.0",
"core-js": "2.4.1",
"custom-event-polyfill": "^0.3.0",
"custom-event-polyfill": "0.3.0",
"dialog-polyfill": "0.4.7",
"element.scrollintoviewifneeded-polyfill": "1.0.1",
"hammerjs": "2.0.8",
"intl": "1.2.5",
"material-design-lite": "1.2.1",
"minimatch": "3.0.4",
"moment": "2.15.1",
"ng2-3d-editor": "0.0.15",
"alfresco-js-api": "1.9.0",
"ng2-activiti-analytics": "1.9.0",
"ng2-activiti-diagrams": "1.9.0",
"ng2-activiti-form": "1.9.0",
"ng2-activiti-processlist": "1.9.0",
"ng2-activiti-tasklist": "1.9.0",
"ng2-alfresco-core": "1.9.0",
"ng2-alfresco-datatable": "1.9.0",
"ng2-alfresco-documentlist": "1.9.0",
@@ -100,52 +65,25 @@
"reflect-metadata": "0.1.9",
"rxjs": "5.1.0",
"web-animations-js": "2.3.1",
"zone.js": "0.8.12"
"zone.js": "0.8.4"
},
"devDependencies": {
"@types/hammerjs": "2.0.35",
"@types/jasmine": "2.5.35",
"@types/node": "6.0.45",
"adf-tslint-rules": "0.0.3",
"angular2-template-loader": "0.6.2",
"codelyzer": "3.1.2",
"copy-webpack-plugin": "4.0.1",
"css-loader": "0.25.0",
"extract-text-webpack-plugin": "2.0.0-rc.3",
"file-loader": "0.10.0",
"fork-ts-checker-webpack-plugin": "0.2.4",
"happypack": "^4.0.0-beta.1",
"html-loader": "0.4.4",
"html-webpack-plugin": "2.28.0",
"jasmine-core": "2.5.2",
"karma": "1.7.0",
"karma-chrome-launcher": "2.0.0",
"karma-coverage": "1.1.1",
"karma-jasmine": "1.1.0",
"karma-jasmine-ajax": "0.1.13",
"karma-jasmine-html-reporter": "0.2.0",
"karma-mocha-reporter": "2.2.2",
"karma-remap-istanbul": "0.6.0",
"karma-sourcemap-loader": "0.3.7",
"karma-webpack": "2.0.3",
"loader-utils": "^1.1.0",
"node-sass": "4.5.3",
"null-loader": "0.1.1",
"raw-loader": "0.5.1",
"rimraf": "2.6.1",
"sass-loader": "6.0.5",
"script-loader": "0.7.0",
"source-map-loader": "0.1.6",
"sourcemap-istanbul-instrumenter-loader": "0.2.0",
"style-loader": "0.13.1",
"to-string-loader": "1.1.5",
"ts-loader": "2.2.1",
"tslint": "5.5.0",
"tslint-loader": "3.5.3",
"typescript": "2.3.4",
"webpack": "2.2.1",
"webpack-dev-server": "2.3.0",
"webpack-merge": "2.6.1",
"wsrv": "0.1.7"
"@angular/cli": "1.0.0",
"@angular/compiler-cli": "^4.4.6",
"@types/jasmine": "2.5.38",
"@types/node": "^6.0.90",
"codelyzer": "~2.0.0",
"jasmine-core": "~2.5.2",
"jasmine-spec-reporter": "~3.2.0",
"karma": "~1.4.1",
"karma-chrome-launcher": "~2.0.0",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^0.2.0",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.1.0",
"ts-node": "~2.0.0",
"tslint": "~4.5.0",
"typescript": "~2.2.0"
}
}

View File

@@ -0,0 +1,30 @@
// Protractor configuration file, see link for more information
// https://github.com/angular/protractor/blob/master/lib/config.ts
const { SpecReporter } = require('jasmine-spec-reporter');
exports.config = {
allScriptsTimeout: 11000,
specs: [
'./e2e/**/*.e2e-spec.ts'
],
capabilities: {
'browserName': 'chrome'
},
directConnect: true,
baseUrl: 'http://localhost:4200/',
framework: 'jasmine',
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000,
print: function() {}
},
beforeLaunch: function() {
require('ts-node').register({
project: 'e2e/tsconfig.e2e.json'
});
},
onPrepare() {
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
}
};

View File

@@ -0,0 +1,18 @@
{
"/alfresco": {
"target": "http://localhost:8080",
"secure": false,
"pathRewrite": {
"^/alfresco/alfresco": ""
},
"changeOrigin": true
},
"/activiti-app": {
"target": "http://localhost:9999",
"secure": false,
"pathRewrite": {
"^/activiti-app/activiti-app": ""
},
"changeOrigin": true
}
}

View File

@@ -1,211 +0,0 @@
/* Blob.js
* A Blob implementation.
* 2014-07-24
*
* By Eli Grey, http://eligrey.com
* By Devin Samarin, https://github.com/dsamarin
* License: MIT
* See https://github.com/eligrey/Blob.js/blob/master/LICENSE.md
*/
/*global self, unescape */
/*jslint bitwise: true, regexp: true, confusion: true, es5: true, vars: true, white: true,
plusplus: true */
/*! @source http://purl.eligrey.com/github/Blob.js/blob/master/Blob.js */
(function (view) {
"use strict";
view.URL = view.URL || view.webkitURL;
if (view.Blob && view.URL) {
try {
new Blob;
return;
} catch (e) {}
}
// Internally we use a BlobBuilder implementation to base Blob off of
// in order to support older browsers that only have BlobBuilder
var BlobBuilder = view.BlobBuilder || view.WebKitBlobBuilder || view.MozBlobBuilder || (function(view) {
var
get_class = function(object) {
return Object.prototype.toString.call(object).match(/^\[object\s(.*)\]$/)[1];
}
, FakeBlobBuilder = function BlobBuilder() {
this.data = [];
}
, FakeBlob = function Blob(data, type, encoding) {
this.data = data;
this.size = data.length;
this.type = type;
this.encoding = encoding;
}
, FBB_proto = FakeBlobBuilder.prototype
, FB_proto = FakeBlob.prototype
, FileReaderSync = view.FileReaderSync
, FileException = function(type) {
this.code = this[this.name = type];
}
, file_ex_codes = (
"NOT_FOUND_ERR SECURITY_ERR ABORT_ERR NOT_READABLE_ERR ENCODING_ERR "
+ "NO_MODIFICATION_ALLOWED_ERR INVALID_STATE_ERR SYNTAX_ERR"
).split(" ")
, file_ex_code = file_ex_codes.length
, real_URL = view.URL || view.webkitURL || view
, real_create_object_URL = real_URL.createObjectURL
, real_revoke_object_URL = real_URL.revokeObjectURL
, URL = real_URL
, btoa = view.btoa
, atob = view.atob
, ArrayBuffer = view.ArrayBuffer
, Uint8Array = view.Uint8Array
, origin = /^[\w-]+:\/*\[?[\w\.:-]+\]?(?::[0-9]+)?/
;
FakeBlob.fake = FB_proto.fake = true;
while (file_ex_code--) {
FileException.prototype[file_ex_codes[file_ex_code]] = file_ex_code + 1;
}
// Polyfill URL
if (!real_URL.createObjectURL) {
URL = view.URL = function(uri) {
var
uri_info = document.createElementNS("http://www.w3.org/1999/xhtml", "a")
, uri_origin
;
uri_info.href = uri;
if (!("origin" in uri_info)) {
if (uri_info.protocol.toLowerCase() === "data:") {
uri_info.origin = null;
} else {
uri_origin = uri.match(origin);
uri_info.origin = uri_origin && uri_origin[1];
}
}
return uri_info;
};
}
URL.createObjectURL = function(blob) {
var
type = blob.type
, data_URI_header
;
if (type === null) {
type = "application/octet-stream";
}
if (blob instanceof FakeBlob) {
data_URI_header = "data:" + type;
if (blob.encoding === "base64") {
return data_URI_header + ";base64," + blob.data;
} else if (blob.encoding === "URI") {
return data_URI_header + "," + decodeURIComponent(blob.data);
} if (btoa) {
return data_URI_header + ";base64," + btoa(blob.data);
} else {
return data_URI_header + "," + encodeURIComponent(blob.data);
}
} else if (real_create_object_URL) {
return real_create_object_URL.call(real_URL, blob);
}
};
URL.revokeObjectURL = function(object_URL) {
if (object_URL.substring(0, 5) !== "data:" && real_revoke_object_URL) {
real_revoke_object_URL.call(real_URL, object_URL);
}
};
FBB_proto.append = function(data/*, endings*/) {
var bb = this.data;
// decode data to a binary string
if (Uint8Array && (data instanceof ArrayBuffer || data instanceof Uint8Array)) {
var
str = ""
, buf = new Uint8Array(data)
, i = 0
, buf_len = buf.length
;
for (; i < buf_len; i++) {
str += String.fromCharCode(buf[i]);
}
bb.push(str);
} else if (get_class(data) === "Blob" || get_class(data) === "File") {
if (FileReaderSync) {
var fr = new FileReaderSync;
bb.push(fr.readAsBinaryString(data));
} else {
// async FileReader won't work as BlobBuilder is sync
throw new FileException("NOT_READABLE_ERR");
}
} else if (data instanceof FakeBlob) {
if (data.encoding === "base64" && atob) {
bb.push(atob(data.data));
} else if (data.encoding === "URI") {
bb.push(decodeURIComponent(data.data));
} else if (data.encoding === "raw") {
bb.push(data.data);
}
} else {
if (typeof data !== "string") {
data += ""; // convert unsupported types to strings
}
// decode UTF-16 to binary string
bb.push(unescape(encodeURIComponent(data)));
}
};
FBB_proto.getBlob = function(type) {
if (!arguments.length) {
type = null;
}
return new FakeBlob(this.data.join(""), type, "raw");
};
FBB_proto.toString = function() {
return "[object BlobBuilder]";
};
FB_proto.slice = function(start, end, type) {
var args = arguments.length;
if (args < 3) {
type = null;
}
return new FakeBlob(
this.data.slice(start, args > 1 ? end : this.data.length)
, type
, this.encoding
);
};
FB_proto.toString = function() {
return "[object Blob]";
};
FB_proto.close = function() {
this.size = 0;
delete this.data;
};
return FakeBlobBuilder;
}(view));
view.Blob = function(blobParts, options) {
var type = options ? (options.type || "") : "";
var builder = new BlobBuilder();
if (blobParts) {
for (var i = 0, len = blobParts.length; i < len; i++) {
if (Uint8Array && blobParts[i] instanceof Uint8Array) {
builder.append(blobParts[i].buffer);
}
else {
builder.append(blobParts[i]);
}
}
}
var blob = builder.getBlob(type);
if (!blob.slice && blob.webkitSlice) {
blob.slice = blob.webkitSlice;
}
return blob;
};
var getPrototypeOf = Object.getPrototypeOf || function(object) {
return object.__proto__;
};
view.Blob.prototype = getPrototypeOf(new view.Blob());
}(typeof self !== "undefined" && self || typeof window !== "undefined" && window || this.content || this));

View File

@@ -1,240 +0,0 @@
/*
* classList.js: Cross-browser full element.classList implementation.
* 1.1.20170427
*
* By Eli Grey, http://eligrey.com
* License: Dedicated to the public domain.
* See https://github.com/eligrey/classList.js/blob/master/LICENSE.md
*/
/*global self, document, DOMException */
/*! @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js */
if ("document" in self) {
// Full polyfill for browsers with no classList support
// Including IE < Edge missing SVGElement.classList
if (!("classList" in document.createElement("_"))
|| document.createElementNS && !("classList" in document.createElementNS("http://www.w3.org/2000/svg","g"))) {
(function (view) {
"use strict";
if (!('Element' in view)) return;
var
classListProp = "classList"
, protoProp = "prototype"
, elemCtrProto = view.Element[protoProp]
, objCtr = Object
, strTrim = String[protoProp].trim || function () {
return this.replace(/^\s+|\s+$/g, "");
}
, arrIndexOf = Array[protoProp].indexOf || function (item) {
var
i = 0
, len = this.length
;
for (; i < len; i++) {
if (i in this && this[i] === item) {
return i;
}
}
return -1;
}
// Vendors: please allow content code to instantiate DOMExceptions
, DOMEx = function (type, message) {
this.name = type;
this.code = DOMException[type];
this.message = message;
}
, checkTokenAndGetIndex = function (classList, token) {
if (token === "") {
throw new DOMEx(
"SYNTAX_ERR"
, "An invalid or illegal string was specified"
);
}
if (/\s/.test(token)) {
throw new DOMEx(
"INVALID_CHARACTER_ERR"
, "String contains an invalid character"
);
}
return arrIndexOf.call(classList, token);
}
, ClassList = function (elem) {
var
trimmedClasses = strTrim.call(elem.getAttribute("class") || "")
, classes = trimmedClasses ? trimmedClasses.split(/\s+/) : []
, i = 0
, len = classes.length
;
for (; i < len; i++) {
this.push(classes[i]);
}
this._updateClassName = function () {
elem.setAttribute("class", this.toString());
};
}
, classListProto = ClassList[protoProp] = []
, classListGetter = function () {
return new ClassList(this);
}
;
// Most DOMException implementations don't allow calling DOMException's toString()
// on non-DOMExceptions. Error's toString() is sufficient here.
DOMEx[protoProp] = Error[protoProp];
classListProto.item = function (i) {
return this[i] || null;
};
classListProto.contains = function (token) {
token += "";
return checkTokenAndGetIndex(this, token) !== -1;
};
classListProto.add = function () {
var
tokens = arguments
, i = 0
, l = tokens.length
, token
, updated = false
;
do {
token = tokens[i] + "";
if (checkTokenAndGetIndex(this, token) === -1) {
this.push(token);
updated = true;
}
}
while (++i < l);
if (updated) {
this._updateClassName();
}
};
classListProto.remove = function () {
var
tokens = arguments
, i = 0
, l = tokens.length
, token
, updated = false
, index
;
do {
token = tokens[i] + "";
index = checkTokenAndGetIndex(this, token);
while (index !== -1) {
this.splice(index, 1);
updated = true;
index = checkTokenAndGetIndex(this, token);
}
}
while (++i < l);
if (updated) {
this._updateClassName();
}
};
classListProto.toggle = function (token, force) {
token += "";
var
result = this.contains(token)
, method = result ?
force !== true && "remove"
:
force !== false && "add"
;
if (method) {
this[method](token);
}
if (force === true || force === false) {
return force;
} else {
return !result;
}
};
classListProto.toString = function () {
return this.join(" ");
};
if (objCtr.defineProperty) {
var classListPropDesc = {
get: classListGetter
, enumerable: true
, configurable: true
};
try {
objCtr.defineProperty(elemCtrProto, classListProp, classListPropDesc);
} catch (ex) { // IE 8 doesn't support enumerable:true
// adding undefined to fight this issue https://github.com/eligrey/classList.js/issues/36
// modernie IE8-MSW7 machine has IE8 8.0.6001.18702 and is affected
if (ex.number === undefined || ex.number === -0x7FF5EC54) {
classListPropDesc.enumerable = false;
objCtr.defineProperty(elemCtrProto, classListProp, classListPropDesc);
}
}
} else if (objCtr[protoProp].__defineGetter__) {
elemCtrProto.__defineGetter__(classListProp, classListGetter);
}
}(self));
}
// There is full or partial native classList support, so just check if we need
// to normalize the add/remove and toggle APIs.
(function () {
"use strict";
var testElement = document.createElement("_");
testElement.classList.add("c1", "c2");
// Polyfill for IE 10/11 and Firefox <26, where classList.add and
// classList.remove exist but support only one argument at a time.
if (!testElement.classList.contains("c2")) {
var createMethod = function(method) {
var original = DOMTokenList.prototype[method];
DOMTokenList.prototype[method] = function(token) {
var i, len = arguments.length;
for (i = 0; i < len; i++) {
token = arguments[i];
original.call(this, token);
}
};
};
createMethod('add');
createMethod('remove');
}
testElement.classList.toggle("c3", false);
// Polyfill for IE 10 and Firefox <24, where classList.toggle does not
// support the second argument.
if (testElement.classList.contains("c3")) {
var _toggle = DOMTokenList.prototype.toggle;
DOMTokenList.prototype.toggle = function(token, force) {
if (1 in arguments && !this.contains(token) === !force) {
return force;
} else {
return _toggle.call(this, token);
}
};
}
testElement = null;
}());
}

View File

@@ -1,37 +0,0 @@
/**
* Emulate FormData for some browsers
* MIT License
* (c) 2010 François de Metz
*/
(function(w) {
if (w.FormData)
return;
function FormData() {
this.fake = true;
this.boundary = "--------FormData" + Math.random();
this._fields = [];
}
FormData.prototype.append = function(key, value) {
this._fields.push([key, value]);
}
FormData.prototype.toString = function() {
var boundary = this.boundary;
var body = "";
this._fields.forEach(function(field) {
body += "--" + boundary + "\r\n";
// file upload
if (field[1].name) {
var file = field[1];
body += "Content-Disposition: form-data; name=\""+ field[0] +"\"; filename=\""+ file.name +"\"\r\n";
body += "Content-Type: "+ file.type +"\r\n\r\n";
body += file.getAsBinary() + "\r\n";
} else {
body += "Content-Disposition: form-data; name=\""+ field[0] +"\";\r\n\r\n";
body += field[1] + "\r\n";
}
});
body += "--" + boundary +"--";
return body;
}
w.FormData = FormData;
})(window);

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,47 @@
import { NgModule } from '@angular/core';
// ADF modules
import { CoreModule } from 'ng2-alfresco-core';
import { DataTableModule } from 'ng2-alfresco-datatable';
import { ViewerModule } from 'ng2-alfresco-viewer';
import { DocumentListModule } from 'ng2-alfresco-documentlist';
import { LoginModule } from 'ng2-alfresco-login';
import { UploadModule } from 'ng2-alfresco-upload';
import { SearchModule } from 'ng2-alfresco-search';
import { UserInfoModule } from 'ng2-alfresco-userinfo';
import { SocialModule } from 'ng2-alfresco-social';
import { TagModule } from 'ng2-alfresco-tag';
import { WebScriptModule } from 'ng2-alfresco-webscript';
import { ActivitiFormModule } from 'ng2-activiti-form';
import { ActivitiTaskListModule } from 'ng2-activiti-tasklist';
import { ActivitiProcessListModule } from 'ng2-activiti-processlist';
import { DiagramsModule } from 'ng2-activiti-diagrams';
import { AnalyticsModule } from 'ng2-activiti-analytics';
export function modules() {
return [
// ADF modules
CoreModule,
DataTableModule,
DocumentListModule,
LoginModule,
SearchModule,
SocialModule,
TagModule,
UploadModule,
UserInfoModule,
ViewerModule,
WebScriptModule,
ActivitiFormModule,
ActivitiTaskListModule,
ActivitiProcessListModule,
DiagramsModule,
AnalyticsModule
];
}
@NgModule({
imports: modules(),
exports: modules()
})
export class AdfModule {}

View File

@@ -0,0 +1 @@
<router-outlet></router-outlet>

View File

@@ -0,0 +1,32 @@
import { TestBed, async } from '@angular/core/testing';
import { AppComponent } from './app.component';
describe('AppComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [
AppComponent
],
}).compileComponents();
}));
it('should create the app', async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app).toBeTruthy();
}));
it(`should have as title 'app works!'`, async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app.title).toEqual('app works!');
}));
it('should render title in a h1 tag', async(() => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.debugElement.nativeElement;
expect(compiled.querySelector('h1').textContent).toContain('app works!');
}));
});

View File

@@ -20,9 +20,9 @@ import { ActivatedRoute, Router } from '@angular/router';
import { AlfrescoSettingsService, PageTitleService, StorageService, TranslationService } from 'ng2-alfresco-core';
@Component({
selector: 'adf-app',
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./theme.scss'],
styleUrls: ['./app.component.css'],
encapsulation: ViewEncapsulation.None
})
export class AppComponent {

View File

@@ -0,0 +1,100 @@
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import { MatInputModule } from '@angular/material';
import { FlexLayoutModule } from '@angular/flex-layout';
// import { Editor3DModule } from 'ng2-3d-editor';
import { ChartsModule } from 'ng2-charts';
// import { Viewer3DComponent } from './../../node_modules/ng2-3d-editor/src/componets/viewer3D.component';
import { AppConfigService, TRANSLATION_PROVIDER } from 'ng2-alfresco-core';
import { AppComponent } from './app.component';
import { AdfModule } from './adf.module';
import { MaterialModule } from './material.module';
import { LoginComponent } from './components/login/login.component';
import { SettingsComponent } from './components/settings/settings.component';
import { AppLayoutComponent } from './components/app-layout/app-layout.component';
import { HomeComponent } from './components/home/home.component';
import { SearchBarComponent } from './components/search/search-bar.component';
import { SearchComponent } from './components/search/search.component';
import { AboutComponent } from './components/about/about.component';
import { FormComponent } from './components/form/form.component';
import { FormListComponent } from './components/form/form-list.component';
import { CustomSourcesComponent } from './components/files/custom-sources.component';
import { ActivitiComponent } from './components/activiti/activiti.component';
import { ActivitiTaskAttachmentsComponent } from './components/activiti/activiti-task-attachments.component';
import { ActivitiProcessAttachmentsComponent } from './components/activiti/activiti-process-attachments.component';
import { ActivitiShowDiagramComponent } from './components/activiti/activiti-show-diagram.component';
import { FormViewerComponent } from './components/activiti/form-viewer.component';
import { FormNodeViewerComponent } from './components/activiti/form-node-viewer.component';
import { ActivitiAppsViewComponent } from './components/activiti/apps.view';
import { DataTableComponent } from './components/datatable/datatable.component';
import { FilesComponent } from './components/files/files.component';
import { FileViewComponent } from './components/file-view/file-view.component';
import { WebscriptComponent } from './components/webscript/webscript.component';
import { TagComponent } from './components/tag/tag.component';
import { SocialComponent } from './components/social/social.component';
import { ThemePickerModule } from './components/theme-picker/theme-picker';
import { DebugAppConfigService } from './services/debug-app-config.service';
import { routing } from './app.routes';
@NgModule({
declarations: [
AppComponent,
LoginComponent,
SettingsComponent,
AppLayoutComponent,
HomeComponent,
SearchBarComponent,
SearchComponent,
AboutComponent,
ActivitiComponent,
ActivitiTaskAttachmentsComponent,
ActivitiProcessAttachmentsComponent,
ActivitiShowDiagramComponent,
FormViewerComponent,
FormNodeViewerComponent,
ActivitiAppsViewComponent,
DataTableComponent,
FilesComponent,
FileViewComponent,
FormComponent,
FormListComponent,
WebscriptComponent,
TagComponent,
SocialComponent,
CustomSourcesComponent
],
imports: [
BrowserModule,
routing,
FormsModule,
HttpModule,
MatInputModule,
AdfModule,
MaterialModule,
ThemePickerModule,
FlexLayoutModule,
// Editor3DModule,
ChartsModule,
],
providers: [
{ provide: AppConfigService, useClass: DebugAppConfigService },
{
provide: TRANSLATION_PROVIDER,
multi: true,
useValue: {
name: 'app',
source: 'resources'
}
}
],
bootstrap: [AppComponent]
})
export class AppModule {
}

View File

@@ -19,33 +19,31 @@ import { ModuleWithProviders } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { AuthGuard, AuthGuardBpm, AuthGuardEcm } from 'ng2-alfresco-core';
import { AppLayoutComponent } from './components/app-layout/app-layout.component';
import { LoginComponent } from './components/login/login.component';
import { SettingsComponent } from './components/settings/settings.component';
import { HomeComponent } from './components/home/home.component';
import { AboutComponent } from './components/about/about.component';
import { ActivitiComponent } from './components/activiti/activiti.component';
import { ActivitiShowDiagramComponent } from './components/activiti/activiti-show-diagram.component';
import { FormViewerComponent } from './components/activiti/form-viewer.component';
import { FormNodeViewerComponent } from './components/activiti/form-node-viewer.component';
import { ActivitiAppsViewComponent } from './components/activiti/apps.view';
import { SearchComponent } from './components/search/search.component';
import {
AboutComponent,
ActivitiAppsViewComponent,
ActivitiDemoComponent,
ActivitiShowDiagramComponent,
DataTableDemoComponent,
FilesComponent,
FormDemoComponent,
FormNodeViewerComponent,
FormViewerComponent,
HomeComponent,
LoginDemoComponent,
SearchComponent,
SettingsComponent,
SocialComponent,
TagComponent,
WebscriptComponent
} from './components/index';
import { DataTableComponent } from './components/datatable/datatable.component';
import { WebscriptComponent } from './components/webscript/webscript.component';
import { TagComponent } from './components/tag/tag.component';
import { SocialComponent } from './components/social/social.component';
import { FilesComponent } from './components/files/files.component';
import { FormComponent } from './components/form/form.component';
import { UploadButtonComponent } from 'ng2-alfresco-upload';
import { FileViewComponent } from './components/file-view/file-view.component';
import { CustomSourcesComponent } from './components/files/custom-sources.component';
import { FormListDemoComponent } from './components/form/form-list-demo.component';
import { FormListComponent } from './components/form/form-list.component';
export const appRoutes: Routes = [
{ path: 'login', component: LoginDemoComponent },
{ path: 'login', component: LoginComponent },
{ path: 'settings', component: SettingsComponent },
{ path: 'files/:nodeId/view', component: FileViewComponent, canActivate: [ AuthGuardEcm ] },
{
@@ -60,7 +58,8 @@ export const appRoutes: Routes = [
{
path: 'home',
component: HomeComponent
},
}
,
{
path: 'files',
component: FilesComponent,
@@ -78,7 +77,7 @@ export const appRoutes: Routes = [
},
{
path: 'datatable',
component: DataTableDemoComponent
component: DataTableComponent
},
{
path: 'uploader',
@@ -102,12 +101,12 @@ export const appRoutes: Routes = [
},
{
path: 'activiti/apps/:appId/tasks',
component: ActivitiDemoComponent,
component: ActivitiComponent,
canActivate: [AuthGuardBpm]
},
{
path: 'activiti/apps/:appId/processes',
component: ActivitiDemoComponent,
component: ActivitiComponent,
canActivate: [AuthGuardBpm]
},
{
@@ -118,7 +117,7 @@ export const appRoutes: Routes = [
// TODO: check if neeeded
{
path: 'activiti/appId/:appId',
component: ActivitiDemoComponent,
component: ActivitiComponent,
canActivate: [AuthGuardBpm]
},
// TODO: check if needed
@@ -149,8 +148,8 @@ export const appRoutes: Routes = [
canActivate: [AuthGuardEcm]
},
{ path: 'about', component: AboutComponent },
{ path: 'form', component: FormDemoComponent },
{ path: 'form-list', component: FormListDemoComponent }
{ path: 'form', component: FormComponent },
{ path: 'form-list', component: FormListComponent }
]
}
];

View File

@@ -24,6 +24,7 @@ import {
DynamicTableRow, FORM_FIELD_VALIDATORS, FormEvent, FormFieldEvent, FormRenderingService,
FormService, ValidateDynamicTableRowEvent
} from 'ng2-activiti-form';
import {
ProcessFiltersComponent,
ProcessInstance,
@@ -56,11 +57,11 @@ const currentTaskIdNew = '__NEW__';
@Component({
selector: 'adf-activiti-demo',
templateUrl: './activiti-demo.component.html',
styleUrls: ['./activiti-demo.component.scss'],
templateUrl: './activiti.component.html',
styleUrls: ['./activiti.component.scss'],
encapsulation: ViewEncapsulation.None
})
export class ActivitiDemoComponent implements AfterViewInit, OnDestroy, OnInit {
export class ActivitiComponent implements AfterViewInit, OnDestroy, OnInit {
@ViewChild(TaskFiltersComponent)
activitifilter: TaskFiltersComponent;

View File

@@ -0,0 +1,58 @@
@mixin adf-app-layout-theme($theme) {
$primary: map-get($theme, primary);
$minimumAppWidth: 320px;
$toolbarHeight: 64px;
.adf-app-layout {
display: block;
min-width: $minimumAppWidth;
height: 100%;
.adf-nav-container {
display: block;
min-width: $minimumAppWidth;
height: 100%;
}
.adf-sidenav-link {
&.active {
color: mat-color($primary);
}
}
&-user-profile {
margin-right: 10px;
}
&-menu-spacer {
flex: 1 1 auto;
}
&-toolbar {
height: $toolbarHeight;
line-height: $toolbarHeight;
overflow: hidden;
mat-toolbar-row {
height: $toolbarHeight;
align-items: stretch;
justify-content: space-between;
}
.adf-toolbar-link {
min-width: 0;
line-height: $toolbarHeight;
&.active {
background-color: rgba(0, 0, 0, .12);
}
}
}
}
@media ($mat-small) {
.adf-userinfo-name {
display: none;
}
}
}

View File

@@ -44,5 +44,5 @@ export class AppLayoutComponent {
{ href: '/about', icon: 'info_outline', title: 'About' }
];
constructor() {}
constructor(){};
}

View File

@@ -22,10 +22,10 @@ import { Observable } from 'rxjs/Rx';
@Component({
selector: 'datatable-demo',
templateUrl: './datatable-demo.component.html',
styleUrls: ['./datatable-demo.component.css']
templateUrl: './datatable.component.html',
styleUrls: ['./datatable.component.css']
})
export class DataTableDemoComponent {
export class DataTableComponent {
multiselect: boolean = false;
data: ObjectDataTableAdapter;

View File

@@ -0,0 +1,5 @@
<ng-container *ngIf="nodeId">
<adf-viewer [fileNodeId]="nodeId">
§-->
</adf-viewer>
</ng-container>

View File

@@ -90,5 +90,3 @@ adf-document-list ::ng-deep adf-datatable tr.is-selected .image-table-cell::befo
}
}
}

View File

@@ -21,10 +21,10 @@ import { LogService } from 'ng2-alfresco-core';
@Component({
selector: 'form-list-demo',
templateUrl: 'form-list-demo.component.html',
styleUrls: ['form-list-demo.component.scss']
templateUrl: 'form-list.component.html',
styleUrls: ['form-list.component.scss']
})
export class FormListDemoComponent {
export class FormListComponent {
@ViewChild(ActivitiForm)
activitiForm: ActivitiForm;

View File

@@ -23,13 +23,13 @@ import { DemoForm } from './demo-form';
@Component({
selector: 'form-demo',
templateUrl: 'form-demo.component.html',
styleUrls: [ 'form-demo.component.css' ],
templateUrl: 'form.component.html',
styleUrls: [ 'form.component.css' ],
providers: [
{ provide: FormService, useClass: InMemoryFormService }
]
})
export class FormDemoComponent implements OnInit {
export class FormComponent implements OnInit {
form: FormModel;

View File

@@ -22,10 +22,10 @@ import { LogService, StorageService } from 'ng2-alfresco-core';
@Component({
selector: 'login-demo',
templateUrl: './login-demo.component.html',
styleUrls: ['./login-demo.component.css']
templateUrl: './login.component.html',
styleUrls: ['./login.component.css']
})
export class LoginDemoComponent implements OnInit {
export class LoginComponent implements OnInit {
@ViewChild('alfrescologin')
alfrescologin: any;

Some files were not shown because too many files have changed in this diff Show More