mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-05-12 17:04:46 +00:00
[ACA-1407] Version Manager - file name conflict message (#398)
* upoad file conflict message * SnackbarErrorAction
This commit is contained in:
parent
8d58d00c08
commit
9076c7ee9f
@ -103,7 +103,8 @@ export class FilesComponent extends PageComponent implements OnInit, OnDestroy {
|
|||||||
contentManagementService.nodesMoved.subscribe(() => this.documentList.reload()),
|
contentManagementService.nodesMoved.subscribe(() => this.documentList.reload()),
|
||||||
contentManagementService.nodesRestored.subscribe(() => this.documentList.reload()),
|
contentManagementService.nodesRestored.subscribe(() => this.documentList.reload()),
|
||||||
uploadService.fileUploadComplete.subscribe(file => this.onFileUploadedEvent(file)),
|
uploadService.fileUploadComplete.subscribe(file => this.onFileUploadedEvent(file)),
|
||||||
uploadService.fileUploadDeleted.subscribe((file) => this.onFileUploadedEvent(file))
|
uploadService.fileUploadDeleted.subscribe((file) => this.onFileUploadedEvent(file)),
|
||||||
|
uploadService.fileUploadError.subscribe((error) => this.onFileUploadedError(error))
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { MinimalNodeEntity, MinimalNodeEntryEntity, Pagination } from 'alfresco-js-api';
|
import { MinimalNodeEntity, MinimalNodeEntryEntity, Pagination } from 'alfresco-js-api';
|
||||||
import { UserPreferencesService } from '@alfresco/adf-core';
|
import { UserPreferencesService, FileUploadErrorEvent } from '@alfresco/adf-core';
|
||||||
import { ShareDataRow, DocumentListComponent } from '@alfresco/adf-content-services';
|
import { ShareDataRow, DocumentListComponent } from '@alfresco/adf-content-services';
|
||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import { OnDestroy, ViewChild, OnInit } from '@angular/core';
|
import { OnDestroy, ViewChild, OnInit } from '@angular/core';
|
||||||
@ -34,6 +34,8 @@ import { AppStore } from '../store/states/app.state';
|
|||||||
import { SetSelectedNodesAction } from '../store/actions/node.action';
|
import { SetSelectedNodesAction } from '../store/actions/node.action';
|
||||||
import { selectedNodes } from '../store/selectors/app.selectors';
|
import { selectedNodes } from '../store/selectors/app.selectors';
|
||||||
import { takeUntil } from 'rxjs/operators';
|
import { takeUntil } from 'rxjs/operators';
|
||||||
|
import { SnackbarErrorAction } from '../store/actions';
|
||||||
|
|
||||||
|
|
||||||
export abstract class PageComponent implements OnInit, OnDestroy {
|
export abstract class PageComponent implements OnInit, OnDestroy {
|
||||||
|
|
||||||
@ -181,4 +183,14 @@ export abstract class PageComponent implements OnInit, OnDestroy {
|
|||||||
this.documentList.reload();
|
this.documentList.reload();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onFileUploadedError(error: FileUploadErrorEvent) {
|
||||||
|
let message = null;
|
||||||
|
|
||||||
|
if (error.error.status === 409) {
|
||||||
|
message = new SnackbarErrorAction('VERSION.MESSAGE.ERROR.CONFLICT');
|
||||||
|
}
|
||||||
|
|
||||||
|
this.store.dispatch(message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ import { TestBed, async, ComponentFixture } from '@angular/core/testing';
|
|||||||
import {
|
import {
|
||||||
AlfrescoApiService, UserPreferencesService,
|
AlfrescoApiService, UserPreferencesService,
|
||||||
TranslationService, TranslationMock,
|
TranslationService, TranslationMock,
|
||||||
CoreModule
|
CoreModule, UploadService
|
||||||
} from '@alfresco/adf-core';
|
} from '@alfresco/adf-core';
|
||||||
|
|
||||||
import { PreviewComponent } from './preview.component';
|
import { PreviewComponent } from './preview.component';
|
||||||
@ -63,7 +63,8 @@ describe('PreviewComponent', () => {
|
|||||||
providers: [
|
providers: [
|
||||||
{ provide: TranslationService, useClass: TranslationMock },
|
{ provide: TranslationService, useClass: TranslationMock },
|
||||||
NodePermissionService,
|
NodePermissionService,
|
||||||
ContentManagementService
|
ContentManagementService,
|
||||||
|
UploadService
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
PreviewComponent,
|
PreviewComponent,
|
||||||
|
@ -25,13 +25,13 @@
|
|||||||
|
|
||||||
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
|
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
|
||||||
import { ActivatedRoute, Router, UrlTree, UrlSegmentGroup, UrlSegment, PRIMARY_OUTLET } from '@angular/router';
|
import { ActivatedRoute, Router, UrlTree, UrlSegmentGroup, UrlSegment, PRIMARY_OUTLET } from '@angular/router';
|
||||||
import { AlfrescoApiService, UserPreferencesService, ObjectUtils } from '@alfresco/adf-core';
|
import { AlfrescoApiService, UserPreferencesService, ObjectUtils, UploadService } from '@alfresco/adf-core';
|
||||||
import { Node, MinimalNodeEntity } from 'alfresco-js-api';
|
import { Node, MinimalNodeEntity } from 'alfresco-js-api';
|
||||||
import { NodePermissionService } from '../../common/services/node-permission.service';
|
import { NodePermissionService } from '../../common/services/node-permission.service';
|
||||||
import { Store } from '@ngrx/store';
|
import { Store } from '@ngrx/store';
|
||||||
import { AppStore } from '../../store/states/app.state';
|
import { AppStore } from '../../store/states/app.state';
|
||||||
import { DeleteNodesAction } from '../../store/actions';
|
import { DeleteNodesAction } from '../../store/actions';
|
||||||
|
import { PageComponent } from '../page.component';
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-preview',
|
selector: 'app-preview',
|
||||||
templateUrl: 'preview.component.html',
|
templateUrl: 'preview.component.html',
|
||||||
@ -40,7 +40,7 @@ import { DeleteNodesAction } from '../../store/actions';
|
|||||||
// tslint:disable-next-line:use-host-property-decorator
|
// tslint:disable-next-line:use-host-property-decorator
|
||||||
host: { 'class': 'app-preview' }
|
host: { 'class': 'app-preview' }
|
||||||
})
|
})
|
||||||
export class PreviewComponent implements OnInit {
|
export class PreviewComponent extends PageComponent implements OnInit {
|
||||||
|
|
||||||
node: Node;
|
node: Node;
|
||||||
previewLocation: string = null;
|
previewLocation: string = null;
|
||||||
@ -57,12 +57,15 @@ export class PreviewComponent implements OnInit {
|
|||||||
selectedEntities: MinimalNodeEntity[] = [];
|
selectedEntities: MinimalNodeEntity[] = [];
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private store: Store<AppStore>,
|
private uploadService: UploadService,
|
||||||
private router: Router,
|
|
||||||
private route: ActivatedRoute,
|
|
||||||
private apiService: AlfrescoApiService,
|
private apiService: AlfrescoApiService,
|
||||||
private preferences: UserPreferencesService,
|
preferences: UserPreferencesService,
|
||||||
|
route: ActivatedRoute,
|
||||||
|
router: Router,
|
||||||
|
store: Store<AppStore>,
|
||||||
public permission: NodePermissionService) {
|
public permission: NodePermissionService) {
|
||||||
|
|
||||||
|
super(preferences, router, route, store);
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
@ -90,6 +93,10 @@ export class PreviewComponent implements OnInit {
|
|||||||
this.displayNode(id);
|
this.displayNode(id);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.subscriptions = this.subscriptions.concat([
|
||||||
|
this.uploadService.fileUploadError.subscribe((error) => this.onFileUploadedError(error))
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -30,7 +30,7 @@ import { RouterTestingModule } from '@angular/router/testing';
|
|||||||
import { HttpClientModule } from '@angular/common/http';
|
import { HttpClientModule } from '@angular/common/http';
|
||||||
import {
|
import {
|
||||||
NotificationService, TranslationService, TranslationMock,
|
NotificationService, TranslationService, TranslationMock,
|
||||||
NodesApiService, AlfrescoApiService, ContentService,
|
NodesApiService, AlfrescoApiService, ContentService, UploadService,
|
||||||
UserPreferencesService, LogService, AppConfigService,
|
UserPreferencesService, LogService, AppConfigService,
|
||||||
StorageService, CookieService, ThumbnailService, AuthenticationService,
|
StorageService, CookieService, ThumbnailService, AuthenticationService,
|
||||||
TimeAgoPipe, NodeNameTooltipPipe, NodeFavoriteDirective, DataTableComponent, AppConfigPipe
|
TimeAgoPipe, NodeNameTooltipPipe, NodeFavoriteDirective, DataTableComponent, AppConfigPipe
|
||||||
@ -99,7 +99,8 @@ describe('RecentFiles Routed Component', () => {
|
|||||||
NodesApiService,
|
NodesApiService,
|
||||||
DocumentListService,
|
DocumentListService,
|
||||||
ThumbnailService,
|
ThumbnailService,
|
||||||
CustomResourcesService
|
CustomResourcesService,
|
||||||
|
UploadService
|
||||||
],
|
],
|
||||||
schemas: [ NO_ERRORS_SCHEMA ]
|
schemas: [ NO_ERRORS_SCHEMA ]
|
||||||
})
|
})
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { Router, ActivatedRoute } from '@angular/router';
|
import { Router, ActivatedRoute } from '@angular/router';
|
||||||
import { MinimalNodeEntryEntity } from 'alfresco-js-api';
|
import { MinimalNodeEntryEntity } from 'alfresco-js-api';
|
||||||
import { UserPreferencesService } from '@alfresco/adf-core';
|
import { UserPreferencesService, UploadService } from '@alfresco/adf-core';
|
||||||
|
|
||||||
import { ContentManagementService } from '../../common/services/content-management.service';
|
import { ContentManagementService } from '../../common/services/content-management.service';
|
||||||
import { PageComponent } from '../page.component';
|
import { PageComponent } from '../page.component';
|
||||||
@ -43,6 +43,7 @@ export class RecentFilesComponent extends PageComponent implements OnInit {
|
|||||||
router: Router,
|
router: Router,
|
||||||
route: ActivatedRoute,
|
route: ActivatedRoute,
|
||||||
store: Store<AppStore>,
|
store: Store<AppStore>,
|
||||||
|
private uploadService: UploadService,
|
||||||
private content: ContentManagementService,
|
private content: ContentManagementService,
|
||||||
public permission: NodePermissionService,
|
public permission: NodePermissionService,
|
||||||
preferences: UserPreferencesService) {
|
preferences: UserPreferencesService) {
|
||||||
@ -55,7 +56,8 @@ export class RecentFilesComponent extends PageComponent implements OnInit {
|
|||||||
this.subscriptions = this.subscriptions.concat([
|
this.subscriptions = this.subscriptions.concat([
|
||||||
this.content.nodesDeleted.subscribe(() => this.reload()),
|
this.content.nodesDeleted.subscribe(() => this.reload()),
|
||||||
this.content.nodesMoved.subscribe(() => this.reload()),
|
this.content.nodesMoved.subscribe(() => this.reload()),
|
||||||
this.content.nodesRestored.subscribe(() => this.reload())
|
this.content.nodesRestored.subscribe(() => this.reload()),
|
||||||
|
this.uploadService.fileUploadError.subscribe((error) => this.onFileUploadedError(error))
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ import { HttpClientModule } from '@angular/common/http';
|
|||||||
import {
|
import {
|
||||||
NotificationService, TranslationService, TranslationMock,
|
NotificationService, TranslationService, TranslationMock,
|
||||||
NodesApiService, AlfrescoApiService, ContentService,
|
NodesApiService, AlfrescoApiService, ContentService,
|
||||||
UserPreferencesService, LogService, AppConfigService,
|
UserPreferencesService, LogService, AppConfigService, UploadService,
|
||||||
StorageService, CookieService, ThumbnailService, AuthenticationService,
|
StorageService, CookieService, ThumbnailService, AuthenticationService,
|
||||||
TimeAgoPipe, NodeNameTooltipPipe, NodeFavoriteDirective, DataTableComponent, AppConfigPipe
|
TimeAgoPipe, NodeNameTooltipPipe, NodeFavoriteDirective, DataTableComponent, AppConfigPipe
|
||||||
} from '@alfresco/adf-core';
|
} from '@alfresco/adf-core';
|
||||||
@ -101,7 +101,8 @@ describe('SharedFilesComponent', () => {
|
|||||||
NodesApiService,
|
NodesApiService,
|
||||||
DocumentListService,
|
DocumentListService,
|
||||||
ThumbnailService,
|
ThumbnailService,
|
||||||
CustomResourcesService
|
CustomResourcesService,
|
||||||
|
UploadService
|
||||||
],
|
],
|
||||||
schemas: [ NO_ERRORS_SCHEMA ]
|
schemas: [ NO_ERRORS_SCHEMA ]
|
||||||
})
|
})
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { Router, ActivatedRoute } from '@angular/router';
|
import { Router, ActivatedRoute } from '@angular/router';
|
||||||
import { UserPreferencesService } from '@alfresco/adf-core';
|
import { UserPreferencesService, UploadService } from '@alfresco/adf-core';
|
||||||
|
|
||||||
import { ContentManagementService } from '../../common/services/content-management.service';
|
import { ContentManagementService } from '../../common/services/content-management.service';
|
||||||
import { NodePermissionService } from '../../common/services/node-permission.service';
|
import { NodePermissionService } from '../../common/services/node-permission.service';
|
||||||
@ -41,6 +41,7 @@ export class SharedFilesComponent extends PageComponent implements OnInit {
|
|||||||
constructor(router: Router,
|
constructor(router: Router,
|
||||||
route: ActivatedRoute,
|
route: ActivatedRoute,
|
||||||
store: Store<AppStore>,
|
store: Store<AppStore>,
|
||||||
|
private uploadService: UploadService,
|
||||||
private content: ContentManagementService,
|
private content: ContentManagementService,
|
||||||
public permission: NodePermissionService,
|
public permission: NodePermissionService,
|
||||||
preferences: UserPreferencesService) {
|
preferences: UserPreferencesService) {
|
||||||
@ -53,7 +54,8 @@ export class SharedFilesComponent extends PageComponent implements OnInit {
|
|||||||
this.subscriptions = this.subscriptions.concat([
|
this.subscriptions = this.subscriptions.concat([
|
||||||
this.content.nodesDeleted.subscribe(() => this.reload()),
|
this.content.nodesDeleted.subscribe(() => this.reload()),
|
||||||
this.content.nodesMoved.subscribe(() => this.reload()),
|
this.content.nodesMoved.subscribe(() => this.reload()),
|
||||||
this.content.nodesRestored.subscribe(() => this.reload())
|
this.content.nodesRestored.subscribe(() => this.reload()),
|
||||||
|
this.uploadService.fileUploadError.subscribe((error) => this.onFileUploadedError(error))
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -226,6 +226,11 @@
|
|||||||
"SEARCH": "Search"
|
"SEARCH": "Search"
|
||||||
},
|
},
|
||||||
"VERSION": {
|
"VERSION": {
|
||||||
|
"MESSAGE": {
|
||||||
|
"ERROR": {
|
||||||
|
"CONFLICT": "New version not uploaded, another file with the same name already exists"
|
||||||
|
}
|
||||||
|
},
|
||||||
"DIALOG": {
|
"DIALOG": {
|
||||||
"TITLE": "Manage Versions",
|
"TITLE": "Manage Versions",
|
||||||
"CLOSE": "Close"
|
"CLOSE": "Close"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user