Skip to content

Commit

Permalink
update generators
Browse files Browse the repository at this point in the history
  • Loading branch information
magemello committed Aug 30, 2016
1 parent 33c5759 commit 4f98015
Show file tree
Hide file tree
Showing 24 changed files with 840 additions and 430 deletions.
64 changes: 51 additions & 13 deletions app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,14 @@ module.exports = yeoman.Base.extend({
}
}, {
name: 'alfrescoServerHost',
message: 'Which is your Alfresco platform server URL?',
message: 'What is your Alfresco platform server URL?',
default: 'http://127.0.0.1:8080',
store: true
}, {
name: 'activitiServerHost',
message: 'What is your Activiti platform server URL?',
default: 'http://127.0.0.1:9999',
store: true
}];

this.prompt(prompts, function (props) {
Expand Down Expand Up @@ -269,22 +274,39 @@ module.exports = yeoman.Base.extend({
this.destinationPath('app/main.ts'),
{
contentPage: this.props.contentPage,
searchBar: this.props.searchBar
searchBar: this.props.searchBar,
bpmTaskPage: this.props.bpmTaskPage
}
);

this.fs.copyTpl(
this.templatePath('app/_app.component.ts'),
this.destinationPath('app/app.component.ts'),
this.templatePath('app/components/_index.ts'),
this.destinationPath('app/components/index.ts'),
{
contentPage: this.props.contentPage,
searchBar: this.props.searchBar,
bpmTaskPage: this.props.bpmTaskPage
}
);

this.fs.copyTpl(
this.templatePath('app/_app.routes.ts'),
this.destinationPath('app/app.routes.ts'),
{
projectName: this.props.projectName,
navigationBar: this.props.navigationBar,
drawerBar: this.props.drawer,
searchBar: this.props.searchBar,
contentPage: this.props.contentPage,
bpmTaskPage: this.props.bpmTaskPage,
chartPage: this.props.chartPage,
alfrescoServerHost: this.props.alfrescoServerHost
chartPage: this.props.chartPage
}
);

this.fs.copyTpl(
this.templatePath('app/_app.component.ts'),
this.destinationPath('app/app.component.ts'),
{
searchBar: this.props.searchBar,
alfrescoServerHost: this.props.alfrescoServerHost,
activitiServerHost: this.props.activitiServerHost
}
);

Expand Down Expand Up @@ -317,6 +339,16 @@ module.exports = yeoman.Base.extend({
this.destinationPath('assets/material.orange-blue.min.css')
);

this.fs.copy(
this.templatePath('assets/_license_header.txt'),
this.destinationPath('assets/license_header.txt')
);

this.fs.copy(
this.templatePath('server/_versions.js'),
this.destinationPath('server/versions.js')
);

this.fs.copy(
this.templatePath('app/css/_muli-font.css'),
this.destinationPath('app/css/muli-font.css')
Expand Down Expand Up @@ -384,14 +416,20 @@ module.exports = yeoman.Base.extend({

if (this.props.bpmTaskPage) {
this.fs.copy(
this.templatePath('app/components/tasks/_tasks-demo.component.ts'),
this.destinationPath('app/components/tasks/tasks-demo.component.ts')
this.templatePath('app/components/tasks/_activiti-demo.component.ts'),
this.destinationPath('app/components/tasks/activiti-demo.component.ts')
);

this.fs.copy(
this.templatePath('app/components/tasks/_activiti.service.ts'),
this.destinationPath('app/components/tasks/activiti.service.ts')
this.templatePath('app/components/tasks/_activiti-demo.component.css'),
this.destinationPath('app/components/tasks/activiti-demo.component.css')
);

this.fs.copy(
this.templatePath('app/components/tasks/_activiti-demo.component.html'),
this.destinationPath('app/components/tasks/activiti-demo.component.html')
);

}

if (this.props.chartPage) {
Expand Down
2 changes: 1 addition & 1 deletion app/templates/_index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<script src="node_modules/reflect-metadata/Reflect.js"></script>
<script src="node_modules/systemjs/dist/system.src.js"></script>

<script src="node_modules/alfresco-js-api/bundle.js"></script>
<script src="node_modules/alfresco-js-api/dist/alfresco-js-api.js"></script>

<% if (contentPage == true) { %><script src="node_modules/pdfjs-dist/build/pdf.js"></script>
<script src="node_modules/pdfjs-dist/build/pdf.worker.js"></script>
Expand Down
62 changes: 35 additions & 27 deletions app/templates/_package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@
"version": "0.1.0",
"author": "<%= authorName %>",
"scripts": {
"postinstall": "typings install",
"clean": "rimraf node_modules typings",
"postinstall" : "typings install && npm run tsc",
"start": "npm run tslint && typings install && concurrently \"npm run tsc:w\" \"npm run serve\" ",
"build": "npm run tslint && npm run tsc && npm run licensecheck",
"start": "npm run build && concurrently \"npm run tsc:w\" \"npm run serve\" ",
"aws": "node app.js",
"tsc": "tsc",
"tsc:w": "tsc -w",
"serve": "node browser-sync-config.js",
"serve": "wsrv -o -s -l -p 3000 -a 0.0.0.0 -x ./server/versions.js",
"typings": "typings install",
"tslint": "npm run tslint-src && npm run tslint-root",
"tslint-src": "tslint -c tslint.json src/{,**/}**.ts",
"tslint-root": "tslint -c tslint.json *.ts"
"tslint": "tslint -c tslint.json *.ts && tslint -c tslint.json 'app/{,**/}**.ts'",
"licensecheck": "license-check"
},
"repository": {
"type": "git",
Expand All @@ -39,34 +40,38 @@
"@angular/common": "2.0.0-rc.3",
"@angular/compiler": "2.0.0-rc.3",
"@angular/core": "2.0.0-rc.3",
"@angular/forms": "0.1.1",
"@angular/http": "2.0.0-rc.3",
"@angular/platform-browser": "2.0.0-rc.3",
"@angular/platform-browser-dynamic": "2.0.0-rc.3",
"@angular/router": "3.0.0-alpha.7",
"@angular/router-deprecated": "2.0.0-rc.2",
"@angular/upgrade": "2.0.0-rc.3",
"alfresco-js-api": "^0.3.0",
"systemjs": "0.19.27",
"core-js": "^2.4.0",
"reflect-metadata": "^0.1.3",
"core-js": "2.4.0",
"reflect-metadata": "0.1.3",
"rxjs": "5.0.0-beta.6",
"zone.js": "^0.6.12",

"material-design-icons": "^2.2.3",
"material-design-lite": "^1.1.3",
"ng2-translate": "2.2.2",
"pdfjs-dist": "^1.5.258",

"alfresco-js-api": "0.1.0",
"ng2-alfresco-core": "0.1.39",
"ng2-alfresco-datatable": "0.1.17",
"ng2-alfresco-documentlist": "0.1.37",
"ng2-alfresco-login": "0.1.32",
"ng2-alfresco-search": "0.1.25",
"ng2-alfresco-upload": "0.1.55",
"ng2-alfresco-viewer": "0.1.35",
"ng2-charts": "1.1.0",
"zone.js": "0.6.12",
"rimraf": "2.5.2",
"material-design-icons": "2.2.3",
"material-design-lite": "1.1.3",
"ng2-translate": "2.2.0",
"pdfjs-dist": "1.5.258",
"flag-icon-css": "2.3.0",
"chart.js": "^2.1.4",
"rimraf": "^2.5.2"
"ng2-charts": "1.1.0",
"ng2-alfresco-core": "0.3.0",
"ng2-alfresco-datatable": "0.3.0",
"ng2-alfresco-documentlist": "0.3.0",
"ng2-alfresco-login": "0.3.0",
"ng2-alfresco-search": "0.3.0",
"ng2-alfresco-upload": "0.3.0",
"ng2-alfresco-viewer": "0.3.0",
"ng2-activiti-form": "0.3.0",
"ng2-activiti-tasklist": "0.3.0",
"ng2-activiti-processlist": "0.3.0",
"ng2-alfresco-webscript": "0.3.0"
},
"devDependencies": {
"angular-cli": "1.0.0-beta.9",
Expand All @@ -77,7 +82,9 @@
"license-check": "^1.0.4",
"tslint": "^3.8.1",
"typescript": "^1.8.10",
"typings": "^1.0.4"
"typings": "^1.0.4",
"mime": "^1.3.4",
"wsrv": "0.1.4"
},
"license-check-config": {
"src": [
Expand All @@ -88,7 +95,8 @@
"!/**/node_modules/**/*",
"!/**/typings/**/*",
"!*.js",
"!app/js/xml2json.js"
"!app/js/xml2json.js",
"!server/versions.js"
],
"path": "assets/license_header.txt",
"blocking": false,
Expand Down
24 changes: 20 additions & 4 deletions app/templates/_systemjs.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,41 @@
'@angular': 'node_modules/@angular',
'angular2-in-memory-web-api': 'node_modules/angular2-in-memory-web-api',
'rxjs': 'node_modules/rxjs',
'ng2-charts': 'node_modules/ng2-charts',

'ng2-translate': 'node_modules/ng2-translate',
'ng2-alfresco-core': 'node_modules/ng2-alfresco-core/dist',
'ng2-alfresco-datatable': 'node_modules/ng2-alfresco-datatable/dist',
'ng2-alfresco-documentlist': 'node_modules/ng2-alfresco-documentlist/dist',
'ng2-alfresco-login': 'node_modules/ng2-alfresco-login/dist',
'ng2-alfresco-search': 'node_modules/ng2-alfresco-search/dist',
'ng2-alfresco-upload': 'node_modules/ng2-alfresco-upload/dist',
'ng2-alfresco-viewer': 'node_modules/ng2-alfresco-viewer/dist'
'ng2-activiti-form': 'node_modules/ng2-activiti-form/dist',
'ng2-alfresco-viewer': 'node_modules/ng2-alfresco-viewer/dist',
'ng2-alfresco-webscript': 'node_modules/ng2-alfresco-webscript/dist',
'ng2-activiti-processlist': 'node_modules/ng2-activiti-processlist/dist',
'ng2-activiti-tasklist': 'node_modules/ng2-activiti-tasklist/dist',
'ng2-charts': 'node_modules/ng2-charts'
};
// packages tells the System loader how to load when no filename and/or no extension
var packages = {
'app': { main: 'main.js', defaultExtension: 'js' },
'rxjs': { defaultExtension: 'js' },
'angular2-in-memory-web-api': { main: 'index.js', defaultExtension: 'js' },

'ng2-translate': { defaultExtension: 'js' },
'ng2-charts' : {defaultExtension: 'js'},

'ng2-alfresco-core': { main: 'index.js', defaultExtension: 'js'},
'ng2-alfresco-datatable': { main: 'index.js', defaultExtension: 'js'},
'ng2-alfresco-documentlist': { main: 'index.js', defaultExtension: 'js'},
'ng2-alfresco-login': { main: 'index.js', defaultExtension: 'js'},
'ng2-alfresco-search': { main: 'index.js', defaultExtension: 'js'},
'ng2-alfresco-upload': { main: 'index.js', defaultExtension: 'js'},
'ng2-alfresco-viewer': { main: 'index.js', defaultExtension: 'js'}
'ng2-alfresco-viewer': { main: 'index.js', defaultExtension: 'js'},
'ng2-activiti-form': { main: 'index.js', defaultExtension: 'js'},
'ng2-activiti-processlist': { main: 'index.js', defaultExtension: 'js'},
'ng2-activiti-tasklist': { main: 'index.js', defaultExtension: 'js'},
'ng2-alfresco-webscript': { main: 'index.js', defaultExtension: 'js'},
'ng2-charts': { main: 'ng2-charts.js', defaultExtension: 'js'}
};
var ngPackageNames = [
'common',
Expand All @@ -55,8 +66,13 @@
}
// Most environments should use UMD; some (Karma) need the individual index files
var setPackageConfig = System.packageWithIndex ? packIndex : packUmd;

// Add package entries for angular packages
ngPackageNames.forEach(setPackageConfig);

// No umd for router yet
packages['@angular/router'] = { main: 'index.js', defaultExtension: 'js' };

var config = {
map: map,
packages: packages
Expand Down
31 changes: 21 additions & 10 deletions app/templates/app/_app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@
<% if (navigationBar == true) { %>
<!-- Navigation. We hide it in small screens. -->
<nav id="navigation-bar" class="mdl-navigation mdl-layout--large-screen-only">
<% if (contentPage == true) { %><a class="mdl-navigation__link" data-automation-id="files" href="" [routerLink]="['Files']">Document library</a>
<a class="mdl-navigation__link" data-automation-id="uploader" href="" [routerLink]="['Uploader']">Uploader</a><% } %>
<% if (bpmTaskPage == true) { %><a class="mdl-navigation__link" data-automation-id="tasks" href="" [routerLink]="['Tasks']">Tasks</a><% } %>
<% if (chartPage == true) { %><a class="mdl-navigation__link" data-automation-id="tasks" href="" [routerLink]="['Chart']">Chart</a><% } %>
<% if (contentPage == true) { %><a class="mdl-navigation__link" data-automation-id="files" href="" [routerLink]="['/files']">Document library</a><% } %>
<% if (bpmTaskPage == true) { %><a class="mdl-navigation__link" data-automation-id="tasks" href="" [routerLink]="['/activiti']">Tasks</a><% } %>
<% if (chartPage == true) { %><a class="mdl-navigation__link" data-automation-id="tasks" href="" [routerLink]="['/chart']">Chart</a><% } %>
</nav>
<% } %>

Expand All @@ -33,8 +32,8 @@
<li class="mdl-menu__item " (click)="changeLanguage('en')"><span class="flag-icon flag-icon-gb"></span> English</li>
<li class="mdl-menu__item" (click)="changeLanguage('gr')"><span class="flag-icon flag-icon-gr"></span> Greek</li>
<li class="mdl-menu__item" (click)="changeLanguage('it')"><span class="flag-icon flag-icon-it"></span> Italian</li>
<li *ngIf="!isLoggedIn()" class="mdl-menu__item" >More</li>
<li *ngIf="!isLoggedIn()" class="mdl-menu__item" [routerLink]="['Login']">Login</li>
<li *ngIf="!isLoggedIn()" class="mdl-menu__item">More</li>
<a *ngIf="!isLoggedIn()" class="mdl-menu__item" routerLink="/login">Login</a>
<li *ngIf="isLoggedIn()" class="mdl-menu__item" (click)="onLogout($event)">Logout</li>
</ul>

Expand All @@ -45,10 +44,22 @@
<div id="drawer-bar" class="mdl-layout__drawer">
<span class="mdl-layout-title">Components List</span>
<nav class="mdl-navigation">
<% if (contentPage == true) { %> <a class="mdl-navigation__link" href="" [routerLink]="['Files']" (click)="hideDrawer()">Document library</a>
<a class="mdl-navigation__link" href="" [routerLink]="['Uploader']" (click)="hideDrawer()">Uploader</a><% } %>
<% if (bpmTaskPage == true) { %><a class="mdl-navigation__link" href="" [routerLink]="['Tasks']" (click)="hideDrawer()">Tasks</a><% } %>
<% if (chartPage == true) { %><a class="mdl-navigation__link" href="" [routerLink]="['Chart']" (click)="hideDrawer()">Chart</a><% } %>
<% if (contentPage == true) { %> <a class="mdl-navigation__link" href="" [routerLink]="['/files']" (click)="hideDrawer()">Document
library</a><% } %>
<% if (bpmTaskPage == true) { %><a class="mdl-navigation__link" href="" [routerLink]="['/tasks']" (click)="hideDrawer()">Tasks</a><%
} %>
<% if (chartPage == true) { %><a class="mdl-navigation__link" href="" [routerLink]="['/chart']" (click)="hideDrawer()">Chart</a><%
} %>
</nav>
<span class="mdl-layout-title">ECM host</span>
<nav class="mdl-navigation">
<input type="text" class="mdl-textfield__input" id="ecmHost" data-automation-id="ecmHost"
tabindex="1" (change)="onChangeECMHost($event)" value="{{ecmHost}}"/>
</nav>
<span class="mdl-layout-title">BPM host</span>
<nav class="mdl-navigation">
<input type="text" class="mdl-textfield__input" id="bpmHost" data-automation-id="bpmHost"
tabindex="1" (change)="onChangeBPMHost($event)" value="{{bpmHost}}"/>
</nav>
</div>
<% } %>
Expand Down
Loading

0 comments on commit 4f98015

Please sign in to comment.