[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:
Denys Vuika
2018-07-31 10:36:26 +01:00
committed by GitHub
parent 617f80c9fd
commit ae8675dfd7
73 changed files with 3578 additions and 3789 deletions

View File

@@ -0,0 +1,56 @@
/*!
* @license
* Alfresco Example Content Application
*
* Copyright (C) 2005 - 2018 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
import { Component } from '@angular/core';
import { Observable } from 'rxjs/Rx';
import { Store } from '@ngrx/store';
import { AppStore } from '../../../store/states';
import { documentDisplayMode } from '../../../store/selectors/app.selectors';
import { ToggleDocumentDisplayMode } from '../../../store/actions';
@Component({
selector: 'app-document-display-mode',
template: `
<button
mat-icon-button
color="primary"
(click)="onClick()">
<mat-icon *ngIf="(displayMode$ | async) === 'list'">view_comfy</mat-icon>
<mat-icon *ngIf="(displayMode$ | async) === 'gallery'">list</mat-icon>
</button>
`
})
export class DocumentDisplayModeComponent {
displayMode$: Observable<string>;
constructor(private store: Store<AppStore>) {
this.displayMode$ = store.select(documentDisplayMode);
}
onClick() {
this.store.dispatch(new ToggleDocumentDisplayMode());
}
}

View File

@@ -0,0 +1,52 @@
/*!
* @license
* Alfresco Example Content Application
*
* Copyright (C) 2005 - 2018 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
import { Component } from '@angular/core';
import { Store } from '@ngrx/store';
import { AppStore, SelectionState } from '../../../store/states';
import { appSelection } from '../../../store/selectors/app.selectors';
import { Observable } from 'rxjs/Observable';
@Component({
selector: 'app-toggle-favorite',
template: `
<button
mat-menu-item
#favorites="adfFavorite"
[adf-node-favorite]="(selection$ | async).nodes">
<mat-icon *ngIf="favorites.hasFavorites()">star</mat-icon>
<mat-icon *ngIf="!favorites.hasFavorites()">star_border</mat-icon>
<span>{{ 'APP.ACTIONS.FAVORITE' | translate }}</span>
</button>
`
})
export class ToggleFavoriteComponent {
selection$: Observable<SelectionState>;
constructor(private store: Store<AppStore>) {
this.selection$ = this.store.select(appSelection);
}
}

View File

@@ -0,0 +1,55 @@
/*!
* @license
* Alfresco Example Content Application
*
* Copyright (C) 2005 - 2018 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
import { Component } from '@angular/core';
import { Observable } from 'rxjs/Rx';
import { Store } from '@ngrx/store';
import { AppStore } from '../../../store/states';
import { infoDrawerOpened } from '../../../store/selectors/app.selectors';
import { ToggleInfoDrawerAction } from '../../../store/actions';
@Component({
selector: 'app-toggle-info-drawer',
template: `
<button
mat-icon-button
[color]="(infoDrawerOpened$ | async) ? 'accent' : 'primary'"
[attr.title]="'APP.ACTIONS.DETAILS' | translate"
(click)="onClick()">
<mat-icon>info_outline</mat-icon>
</button>
`
})
export class ToggleInfoDrawerComponent {
infoDrawerOpened$: Observable<boolean>;
constructor(private store: Store<AppStore>) {
this.infoDrawerOpened$ = this.store.select(infoDrawerOpened);
}
onClick() {
this.store.dispatch(new ToggleInfoDrawerAction());
}
}