diff --git a/.travis.yml b/.travis.yml index a3e5f89fbd..8481446f95 100644 --- a/.travis.yml +++ b/.travis.yml @@ -58,6 +58,10 @@ script: (./scripts/start.sh -dev -t -ss -vjsapi alpha || exit 1;); fi fi +jobs: + include: + - stage: Check 2.0.0 Project Update + script: ./scripts/test-e2e-bc.sh # jobs: # include: diff --git a/integration/base_ver_2_app/.angular-cli.json b/integration/base_ver_2_app/.angular-cli.json new file mode 100644 index 0000000000..fb9d8df2e1 --- /dev/null +++ b/integration/base_ver_2_app/.angular-cli.json @@ -0,0 +1,106 @@ +{ + "$schema": "./node_modules/@angular/cli/lib/config/schema.json", + "project": { + "name": "myapp" + }, + "apps": [ + { + "name" : "dist", + "root": "src", + "outDir": "dist", + "assets": [ + "assets", + "favicon.ico", + "app.config.json", + "versions.json", + { + "glob": "**/*", + "input": "../resources", + "output": "./resources" + }, + { + "glob": "**/*", + "input": "../node_modules/@alfresco/adf-core/prebuilt-themes", + "output": "./assets/prebuilt-themes" + }, + { + "glob": "**/*", + "input": "../node_modules/@alfresco/adf-core/bundles/assets", + "output": "./assets/" + }, + { + "glob": "**/*", + "input": "../node_modules/@alfresco/adf-insights/bundles/assets", + "output": "./assets/" + }, + { + "glob": "**/*", + "input": "../node_modules/@alfresco/adf-process-services/bundles/assets", + "output": "./assets/" + }, + { + "glob": "**/*", + "input": "../node_modules/@alfresco/adf-content-services/bundles/assets", + "output": "./assets/" + }, + { "glob": "pdf.worker.js", "input": "../node_modules/pdfjs-dist/build", "output": "./" } + ], + "index": "index.html", + "main": "main.ts", + "polyfills": "polyfills.ts", + "test": "test.ts", + "tsconfig": "tsconfig.app.json", + "testTsconfig": "tsconfig.spec.json", + "prefix": "app", + "styles": [ + "custom-style.scss" + ], + "stylePreprocessorOptions": { + "includePaths": [ + "../node_modules/" + ] + }, + "scripts": [ + "../node_modules/pdfjs-dist/build/pdf.js", + "../node_modules/pdfjs-dist/web/pdf_viewer.js", + "../node_modules/raphael/raphael.min.js", + "../node_modules/moment/min/moment.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": { + }, + "serve": { + "proxyConfig": "proxy.conf.json", + "port": 4200 + } + } +} diff --git a/integration/base_ver_2_app/.editorconfig b/integration/base_ver_2_app/.editorconfig new file mode 100644 index 0000000000..6e87a003da --- /dev/null +++ b/integration/base_ver_2_app/.editorconfig @@ -0,0 +1,13 @@ +# Editor configuration, see http://editorconfig.org +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 2 +insert_final_newline = true +trim_trailing_whitespace = true + +[*.md] +max_line_length = off +trim_trailing_whitespace = false diff --git a/integration/base_ver_2_app/.npmignore b/integration/base_ver_2_app/.npmignore new file mode 100644 index 0000000000..54bfd2001e --- /dev/null +++ b/integration/base_ver_2_app/.npmignore @@ -0,0 +1,42 @@ +# 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 diff --git a/integration/base_ver_2_app/.travis.yml b/integration/base_ver_2_app/.travis.yml new file mode 100644 index 0000000000..959166f9aa --- /dev/null +++ b/integration/base_ver_2_app/.travis.yml @@ -0,0 +1,19 @@ +dist: trusty +sudo: false + +language: node_js +node_js: + - "8" + +cache: + directories: + - ./node_modules + +install: + - npm install + +script: + # Use Chromium instead of Chrome. + - export CHROME_BIN=chromium-browser + - xvfb-run -a npm run test -- --single-run --no-progress --browser=ChromeNoSandbox + #- xvfb-run -a npm run e2e -- --no-progress --config=protractor-ci.conf.js diff --git a/integration/base_ver_2_app/LICENSE b/integration/base_ver_2_app/LICENSE new file mode 100644 index 0000000000..7bdafc2812 --- /dev/null +++ b/integration/base_ver_2_app/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 Denys Vuika + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/integration/base_ver_2_app/README.md b/integration/base_ver_2_app/README.md new file mode 100644 index 0000000000..f5d5b7d9a1 --- /dev/null +++ b/integration/base_ver_2_app/README.md @@ -0,0 +1,56 @@ +# ADF/APS/ACS Application with Angular CLI + +Minimal ready-to-use Angular CLI project template pre-configured with ADF 2.0.0 components. + +This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.5.0 + +## Quick start + +```sh +npm install +npm start +``` + +## Supported ADF component libraries + +This project has all the existing ADF component libraries already pre-configured. + +The main focus of the project is: + +- ADF integration and setup +- Basic demonstration of working components + +## Development server + +Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files. + +### Proxy settings + +The template provides certain proxy settings to allow running web application locally without CORS setup. +You can find details in the `proxy.conf.json` file. + +List of URLs being proxied: + +- `/alfresco` -> `http://0.0.0.0:8080` +- `/activiti-app` -> `http://0.0.0.0:9999` + +## Code scaffolding + +Run `ng generate component component-name -m app.module` to generate a new component. You can also use `ng generate directive|pipe|service|class|module`. + +## Build + +Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build. + +## Running unit tests + +Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). + +## Running end-to-end tests + +Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/). +Before running the tests make sure you are serving the app via `ng serve`. + +## Further help + +To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). diff --git a/integration/base_ver_2_app/e2e/app.e2e-spec.ts b/integration/base_ver_2_app/e2e/app.e2e-spec.ts new file mode 100644 index 0000000000..e6009d9ce4 --- /dev/null +++ b/integration/base_ver_2_app/e2e/app.e2e-spec.ts @@ -0,0 +1,14 @@ +import { AdfAppPage } from './app.po'; + +describe('adf-app App', () => { + let page: AdfAppPage; + + beforeEach(() => { + page = new AdfAppPage(); + }); + + it('should display toolbar', () => { + page.navigateTo(); + expect(page.getToolbar()).toBeDefined(); + }); +}); diff --git a/integration/base_ver_2_app/e2e/app.po.ts b/integration/base_ver_2_app/e2e/app.po.ts new file mode 100644 index 0000000000..6e1bc9f987 --- /dev/null +++ b/integration/base_ver_2_app/e2e/app.po.ts @@ -0,0 +1,11 @@ +import { browser, by, element } from 'protractor'; + +export class AdfAppPage { + navigateTo() { + return browser.get('/'); + } + + getToolbar() { + return element(by.tagName('adf-toolbar')); + } +} diff --git a/integration/base_ver_2_app/e2e/tsconfig.e2e.json b/integration/base_ver_2_app/e2e/tsconfig.e2e.json new file mode 100644 index 0000000000..1d9e5edf09 --- /dev/null +++ b/integration/base_ver_2_app/e2e/tsconfig.e2e.json @@ -0,0 +1,14 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": { + "outDir": "../out-tsc/e2e", + "baseUrl": "./", + "module": "commonjs", + "target": "es5", + "types": [ + "jasmine", + "jasminewd2", + "node" + ] + } +} diff --git a/integration/base_ver_2_app/karma.conf.js b/integration/base_ver_2_app/karma.conf.js new file mode 100644 index 0000000000..c420e7b9d3 --- /dev/null +++ b/integration/base_ver_2_app/karma.conf.js @@ -0,0 +1,56 @@ +// 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') + ], + files: [ + { pattern: './node_modules/hammerjs/hammer.js', watched: false }, + { pattern: './node_modules/@angular/material/prebuilt-themes/indigo-pink.css', watched: false }, + { pattern: './node_modules/@alfresco/adf-core/bundles/assets/adf-core/i18n/en.json', watched: false, served: true, included: false }, + { pattern: './node_modules/@alfresco/adf-content-services/bundles/assets/adf-content-services/i18n/en.json', watched: false, served: true, included: false }, + { pattern: './node_modules/@alfresco/adf-process-services/bundles/assets/adf-process-services/i18n/en.json', watched: false, served: true, included: false } + ], + proxies: { + '/assets/adf-core/i18n/en.json': '/base/node_modules/@alfresco/adf-core/bundles/assets/adf-core/i18n/en.json', + '/assets/adf-content-services/i18n/en.json': '/base/node_modules/@alfresco/adf-content-services/bundles/assets/adf-content-services/i18n/en.json', + '/assets/adf-process-services/i18n/en.json': '/base/node_modules/@alfresco/adf-process-services/bundles/assets/adf-process-services/i18n/en.json' + }, + client: { + clearContext: false // leave Jasmine Spec Runner output visible in browser + }, + coverageIstanbulReporter: { + reports: ['html', 'lcovonly'], + fixWebpackSourcePaths: true + }, + angularCli: { + environment: 'dev' + }, + reporters: ['progress', 'kjhtml'], + port: 9876, + colors: true, + logLevel: config.LOG_INFO, + autoWatch: true, + browsers: ['Chrome'], + customLaunchers: { + ChromeNoSandbox: { + base: 'Chrome', + flags: ['--no-sandbox'] + } + }, + singleRun: false, + + captureTimeout: 180000, + browserDisconnectTimeout: 180000, + browserDisconnectTolerance: 3, + browserNoActivityTimeout: 300000 + }); +}; diff --git a/integration/base_ver_2_app/package.json b/integration/base_ver_2_app/package.json new file mode 100644 index 0000000000..3c9fa64701 --- /dev/null +++ b/integration/base_ver_2_app/package.json @@ -0,0 +1,75 @@ +{ + "name": "adf-cli-acs-aps-template", + "version": "2.0.0", + "blueprint": "Process and Content Services", + "description": "ACS APS ADF Application with Angular CLI", + "license": "MIT", + "scripts": { + "ng": "ng", + "start": "ng serve --open", + "build": "ng build", + "test": "ng test", + "lint": "ng lint", + "e2e": "ng e2e" + }, + "private": true, + "dependencies": { + "@alfresco/adf-content-services": "2.0.0", + "@alfresco/adf-core": "2.0.0", + "@alfresco/adf-insights": "2.0.1", + "@alfresco/adf-process-services": "2.0.0", + "@angular/animations": "5.0.0", + "@angular/cdk": "5.0.0-rc0", + "@angular/common": "5.0.0", + "@angular/compiler": "5.0.0", + "@angular/core": "5.0.0", + "@angular/flex-layout": "2.0.0-beta.10", + "@angular/forms": "5.0.0", + "@angular/http": "5.0.0", + "@angular/material": "5.0.0-rc0", + "@angular/platform-browser": "5.0.0", + "@angular/platform-browser-dynamic": "5.0.0", + "@angular/router": "5.0.0", + "@ngx-translate/core": "8.0.0", + "alfresco-js-api": "^2.1.0-4c702fe0041642c09f12fb939014cf70671d8ed8", + "chart.js": "2.5.0", + "classlist.js": "1.1.20150312", + "core-js": "2.4.1", + "custom-event-polyfill": "0.3.0", + "hammerjs": "2.0.8", + "intl": "1.2.5", + "minimatch": "3.0.4", + "moment": "2.15.2", + "moment-es6": "1.0.0", + "ng2-charts": "1.6.0", + "pdfjs-dist": "1.5.404", + "raphael": "2.2.7", + "reflect-metadata": "0.1.10", + "rxjs": "5.5.2", + "web-animations-js": "2.3.1", + "zone.js": "0.8.14" + }, + "devDependencies": { + "@angular-devkit/core": "^0.2.0", + "@angular/cli": "1.5.0", + "@angular/compiler-cli": "5.0.0", + "@angular/language-service": "5.0.0", + "@types/jasmine": "~2.5.53", + "@types/jasminewd2": "~2.0.2", + "@types/node": "~6.0.60", + "codelyzer": "~3.2.0", + "jasmine-core": "~2.6.2", + "jasmine-spec-reporter": "~4.1.0", + "karma": "~1.7.0", + "karma-chrome-launcher": "~2.1.1", + "karma-cli": "~1.0.1", + "karma-coverage-istanbul-reporter": "^1.2.1", + "karma-jasmine": "~1.1.0", + "karma-jasmine-html-reporter": "^0.2.2", + "protractor": "~5.1.2", + "rimraf": "^2.6.2", + "ts-node": "~3.2.0", + "tslint": "~5.7.0", + "typescript": "~2.4.2" + } +} diff --git a/integration/base_ver_2_app/protractor-ci.conf.js b/integration/base_ver_2_app/protractor-ci.conf.js new file mode 100644 index 0000000000..d575c56720 --- /dev/null +++ b/integration/base_ver_2_app/protractor-ci.conf.js @@ -0,0 +1,10 @@ +const config = require('./protractor.conf').config; + +config.capabilities = { + browserName: 'chrome', + chromeOptions: { + args: ['--no-sandbox'] + } +}; + +exports.config = config; diff --git a/integration/base_ver_2_app/protractor.conf.js b/integration/base_ver_2_app/protractor.conf.js new file mode 100644 index 0000000000..7ee3b5ee86 --- /dev/null +++ b/integration/base_ver_2_app/protractor.conf.js @@ -0,0 +1,28 @@ +// 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() {} + }, + onPrepare() { + require('ts-node').register({ + project: 'e2e/tsconfig.e2e.json' + }); + jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); + } +}; diff --git a/integration/base_ver_2_app/proxy.conf.json b/integration/base_ver_2_app/proxy.conf.json new file mode 100644 index 0000000000..58325541be --- /dev/null +++ b/integration/base_ver_2_app/proxy.conf.json @@ -0,0 +1,12 @@ +{ + "/alfresco": { + "target": "http://localhost:8080", + "secure": false, + "changeOrigin": true + }, + "/activiti-app": { + "target": "http://localhost:9999", + "secure": false, + "changeOrigin": true + } +} diff --git a/integration/base_ver_2_app/src/app.config.json b/integration/base_ver_2_app/src/app.config.json new file mode 100644 index 0000000000..2dc5c322c4 --- /dev/null +++ b/integration/base_ver_2_app/src/app.config.json @@ -0,0 +1,54 @@ +{ + "ecmHost": "http://{hostname}{:port}", + "bpmHost": "http://{hostname}{:port}", + "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" + } + ], + "logLevel" : "trace" +} diff --git a/integration/base_ver_2_app/src/app/adf.module.ts b/integration/base_ver_2_app/src/app/adf.module.ts new file mode 100644 index 0000000000..59e70e7a66 --- /dev/null +++ b/integration/base_ver_2_app/src/app/adf.module.ts @@ -0,0 +1,20 @@ +import { NgModule } from '@angular/core'; + +// ADF modules +import { ContentModule } from '@alfresco/adf-content-services'; +import { ProcessModule } from '@alfresco/adf-process-services'; +import { CoreModule } from '@alfresco/adf-core'; + +export function modules() { + return [ + CoreModule, + ContentModule, + ProcessModule + ]; +} + +@NgModule({ + imports: modules(), + exports: modules() +}) +export class AdfModule {} diff --git a/integration/base_ver_2_app/src/app/app.component.css b/integration/base_ver_2_app/src/app/app.component.css new file mode 100644 index 0000000000..e69de29bb2 diff --git a/integration/base_ver_2_app/src/app/app.component.html b/integration/base_ver_2_app/src/app/app.component.html new file mode 100644 index 0000000000..c578d2381a --- /dev/null +++ b/integration/base_ver_2_app/src/app/app.component.html @@ -0,0 +1,13 @@ + + + ADF + + + Login + Apps + Documents + + + + + diff --git a/integration/base_ver_2_app/src/app/app.component.spec.ts b/integration/base_ver_2_app/src/app/app.component.spec.ts new file mode 100644 index 0000000000..cba6591526 --- /dev/null +++ b/integration/base_ver_2_app/src/app/app.component.spec.ts @@ -0,0 +1,25 @@ +import { TestBed, async } from '@angular/core/testing'; +import { RouterTestingModule } from '@angular/router/testing'; + +import { AdfModule } from './adf.module'; +import { AppComponent } from './app.component'; + +describe('AppComponent', () => { + beforeEach(async(() => { + TestBed.configureTestingModule({ + imports: [ + RouterTestingModule, + AdfModule + ], + declarations: [ + AppComponent + ], + }).compileComponents(); + })); + + it('should create the app', async(() => { + const fixture = TestBed.createComponent(AppComponent); + const app = fixture.debugElement.componentInstance; + expect(app).toBeTruthy(); + })); +}); diff --git a/integration/base_ver_2_app/src/app/app.component.ts b/integration/base_ver_2_app/src/app/app.component.ts new file mode 100644 index 0000000000..8038e21fd2 --- /dev/null +++ b/integration/base_ver_2_app/src/app/app.component.ts @@ -0,0 +1,24 @@ +import { Component } from '@angular/core'; +import { TranslationService, AuthenticationService } from '@alfresco/adf-core'; +import { Router } from '@angular/router'; + +@Component({ + selector: 'app-root', + templateUrl: './app.component.html', + styleUrls: ['./app.component.css'] +}) +export class AppComponent { + + constructor(translationService: TranslationService, + private authService: AuthenticationService, + private router: Router) { + translationService.use('en'); + } + + logout() { + this.authService.logout().subscribe(() => { + this.router.navigate(['/login']); + }); + } + +} diff --git a/integration/base_ver_2_app/src/app/app.module.ts b/integration/base_ver_2_app/src/app/app.module.ts new file mode 100644 index 0000000000..6071b837c5 --- /dev/null +++ b/integration/base_ver_2_app/src/app/app.module.ts @@ -0,0 +1,85 @@ +import { BrowserModule } from '@angular/platform-browser'; +import { NgModule } from '@angular/core'; +import { RouterModule, Routes } from '@angular/router'; + +// ADF modules +import { AdfModule } from './adf.module'; +import { AuthGuardBpm } from '@alfresco/adf-core'; +import { AuthGuardEcm } from '@alfresco/adf-core'; + +// Custom stencils +import { StencilsModule } from './stencils.module'; + +// App components +import { AppComponent } from './app.component'; +import { HomeComponent } from './home/home.component'; +import { LoginComponent } from './login/login.component'; +import { AppsComponent } from './apps/apps.component'; +import { TasksComponent } from './tasks/tasks.component'; +import { TaskDetailsComponent } from './task-details/task-details.component'; +import { DocumentlistComponent } from './documentlist/documentlist.component'; +import { StartProcessComponent } from './start-process/start-process.component'; + +const appRoutes: Routes = [ + { + path: '', + component: HomeComponent + }, + { + path: 'login', + component: LoginComponent + }, + { + path: 'apps', + component: AppsComponent, + canActivate: [ AuthGuardBpm ] + }, + { + path: 'apps/:appId/tasks', + component: TasksComponent, + canActivate: [ AuthGuardBpm ] + }, + { + path: 'apps/:appId/tasks/:taskId', + component: TaskDetailsComponent, + canActivate: [ AuthGuardBpm ] + }, + { + path: 'apps/:appId/start-process', + component: StartProcessComponent, + canActivate: [ AuthGuardBpm ] + }, + { + path: 'documentlist', + component: DocumentlistComponent, + canActivate: [ AuthGuardEcm ] + } +]; + +@NgModule({ + imports: [ + BrowserModule, + RouterModule.forRoot( + appRoutes // , + // { enableTracing: true } // <-- debugging purposes only + ), + + // ADF modules + AdfModule, + + StencilsModule + ], + declarations: [ + AppComponent, + AppsComponent, + HomeComponent, + LoginComponent, + TasksComponent, + TaskDetailsComponent, + DocumentlistComponent, + StartProcessComponent + ], + providers: [], + bootstrap: [AppComponent] +}) +export class AppModule { } diff --git a/integration/base_ver_2_app/src/app/apps/apps.component.css b/integration/base_ver_2_app/src/app/apps/apps.component.css new file mode 100644 index 0000000000..e69de29bb2 diff --git a/integration/base_ver_2_app/src/app/apps/apps.component.html b/integration/base_ver_2_app/src/app/apps/apps.component.html new file mode 100644 index 0000000000..e9f2d08ba5 --- /dev/null +++ b/integration/base_ver_2_app/src/app/apps/apps.component.html @@ -0,0 +1,3 @@ + + diff --git a/integration/base_ver_2_app/src/app/apps/apps.component.ts b/integration/base_ver_2_app/src/app/apps/apps.component.ts new file mode 100644 index 0000000000..b526f370b4 --- /dev/null +++ b/integration/base_ver_2_app/src/app/apps/apps.component.ts @@ -0,0 +1,18 @@ +import { Component } from '@angular/core'; +import { Router } from '@angular/router'; +import { AppDefinitionRepresentationModel } from '@alfresco/adf-process-services'; + +@Component({ + selector: 'app-apps', + templateUrl: './apps.component.html', + styleUrls: ['./apps.component.css'] +}) +export class AppsComponent { + + constructor(private router: Router) { } + + onAppClicked(app: AppDefinitionRepresentationModel) { + this.router.navigate(['/apps', app.id || 0, 'tasks']); + } + +} diff --git a/integration/base_ver_2_app/src/app/documentlist/documentlist.component.css b/integration/base_ver_2_app/src/app/documentlist/documentlist.component.css new file mode 100644 index 0000000000..e69de29bb2 diff --git a/integration/base_ver_2_app/src/app/documentlist/documentlist.component.html b/integration/base_ver_2_app/src/app/documentlist/documentlist.component.html new file mode 100644 index 0000000000..91cbf23731 --- /dev/null +++ b/integration/base_ver_2_app/src/app/documentlist/documentlist.component.html @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + diff --git a/integration/base_ver_2_app/src/app/documentlist/documentlist.component.spec.ts b/integration/base_ver_2_app/src/app/documentlist/documentlist.component.spec.ts new file mode 100644 index 0000000000..b363977747 --- /dev/null +++ b/integration/base_ver_2_app/src/app/documentlist/documentlist.component.spec.ts @@ -0,0 +1,34 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { Location } from '@angular/common'; +import { SpyLocation } from '@angular/common/testing'; + +import { AdfModule } from '../adf.module'; +import { DocumentlistComponent } from './documentlist.component'; + +describe('DocumentlistComponent', () => { + let component: DocumentlistComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + imports: [ + AdfModule + ], + declarations: [ DocumentlistComponent ], + providers: [ + { provide: Location, useClass: SpyLocation } + ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DocumentlistComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should be created', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/integration/base_ver_2_app/src/app/documentlist/documentlist.component.ts b/integration/base_ver_2_app/src/app/documentlist/documentlist.component.ts new file mode 100644 index 0000000000..34295235d9 --- /dev/null +++ b/integration/base_ver_2_app/src/app/documentlist/documentlist.component.ts @@ -0,0 +1,41 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { NotificationService } from '@alfresco/adf-core'; +import { DocumentListComponent } from '@alfresco/adf-content-services'; + +@Component({ + selector: 'app-documentlist', + templateUrl: './documentlist.component.html', + styleUrls: ['./documentlist.component.css'] +}) +export class DocumentlistComponent implements OnInit { + + showViewer: Boolean = false; + nodeId: String = null; + + @ViewChild(DocumentListComponent) + documentList: DocumentListComponent; + + constructor(private notificationService: NotificationService) { } + + ngOnInit() { + } + + uploadSuccess(event: any) { + this.notificationService.openSnackMessage('File uploaded'); + this.documentList.reload(); + } + + showPreview(event) { + this.showViewer = false; + if (event.value.entry.isFile) { + this.nodeId = event.value.entry.id; + this.showViewer = true; + } + } + + onGoBack(event: any) { + this.showViewer = false; + this.nodeId = null; + } + +} diff --git a/integration/base_ver_2_app/src/app/home/home.component.css b/integration/base_ver_2_app/src/app/home/home.component.css new file mode 100644 index 0000000000..e69de29bb2 diff --git a/integration/base_ver_2_app/src/app/home/home.component.html b/integration/base_ver_2_app/src/app/home/home.component.html new file mode 100644 index 0000000000..7859f272f6 --- /dev/null +++ b/integration/base_ver_2_app/src/app/home/home.component.html @@ -0,0 +1 @@ +

