mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-4340] FormCloud - Be able to upload a file from the local source (#4647)
* Add a shiny upload button * Fix tslint * Enable the viewer on the content click * Call the process storage in case the form has an upload * Fix the lint * Fix unit tests * Fix tslint on unit tests * Fix the lint * Fix the lint
This commit is contained in:
committed by
Eugenio Romano
parent
b87c18bc13
commit
be49e72208
@@ -72,6 +72,7 @@ import { AppsCloudDemoComponent } from './components/cloud/apps-cloud-demo.compo
|
||||
import { TasksCloudDemoComponent } from './components/cloud/tasks-cloud-demo.component';
|
||||
import { ProcessesCloudDemoComponent } from './components/cloud/processes-cloud-demo.component';
|
||||
import { TaskDetailsCloudDemoComponent } from './components/cloud/task-details-cloud-demo.component';
|
||||
import { CloudViewerComponent } from './components/cloud/cloud-viewer.component';
|
||||
import { ProcessDetailsCloudDemoComponent } from './components/cloud/process-details-cloud-demo.component';
|
||||
import { StartTaskCloudDemoComponent } from './components/cloud/start-task-cloud-demo.component';
|
||||
import { StartProcessCloudDemoComponent } from './components/cloud/start-process-cloud-demo.component';
|
||||
@@ -139,6 +140,7 @@ import { FormCloudDemoComponent } from './components/app-layout/cloud/form-demo/
|
||||
TasksCloudDemoComponent,
|
||||
ProcessesCloudDemoComponent,
|
||||
TaskDetailsCloudDemoComponent,
|
||||
CloudViewerComponent,
|
||||
ProcessDetailsCloudDemoComponent,
|
||||
StartTaskCloudDemoComponent,
|
||||
StartProcessCloudDemoComponent,
|
||||
|
@@ -47,6 +47,7 @@ import { ProcessesCloudDemoComponent } from './components/cloud/processes-cloud-
|
||||
import { StartTaskCloudDemoComponent } from './components/cloud/start-task-cloud-demo.component';
|
||||
import { StartProcessCloudDemoComponent } from './components/cloud/start-process-cloud-demo.component';
|
||||
import { TaskDetailsCloudDemoComponent } from './components/cloud/task-details-cloud-demo.component';
|
||||
import { CloudViewerComponent } from './components/cloud/cloud-viewer.component';
|
||||
import { ProcessDetailsCloudDemoComponent } from './components/cloud/process-details-cloud-demo.component';
|
||||
import { TemplateDemoComponent } from './components/template-list/template-demo.component';
|
||||
import { FormCloudDemoComponent } from './components/app-layout/cloud/form-demo/cloud-form-demo.component';
|
||||
@@ -152,6 +153,7 @@ export const appRoutes: Routes = [
|
||||
path: 'cloud',
|
||||
canActivate: [AuthGuardSsoRoleService],
|
||||
data: { roles: ['ACTIVITI_USER'], redirectUrl: '/error/403'},
|
||||
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
@@ -192,6 +194,10 @@ export const appRoutes: Routes = [
|
||||
path: 'task-details/:taskId',
|
||||
component: TaskDetailsCloudDemoComponent
|
||||
},
|
||||
{
|
||||
path: 'task-details/:taskId/files/:nodeId/view',
|
||||
component: CloudViewerComponent
|
||||
},
|
||||
{
|
||||
path: 'process-details/:processInstanceId',
|
||||
component: ProcessDetailsCloudDemoComponent
|
||||
|
@@ -0,0 +1,3 @@
|
||||
.activiti-form-viewer {
|
||||
margin: 10px;
|
||||
}
|
@@ -0,0 +1,4 @@
|
||||
<adf-viewer
|
||||
[overlayMode]="true"
|
||||
[nodeId]="nodeId">
|
||||
</adf-viewer>
|
@@ -0,0 +1,46 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 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, OnDestroy, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { Subscription } from 'rxjs';
|
||||
import { Params } from '@angular/router/src/shared';
|
||||
|
||||
@Component({
|
||||
selector: 'app-cloud-viewer',
|
||||
templateUrl: './cloud-viewer.component.html'
|
||||
})
|
||||
export class CloudViewerComponent implements OnInit, OnDestroy {
|
||||
|
||||
nodeId: string;
|
||||
|
||||
private sub: Subscription;
|
||||
|
||||
constructor(private route: ActivatedRoute) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.sub = this.route.params.subscribe((params: Params) => {
|
||||
this.nodeId = params['nodeId'];
|
||||
});
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
this.sub.unsubscribe();
|
||||
}
|
||||
|
||||
}
|
@@ -69,6 +69,10 @@ export class TaskDetailsCloudDemoComponent {
|
||||
this.goBack();
|
||||
}
|
||||
|
||||
onFormContentClicked(resourceId) {
|
||||
this.router.navigate([`/cloud/${this.appName}/task-details/${this.taskId}/files/${resourceId.nodeId}/view`]);
|
||||
}
|
||||
|
||||
onFormSaved() {
|
||||
this.notificationService.openSnackMessage('Task has been saved successfully');
|
||||
}
|
||||
|
Reference in New Issue
Block a user