mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
Demo shell improvements (#1199)
* #1197 auth guards * #1197 restore lost router dependency to all libs * #1197 ecm/bpm auth guards, home page - ECM auth guard (redirect to Login if ECM auth is missing) - BPM auth guard (redirect to Login if BPM auth is missing) - new Home page and route, show details on demo areas * css improvements make app text white as per request
This commit is contained in:
committed by
Eugenio Romano
parent
3a288c6b1b
commit
800a2a6530
@@ -17,13 +17,13 @@
|
||||
|
||||
<!-- Navigation. We hide it in small screens. -->
|
||||
<nav class="mdl-navigation mdl-layout--large-screen-only">
|
||||
<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="files" href="" routerLink="/">Home</a>
|
||||
<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="activiti" href="" routerLink="/activiti">Activiti</a>
|
||||
<a class="mdl-navigation__link" data-automation-id="webscript" href="" routerLink="/webscript">Webscript</a>
|
||||
<a class="mdl-navigation__link" data-automation-id="tag" href="" routerLink="/tag">Tag</a>
|
||||
<!--<a class="mdl-navigation__link" data-automation-id="webscript" href="" routerLink="/webscript">Webscript</a>-->
|
||||
<!--<a class="mdl-navigation__link" data-automation-id="tag" href="" routerLink="/tag">Tag</a>-->
|
||||
<a class="mdl-navigation__link" data-automation-id="login" href="" routerLink="/login">Login</a>
|
||||
<a class="mdl-navigation__link" data-automation-id="settings" href="" routerLink="/settings">Settings</a>
|
||||
</nav>
|
||||
@@ -60,6 +60,7 @@
|
||||
</nav>
|
||||
<span class="mdl-layout-title">Components</span>
|
||||
<nav class="mdl-navigation">
|
||||
<a class="mdl-navigation__link" href="" routerLink="/" (click)="hideDrawer()">Home</a>
|
||||
<a class="mdl-navigation__link" href="" routerLink="/files" (click)="hideDrawer()">DocumentList</a>
|
||||
<a class="mdl-navigation__link" href="" routerLink="/datatable" (click)="hideDrawer()">DataTable</a>
|
||||
<a class="mdl-navigation__link" href="" routerLink="/uploader" (click)="hideDrawer()">Uploader</a>
|
||||
|
@@ -65,7 +65,7 @@ export class AppComponent {
|
||||
}
|
||||
|
||||
isLoginPage(): boolean {
|
||||
return location.pathname === '/login' || location.pathname === '/' || location.pathname === '/settings';
|
||||
return location.pathname === '/login' || location.pathname === '/settings';
|
||||
}
|
||||
|
||||
onLogout(event) {
|
||||
|
19
demo-shell-ng2/app/app.declarations.d.ts
vendored
Normal file
19
demo-shell-ng2/app/app.declarations.d.ts
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
/*!
|
||||
* @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.
|
||||
*/
|
||||
|
||||
declare var module: any;
|
||||
declare let __moduleName: string;
|
@@ -38,6 +38,7 @@ import { routing } from './app.routes';
|
||||
import { CustomEditorsModule } from './components/activiti/custom-editor/custom-editor.component';
|
||||
|
||||
import {
|
||||
HomeComponent,
|
||||
DataTableDemoComponent,
|
||||
SearchComponent,
|
||||
SearchBarComponent,
|
||||
@@ -75,6 +76,7 @@ import {
|
||||
],
|
||||
declarations: [
|
||||
AppComponent,
|
||||
HomeComponent,
|
||||
SearchBarComponent,
|
||||
DataTableDemoComponent,
|
||||
SearchComponent,
|
||||
|
@@ -17,8 +17,10 @@
|
||||
|
||||
import { ModuleWithProviders } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
import { AuthGuard, AuthGuardEcm, AuthGuardBpm } from 'ng2-alfresco-core';
|
||||
|
||||
import {
|
||||
HomeComponent,
|
||||
FilesComponent,
|
||||
DataTableDemoComponent,
|
||||
SearchComponent,
|
||||
@@ -36,23 +38,80 @@ import {
|
||||
import { UploadButtonComponent } from 'ng2-alfresco-upload';
|
||||
|
||||
export const appRoutes: Routes = [
|
||||
{ path: 'home', component: FilesComponent },
|
||||
{ path: 'files', component: FilesComponent },
|
||||
{ path: 'datatable', component: DataTableDemoComponent },
|
||||
{ path: '', component: LoginDemoComponent },
|
||||
{ path: 'uploader', component: UploadButtonComponent },
|
||||
{ path: 'login', component: LoginDemoComponent },
|
||||
{ path: 'search', component: SearchComponent },
|
||||
|
||||
{ path: 'activiti', component: ActivitiAppsView },
|
||||
{ path: 'activiti/apps', component: ActivitiAppsView },
|
||||
{ path: 'activiti/apps/:appId/tasks', component: ActivitiDemoComponent },
|
||||
|
||||
{ path: 'activiti/appId/:appId', component: ActivitiDemoComponent },
|
||||
{ path: 'activiti/tasks/:id', component: FormViewer },
|
||||
{ path: 'activiti/tasksnode/:id', component: FormNodeViewer },
|
||||
{ path: 'webscript', component: WebscriptComponent },
|
||||
{ path: 'tag', component: TagComponent },
|
||||
{
|
||||
path: '',
|
||||
component: HomeComponent,
|
||||
canActivate: [AuthGuard]
|
||||
},
|
||||
{
|
||||
path: 'home',
|
||||
component: HomeComponent,
|
||||
canActivate: [AuthGuard]
|
||||
},
|
||||
{
|
||||
path: 'files',
|
||||
component: FilesComponent,
|
||||
canActivate: [AuthGuardEcm]
|
||||
},
|
||||
{
|
||||
path: 'datatable',
|
||||
component: DataTableDemoComponent,
|
||||
canActivate: [AuthGuard]
|
||||
},
|
||||
{
|
||||
path: 'uploader',
|
||||
component: UploadButtonComponent,
|
||||
canActivate: [AuthGuardEcm]
|
||||
},
|
||||
{
|
||||
path: 'search',
|
||||
component: SearchComponent,
|
||||
canActivate: [AuthGuardEcm]
|
||||
},
|
||||
{
|
||||
path: 'activiti',
|
||||
component: ActivitiAppsView,
|
||||
canActivate: [AuthGuardBpm]
|
||||
},
|
||||
{
|
||||
path: 'activiti/apps',
|
||||
component: ActivitiAppsView,
|
||||
canActivate: [AuthGuardBpm]
|
||||
},
|
||||
{
|
||||
path: 'activiti/apps/:appId/tasks',
|
||||
component: ActivitiDemoComponent,
|
||||
canActivate: [AuthGuardBpm]
|
||||
},
|
||||
// TODO: check if neeeded
|
||||
{
|
||||
path: 'activiti/appId/:appId',
|
||||
component: ActivitiDemoComponent,
|
||||
canActivate: [AuthGuardBpm]
|
||||
},
|
||||
// TODO: check if needed
|
||||
{
|
||||
path: 'activiti/tasks/:id',
|
||||
component: FormViewer,
|
||||
canActivate: [AuthGuardBpm]
|
||||
},
|
||||
// TODO: check if needed
|
||||
{
|
||||
path: 'activiti/tasksnode/:id',
|
||||
component: FormNodeViewer,
|
||||
canActivate: [AuthGuardBpm]
|
||||
},
|
||||
{
|
||||
path: 'webscript',
|
||||
component: WebscriptComponent,
|
||||
canActivate: [AuthGuardEcm]
|
||||
},
|
||||
{
|
||||
path: 'tag',
|
||||
component: TagComponent,
|
||||
canActivate: [AuthGuardEcm]
|
||||
},
|
||||
{ path: 'about', component: AboutComponent },
|
||||
{ path: 'settings', component: SettingComponent }
|
||||
];
|
||||
|
112
demo-shell-ng2/app/components/home/home.component.html
Normal file
112
demo-shell-ng2/app/components/home/home.component.html
Normal file
@@ -0,0 +1,112 @@
|
||||
<div class="p-10">
|
||||
<h1>Demo App</h1>
|
||||
<p>Demo Application for Alfresco Angular 2 Components</p>
|
||||
|
||||
<h2>Featured demos</h2>
|
||||
Some of the areas will require diffent authentication providers.
|
||||
See details for each component.
|
||||
You may be automatically redirected to Login screen.
|
||||
|
||||
|
||||
<h3><a href="" routerLink="/files">DocumentList</a></h3>
|
||||
<div>
|
||||
Demonstrates multiple Alfresco ECM components used together:
|
||||
<ul>
|
||||
<li>
|
||||
Document List (
|
||||
<a href="https://www.npmjs.com/package/ng2-alfresco-documentlist" target="_blank">ng2-alfresco-documentlist</a>
|
||||
)
|
||||
</li>
|
||||
<li>
|
||||
Upload (
|
||||
<a href="https://www.npmjs.com/package/ng2-alfresco-upload" target="_blank">ng2-alfresco-upload</a>
|
||||
)
|
||||
</li>
|
||||
<li>
|
||||
Context Menu (
|
||||
<a href="https://www.npmjs.com/package/ng2-alfresco-core" target="_blank">ng2-alfresco-core</a>
|
||||
)
|
||||
</li>
|
||||
<li>
|
||||
DataTable (
|
||||
<a href="https://www.npmjs.com/package/ng2-alfresco-datatable" target="_blank">ng2-alfresco-datatable</a>
|
||||
)
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<p>
|
||||
Authentication provider: ECM
|
||||
</p>
|
||||
|
||||
<h3><a href="" routerLink="/activiti">Activiti</a></h3>
|
||||
<div>
|
||||
Demonstrates multiple Alfresco BPM components used together:
|
||||
<ul>
|
||||
<li>
|
||||
App List (
|
||||
<a href="https://www.npmjs.com/package/ng2-activiti-tasklist" target="_blank">ng2-activiti-tasklist</a>
|
||||
)
|
||||
</li>
|
||||
<li>
|
||||
Task List (
|
||||
<a href="https://www.npmjs.com/package/ng2-activiti-tasklist" target="_blank">ng2-activiti-tasklist</a>
|
||||
)
|
||||
</li>
|
||||
<li>
|
||||
Process List (
|
||||
<a href="https://www.npmjs.com/package/ng2-activiti-processlist" target="_blank">ng2-activiti-processlist</a>
|
||||
)
|
||||
</li>
|
||||
<li>
|
||||
Form (
|
||||
<a href="https://www.npmjs.com/package/ng2-activiti-form" target="_blank">ng2-activiti-form</a>
|
||||
)
|
||||
</li>
|
||||
<li>
|
||||
Analytics (
|
||||
<a href="https://www.npmjs.com/package/ng2-activiti-analytics" target="_blank">ng2-activiti-analytics</a>,
|
||||
<a href="https://www.npmjs.com/package/ng2-activiti-diagrams" target="_blank">ng2-activiti-diagrams</a>
|
||||
)
|
||||
</li>
|
||||
<li>
|
||||
DataTable (
|
||||
<a href="https://www.npmjs.com/package/ng2-alfresco-datatable" target="_blank">ng2-alfresco-datatable</a>
|
||||
)
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<p>
|
||||
Authentication provider: BPM
|
||||
</p>
|
||||
|
||||
<h3><a href="" routerLink="/datatable">DataTable</a></h3>
|
||||
<p>TODO: summary</p>
|
||||
<p>
|
||||
Authentication provider: any
|
||||
</p>
|
||||
|
||||
<h3><a href="" routerLink="/uploader">Uploader</a></h3>
|
||||
<p>TODO: summary</p>
|
||||
<p>
|
||||
Authentication provider: ECM
|
||||
</p>
|
||||
|
||||
<h3><a href="" routerLink="/login">Login</a></h3>
|
||||
<p>TODO: summary</p>
|
||||
<p>
|
||||
Authentication provider: none
|
||||
</p>
|
||||
|
||||
<h3><a href="" routerLink="/webscript">Webscript</a></h3>
|
||||
<p>TODO: summary</p>
|
||||
<p>
|
||||
Authentication provider: ECM
|
||||
</p>
|
||||
|
||||
<h3><a href="" routerLink="/tag">Tag</a></h3>
|
||||
<p>TODO: summary</p>
|
||||
<p>
|
||||
Authentication provider: ECM
|
||||
</p>
|
||||
|
||||
</div>
|
25
demo-shell-ng2/app/components/home/home.component.ts
Normal file
25
demo-shell-ng2/app/components/home/home.component.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
/*!
|
||||
* @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 } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
moduleId: __moduleName,
|
||||
selector: 'home-view',
|
||||
templateUrl: './home.component.html'
|
||||
})
|
||||
export class HomeComponent {}
|
@@ -15,6 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export { HomeComponent } from './home/home.component';
|
||||
export { DataTableDemoComponent } from './datatable/datatable-demo.component';
|
||||
export { SearchComponent } from './search/search.component';
|
||||
export { SearchBarComponent } from './search/search-bar.component';
|
||||
|
Reference in New Issue
Block a user