mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-31 17:38:28 +00:00
[ACA-1508] extensions: wave 1 (#480)
* initial structure scaffold * core extensions module * simple navbar composition * allow using app routes instead of registered * migrate to new navbar setup * remove commented out tests * populate toolbar * evaluate expressions * redirect to url from toolbar * populate "open with" viewer menu * update test setup * experimental flag for extensions * test fixes * fix tests * code improvements, order support * improve routing management * populate "create" menu * extra dictionaries for spellcheck * allow disabling extension content * support file/folder targets for toolbar actions * add safety check * navigate directly * toolbar actions for all pages * support route data * "experimental" flag for "create" menu extensions * code fixes
This commit is contained in:
@@ -33,6 +33,8 @@ import { AppStore } from '../../store/states/app.state';
|
||||
import { DeleteNodesAction } from '../../store/actions';
|
||||
import { PageComponent } from '../page.component';
|
||||
import { ContentApiService } from '../../services/content-api.service';
|
||||
import { ExtensionService } from '../../extensions/extension.service';
|
||||
import { OpenWithExtension } from '../../extensions/open-with.extension';
|
||||
@Component({
|
||||
selector: 'app-preview',
|
||||
templateUrl: 'preview.component.html',
|
||||
@@ -55,6 +57,7 @@ export class PreviewComponent extends PageComponent implements OnInit {
|
||||
navigateMultiple = false;
|
||||
|
||||
selectedEntities: MinimalNodeEntity[] = [];
|
||||
openWith: Array<OpenWithExtension> = [];
|
||||
|
||||
constructor(
|
||||
private contentApi: ContentApiService,
|
||||
@@ -63,9 +66,9 @@ export class PreviewComponent extends PageComponent implements OnInit {
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
store: Store<AppStore>,
|
||||
public permission: NodePermissionService) {
|
||||
|
||||
super(store);
|
||||
public permission: NodePermissionService,
|
||||
extensions: ExtensionService) {
|
||||
super(store, extensions);
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -97,6 +100,8 @@ export class PreviewComponent extends PageComponent implements OnInit {
|
||||
this.subscriptions = this.subscriptions.concat([
|
||||
this.uploadService.fileUploadError.subscribe((error) => this.onFileUploadedError(error))
|
||||
]);
|
||||
|
||||
this.openWith = this.extensions.openWithActions;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -359,4 +364,10 @@ export class PreviewComponent extends PageComponent implements OnInit {
|
||||
return acc;
|
||||
}, []);
|
||||
}
|
||||
|
||||
// this is where each application decides how to treat an action and what to do
|
||||
// the ACA maps actions to the NgRx actions as an example
|
||||
runAction(actionId: string) {
|
||||
this.extensions.runActionById(actionId);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user