mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-31 17:38:28 +00:00
[ACA-1631] more application ngrx actions (#540)
* delete action * library path evaluator * extension for sharing files * upload actions * delete library * use extensions for experimental library actions * unshare nodes * fix icons and titles * "create menu" backed by core extension * support for descriptions, update upload selector * update code and tests * support disabled tooltips for navbar * fix selector * [ACA-1486] remove double fetch call * migrate to trashcan actions, element IDs * cleanup code, remove deprecated directives * add/remove favorite * improve rendering performance * update favorites without reload * support for adding Sites to favorites * disable favorites for Libraries for now * copy action * move node * manage versions and permissions * cleanup code * toggle info drawer * card view mode * use extension layer for favorites toolbar * fix menu tooltips * fix 'remove as favorite' tests * update tests * test fixes * fix edit folder for favorites * fix test * cleanup favorites layout * upgrade recent files layout * update evaluators for shared nodes * test fixes * test fixes * restore recent files layout * workaround for "favorite" toggle and recent files * upgrade shared files page * upgrade files page layout * fix library evaluator * workaround for shared files and permissions * cleanup code * upgrade search results * upgrade sidebar and viewer actions * code cleanup * code cleanup * code cleanup
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
[canNavigateBefore]="previousNodeId"
|
||||
[canNavigateNext]="nextNodeId"
|
||||
[overlayMode]="true"
|
||||
(print) = "printFile($event)"
|
||||
(print)="printFile()"
|
||||
(showViewerChange)="onVisibilityChanged($event)"
|
||||
(navigateBefore)="onNavigateBefore()"
|
||||
(navigateNext)="onNavigateNext()">
|
||||
@@ -18,74 +18,14 @@
|
||||
</adf-viewer-sidebar>
|
||||
|
||||
<adf-viewer-open-with *ifExperimental="'extensions'">
|
||||
<button *ngFor="let entry of openWith"
|
||||
mat-menu-item
|
||||
(click)="runAction(entry.actions.click)">
|
||||
<mat-icon>{{ entry.icon }}</mat-icon>
|
||||
<span>{{ entry.title }}</span>
|
||||
</button>
|
||||
<ng-container *ngFor="let action of openWith; trackBy: trackByActionId">
|
||||
<aca-toolbar-action type="menu-item" [entry]="action"></aca-toolbar-action>
|
||||
</ng-container>
|
||||
</adf-viewer-open-with>
|
||||
|
||||
<adf-viewer-more-actions>
|
||||
|
||||
<button
|
||||
mat-menu-item
|
||||
#favorites="adfFavorite"
|
||||
[adf-node-favorite]="selection.nodes">
|
||||
<mat-icon color="primary" *ngIf="favorites.hasFavorites()">star</mat-icon>
|
||||
<mat-icon *ngIf="!favorites.hasFavorites()">star_border</mat-icon>
|
||||
<span>{{ 'APP.ACTIONS.FAVORITE' | translate }}</span>
|
||||
</button>
|
||||
|
||||
<ng-container *ifExperimental="'share'">
|
||||
<button mat-menu-item
|
||||
color="primary"
|
||||
[baseShareUrl]="sharedPreviewUrl$ | async"
|
||||
[adf-share]="selection.file">
|
||||
<mat-icon>share</mat-icon>
|
||||
<span>{{ 'APP.ACTIONS.SHARE' | translate }}</span>
|
||||
</button>
|
||||
</ng-container>
|
||||
|
||||
<button
|
||||
mat-menu-item
|
||||
[acaCopyNode]="selection.nodes">
|
||||
<mat-icon>content_copy</mat-icon>
|
||||
<span>{{ 'APP.ACTIONS.COPY' | translate }}</span>
|
||||
</button>
|
||||
|
||||
<button
|
||||
mat-menu-item
|
||||
*ngIf="canDelete"
|
||||
[acaMoveNode]="selection.nodes">
|
||||
<mat-icon>library_books</mat-icon>
|
||||
<span>{{ 'APP.ACTIONS.MOVE' | translate }}</span>
|
||||
</button>
|
||||
|
||||
<button
|
||||
mat-menu-item
|
||||
*ngIf="canDelete"
|
||||
(click)="deleteFile()">
|
||||
<mat-icon>delete</mat-icon>
|
||||
<span>{{ 'APP.ACTIONS.DELETE' | translate }}</span>
|
||||
</button>
|
||||
|
||||
<button
|
||||
mat-menu-item
|
||||
*ngIf="canUpdateFile"
|
||||
[acaNodeVersions]="selection.file">
|
||||
<mat-icon>history</mat-icon>
|
||||
<span>{{ 'APP.ACTIONS.VERSIONS' | translate }}</span>
|
||||
</button>
|
||||
|
||||
<ng-container *ifExperimental="'permissions'">
|
||||
<button
|
||||
mat-menu-item
|
||||
*ngIf="canUpdateNode"
|
||||
[acaNodePermissions]="selection.first">
|
||||
<mat-icon>settings_input_component</mat-icon>
|
||||
<span>{{ 'APP.ACTIONS.PERMISSIONS' | translate }}</span>
|
||||
</button>
|
||||
<ng-container *ngFor="let action of viewerActions; trackBy: trackByActionId">
|
||||
<aca-toolbar-action type="menu-item" [entry]="action"></aca-toolbar-action>
|
||||
</ng-container>
|
||||
</adf-viewer-more-actions>
|
||||
</adf-viewer>
|
||||
|
@@ -28,7 +28,7 @@ import { ActivatedRoute, Router, UrlTree, UrlSegmentGroup, UrlSegment, PRIMARY_O
|
||||
import { UserPreferencesService, ObjectUtils } from '@alfresco/adf-core';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { AppStore } from '../../store/states/app.state';
|
||||
import { DeleteNodesAction, SetSelectedNodesAction } from '../../store/actions';
|
||||
import { SetSelectedNodesAction } from '../../store/actions';
|
||||
import { PageComponent } from '../page.component';
|
||||
import { ContentApiService } from '../../services/content-api.service';
|
||||
import { ExtensionService } from '../../extensions/extension.service';
|
||||
@@ -335,17 +335,7 @@ export class PreviewComponent extends PageComponent implements OnInit {
|
||||
return path;
|
||||
}
|
||||
|
||||
deleteFile() {
|
||||
this.store.dispatch(new DeleteNodesAction([
|
||||
{
|
||||
id: this.node.nodeId || this.node.id,
|
||||
name: this.node.name
|
||||
}
|
||||
]));
|
||||
this.onVisibilityChanged(false);
|
||||
}
|
||||
|
||||
printFile(event: any) {
|
||||
printFile() {
|
||||
this.viewUtils.printFileGeneric(this.nodeId, this.node.content.mimeType);
|
||||
}
|
||||
|
||||
|
@@ -27,7 +27,7 @@ import { CoreModule } from '@alfresco/adf-core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { CoreExtensionsModule } from '../../extensions/core.extensions.module';
|
||||
import { DirectivesModule } from '../../directives/directives.module';
|
||||
import { AppInfoDrawerModule } from '../info-drawer/info.drawer.module';
|
||||
import { PreviewComponent } from './preview.component';
|
||||
@@ -51,7 +51,8 @@ const routes: Routes = [
|
||||
CoreModule.forChild(),
|
||||
ContentDirectiveModule,
|
||||
DirectivesModule,
|
||||
AppInfoDrawerModule
|
||||
AppInfoDrawerModule,
|
||||
CoreExtensionsModule.forChild()
|
||||
],
|
||||
declarations: [
|
||||
PreviewComponent,
|
||||
|
Reference in New Issue
Block a user