mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-31 17:38:28 +00:00
[ACA-45] Drag and Drop a new version (#1477)
* added functionality to import a file from drag&drop * handle dropping a file over another and triggering the dialog for manage versions while passing the dropped file * handle receiving and passing a file to version manager * handle dropping a file over another. * refactoring the component by using 2 ADF components and showing them by a specific view case. * updated the dialog ref based on how the version dialog should behave in order to change/view a file's versions * handle the new drag&drop to upload a file's version functionality * removed the custom previous version upload component * added payload constructor * added unit test, fixed some misstypes * fix failing travis unit tests * fix failing travis unit tests * added translate module * added last version and fix failing test * small fixes and change type workflow to customevent. * small fix * fix flaky test * deleted flaky merge * ACA-45: Take drag'n'drop pop-up title from ACA rather than the ADF component * fixed a logical issue * ACA-45: Fix failing e2e tests * unit testing error fixing * unit testing error fixing * fix unknown word travis * unlock node after upload success * unlock node after cancelling upload * ACA-45: Introduce back fileUnlock asserts * added unit test for checking if the locked node is unlocked when uploading successfully a new version * added type of event and small update to unit test Co-authored-by: kristian <kristian.dimitrov@alfresco.com>
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
|
||||
<aca-page-layout-content>
|
||||
<div class="main-content">
|
||||
<adf-upload-drag-area [rootFolderId]="node?.id" [disabled]="!canUpload">
|
||||
<adf-upload-drag-area [rootFolderId]="node?.id" [disabled]="!canUpload" (updateFileVersion)="onUploadNewVersion($event)">
|
||||
<adf-document-list
|
||||
#documentList
|
||||
acaDocumentList
|
||||
|
@@ -40,7 +40,8 @@ import { AppExtensionService, ContentApiService } from '@alfresco/aca-shared';
|
||||
import {
|
||||
SetCurrentFolderAction,
|
||||
isAdmin,
|
||||
AppStore
|
||||
AppStore,
|
||||
UploadFileVersionAction
|
||||
} from '@alfresco/aca-shared/store';
|
||||
import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout';
|
||||
import { debounceTime, takeUntil } from 'rxjs/operators';
|
||||
@@ -145,6 +146,10 @@ export class FilesComponent extends PageComponent implements OnInit, OnDestroy {
|
||||
this.router.navigate(commands);
|
||||
}
|
||||
|
||||
onUploadNewVersion(ev: CustomEvent) {
|
||||
this.store.dispatch(new UploadFileVersionAction(ev));
|
||||
}
|
||||
|
||||
navigateTo(node: MinimalNodeEntity) {
|
||||
if (node && node.entry) {
|
||||
this.selectedNode = node;
|
||||
|
@@ -31,6 +31,7 @@ import { CoreModule } from '@alfresco/adf-core';
|
||||
import { Router } from '@angular/router';
|
||||
import { of } from 'rxjs';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { AppTestingModule } from '../../../testing/app-testing.module';
|
||||
|
||||
describe('ToggleFavoriteComponent', () => {
|
||||
let component: ToggleFavoriteComponent;
|
||||
@@ -50,7 +51,11 @@ describe('ToggleFavoriteComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [TranslateModule.forRoot(), CoreModule.forRoot()],
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
CoreModule.forRoot(),
|
||||
AppTestingModule
|
||||
],
|
||||
declarations: [ToggleFavoriteComponent],
|
||||
providers: [
|
||||
ExtensionService,
|
||||
@@ -78,7 +83,7 @@ describe('ToggleFavoriteComponent', () => {
|
||||
fixture.detectChanges();
|
||||
component.onToggleEvent();
|
||||
|
||||
expect(mockStore.dispatch).not.toHaveBeenCalled();
|
||||
expect(mockStore.dispatch).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should dispatch reload if route is specified', () => {
|
||||
|
Reference in New Issue
Block a user