Skip to content

Commit 95d372b

Browse files
Chore/151 files api (#92)
* chore(files): api # Conflicts: # src/app/features/project/addons/addons.component.spec.ts # src/app/features/project/files/components/file-detail/file-detail.component.html # src/app/features/project/files/components/file-detail/file-detail.component.ts # src/app/features/project/files/components/move-file-dialog/move-file-dialog.component.html # src/app/features/project/files/components/move-file-dialog/move-file-dialog.component.scss # src/app/features/project/files/components/move-file-dialog/move-file-dialog.component.spec.ts # src/app/features/project/files/components/move-file-dialog/move-file-dialog.component.ts # src/app/features/project/files/mappers/file-custom-metadata.mapper.ts # src/app/features/project/files/mappers/project-metadata.mapper.ts # src/app/features/project/files/models/index.ts # src/app/features/project/files/project-files.component.html # src/app/features/project/files/project-files.component.scss # src/app/features/project/files/project-files.component.ts # src/app/features/project/files/services/project-files.service.ts # src/app/features/project/files/store/project-files.actions.ts # src/app/features/project/files/store/project-files.model.ts # src/app/features/project/files/store/project-files.selectors.ts # src/app/shared/components/text-input/text-input.component.spec.ts * fix(files-api): general fixes * fix(files-api): fix moving files
1 parent ce4151b commit 95d372b

File tree

3 files changed

+81
-2
lines changed

3 files changed

+81
-2
lines changed

src/app/features/project/addons/addons.component.spec.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { ComponentFixture, TestBed } from '@angular/core/testing';
22

3+
<<<<<<<< HEAD:src/app/features/project/addons/addons.component.spec.ts
34
import { AddonsComponent } from './addons.component';
45

56
describe('AddonsComponent', () => {
@@ -12,6 +13,20 @@ describe('AddonsComponent', () => {
1213
}).compileComponents();
1314

1415
fixture = TestBed.createComponent(AddonsComponent);
16+
========
17+
import { MoveFileDialogComponent } from './move-file-dialog.component';
18+
19+
describe('MoveFileDialogComponent', () => {
20+
let component: MoveFileDialogComponent;
21+
let fixture: ComponentFixture<MoveFileDialogComponent>;
22+
23+
beforeEach(async () => {
24+
await TestBed.configureTestingModule({
25+
imports: [MoveFileDialogComponent],
26+
}).compileComponents();
27+
28+
fixture = TestBed.createComponent(MoveFileDialogComponent);
29+
>>>>>>>> 0317809 (chore(files): api):src/app/features/project/files/components/move-file-dialog/move-file-dialog.component.spec.ts
1530
component = fixture.componentInstance;
1631
fixture.detectChanges();
1732
});

src/app/features/project/files/components/move-file-dialog/move-file-dialog.component.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export class MoveFileDialogComponent {
101101
path = '/';
102102
}
103103

104-
this.dispatch.setFilesIsLoading(true);
104+
this.isFilesUpdating.set(true);
105105
this.projectFilesService
106106
.moveFile(this.config.data.file.links.move, path, this.config.data.projectId, this.config.data.action)
107107
.pipe(
@@ -110,9 +110,11 @@ export class MoveFileDialogComponent {
110110
finalize(() => {
111111
this.dispatch.setCurrentFolder(this.currentFolder());
112112
this.dispatch.setMoveFileCurrentFolder(undefined);
113+
this.isFilesUpdating.set(false);
113114
})
114115
)
115116
.subscribe((file) => {
117+
this.dialogRef.close();
116118
if (file.id) {
117119
const filesLink = this.currentFolder()?.relationships.filesLink;
118120
if (filesLink) {
@@ -122,6 +124,5 @@ export class MoveFileDialogComponent {
122124
}
123125
}
124126
});
125-
this.dialogRef.close();
126127
}
127128
}

src/assets/i18n/en.json

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,69 @@
562562
"openResources": "Open Resources"
563563
}
564564
},
565+
"files": {
566+
"title": "Files",
567+
"storageLocation": "OSF Storage",
568+
"searchPlaceholder": "Search your projects",
569+
"sort": {
570+
"placeholder": "Sort",
571+
"nameAZ": "Name: A-Z",
572+
"nameZA": "Name: Z-A",
573+
"lastModifiedOldest": "Last modified: oldest to newest",
574+
"lastModifiedNewest": "Last modified: newest to oldest"
575+
},
576+
"actions": {
577+
"downloadAsZip": "Download As Zip",
578+
"createFolder": "Create Folder",
579+
"uploadFile": "Upload File"
580+
},
581+
"dialogs": {
582+
"uploadFile": {
583+
"title": "Upload file"
584+
},
585+
"createFolder": {
586+
"title": "Create folder",
587+
"folderName": "New folder name",
588+
"folderNamePlaceholder": "Please enter a folder name"
589+
},
590+
"renameFile": {
591+
"title": "Rename file",
592+
"renameLabel": "Please rename the file"
593+
},
594+
"moveFile": "Cannot move to the same folder"
595+
},
596+
"emptyState": "This folder is empty",
597+
"detail": {
598+
"backToList": "Back to list of files",
599+
"fileMetadata": {
600+
"title": "File Metadata",
601+
"edit": "Edit",
602+
"fields": {
603+
"title": "Title",
604+
"description": "Description",
605+
"resourceType": "Resource Type",
606+
"resourceLanguage": "Resource Language"
607+
}
608+
},
609+
"projectMetadata": {
610+
"title": "Project Metadata",
611+
"edit": "Edit",
612+
"fields": {
613+
"funder": "Funder",
614+
"awardTitle": "Award title",
615+
"awardNumber": "Award number",
616+
"awardUri": "Award URI",
617+
"title": "Title",
618+
"description": "Description",
619+
"resourceType": "Resource type",
620+
"resourceLanguage": "Resource language",
621+
"dateCreated": "Date created",
622+
"dateModified": "Date modified",
623+
"contributors": "Contributors"
624+
}
625+
}
626+
}
627+
},
565628
"files": {
566629
"title": "Files",
567630
"storageLocation": "OSF Storage",

0 commit comments

Comments
 (0)