mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-2136] support shared links and renditions in the Viewer (#2826)
* support previewing shared link content * remove unused router instance * docs update * support 'shared links' preview in the Viewer
This commit is contained in:
committed by
Eugenio Romano
parent
46ad98cd8b
commit
713e4bb33b
@@ -43,6 +43,7 @@ import { TranslateModule } from '@ngx-translate/core';
|
||||
import { ReactiveFormsModule } from '@angular/forms';
|
||||
import { TaskAttachmentsComponent } from './components/process-service/task-attachments.component';
|
||||
import { ProcessAttachmentsComponent } from './components/process-service/process-attachments.component';
|
||||
import { SharedLinkViewComponent } from './components/shared-link-view/shared-link-view.component';
|
||||
|
||||
|
||||
@NgModule({
|
||||
@@ -85,7 +86,8 @@ import { ProcessAttachmentsComponent } from './components/process-service/proces
|
||||
VersionManagerDialogAdapterComponent,
|
||||
TaskAttachmentsComponent,
|
||||
ProcessAttachmentsComponent,
|
||||
OverlayViewerComponent
|
||||
OverlayViewerComponent,
|
||||
SharedLinkViewComponent
|
||||
],
|
||||
providers: [
|
||||
TranslateService,
|
||||
|
@@ -42,11 +42,16 @@ import { FileViewComponent } from './components/file-view/file-view.component';
|
||||
import { CustomSourcesComponent } from './components/files/custom-sources.component';
|
||||
import { FormListComponent } from './components/form/form-list.component';
|
||||
import { OverlayViewerComponent } from './components/overlay-viewer/overlay-viewer.component';
|
||||
import { SharedLinkViewComponent } from './components/shared-link-view/shared-link-view.component';
|
||||
|
||||
export const appRoutes: Routes = [
|
||||
{ path: 'login', component: LoginComponent },
|
||||
{ path: 'settings', component: SettingsComponent },
|
||||
{ path: 'files/:nodeId/view', component: FileViewComponent, canActivate: [ AuthGuardEcm ] },
|
||||
{
|
||||
path: 'preview/s/:id',
|
||||
component: SharedLinkViewComponent
|
||||
},
|
||||
{
|
||||
path: '',
|
||||
component: AppLayoutComponent,
|
||||
|
@@ -0,0 +1,6 @@
|
||||
<ng-container *ngIf="sharedLinkId">
|
||||
<adf-viewer
|
||||
[sharedLinkId]="sharedLinkId"
|
||||
[allowGoBack]="false">
|
||||
</adf-viewer>
|
||||
</ng-container>
|
@@ -0,0 +1,4 @@
|
||||
.app-shared-link-view {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
@@ -0,0 +1,24 @@
|
||||
import { Component, ViewEncapsulation, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
|
||||
@Component({
|
||||
selector: 'app-shared-link-view',
|
||||
templateUrl: 'shared-link-view.component.html',
|
||||
styleUrls: [ 'shared-link-view.component.scss' ],
|
||||
encapsulation: ViewEncapsulation.None,
|
||||
// tslint:disable-next-line:use-host-property-decorator
|
||||
host: { 'class': 'app-shared-link-view' }
|
||||
})
|
||||
export class SharedLinkViewComponent implements OnInit {
|
||||
|
||||
sharedLinkId: string = null;
|
||||
|
||||
constructor(private route: ActivatedRoute) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.route.params.subscribe(params => {
|
||||
this.sharedLinkId = params.id;
|
||||
});
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user