mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-09-24 14:31:41 +00:00
Merge pull request #460 from Alfresco/dev-denys-455
About page with package versions
This commit is contained in:
@@ -15,10 +15,11 @@
|
||||
<a class="mdl-navigation__link" data-automation-id="files" href="" [routerLink]="['Files']">DocumentList</a>
|
||||
<a class="mdl-navigation__link" data-automation-id="datatable" href="" [routerLink]="['DataTable']">DataTable</a>
|
||||
<a class="mdl-navigation__link" data-automation-id="uploader" href="" [routerLink]="['Uploader']">Uploader</a>
|
||||
<a class="mdl-navigation__link" data-automation-id="tasks" href="" [routerLink]="['Activiti']">Activiti</a>
|
||||
<a class="mdl-navigation__link" data-automation-id="activiti" href="" [routerLink]="['Activiti']">Activiti</a>
|
||||
<a class="mdl-navigation__link" data-automation-id="tasks" href="" [routerLink]="['Tasks']">Tasks</a>
|
||||
<a class="mdl-navigation__link" data-automation-id="webscript" href="" [routerLink]="['Webscript']">Webscript</a>
|
||||
<a class="mdl-navigation__link" data-automation-id="login" href="" [routerLink]="['Login']">Login</a>
|
||||
<a class="mdl-navigation__link" data-automation-id="about" href="" [routerLink]="['About']">About</a>
|
||||
</nav>
|
||||
|
||||
<!-- Right aligned menu below button -->
|
||||
@@ -48,6 +49,7 @@
|
||||
<a class="mdl-navigation__link" href="" [routerLink]="['Activiti']" (click)="hideDrawer()">Activiti Components Demo</a>
|
||||
<a class="mdl-navigation__link" href="" [routerLink]="['Tasks']" (click)="hideDrawer()">Activiti Tasks Demo</a>
|
||||
<a class="mdl-navigation__link" href="" [routerLink]="['Webscript']" (click)="hideDrawer()">Webscript</a>
|
||||
<a class="mdl-navigation__link" href="" [routerLink]="['About']" (click)="hideDrawer()">About</a>
|
||||
</nav>
|
||||
</div>
|
||||
<main class="mdl-layout__content">
|
||||
|
@@ -34,6 +34,7 @@ import { LoginDemoComponent } from './components/login/login-demo.component';
|
||||
import { TasksDemoComponent } from './components/tasks/tasks-demo.component';
|
||||
import { ActivitiDemoComponent } from './components/activiti/activiti-demo.component';
|
||||
import { WebscriptComponent } from './components/webscript/webscript.component';
|
||||
import { AboutComponent } from './components/about/about.component';
|
||||
|
||||
declare var document: any;
|
||||
|
||||
@@ -45,16 +46,17 @@ declare var document: any;
|
||||
pipes: [AlfrescoPipeTranslate]
|
||||
})
|
||||
@RouteConfig([
|
||||
{path: '/home', name: 'Home', component: FilesComponent},
|
||||
{path: '/files', name: 'Files', component: FilesComponent},
|
||||
{path: '/datatable', name: 'DataTable', component: DataTableDemoComponent},
|
||||
{path: '/', name: 'Login', component: LoginDemoComponent, useAsDefault: true},
|
||||
{path: '/uploader', name: 'Uploader', component: UploadButtonComponent},
|
||||
{path: '/login', name: 'Login', component: LoginDemoComponent},
|
||||
{path: '/search', name: 'Search', component: SearchComponent},
|
||||
{path: '/tasks', name: 'Tasks', component: TasksDemoComponent},
|
||||
{path: '/activiti', name: 'Activiti', component: ActivitiDemoComponent},
|
||||
{path: '/webscript', name: 'Webscript', component: WebscriptComponent}
|
||||
{ path: '/home', name: 'Home', component: FilesComponent },
|
||||
{ path: '/files', name: 'Files', component: FilesComponent },
|
||||
{ path: '/datatable', name: 'DataTable', component: DataTableDemoComponent },
|
||||
{ path: '/', name: 'Login', component: LoginDemoComponent, useAsDefault: true },
|
||||
{ path: '/uploader', name: 'Uploader', component: UploadButtonComponent },
|
||||
{ path: '/login', name: 'Login', component: LoginDemoComponent },
|
||||
{ path: '/search', name: 'Search', component: SearchComponent },
|
||||
{ path: '/tasks', name: 'Tasks', component: TasksDemoComponent },
|
||||
{ path: '/activiti', name: 'Activiti', component: ActivitiDemoComponent },
|
||||
{ path: '/webscript', name: 'Webscript', component: WebscriptComponent },
|
||||
{ path: '/about', name: 'About', component: AboutComponent }
|
||||
])
|
||||
export class AppComponent {
|
||||
translate: AlfrescoTranslationService;
|
||||
|
4
demo-shell-ng2/app/components/about/about.component.html
Normal file
4
demo-shell-ng2/app/components/about/about.component.html
Normal file
@@ -0,0 +1,4 @@
|
||||
<div style="padding: 10px">
|
||||
<h3>Packages</h3>
|
||||
<alfresco-datatable [data]="data"></alfresco-datatable>
|
||||
</div>
|
55
demo-shell-ng2/app/components/about/about.component.ts
Normal file
55
demo-shell-ng2/app/components/about/about.component.ts
Normal file
@@ -0,0 +1,55 @@
|
||||
/*!
|
||||
* @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 { Component, OnInit } from '@angular/core';
|
||||
import { Http } from '@angular/http';
|
||||
import {
|
||||
ALFRESCO_DATATABLE_DIRECTIVES,
|
||||
ObjectDataTableAdapter /*,
|
||||
DataSorting,
|
||||
ObjectDataRow,
|
||||
ObjectDataColumn*/
|
||||
} from 'ng2-alfresco-datatable';
|
||||
|
||||
declare let __moduleName: string;
|
||||
|
||||
@Component({
|
||||
moduleId: __moduleName,
|
||||
selector: 'about-page',
|
||||
templateUrl: './about.component.html',
|
||||
directives: [ALFRESCO_DATATABLE_DIRECTIVES]
|
||||
})
|
||||
export class AboutComponent implements OnInit {
|
||||
|
||||
data: ObjectDataTableAdapter;
|
||||
|
||||
constructor(private http: Http) {}
|
||||
|
||||
ngOnInit() {
|
||||
// this.data = new ObjectDataTableAdapter();
|
||||
this.http.get('/versions').subscribe(response => {
|
||||
let data = response.json() || {};
|
||||
let packages = data.packages || [];
|
||||
|
||||
this.data = new ObjectDataTableAdapter(packages, [
|
||||
{ type: 'text', key: 'name', title: 'Name', sortable: true },
|
||||
{ type: 'text', key: 'version', title: 'Version', sortable: true }
|
||||
]);
|
||||
});
|
||||
|
||||
}
|
||||
}
|
@@ -1,25 +0,0 @@
|
||||
var browserSync = require("browser-sync").create();
|
||||
var historyApiFallback = require('connect-history-api-fallback');
|
||||
|
||||
browserSync.init({
|
||||
|
||||
server: {
|
||||
baseDir: './',
|
||||
middleware: [ historyApiFallback() ]
|
||||
},
|
||||
|
||||
files: [
|
||||
'index.html',
|
||||
'app/**/*.{html,htm,css,js}',
|
||||
'dist/**/*.{html,htm,css,js}',
|
||||
'node_modules/ng2-alfresco-core/dist/**/*.{html,htm,css,js}',
|
||||
'node_modules/ng2-alfresco-datatable/dist/**/*.{html,htm,css,js}',
|
||||
'node_modules/ng2-alfresco-documentlist/dist/**/*.{html,htm,css,js}',
|
||||
'node_modules/ng2-alfresco-login/dist/**/*.{html,htm,css,js}',
|
||||
'node_modules/ng2-alfresco-search/dist/**/*.{html,htm,css,js}',
|
||||
'node_modules/ng2-alfresco-upload/dist/**/*.{html,htm,css,js}',
|
||||
'node_modules/ng2-alfresco-viewer/dist/**/*.{html,htm,css,js}',
|
||||
'node_modules/ng2-alfresco-webscript/dist/**/*.{html,htm,css,js}'],
|
||||
|
||||
reloadDelay: 1000
|
||||
});
|
@@ -9,7 +9,7 @@
|
||||
"start": "npm run tslint && concurrently \"npm run tsc:w\" \"license-check\" \"npm run serve\" ",
|
||||
"tsc": "tsc",
|
||||
"tsc:w": "tsc -w",
|
||||
"serve": "node browser-sync-config.js",
|
||||
"serve": "wsrv -o -s -l -p 3000 -x ./server/versions.js",
|
||||
"typings": "typings install",
|
||||
"tslint": "tslint -c tslint.json *.ts && tslint -c tslint.json app/{,**/}**.ts",
|
||||
"licensecheck": "license-check"
|
||||
@@ -86,13 +86,12 @@
|
||||
"ng2-alfresco-webscript": "file:../ng2-components/ng2-alfresco-webscript"
|
||||
},
|
||||
"devDependencies": {
|
||||
"browser-sync": "2.10.0",
|
||||
"concurrently": "2.0.0",
|
||||
"connect-history-api-fallback": "1.2.0",
|
||||
"license-check": "1.1.5",
|
||||
"tslint": "3.8.1",
|
||||
"typescript": "1.8.10",
|
||||
"typings": "1.0.4"
|
||||
"typings": "1.0.4",
|
||||
"wsrv": "0.1.4"
|
||||
},
|
||||
"license-check-config": {
|
||||
"src": [
|
||||
|
42
demo-shell-ng2/server/versions.js
Normal file
42
demo-shell-ng2/server/versions.js
Normal file
@@ -0,0 +1,42 @@
|
||||
'use strict';
|
||||
|
||||
// wsrv extension that provides dynamic '/versions' route
|
||||
|
||||
exports.register = function (server, options, next) {
|
||||
|
||||
var packages = [
|
||||
'ng2-activiti-form',
|
||||
'ng2-alfresco-core',
|
||||
'ng2-alfresco-datatable',
|
||||
'ng2-alfresco-documentlist',
|
||||
'ng2-alfresco-login',
|
||||
'ng2-alfresco-search',
|
||||
'ng2-alfresco-upload',
|
||||
'ng2-alfresco-viewer',
|
||||
'ng2-alfresco-webscript'
|
||||
];
|
||||
|
||||
server.route({
|
||||
method: 'GET',
|
||||
path: '/versions',
|
||||
handler: function (request, reply) {
|
||||
var result = {
|
||||
packages: packages.map(function (packageName) {
|
||||
return {
|
||||
name: packageName,
|
||||
version: require('./../node_modules/' + packageName + '/package.json').version
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
return reply(result).type('application/json');
|
||||
}
|
||||
});
|
||||
|
||||
next();
|
||||
};
|
||||
|
||||
exports.register.attributes = {
|
||||
name: 'ng2-module-versions',
|
||||
version: '1.0.0'
|
||||
};
|
13
demo-shell-ng2/wsrv-config.json
Normal file
13
demo-shell-ng2/wsrv-config.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"watch": [
|
||||
"node_modules/ng2-alfresco-core/dist/**/*.{html,css,js}",
|
||||
"node_modules/ng2-alfresco-datatable/dist/**/*.{html,css,js}",
|
||||
"node_modules/ng2-alfresco-documentlist/dist/**/*.{html,css,js}",
|
||||
"node_modules/ng2-alfresco-login/dist/**/*.{html,css,js}",
|
||||
"node_modules/ng2-alfresco-search/dist/**/*.{html,css,js}",
|
||||
"node_modules/ng2-alfresco-upload/dist/**/*.{html,css,js}",
|
||||
"node_modules/ng2-alfresco-viewer/dist/**/*.{html,css,js}",
|
||||
"node_modules/ng2-alfresco-webscript/dist/**/*.{html,css,js}",
|
||||
"node_modules/ng2-activiti-form/dist/**/*.{html,css,js}"
|
||||
]
|
||||
}
|
Reference in New Issue
Block a user