Skip to content

Commit

Permalink
Merge pull request #1573 from Alfresco/development
Browse files Browse the repository at this point in the history
1.1.0
  • Loading branch information
Denys Vuika authored Jan 30, 2017
2 parents 001466f + 3a08a21 commit a743ad9
Show file tree
Hide file tree
Showing 384 changed files with 6,992 additions and 4,806 deletions.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Please ask before on our gitter channel https://gitter.im/Alfresco/alfresco-ng2-
- [ ] New feature request
- [ ] Bug
- [ ] Support request
- [ ] Documentation
```
**Current behavior:**
<!-- Describe the current behavior. -->
Expand Down
21 changes: 14 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,31 @@ env:

before_script:
- if ([ "$MODULE" != "ng2-alfresco-core" ]); then
(cd ng2-components/ng2-alfresco-core; if [ ! -d "dist" ]; then npm install; fi; npm link);
(cd ng2-components/ng2-alfresco-core; if [ ! -d "bundles" ]; then npm link; fi);
fi
- if ([ "$MODULE" == "ng2-alfresco-documentlist" ] || [ "$MODULE" == "ng2-alfresco-webscript" ] || [ "$MODULE" == "ng2-activiti-processlist" ] || [ "$MODULE" == "ng2-activiti-tasklist" ]); then
(cd ng2-components/ng2-alfresco-datatable; npm link ng2-alfresco-core; if [ ! -d "dist" ]; then npm install; fi; npm link);
(cd ng2-components/ng2-alfresco-datatable; npm link ng2-alfresco-core; if [ ! -d "bundles" ]; then npm link; fi);
fi
- if ([ "$MODULE" == "ng2-activiti-tasklist" ] || [ "$MODULE" == "ng2-activiti-processlist" ]); then
(cd ng2-components/ng2-activiti-form; npm link ng2-alfresco-core; if [ ! -d "dist" ]; then npm install; fi; npm link);
(cd ng2-components/ng2-alfresco-datatable; npm link ng2-alfresco-core; if [ ! -d "bundles" ]; then npm link; fi);
(cd ng2-components/ng2-activiti-form; npm link ng2-alfresco-core; if [ ! -d "bundles" ]; then npm link; fi);
fi
- if ([ "$MODULE" == "ng2-activiti-processlist" ]); then
(cd ng2-components/ng2-activiti-tasklist; npm link ng2-alfresco-core; npm link ng2-alfresco-datatable; npm link ng2-activiti-form; if [ ! -d "dist" ]; then npm install; fi; npm link);
(cd ng2-components/ng2-alfresco-datatable; npm link ng2-alfresco-core; if [ ! -d "bundles" ]; then npm link; fi);
(cd ng2-components/ng2-activiti-form; npm link ng2-alfresco-core; if [ ! -d "bundles" ]; then npm link; fi);
(cd ng2-components/ng2-activiti-tasklist; npm link ng2-alfresco-core; npm link ng2-alfresco-datatable; npm link ng2-activiti-form; if [ ! -d "bundles" ]; then npm link; fi);
fi
- if ([ "$MODULE" == "ng2-activiti-analytics" ]); then
(cd ng2-components/ng2-activiti-diagrams; npm link ng2-alfresco-core; if [ ! -d "dist" ]; then npm install; fi; npm link);
(cd ng2-components/ng2-activiti-diagrams; npm link ng2-alfresco-core; if [ ! -d "bundles" ]; then npm link; fi);
fi
- if ([ "$MODULE" == "ng2-alfresco-search" ]); then
(cd ng2-components/ng2-alfresco-datatable; npm link ng2-alfresco-core; if [ ! -d "bundles" ]; then npm link; fi);
(cd ng2-components/ng2-alfresco-documentlist; npm link ng2-alfresco-core; npm link ng2-alfresco-datatable; if [ ! -d "bundles" ]; then npm link; fi);
fi
- cd ng2-components/$MODULE;
- npm run travis;
- npm install;
script: npm run test
#npm insall run install, build and tests
script: npm install
# Send coverage data to Coveralls
after_success:
bash <(curl -s https://codecov.io/bash) -X gcov
Expand Down
6 changes: 4 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"**/.hg": true,
"**/.DS_Store": true,
"**/*.js": { "when": "$(basename).ts"},
"**/*.js.map": { "when": "$(basename)"}
}
"**/*.js.map": { "when": "$(basename)"},
"**/*.d.ts": { "when": "$(basename).ts"}
},
"editor.renderIndentGuides": true
}
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ To view the complete list of all the components that you can use to build your c

You can browse all the components at the following [page](http://devproducts.alfresco.com/).

## Demo Application

A separate application showcasing integration of components can be found [here](https://github.com/Alfresco/alfresco-ng2-components/tree/master/demo-shell-ng2).

You will find examples of basic interaction for both BPM and ECM sets of widgets.

## Yeoman generators

To speed up the development of your Alfresco Angular 2 application, or Alfresco Angular 2 component, use one of the Yeoman generators.
Expand Down
32 changes: 17 additions & 15 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# Test against this version of Node.js
branches:
only:
- master
- development
- dev-build-test

environment:
nodejs_version: "5"
Expand All @@ -25,22 +30,19 @@ install:
# Get the latest stable version of Node.js or io.js
- ps: Install-Product node $env:nodejs_version
# install module
- IF %COMPONENT_NAME% NEQ ng2-alfresco-core (cd ng2-components/ng2-alfresco-core && npm install && npm link && cd ../../)
- IF %COMPONENT_NAME% EQU ng2-alfresco-documentlist (cd ng2-components/ng2-alfresco-datatable && npm link ng2-alfresco-core && npm install && npm link && cd ../../)
- IF %COMPONENT_NAME% EQU ng2-activiti-processlist (cd ng2-components/ng2-alfresco-datatable && npm link ng2-alfresco-core && npm install && npm link && cd ../../)
- IF %COMPONENT_NAME% EQU ng2-activiti-processlist (cd ng2-components/ng2-activiti-form && npm link ng2-alfresco-core && npm install && npm link && cd ../../)
- IF %COMPONENT_NAME% EQU ng2-activiti-processlist (cd ng2-components/ng2-activiti-tasklist && npm link ng2-alfresco-core && npm link ng2-alfresco-datatable && npm link ng2-activiti-form && npm install && npm link && cd ../../)
- IF %COMPONENT_NAME% EQU ng2-activiti-tasklist (cd ng2-components/ng2-alfresco-datatable && npm link ng2-alfresco-core && npm install && npm link && cd ../../)
- IF %COMPONENT_NAME% EQU ng2-activiti-tasklist (cd ng2-components/ng2-activiti-form && npm link ng2-alfresco-core && npm install && npm link && cd ../../)
- IF %COMPONENT_NAME% EQU ng2-alfresco-webscript (cd ng2-components/ng2-alfresco-datatable && npm link ng2-alfresco-core && npm install && npm link && cd ../../)
- IF %COMPONENT_NAME% EQU ng2-activiti-analytics (cd ng2-components/ng2-activiti-diagrams && npm link link ng2-alfresco-core && npm install && npm link && cd ../../)
- IF %COMPONENT_NAME% NEQ ng2-alfresco-core (cd ng2-components/ng2-alfresco-core && npm link && cd ../../)
- IF %COMPONENT_NAME% EQU ng2-alfresco-documentlist (cd ng2-components/ng2-alfresco-datatable && npm link ng2-alfresco-core && npm link && cd ../../)
- IF %COMPONENT_NAME% EQU ng2-alfresco-search (cd ng2-components/ng2-alfresco-datatable && npm link ng2-alfresco-core && npm link && cd ../../)
- IF %COMPONENT_NAME% EQU ng2-alfresco-search (cd ng2-components/ng2-alfresco-documentlist && npm link ng2-alfresco-core && npm link ng2-alfresco-datatable && npm link && cd ../../)
- IF %COMPONENT_NAME% EQU ng2-activiti-processlist (cd ng2-components/ng2-alfresco-datatable && npm link ng2-alfresco-core && npm link && cd ../../)
- IF %COMPONENT_NAME% EQU ng2-activiti-processlist (cd ng2-components/ng2-activiti-form && npm link ng2-alfresco-core && npm link && cd ../../)
- IF %COMPONENT_NAME% EQU ng2-activiti-processlist (cd ng2-components/ng2-activiti-tasklist && npm link ng2-alfresco-core && npm link ng2-alfresco-datatable && npm link ng2-activiti-form && npm link && cd ../../)
- IF %COMPONENT_NAME% EQU ng2-activiti-tasklist (cd ng2-components/ng2-alfresco-datatable && npm link ng2-alfresco-core && npm link && cd ../../)
- IF %COMPONENT_NAME% EQU ng2-activiti-tasklist (cd ng2-components/ng2-activiti-form && npm link ng2-alfresco-core && npm link && cd ../../)
- IF %COMPONENT_NAME% EQU ng2-alfresco-webscript (cd ng2-components/ng2-alfresco-datatable && npm link ng2-alfresco-core && npm link && cd ../../)
- IF %COMPONENT_NAME% EQU ng2-activiti-analytics (cd ng2-components/ng2-activiti-diagrams && npm link link ng2-alfresco-core && npm link && cd ../../)
- cd ng2-components/%COMPONENT_NAME%
- IF %COMPONENT_NAME% NEQ ng2-alfresco-core (npm link ng2-alfresco-core)
- IF %COMPONENT_NAME% EQU ng2-alfresco-documentlist (npm link ng2-alfresco-datatable)
- IF %COMPONENT_NAME% EQU ng2-activiti-processlist (npm link ng2-alfresco-datatable && npm link ng2-activiti-form && npm link ng2-activiti-tasklist)
- IF %COMPONENT_NAME% EQU ng2-activiti-tasklist (npm link ng2-alfresco-datatable && npm link ng2-activiti-form)
- IF %COMPONENT_NAME% EQU ng2-alfresco-webscript (npm link ng2-alfresco-datatable)
- IF %COMPONENT_NAME% EQU ng2-activiti-analytics (npm link ng2-activiti-diagrams)
- npm run travis

# Post-install test scripts.
test_script:
Expand Down
18 changes: 12 additions & 6 deletions demo-shell-ng2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@

## Installing

To correctly use this demo check that on your machine is running Node version 6.9.2 LTS or higher.
To correctly use this demo check that on your machine is running [Node](https://nodejs.org/en/) version 6.9.2 LTS or higher.

```sh
git clone https://github.com/Alfresco/alfresco-ng2-components.git
cd alfresco-ng2-components/demo-shell-ng2/
npm install
```

Expand All @@ -28,22 +30,26 @@ This command compiles and starts the project in watch mode.
Browser will automatically reload upon changes.
Upon start you can navigate to `http://localhost:3000` with your preferred browser.

