mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
Upgrade demo-shell
This commit is contained in:
@@ -17,21 +17,14 @@
|
||||
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Http } from '@angular/http';
|
||||
import {
|
||||
ALFRESCO_DATATABLE_DIRECTIVES,
|
||||
ObjectDataTableAdapter /*,
|
||||
DataSorting,
|
||||
ObjectDataRow,
|
||||
ObjectDataColumn*/
|
||||
} from 'ng2-alfresco-datatable';
|
||||
import { ObjectDataTableAdapter } from 'ng2-alfresco-datatable';
|
||||
|
||||
declare let __moduleName: string;
|
||||
|
||||
@Component({
|
||||
moduleId: __moduleName,
|
||||
selector: 'about-page',
|
||||
templateUrl: './about.component.html',
|
||||
directives: [ALFRESCO_DATATABLE_DIRECTIVES]
|
||||
templateUrl: './about.component.html'
|
||||
})
|
||||
export class AboutComponent implements OnInit {
|
||||
|
||||
|
@@ -16,14 +16,12 @@
|
||||
*/
|
||||
|
||||
import { Component, AfterViewChecked, ViewChild, Input } from '@angular/core';
|
||||
import { ALFRESCO_TASKLIST_DIRECTIVES,
|
||||
import {
|
||||
AppDefinitionRepresentationModel,
|
||||
FilterRepresentationModel,
|
||||
UserTaskFilterRepresentationModel,
|
||||
ActivitiApps
|
||||
} from 'ng2-activiti-tasklist';
|
||||
import { ACTIVITI_PROCESSLIST_DIRECTIVES } from 'ng2-activiti-processlist';
|
||||
import { ActivitiForm } from 'ng2-activiti-form';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { Subscription } from 'rxjs/Rx';
|
||||
import {
|
||||
@@ -38,8 +36,7 @@ declare var componentHandler;
|
||||
moduleId: __moduleName,
|
||||
selector: 'activiti-demo',
|
||||
templateUrl: './activiti-demo.component.html',
|
||||
styleUrls: ['./activiti-demo.component.css'],
|
||||
directives: [ALFRESCO_TASKLIST_DIRECTIVES, ACTIVITI_PROCESSLIST_DIRECTIVES, ActivitiForm]
|
||||
styleUrls: ['./activiti-demo.component.css']
|
||||
})
|
||||
export class ActivitiDemoComponent implements AfterViewChecked {
|
||||
|
||||
|
@@ -16,8 +16,7 @@
|
||||
*/
|
||||
|
||||
import { Component, OnInit, OnDestroy, AfterViewChecked } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { ActivitiForm, FormService, EcmModelService, NodeService } from 'ng2-activiti-form';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { Subscription } from 'rxjs/Rx';
|
||||
|
||||
declare let __moduleName: string;
|
||||
@@ -27,9 +26,7 @@ declare var componentHandler;
|
||||
moduleId: __moduleName,
|
||||
selector: 'form-node-viewer',
|
||||
templateUrl: './form-node-viewer.component.html',
|
||||
styleUrls: ['./form-node-viewer.component.css'],
|
||||
directives: [ActivitiForm],
|
||||
providers: [FormService, EcmModelService, NodeService]
|
||||
styleUrls: ['./form-node-viewer.component.css']
|
||||
})
|
||||
export class FormNodeViewer implements OnInit, OnDestroy, AfterViewChecked {
|
||||
|
||||
@@ -37,9 +34,7 @@ export class FormNodeViewer implements OnInit, OnDestroy, AfterViewChecked {
|
||||
|
||||
private sub: Subscription;
|
||||
|
||||
constructor(private formService: FormService,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router) {
|
||||
constructor(private route: ActivatedRoute) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
@@ -16,8 +16,7 @@
|
||||
*/
|
||||
|
||||
import { Component, OnInit, OnDestroy, AfterViewChecked } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { ActivitiForm, FormService, EcmModelService, NodeService } from 'ng2-activiti-form';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { Subscription } from 'rxjs/Rx';
|
||||
|
||||
declare let __moduleName: string;
|
||||
@@ -27,9 +26,7 @@ declare var componentHandler;
|
||||
moduleId: __moduleName,
|
||||
selector: 'form-viewer',
|
||||
templateUrl: './form-viewer.component.html',
|
||||
styleUrls: ['./form-viewer.component.css'],
|
||||
directives: [ActivitiForm],
|
||||
providers: [FormService, EcmModelService, NodeService]
|
||||
styleUrls: ['./form-viewer.component.css']
|
||||
})
|
||||
export class FormViewer implements OnInit, OnDestroy, AfterViewChecked {
|
||||
|
||||
@@ -37,9 +34,7 @@ export class FormViewer implements OnInit, OnDestroy, AfterViewChecked {
|
||||
|
||||
private sub: Subscription;
|
||||
|
||||
constructor(private formService: FormService,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router) {
|
||||
constructor(private route: ActivatedRoute) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
@@ -17,7 +17,6 @@
|
||||
|
||||
import { Component } from '@angular/core';
|
||||
import {
|
||||
ALFRESCO_DATATABLE_DIRECTIVES,
|
||||
ObjectDataTableAdapter,
|
||||
DataSorting,
|
||||
ObjectDataRow,
|
||||
@@ -29,8 +28,7 @@ declare let __moduleName: string;
|
||||
@Component({
|
||||
moduleId: __moduleName,
|
||||
selector: 'datatable-demo',
|
||||
templateUrl: './datatable-demo.component.html',
|
||||
directives: [ALFRESCO_DATATABLE_DIRECTIVES]
|
||||
templateUrl: './datatable-demo.component.html'
|
||||
})
|
||||
export class DataTableDemoComponent {
|
||||
|
||||
|
@@ -18,22 +18,12 @@
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import {
|
||||
DOCUMENT_LIST_DIRECTIVES,
|
||||
DOCUMENT_LIST_PROVIDERS,
|
||||
DocumentActionsService,
|
||||
DocumentList,
|
||||
ContentActionHandler,
|
||||
DocumentActionModel,
|
||||
FolderActionModel
|
||||
} from 'ng2-alfresco-documentlist';
|
||||
import {
|
||||
MDL,
|
||||
AlfrescoContentService,
|
||||
CONTEXT_MENU_DIRECTIVES
|
||||
} from 'ng2-alfresco-core';
|
||||
import { PaginationComponent } from 'ng2-alfresco-datatable';
|
||||
import { ALFRESCO_ULPOAD_COMPONENTS } from 'ng2-alfresco-upload';
|
||||
import { VIEWERCOMPONENT } from 'ng2-alfresco-viewer';
|
||||
import { FormService } from 'ng2-activiti-form';
|
||||
|
||||
declare let __moduleName: string;
|
||||
@@ -42,16 +32,7 @@ declare let __moduleName: string;
|
||||
moduleId: __moduleName,
|
||||
selector: 'files-component',
|
||||
templateUrl: './files.component.html',
|
||||
styleUrls: ['./files.component.css'],
|
||||
directives: [
|
||||
DOCUMENT_LIST_DIRECTIVES,
|
||||
MDL,
|
||||
ALFRESCO_ULPOAD_COMPONENTS,
|
||||
VIEWERCOMPONENT,
|
||||
CONTEXT_MENU_DIRECTIVES,
|
||||
PaginationComponent
|
||||
],
|
||||
providers: [DOCUMENT_LIST_PROVIDERS, FormService]
|
||||
styleUrls: ['./files.component.css']
|
||||
})
|
||||
export class FilesComponent implements OnInit {
|
||||
currentPath: string = '/Sites/swsdp/documentLibrary';
|
||||
@@ -68,8 +49,7 @@ export class FilesComponent implements OnInit {
|
||||
@ViewChild(DocumentList)
|
||||
documentList: DocumentList;
|
||||
|
||||
constructor(private contentService: AlfrescoContentService,
|
||||
private documentActions: DocumentActionsService,
|
||||
constructor(private documentActions: DocumentActionsService,
|
||||
private formService: FormService,
|
||||
private router: Router) {
|
||||
documentActions.setHandler('my-handler', this.myDocumentActionHandler.bind(this));
|
||||
|
@@ -26,3 +26,4 @@ export { WebscriptComponent } from './webscript/webscript.component';
|
||||
export { TagComponent } from './tag/tag.component';
|
||||
export { AboutComponent } from './about/about.component';
|
||||
export { FilesComponent } from './files/files.component';
|
||||
export { FormNodeViewer } from './activiti/form-node-viewer.component';
|
||||
|
@@ -15,10 +15,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {Component, ViewChild, OnInit} from '@angular/core';
|
||||
import {AlfrescoLoginComponent} from 'ng2-alfresco-login';
|
||||
import {ROUTER_DIRECTIVES, Router} from '@angular/router';
|
||||
import {Validators} from '@angular/common';
|
||||
import { Component, ViewChild, OnInit } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { Validators } from '@angular/forms';
|
||||
|
||||
declare let __moduleName: string;
|
||||
|
||||
@@ -26,9 +25,7 @@ declare let __moduleName: string;
|
||||
moduleId: __moduleName,
|
||||
selector: 'login-demo',
|
||||
templateUrl: './login-demo.component.html',
|
||||
styleUrls: ['./login-demo.component.css'],
|
||||
directives: [ROUTER_DIRECTIVES, AlfrescoLoginComponent],
|
||||
pipes: []
|
||||
styleUrls: ['./login-demo.component.css']
|
||||
})
|
||||
export class LoginDemoComponent implements OnInit {
|
||||
|
||||
|
@@ -1,53 +0,0 @@
|
||||
/*!
|
||||
* @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 { ElementRef, DynamicComponentLoader, Directive, Attribute } from '@angular/core';
|
||||
import { Router, RouterOutlet, ComponentInstruction } from '@angular/router-deprecated';
|
||||
import { AlfrescoAuthenticationService } from 'ng2-alfresco-core/dist/ng2-alfresco-core';
|
||||
|
||||
@Directive({selector: 'auth-router-outlet'})
|
||||
export class AuthRouterOutlet extends RouterOutlet {
|
||||
|
||||
publicRoutes: Array<string>;
|
||||
private router: Router;
|
||||
|
||||
constructor(_elementRef: ElementRef, _loader: DynamicComponentLoader,
|
||||
_parentRouter: Router, @Attribute('name') nameAttr: string,
|
||||
private authentication: AlfrescoAuthenticationService) {
|
||||
super(_elementRef, _loader, _parentRouter, nameAttr);
|
||||
|
||||
this.router = _parentRouter;
|
||||
this.publicRoutes = [
|
||||
'', 'login', 'signup'
|
||||
];
|
||||
}
|
||||
|
||||
activate(instruction: ComponentInstruction) {
|
||||
if (this._canActivate(instruction.urlPath)) {
|
||||
return super.activate(instruction);
|
||||
}
|
||||
|
||||
this.router.navigate(['Login']);
|
||||
}
|
||||
|
||||
_canActivate(url) {
|
||||
return this.publicRoutes.indexOf(url) !== -1
|
||||
|| this.authentication.isLoggedIn();
|
||||
}
|
||||
}
|
||||
*/
|
@@ -16,8 +16,6 @@
|
||||
*/
|
||||
|
||||
import { Component, EventEmitter, Output } from '@angular/core';
|
||||
import { ALFRESCO_SEARCH_DIRECTIVES } from 'ng2-alfresco-search';
|
||||
import { VIEWERCOMPONENT } from 'ng2-alfresco-viewer';
|
||||
import { AlfrescoAuthenticationService } from 'ng2-alfresco-core';
|
||||
|
||||
declare let __moduleName: string;
|
||||
@@ -25,8 +23,7 @@ declare let __moduleName: string;
|
||||
@Component({
|
||||
moduleId: __moduleName,
|
||||
selector: 'search-bar',
|
||||
templateUrl: './search-bar.component.html',
|
||||
directives: [ALFRESCO_SEARCH_DIRECTIVES, VIEWERCOMPONENT]
|
||||
templateUrl: './search-bar.component.html'
|
||||
})
|
||||
export class SearchBarComponent {
|
||||
|
||||
|
@@ -16,9 +16,6 @@
|
||||
*/
|
||||
|
||||
import { Component } from '@angular/core';
|
||||
import { AlfrescoContentService } from 'ng2-alfresco-core';
|
||||
import { ALFRESCO_SEARCH_DIRECTIVES } from 'ng2-alfresco-search';
|
||||
import { VIEWERCOMPONENT } from 'ng2-alfresco-viewer';
|
||||
|
||||
declare let __moduleName: string;
|
||||
|
||||
@@ -47,17 +44,13 @@ declare let __moduleName: string;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
`],
|
||||
directives: [ ALFRESCO_SEARCH_DIRECTIVES, VIEWERCOMPONENT ]
|
||||
`]
|
||||
})
|
||||
export class SearchComponent {
|
||||
|
||||
fileShowed: boolean = false;
|
||||
fileNodeId: string;
|
||||
|
||||
constructor(public contentService: AlfrescoContentService) {
|
||||
}
|
||||
|
||||
onFileClicked(event) {
|
||||
if (event.value.entry.isFile) {
|
||||
this.fileNodeId = event.value.entry.id;
|
||||
|
@@ -16,7 +16,6 @@
|
||||
*/
|
||||
|
||||
import { Component } from '@angular/core';
|
||||
import { TAGCOMPONENT, TAGSERVICES } from 'ng2-alfresco-tag';
|
||||
|
||||
@Component({
|
||||
selector: 'alfresco-tag-demo',
|
||||
@@ -31,9 +30,7 @@ import { TAGCOMPONENT, TAGSERVICES } from 'ng2-alfresco-tag';
|
||||
<alfresco-tag-node-list [nodeId]="nodeId"></alfresco-tag-node-list>
|
||||
</div>
|
||||
</div>
|
||||
`,
|
||||
directives: [TAGCOMPONENT],
|
||||
providers: [TAGSERVICES]
|
||||
`
|
||||
})
|
||||
export class TagComponent {
|
||||
|
||||
|
@@ -16,11 +16,6 @@
|
||||
*/
|
||||
|
||||
import { Component } from '@angular/core';
|
||||
import {
|
||||
CONTEXT_MENU_DIRECTIVES
|
||||
} from 'ng2-alfresco-core';
|
||||
|
||||
import { WEBSCRIPTCOMPONENT } from 'ng2-alfresco-webscript';
|
||||
|
||||
@Component({
|
||||
selector: 'alfresco-webscript-demo',
|
||||
@@ -37,8 +32,7 @@ import { WEBSCRIPTCOMPONENT } from 'ng2-alfresco-webscript';
|
||||
[servicePath]="servicePath"
|
||||
[contentType]="'HTML'"
|
||||
(onSuccess)= "logData($event)"></alfresco-webscript-get>
|
||||
`,
|
||||
directives: [WEBSCRIPTCOMPONENT, CONTEXT_MENU_DIRECTIVES]
|
||||
`
|
||||
})
|
||||
export class WebscriptComponent {
|
||||
|
||||
|
Reference in New Issue
Block a user