Please select a feature in the app menu

diff --git a/integration/base_ver_2_app/src/app/home/home.component.spec.ts b/integration/base_ver_2_app/src/app/home/home.component.spec.ts new file mode 100644 index 0000000000..86774ae217 --- /dev/null +++ b/integration/base_ver_2_app/src/app/home/home.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { HomeComponent } from './home.component'; + +describe('HomeComponent', () => { + let component: HomeComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ HomeComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(HomeComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should be created', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/integration/base_ver_2_app/src/app/home/home.component.ts b/integration/base_ver_2_app/src/app/home/home.component.ts new file mode 100644 index 0000000000..33fd77077e --- /dev/null +++ b/integration/base_ver_2_app/src/app/home/home.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-home', + templateUrl: './home.component.html', + styleUrls: ['./home.component.css'] +}) +export class HomeComponent implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} diff --git a/integration/base_ver_2_app/src/app/login/login.component.css b/integration/base_ver_2_app/src/app/login/login.component.css new file mode 100644 index 0000000000..e69de29bb2 diff --git a/integration/base_ver_2_app/src/app/login/login.component.html b/integration/base_ver_2_app/src/app/login/login.component.html new file mode 100644 index 0000000000..679611b729 --- /dev/null +++ b/integration/base_ver_2_app/src/app/login/login.component.html @@ -0,0 +1,5 @@ + + diff --git a/integration/base_ver_2_app/src/app/login/login.component.spec.ts b/integration/base_ver_2_app/src/app/login/login.component.spec.ts new file mode 100644 index 0000000000..c02862901b --- /dev/null +++ b/integration/base_ver_2_app/src/app/login/login.component.spec.ts @@ -0,0 +1,31 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { RouterTestingModule } from '@angular/router/testing'; + +import { AdfModule } from '../adf.module'; +import { LoginComponent } from './login.component'; + +describe('LoginComponent', () => { + let component: LoginComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + imports: [ + RouterTestingModule, + AdfModule + ], + declarations: [ LoginComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(LoginComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should be created', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/integration/base_ver_2_app/src/app/login/login.component.ts b/integration/base_ver_2_app/src/app/login/login.component.ts new file mode 100644 index 0000000000..cafd4f58a5 --- /dev/null +++ b/integration/base_ver_2_app/src/app/login/login.component.ts @@ -0,0 +1,12 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'app-login', + templateUrl: './login.component.html', + styleUrls: ['./login.component.css'] +}) +export class LoginComponent { + + constructor() { } + +} diff --git a/integration/base_ver_2_app/src/app/start-process/start-process.component.html b/integration/base_ver_2_app/src/app/start-process/start-process.component.html new file mode 100644 index 0000000000..2ff16af907 --- /dev/null +++ b/integration/base_ver_2_app/src/app/start-process/start-process.component.html @@ -0,0 +1,5 @@ + + diff --git a/integration/base_ver_2_app/src/app/start-process/start-process.component.scss b/integration/base_ver_2_app/src/app/start-process/start-process.component.scss new file mode 100644 index 0000000000..e69de29bb2 diff --git a/integration/base_ver_2_app/src/app/start-process/start-process.component.spec.ts b/integration/base_ver_2_app/src/app/start-process/start-process.component.spec.ts new file mode 100644 index 0000000000..ac99e84de9 --- /dev/null +++ b/integration/base_ver_2_app/src/app/start-process/start-process.component.spec.ts @@ -0,0 +1,31 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { RouterTestingModule } from '@angular/router/testing'; + +import { AdfModule } from '../adf.module'; +import { StartProcessComponent } from './start-process.component'; + +describe('StartProcessComponent', () => { + let component: StartProcessComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + imports: [ + RouterTestingModule, + AdfModule + ], + declarations: [ StartProcessComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(StartProcessComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/integration/base_ver_2_app/src/app/start-process/start-process.component.ts b/integration/base_ver_2_app/src/app/start-process/start-process.component.ts new file mode 100644 index 0000000000..6c590d690d --- /dev/null +++ b/integration/base_ver_2_app/src/app/start-process/start-process.component.ts @@ -0,0 +1,34 @@ +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { ProcessInstance } from '@alfresco/adf-process-services'; + +@Component({ + selector: 'app-start-process', + templateUrl: './start-process.component.html', + styleUrls: ['./start-process.component.scss'] +}) +export class StartProcessComponent implements OnInit { + + appId: string = null; + + constructor(private router: Router, + private route: ActivatedRoute) { } + + ngOnInit() { + this.route.params.subscribe(params => { + if (params.appId && params.appId !== '0') { + this.appId = params.appId; + } else { + this.router.navigate(['/apps']); + } + }); + } + + onProcessStarted(process: ProcessInstance) { + this.router.navigate(['/apps', this.appId || 0, 'tasks']); + } + + onCancelStartProcess() { + this.router.navigate(['/apps', this.appId || 0, 'tasks']); + } +} diff --git a/integration/base_ver_2_app/src/app/stencils.module.ts b/integration/base_ver_2_app/src/app/stencils.module.ts new file mode 100644 index 0000000000..bb70ad99a0 --- /dev/null +++ b/integration/base_ver_2_app/src/app/stencils.module.ts @@ -0,0 +1,44 @@ +/* tslint:disable */ + +import { Component, NgModule } from '@angular/core'; +import { WidgetComponent } from '@alfresco/adf-core'; + +@Component({ + selector: 'custom-editor', + template: ` +
Look, I'm a custom editor!
+ ` +}) +export class CustomEditorComponent extends WidgetComponent { + + constructor() { + super(); + } +} + +@Component({ + selector: 'custom-stencil-01', + template: `
ADF version of custom Activiti stencil
` +}) +export class CustomStencil01 extends WidgetComponent { + + constructor() { + super(); + } +} + +@NgModule({ + declarations: [ + CustomEditorComponent, + CustomStencil01 + ], + exports: [ + CustomEditorComponent, + CustomStencil01 + ], + entryComponents: [ + CustomEditorComponent, + CustomStencil01 + ] +}) +export class StencilsModule {} diff --git a/integration/base_ver_2_app/src/app/task-details/task-details.component.css b/integration/base_ver_2_app/src/app/task-details/task-details.component.css new file mode 100644 index 0000000000..e69de29bb2 diff --git a/integration/base_ver_2_app/src/app/task-details/task-details.component.html b/integration/base_ver_2_app/src/app/task-details/task-details.component.html new file mode 100644 index 0000000000..ac5c3edf5b --- /dev/null +++ b/integration/base_ver_2_app/src/app/task-details/task-details.component.html @@ -0,0 +1,15 @@ +

Task details

+ + + + +
+ + +
\ No newline at end of file diff --git a/integration/base_ver_2_app/src/app/task-details/task-details.component.spec.ts b/integration/base_ver_2_app/src/app/task-details/task-details.component.spec.ts new file mode 100644 index 0000000000..c26097a072 --- /dev/null +++ b/integration/base_ver_2_app/src/app/task-details/task-details.component.spec.ts @@ -0,0 +1,31 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { RouterTestingModule } from '@angular/router/testing'; + +import { AdfModule } from '../adf.module'; +import { TaskDetailsComponent } from './task-details.component'; + +describe('TaskDetailsComponent', () => { + let component: TaskDetailsComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + imports: [ + RouterTestingModule, + AdfModule + ], + declarations: [ TaskDetailsComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(TaskDetailsComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should be created', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/integration/base_ver_2_app/src/app/task-details/task-details.component.ts b/integration/base_ver_2_app/src/app/task-details/task-details.component.ts new file mode 100644 index 0000000000..6e7d2910d7 --- /dev/null +++ b/integration/base_ver_2_app/src/app/task-details/task-details.component.ts @@ -0,0 +1,42 @@ +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { FormRenderingService } from '@alfresco/adf-core'; +import { CustomEditorComponent } from '../stencils.module'; + +@Component({ + selector: 'app-task-details', + templateUrl: './task-details.component.html', + styleUrls: ['./task-details.component.css'] +}) +export class TaskDetailsComponent implements OnInit { + + appId: string = null; + taskId: string = null; + fileShowed: any = null; + content: any = null; + contentName: any= null; + + constructor(private router: Router, + private route: ActivatedRoute, + formRenderingService: FormRenderingService) { + formRenderingService.setComponentTypeResolver('testole_01', () => CustomEditorComponent, true); + } + + ngOnInit() { + this.route.params.subscribe(params => { + if (params.appId && params.appId !== '0') { + this.appId = params.appId; + } + if (params.taskId) { + this.taskId = params.taskId; + } + }); + } + + onFormContentClick(content: any): void { + this.fileShowed = true; + this.content = content.contentBlob; + this.contentName = content.name; + } + +} diff --git a/integration/base_ver_2_app/src/app/tasks/tasks.component.css b/integration/base_ver_2_app/src/app/tasks/tasks.component.css new file mode 100644 index 0000000000..e69de29bb2 diff --git a/integration/base_ver_2_app/src/app/tasks/tasks.component.html b/integration/base_ver_2_app/src/app/tasks/tasks.component.html new file mode 100644 index 0000000000..0ebbea928b --- /dev/null +++ b/integration/base_ver_2_app/src/app/tasks/tasks.component.html @@ -0,0 +1,12 @@ +

Tasks

+ + + Start new process + + + + diff --git a/integration/base_ver_2_app/src/app/tasks/tasks.component.spec.ts b/integration/base_ver_2_app/src/app/tasks/tasks.component.spec.ts new file mode 100644 index 0000000000..33bc600895 --- /dev/null +++ b/integration/base_ver_2_app/src/app/tasks/tasks.component.spec.ts @@ -0,0 +1,31 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { RouterTestingModule } from '@angular/router/testing'; + +import { AdfModule } from '../adf.module'; +import { TasksComponent } from './tasks.component'; + +describe('TasksComponent', () => { + let component: TasksComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + imports: [ + RouterTestingModule, + AdfModule + ], + declarations: [ TasksComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(TasksComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should be created', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/integration/base_ver_2_app/src/app/tasks/tasks.component.ts b/integration/base_ver_2_app/src/app/tasks/tasks.component.ts new file mode 100644 index 0000000000..78cb3cbfb7 --- /dev/null +++ b/integration/base_ver_2_app/src/app/tasks/tasks.component.ts @@ -0,0 +1,31 @@ +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; + +@Component({ + selector: 'app-tasks', + templateUrl: './tasks.component.html', + styleUrls: ['./tasks.component.css'] +}) +export class TasksComponent implements OnInit { + + appId: string = null; + + constructor(private router: Router, + private route: ActivatedRoute) { } + + ngOnInit() { + this.route.params.subscribe(params => { + const applicationId = params['appId']; + if (applicationId && applicationId !== '0') { + this.appId = params['appId']; + } + }); + } + + onRowClick(taskId: string) { + if (taskId) { + this.router.navigate(['/apps', this.appId || 0, 'tasks', taskId]); + } + } + +} diff --git a/integration/base_ver_2_app/src/assets/.gitkeep b/integration/base_ver_2_app/src/assets/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/integration/base_ver_2_app/src/custom-style.scss b/integration/base_ver_2_app/src/custom-style.scss new file mode 100644 index 0000000000..7443c5239a --- /dev/null +++ b/integration/base_ver_2_app/src/custom-style.scss @@ -0,0 +1,33 @@ +@import '~@alfresco/adf-core/prebuilt-themes/adf-blue-orange.css'; + + +@import '~@alfresco/adf-content-services/theming'; +@import '~@alfresco/adf-process-services/theming'; +@import '~@alfresco/adf-core/theming'; + +@import '~@angular/material/theming'; + +@include mat-core($alfresco-typography); + +$primary: mat-palette($alfresco-accent-orange); +$accent: mat-palette($alfresco-accent-purple); +$warn: mat-palette($alfresco-warn); +$theme: mat-light-theme($primary, $accent, $warn); + +@include angular-material-theme($theme); +@include adf-content-services-theme($theme); +@include adf-process-services-theme($theme); +@include adf-core-theme($theme); + +body, html { + margin: 0; + height: 100%; + overflow: hidden; + font-size: mat-font-size($alfresco-typography, body-1); + font-family: mat-font-family($alfresco-typography); + line-height: mat-line-height($alfresco-typography, body-1); +} + +body { + overflow: auto; +} diff --git a/integration/base_ver_2_app/src/environments/environment.prod.ts b/integration/base_ver_2_app/src/environments/environment.prod.ts new file mode 100644 index 0000000000..3612073bc3 --- /dev/null +++ b/integration/base_ver_2_app/src/environments/environment.prod.ts @@ -0,0 +1,3 @@ +export const environment = { + production: true +}; diff --git a/integration/base_ver_2_app/src/environments/environment.ts b/integration/base_ver_2_app/src/environments/environment.ts new file mode 100644 index 0000000000..b7f639aeca --- /dev/null +++ b/integration/base_ver_2_app/src/environments/environment.ts @@ -0,0 +1,8 @@ +// The file contents for the current environment will overwrite these during build. +// The build system defaults to the dev environment which uses `environment.ts`, but if you do +// `ng build --env=prod` then `environment.prod.ts` will be used instead. +// The list of which env maps to which file can be found in `.angular-cli.json`. + +export const environment = { + production: false +}; diff --git a/integration/base_ver_2_app/src/favicon-96x96.png b/integration/base_ver_2_app/src/favicon-96x96.png new file mode 100644 index 0000000000..d342b10ee0 Binary files /dev/null and b/integration/base_ver_2_app/src/favicon-96x96.png differ diff --git a/integration/base_ver_2_app/src/index.html b/integration/base_ver_2_app/src/index.html new file mode 100644 index 0000000000..a51c4c592e --- /dev/null +++ b/integration/base_ver_2_app/src/index.html @@ -0,0 +1,17 @@ + + + + + ACS APS ADF Application with Angular CLI + + + + + + + + + + + + diff --git a/integration/base_ver_2_app/src/main.ts b/integration/base_ver_2_app/src/main.ts new file mode 100644 index 0000000000..520bafd835 --- /dev/null +++ b/integration/base_ver_2_app/src/main.ts @@ -0,0 +1,16 @@ +import { enableProdMode } from '@angular/core'; +import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; + +import { AppModule } from './app/app.module'; +import { environment } from './environments/environment'; + +import 'hammerjs'; + +import pdfjsLib from 'pdfjs-dist'; +pdfjsLib.PDFJS.workerSrc = 'pdf.worker.js'; + +if (environment.production) { + enableProdMode(); +} + +platformBrowserDynamic().bootstrapModule(AppModule); diff --git a/integration/base_ver_2_app/src/polyfills.ts b/integration/base_ver_2_app/src/polyfills.ts new file mode 100644 index 0000000000..7831e97b79 --- /dev/null +++ b/integration/base_ver_2_app/src/polyfills.ts @@ -0,0 +1,72 @@ +/** + * This file includes polyfills needed by Angular and is loaded before the app. + * You can add your own extra polyfills to this file. + * + * This file is divided into 2 sections: + * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. + * 2. Application imports. Files imported after ZoneJS that should be loaded before your main + * file. + * + * The current setup is for so-called "evergreen" browsers; the last versions of browsers that + * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), + * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. + * + * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html + */ + +/*************************************************************************************************** + * BROWSER POLYFILLS + */ + +/** IE9, IE10 and IE11 requires all of the following polyfills. **/ +// import 'core-js/es6/symbol'; +// import 'core-js/es6/object'; +// import 'core-js/es6/function'; +// import 'core-js/es6/parse-int'; +// import 'core-js/es6/parse-float'; +// import 'core-js/es6/number'; +// import 'core-js/es6/math'; +// import 'core-js/es6/string'; +// import 'core-js/es6/date'; +// import 'core-js/es6/array'; +// import 'core-js/es6/regexp'; +// import 'core-js/es6/map'; +// import 'core-js/es6/weak-map'; +// import 'core-js/es6/set'; + +/** IE10 and IE11 requires the following for NgClass support on SVG elements */ +// import 'classlist.js'; // Run `npm install --save classlist.js`. + +/** Evergreen browsers require these. **/ +import 'core-js/es6/reflect'; +import 'core-js/es7/reflect'; + + +/** + * Required to support Web Animations `@angular/animation`. + * Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation + **/ +// import 'web-animations-js'; // Run `npm install --save web-animations-js`. + + + +/*************************************************************************************************** + * Zone JS is required by Angular itself. + */ +import 'zone.js/dist/zone'; // Included with Angular CLI. + + + +/*************************************************************************************************** + * APPLICATION IMPORTS + */ + +/** + * Date, currency, decimal and percent pipes. + * Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10 + */ +// import 'intl'; // Run `npm install --save intl`. +/** + * Need to import at least one locale-data with intl. + */ +// import 'intl/locale-data/jsonp/en'; diff --git a/integration/base_ver_2_app/src/test.ts b/integration/base_ver_2_app/src/test.ts new file mode 100644 index 0000000000..cd612eeb0e --- /dev/null +++ b/integration/base_ver_2_app/src/test.ts @@ -0,0 +1,32 @@ +// This file is required by karma.conf.js and loads recursively all the .spec and framework files + +import 'zone.js/dist/long-stack-trace-zone'; +import 'zone.js/dist/proxy.js'; +import 'zone.js/dist/sync-test'; +import 'zone.js/dist/jasmine-patch'; +import 'zone.js/dist/async-test'; +import 'zone.js/dist/fake-async-test'; +import { getTestBed } from '@angular/core/testing'; +import { + BrowserDynamicTestingModule, + platformBrowserDynamicTesting +} from '@angular/platform-browser-dynamic/testing'; + +// Unfortunately there's no typing for the `__karma__` variable. Just declare it as any. +declare const __karma__: any; +declare const require: any; + +// Prevent Karma from running prematurely. +__karma__.loaded = function () {}; + +// First, initialize the Angular testing environment. +getTestBed().initTestEnvironment( + BrowserDynamicTestingModule, + platformBrowserDynamicTesting() +); +// Then we find all the tests. +const context = require.context('./', true, /\.spec\.ts$/); +// And load the modules. +context.keys().map(context); +// Finally, start Karma to run the tests. +__karma__.start(); diff --git a/integration/base_ver_2_app/src/tsconfig.app.json b/integration/base_ver_2_app/src/tsconfig.app.json new file mode 100644 index 0000000000..ab31b96f59 --- /dev/null +++ b/integration/base_ver_2_app/src/tsconfig.app.json @@ -0,0 +1,41 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": { + "outDir": "../out-tsc/app", + "module": "es2015", + "rootDir": "..", + "baseUrl": ".", + "skipLibCheck": false, + "types": [], + "paths": { + "alfresco-js-api": [ + "../node_modules/alfresco-js-api/dist/alfresco-js-api.js" + ], + "rxjs/*": [ + "../node_modules/rxjs/*" + ], + "@angular/*": [ + "../node_modules/@angular/*" + ], + "@alfresco/adf-core": [ + "../../../lib/core" + ], + "@alfresco/adf-content-services": [ + "../../../lib/content-services" + ], + "@alfresco/adf-process-services": [ + "../../../lib/process-services" + ], + "@alfresco/adf-insights": [ + "../../../lib/insights" + ] + } + }, + "exclude": [ + "test.ts", + "**/*.spec.ts" + ], + "angularCompilerOptions": { + "skipTemplateCodegen": false + } +} diff --git a/integration/base_ver_2_app/src/tsconfig.spec.json b/integration/base_ver_2_app/src/tsconfig.spec.json new file mode 100644 index 0000000000..646bc0eff8 --- /dev/null +++ b/integration/base_ver_2_app/src/tsconfig.spec.json @@ -0,0 +1,41 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": { + "outDir": "../out-tsc/spec", + "module": "es2015", + "rootDir": "..", + "baseUrl": ".", + "skipLibCheck": false, + "types": [], + "paths": { + "alfresco-js-api": [ + "../node_modules/alfresco-js-api/dist/alfresco-js-api.js" + ], + "rxjs/*": [ + "../node_modules/rxjs/*" + ], + "@angular/*": [ + "../node_modules/@angular/*" + ], + "@alfresco/adf-core": [ + "../../../lib/core" + ], + "@alfresco/adf-content-services": [ + "../../../lib/content-services" + ], + "@alfresco/adf-process-services": [ + "../../../lib/process-services" + ], + "@alfresco/adf-insights": [ + "../../../lib/insights" + ] + } + }, + "exclude": [ + "test.ts", + "**/*.spec.ts" + ], + "angularCompilerOptions": { + "skipTemplateCodegen": false + } +} diff --git a/integration/base_ver_2_app/src/typings.d.ts b/integration/base_ver_2_app/src/typings.d.ts new file mode 100644 index 0000000000..ef5c7bd620 --- /dev/null +++ b/integration/base_ver_2_app/src/typings.d.ts @@ -0,0 +1,5 @@ +/* SystemJS module definition */ +declare var module: NodeModule; +interface NodeModule { + id: string; +} diff --git a/integration/base_ver_2_app/tsconfig.json b/integration/base_ver_2_app/tsconfig.json new file mode 100644 index 0000000000..b4d58af4b3 --- /dev/null +++ b/integration/base_ver_2_app/tsconfig.json @@ -0,0 +1,30 @@ +{ + "compileOnSave": false, + "compilerOptions": { + "outDir": "./dist/out-tsc", + "baseUrl": "src", + "sourceMap": true, + "declaration": false, + "moduleResolution": "node", + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "skipLibCheck": true, + "noUnusedLocals": false, + "target": "es5", + "typeRoots": [ + "node_modules/@types" + ], + "lib": [ + "es2016", + "dom" + ], + "paths": { + "rxjs/*": [ + "../node_modules/rxjs/*" + ], + "@angular/*": [ + "../node_modules/@angular/*" + ] + } + } +} \ No newline at end of file diff --git a/integration/base_ver_2_app/tslint.json b/integration/base_ver_2_app/tslint.json new file mode 100644 index 0000000000..0db5751c78 --- /dev/null +++ b/integration/base_ver_2_app/tslint.json @@ -0,0 +1,142 @@ +{ + "rulesDirectory": [ + "node_modules/codelyzer" + ], + "rules": { + "arrow-return-shorthand": true, + "callable-types": true, + "class-name": true, + "comment-format": [ + true, + "check-space" + ], + "curly": true, + "eofline": true, + "forin": true, + "import-blacklist": [ + true, + "rxjs" + ], + "import-spacing": true, + "indent": [ + true, + "spaces" + ], + "interface-over-type-literal": true, + "label-position": true, + "max-line-length": [ + true, + 140 + ], + "member-access": false, + "member-ordering": [ + true, + { + "order": [ + "static-field", + "instance-field", + "static-method", + "instance-method" + ] + } + ], + "no-arg": true, + "no-bitwise": true, + "no-console": [ + true, + "debug", + "info", + "time", + "timeEnd", + "trace" + ], + "no-construct": true, + "no-debugger": true, + "no-duplicate-super": true, + "no-empty": false, + "no-empty-interface": true, + "no-eval": true, + "no-inferrable-types": [ + true, + "ignore-params" + ], + "no-misused-new": true, + "no-non-null-assertion": true, + "no-shadowed-variable": true, + "no-string-literal": false, + "no-string-throw": true, + "no-switch-case-fall-through": true, + "no-trailing-whitespace": true, + "no-unnecessary-initializer": true, + "no-unused-expression": true, + "no-use-before-declare": true, + "no-var-keyword": true, + "object-literal-sort-keys": false, + "one-line": [ + true, + "check-open-brace", + "check-catch", + "check-else", + "check-whitespace" + ], + "prefer-const": true, + "quotemark": [ + true, + "single" + ], + "radix": true, + "semicolon": [ + true, + "always" + ], + "triple-equals": [ + true, + "allow-null-check" + ], + "typedef-whitespace": [ + true, + { + "call-signature": "nospace", + "index-signature": "nospace", + "parameter": "nospace", + "property-declaration": "nospace", + "variable-declaration": "nospace" + } + ], + "typeof-compare": true, + "unified-signatures": true, + "variable-name": false, + "whitespace": [ + true, + "check-branch", + "check-decl", + "check-operator", + "check-separator", + "check-type" + ], + "directive-selector": [ + true, + "attribute", + "app", + "camelCase" + ], + "component-selector": [ + true, + "element", + "app", + "kebab-case" + ], + "use-input-property-decorator": true, + "use-output-property-decorator": true, + "use-host-property-decorator": true, + "no-input-rename": true, + "no-output-rename": true, + "use-life-cycle-interface": true, + "use-pipe-transform-interface": true, + "component-class-suffix": true, + "directive-class-suffix": true, + "no-access-missing-member": true, + "templates-use-public": true, + "invoke-injectable": true + } +} diff --git a/lib/config/test-export.js b/lib/config/test-export.js new file mode 100644 index 0000000000..e582d56acf --- /dev/null +++ b/lib/config/test-export.js @@ -0,0 +1 @@ +console.log('Start'); diff --git a/lib/package.json b/lib/package.json index 38277716c7..330dc4b77a 100644 --- a/lib/package.json +++ b/lib/package.json @@ -32,6 +32,7 @@ "build-content": "ng-packagr -p ./ng-package/ng-package-content.json", "build-process": "ng-packagr -p ./ng-package/ng-package-process.json", "build-insights": "ng-packagr -p ./ng-package/ng-package-insights.json", + "test-export": "node config/test-export.js", "webpack": "node node_modules/webpack/bin/webpack.js" }, "main": "./index.js", @@ -128,6 +129,9 @@ "raw-loader": "0.5.1", "remap-istanbul": "0.6.3", "rimraf": "^2.6.2", + "rollup-plugin-cleanup": "^2.0.0", + "rollup-plugin-license": "^0.5.0", + "rollup-plugin-shift-header": "^1.0.1", "run-sequence": "1.2.2", "sass-loader": "6.0.5", "script-loader": "0.7.0", diff --git a/scripts/README.md b/scripts/README.md index 12bc1229b8..cd93d73f43 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -267,10 +267,14 @@ For development environment configuration please refer to [project docs](../demo | -v or --version | the version of the components to check | +# npm-add-pkg.sh + ***npm-add-pkg.sh*** check the bundles in the package npm are present Add a package across all the pacakge json in the project +## Options + | Option | Description | | --- | --- | | -h or --help | show the help | @@ -279,35 +283,59 @@ Add a package across all the pacakge json in the project * Add a package in the project +## Examples + ```sh ./npm-add-pkg.sh --save-dev NPM_NAME ``` +# extract-langs.sh + ***extract-langs.sh*** Extract the i18n files from the repo and create a zip +## Options + | Option | Description | | --- | --- | | -h or --help | show the help | | --output or o | output folder otherwise will be 18n | +## Examples + ```sh ./extract-langs.sh ``` +# docker-publish.sh ***docker-publish.sh*** publish doker images in the selected repository +## Options + | Option | Description | | --- | --- | | -u or --username | username | | -p or --password | password | | -t or --tags | tags | +## Examples ```sh ./docker-publish.sh +``` + +# test-e2e-bc.sh + +***test-e2e-bc.sh*** + +This script test that the update from 2.0.0 to 2.x.x is still smooth + +## Examples + +```sh +./test-e2e-bc ``` \ No newline at end of file diff --git a/scripts/test-e2e-bc.sh b/scripts/test-e2e-bc.sh new file mode 100755 index 0000000000..412150e012 --- /dev/null +++ b/scripts/test-e2e-bc.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +rm -rf "$DIR/../lib/node_modules/@angular" +cd "$DIR/../integration/base_ver_2_app" + +ADF_VERSION=$(npm view @alfresco/adf-core version) +ANGULAR_VERSION="5.1.1" +MATERIAL_VERSION="5.0.1" + +npm install + +#Use last js-api +npm install --save alfresco-js-api@alpha + +#New documented dependency +npm install --save-exact --save @alfresco/adf-content-services@${ADF_VERSION} @alfresco/adf-core@${ADF_VERSION} @alfresco/adf-insights@${ADF_VERSION} @alfresco/adf-process-services@${ADF_VERSION} +npm install --save-exact --save-dev @angular-devkit/core@0.0.28 @angular/compiler-cli@${ANGULAR_VERSION} typescript@2.6.2 +npm install --save @mat-datetimepicker/core @mat-datetimepicker/moment +npm install --save-exact --save @angular/animations@${ANGULAR_VERSION} @angular/common@${ANGULAR_VERSION} @angular/compiler@${ANGULAR_VERSION} @angular/core@${ANGULAR_VERSION} @angular/platform-browser@${ANGULAR_VERSION} @angular/router@${ANGULAR_VERSION} @angular/flex-layout@2.0.0-beta.12 @angular/forms@${ANGULAR_VERSION} @angular/forms@${ANGULAR_VERSION} @angular/http@${ANGULAR_VERSION} @angular/platform-browser-dynamic@${ANGULAR_VERSION} +npm install --save-exact --save @angular/cdk@${MATERIAL_VERSION} @angular/material@${MATERIAL_VERSION} + +npm run e2e