### Important notes

This script is recommended for development environment and not suited for headless servers and network access.

## Production build

```sh
npm run build
npm run start:dist
```

This command builds broject in `production` mode.
All output is placed to `dist` folder and can be served your preferred web server.
You should need no additional files outside the `dist` folder.

In order to quickly test the output you can use the [wsrv](https://www.npmjs.com/package/wsrv) tool (lightweight web server):
### Important notes

```sh
npm install -g wsrv
wsrv -s -o dist/
```
By default demo application is configured to use [wsrv](https://www.npmjs.com/package/wsrv) tool (lightweight web server)
to serve production build output. It will be running at `0.0.0.0` address with port `3000` and allow you accessing your application
via network. However you can use any web server of your choice in production.

## Development branch build

Expand Down
2 changes: 1 addition & 1 deletion demo-shell-ng2/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- Always shows a header, even in smaller screens. -->
<div mdl class="mdl-layout mdl-js-layout mdl-layout--fixed-header">
<header class="mdl-layout__header main_header_adf" [ngClass]="{hide: isLoginPage()}">
<header class="mdl-layout__header main_header_adf" [ngClass]="{hide: isAPageWithHeaderBar()}">
<div class="mdl-button-padding mdl-layout__header-row">

<!-- User Info -->
Expand Down
58 changes: 21 additions & 37 deletions demo-shell-ng2/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,7 @@

import { Component } from '@angular/core';
import { Router } from '@angular/router';

import {
AlfrescoTranslationService,
AlfrescoAuthenticationService,
AlfrescoSettingsService,
StorageService
} from 'ng2-alfresco-core';
import { AlfrescoTranslationService, AlfrescoAuthenticationService, AlfrescoSettingsService, StorageService, LogService } from 'ng2-alfresco-core';

declare var document: any;

Expand All @@ -38,44 +32,34 @@ export class AppComponent {
ecmHost: string = 'http://' + window.location.hostname + ':8080';
bpmHost: string = 'http://' + window.location.hostname + ':9999';

constructor(public auth: AlfrescoAuthenticationService,
public router: Router,
public alfrescoSettingsService: AlfrescoSettingsService,
private translate: AlfrescoTranslationService,
private storage: StorageService) {
constructor(private authService: AlfrescoAuthenticationService,
private router: Router,
private settingsService: AlfrescoSettingsService,
private translateService: AlfrescoTranslationService,
private storage: StorageService,
private logService: LogService) {
this.setEcmHost();
this.setBpmHost();
this.setProvider();

if (translate) {
if (translateService) {
if (process.env.ENV === 'production') {
translate.addTranslationFolder('custom', 'i18n/custom-translation');
translate.addTranslationFolder('ng2-alfresco-login', 'i18n/custom-translation/alfresco-login');
translateService.addTranslationFolder('custom', 'i18n/custom-translation');
translateService.addTranslationFolder('ng2-alfresco-login', 'i18n/custom-translation/alfresco-login');
} else {
translate.addTranslationFolder('custom', 'custom-translation');
translate.addTranslationFolder('ng2-alfresco-login', 'custom-translation/alfresco-login');
translateService.addTranslationFolder('custom', 'custom-translation');
translateService.addTranslationFolder('ng2-alfresco-login', 'custom-translation/alfresco-login');
}
}
}

isLoggedIn(): boolean {
this.redirectToLoginPageIfNotLoggedIn();
return this.auth.isLoggedIn();
}

redirectToLoginPageIfNotLoggedIn(): void {
if (!this.isLoginPage() && !this.auth.isLoggedIn()) {
this.router.navigate(['/login']);
}
}

isLoginPage(): boolean {
isAPageWithHeaderBar(): boolean {
return location.pathname === '/login' || location.pathname === '/settings';
}

onLogout(event) {
event.preventDefault();
this.auth.logout()
this.authService.logout()
.subscribe(
() => {
this.navigateToLogin();
Expand All @@ -84,7 +68,7 @@ export class AppComponent {
if (error && error.response && error.response.status === 401) {
this.navigateToLogin();
} else {
console.error('An unknown error occurred while logging out', error);
this.logService.error('An unknown error occurred while logging out', error);
this.navigateToLogin();
}
}
Expand All @@ -107,7 +91,7 @@ export class AppComponent {
}

changeLanguage(lang: string) {
this.translate.use(lang);
this.translateService.use(lang);
this.hideDrawer();
}

Expand All @@ -118,25 +102,25 @@ export class AppComponent {

private setEcmHost() {
if (this.storage.hasItem(`ecmHost`)) {
this.alfrescoSettingsService.ecmHost = this.storage.getItem(`ecmHost`);
this.settingsService.ecmHost = this.storage.getItem(`ecmHost`);
this.ecmHost = this.storage.getItem(`ecmHost`);
} else {
this.alfrescoSettingsService.ecmHost = this.ecmHost;
this.settingsService.ecmHost = this.ecmHost;
}
}

private setBpmHost() {
if (this.storage.hasItem(`bpmHost`)) {
this.alfrescoSettingsService.bpmHost = this.storage.getItem(`bpmHost`);
this.settingsService.bpmHost = this.storage.getItem(`bpmHost`);
this.bpmHost = this.storage.getItem(`bpmHost`);
} else {
this.alfrescoSettingsService.bpmHost = this.bpmHost;
this.settingsService.bpmHost = this.bpmHost;
}
}

private setProvider() {
if (this.storage.hasItem(`providers`)) {
this.alfrescoSettingsService.setProviders(this.storage.getItem(`providers`));
this.settingsService.setProviders(this.storage.getItem(`providers`));
}
}
}
7 changes: 3 additions & 4 deletions demo-shell-ng2/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import { ActivitiTaskListModule } from 'ng2-activiti-tasklist';
import { ActivitiProcessListModule } from 'ng2-activiti-processlist';
import { UserInfoComponentModule } from 'ng2-alfresco-userinfo';
import { AnalyticsModule } from 'ng2-activiti-analytics';

import { AppComponent } from './app.component';
import { routing } from './app.routes';
import { CustomEditorsModule } from './components/activiti/custom-editor/custom-editor.component';
Expand All @@ -59,13 +58,13 @@ import {
BrowserModule,
routing,
CoreModule.forRoot(),
LoginModule,
LoginModule.forRoot(),
SearchModule.forRoot(),
DataTableModule,
DataTableModule.forRoot(),
DocumentListModule.forRoot(),
UploadModule.forRoot(),
TagModule.forRoot(),
WebScriptModule,
WebScriptModule.forRoot(),
ViewerModule.forRoot(),
ActivitiFormModule.forRoot(),
ActivitiTaskListModule.forRoot(),
Expand Down
21 changes: 11 additions & 10 deletions demo-shell-ng2/app/components/about/about.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import { Component, OnInit } from '@angular/core';
import { Http } from '@angular/http';
import { ObjectDataTableAdapter } from 'ng2-alfresco-datatable';
import { LogService } from 'ng2-alfresco-core';

@Component({
selector: 'about-page',
Expand All @@ -27,31 +28,31 @@ export class AboutComponent implements OnInit {

data: ObjectDataTableAdapter;

constructor(private http: Http) {
constructor(private http: Http,
private logService: LogService) {
}

ngOnInit() {
this.http.get('/versions.json').subscribe(response => {
var regexp = new RegExp("^(ng2-activiti|ng2-alfresco|alfresco-)", 'g');
let regexp = new RegExp('^(ng2-activiti|ng2-alfresco|alfresco-)', 'g');

var alfrescoPackages = Object.keys(response.json().dependencies).filter(function (val) {
console.log(val);
let alfrescoPackages = Object.keys(response.json().dependencies).filter((val) => {
this.logService.log(val);
return regexp.test(val);
});

let alfrescoPackagesTableRappresentation = [];
alfrescoPackages.forEach((val)=> {
console.log(response.json().dependencies[val]);
alfrescoPackagesTableRappresentation.push({name:val,version:response.json().dependencies[val].version});
let alfrescoPackagesTableRappresentation = [];
alfrescoPackages.forEach((val) => {
this.logService.log(response.json().dependencies[val]);
alfrescoPackagesTableRappresentation.push({name: val, version: response.json().dependencies[val].version});
});

console.log(alfrescoPackagesTableRappresentation);
this.logService.log(alfrescoPackagesTableRappresentation);

this.data = new ObjectDataTableAdapter(alfrescoPackagesTableRappresentation, [
{type: 'text', key: 'name', title: 'Name', sortable: true},
{type: 'text', key: 'version', title: 'Version', sortable: true}
]);
});

}
}
Loading

0 comments on commit a743ad9

Please sign in to comment.