[ACA-2286] handle metadata errors (#1115)

* [ACA-2286] handle errors in metadata

* [ACA-2377] use ADF i18n support for info drawer

* update lint settings

* update plint settings
This commit is contained in:
Denys Vuika
2019-05-22 10:45:57 +03:00
committed by Suzana Dirla
parent eb1e8c8fa1
commit 715609f71a
3 changed files with 35 additions and 7 deletions
+3
View File
@@ -3,11 +3,14 @@ modules:
- pr.spellcheck
prettier:
options:
singleQuote: true
exclude:
- '*.json'
spellcheck:
dictionaries:
- softwareTerms
- html
- en-gb
- en_US
@@ -2,11 +2,11 @@
<mat-progress-bar mode="indeterminate"></mat-progress-bar>
</div>
<ng-container *ngIf="!isLoading && !!displayNode">
<adf-info-drawer [title]="'APP.INFO_DRAWER.TITLE' | translate">
<adf-info-drawer [title]="'APP.INFO_DRAWER.TITLE'">
<adf-info-drawer-tab
*ngFor="let tab of tabs"
[icon]="tab.icon"
[label]="tab.title | translate"
[label]="tab.title"
>
<adf-dynamic-tab
[node]="displayNode"
@@ -23,15 +23,23 @@
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
import { Component, Input, ViewEncapsulation } from '@angular/core';
import {
Component,
Input,
ViewEncapsulation,
OnInit,
OnDestroy
} from '@angular/core';
import { MinimalNodeEntryEntity } from '@alfresco/js-api';
import { NodePermissionService } from '@alfresco/aca-shared';
import { AppStore, infoDrawerMetadataAspect } from '@alfresco/aca-shared/store';
import { AppExtensionService } from '../../../extensions/extension.service';
import { AppConfigService } from '@alfresco/adf-core';
import { AppConfigService, NotificationService } from '@alfresco/adf-core';
import { isLocked } from '../../../utils/node.utils';
import { Observable } from 'rxjs';
import { Observable, Subject } from 'rxjs';
import { Store } from '@ngrx/store';
import { ContentMetadataService } from '@alfresco/adf-content-services';
import { takeUntil } from 'rxjs/operators';
@Component({
selector: 'app-metadata-tab',
@@ -47,7 +55,9 @@ import { Store } from '@ngrx/store';
encapsulation: ViewEncapsulation.None,
host: { class: 'app-metadata-tab' }
})
export class MetadataTabComponent {
export class MetadataTabComponent implements OnInit, OnDestroy {
protected onDestroy$ = new Subject<boolean>();
@Input()
node: MinimalNodeEntryEntity;
@@ -57,7 +67,9 @@ export class MetadataTabComponent {
private permission: NodePermissionService,
protected extensions: AppExtensionService,
private appConfig: AppConfigService,
private store: Store<AppStore>
private store: Store<AppStore>,
private notificationService: NotificationService,
private contentMetadataService: ContentMetadataService
) {
if (this.extensions.contentMetadata) {
this.appConfig.config[
@@ -74,4 +86,17 @@ export class MetadataTabComponent {
return false;
}
ngOnInit() {
this.contentMetadataService.error
.pipe(takeUntil(this.onDestroy$))
.subscribe((err: { message: string }) => {
this.notificationService.showError(err.message);
});
}
ngOnDestroy() {
this.onDestroy$.next(true);
this.onDestroy$.complete();
}
}