-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: fixed and improved some user interface issues. #1666
Changes from 7 commits
ee51ea4
1472fbe
a51bbdb
29d76ff
1f2fb15
dceb6ae
1f9b433
01e2e9c
bc3fcfe
31e29a1
e06eddc
8b8f949
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,7 +76,9 @@ export class DatafilesComponent | |
this.appConfig.fileserverButtonLabel || "Download"; | ||
multipleDownloadAction: string | null = this.appConfig.multipleDownloadAction; | ||
maxFileSize: number | null = this.appConfig.maxDirectDownloadSize; | ||
sftpHost: string | null = this.appConfig.sftpHost; | ||
sftpHost: string = this.appConfig.sftpHost || "no sftp host provided"; | ||
customSourcefolder: string | null = | ||
this.appConfig.largeDataFileAccessInstruction; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Change it to:
|
||
jwt: any; | ||
auth_token: any; | ||
|
||
|
@@ -204,6 +206,12 @@ export class DatafilesComponent | |
} | ||
} | ||
|
||
replace_dynamic_values() { | ||
return `Some files are too big, but they can be downloaded | ||
at our sftp server: <strong>${this.sftpHost}</strong> | ||
at the folder: <strong>${this.customSourcefolder || this.sourcefolder}</strong>`; | ||
} | ||
|
||
ngAfterViewInit() { | ||
this.subscriptions.push( | ||
this.dataset$.subscribe((dataset) => { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -268,13 +268,17 @@ | |
<a (click)="onClickSample(sample.sampleId)"> | ||
<span>{{ sample.description }}</span> | ||
</a> | ||
<span | ||
<!-- NOTE: Sample editing is currently disabled. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we want to keep this or remove it completely from the code for now? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree. Maybe it's better off to remove this code as we are not certain if we need this feature or not, instead of polluting the source code. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have mixed feelings... THINKING THINKING... |
||
This feature not only contains bugs that need to be fixed, | ||
but we also want to have a centralized edit button in one location. | ||
--> | ||
<!-- <span | ||
class="sample-edit" | ||
(click)="openSampleEditDialog()" | ||
*ngIf="appConfig.editDatasetSampleEnabled && editingAllowed" | ||
> | ||
<mat-icon>edit</mat-icon> | ||
</span> | ||
</span> --> | ||
</td> | ||
</tr> | ||
<tr *ngIf="dataset['instrumentId'] && instrument"> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -341,33 +341,37 @@ describe("DatasetDetailComponent", () => { | |
}); | ||
}); | ||
|
||
describe("#openSampleEditDialog()", () => { | ||
it("should open the sample edit dialog and dispatch updatePropertyAction", () => { | ||
const dispatchSpy = spyOn(store, "dispatch"); | ||
component.dataset = new Dataset(); | ||
component.dataset.ownerGroup = "test"; | ||
component.sample = new Sample(); | ||
const sampleId = "testId"; | ||
component.sample.sampleId = sampleId; | ||
const pid = "testPid"; | ||
component.dataset.pid = pid; | ||
const property = { sampleId }; | ||
const dialogOpenSpy = spyOn(component.dialog, "open").and.returnValue({ | ||
afterClosed: () => of({ sample: { sampleId: "testId" } }), | ||
} as MatDialogRef<SampleEditComponent>); | ||
component.openSampleEditDialog(); | ||
|
||
expect(dialogOpenSpy).toHaveBeenCalledTimes(1); | ||
expect(dialogOpenSpy).toHaveBeenCalledWith(SampleEditComponent, { | ||
width: "1000px", | ||
data: { ownerGroup: "test", sampleId: "testId" }, | ||
}); | ||
expect(dispatchSpy).toHaveBeenCalledTimes(1); | ||
expect(dispatchSpy).toHaveBeenCalledWith( | ||
updatePropertyAction({ pid, property }), | ||
); | ||
}); | ||
}); | ||
// NOTE: Sample editing is currently disabled. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe it is better to remove this instead of just commenting it There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above. Remove it. |
||
// This feature not only contains bugs that need to be fixed, | ||
// but we also want to have a centralized edit button in one location. | ||
|
||
// describe("#openSampleEditDialog()", () => { | ||
// it("should open the sample edit dialog and dispatch updatePropertyAction", () => { | ||
// const dispatchSpy = spyOn(store, "dispatch"); | ||
// component.dataset = new Dataset(); | ||
// component.dataset.ownerGroup = "test"; | ||
// component.sample = new Sample(); | ||
// const sampleId = "testId"; | ||
// component.sample.sampleId = sampleId; | ||
// const pid = "testPid"; | ||
// component.dataset.pid = pid; | ||
// const property = { sampleId }; | ||
// const dialogOpenSpy = spyOn(component.dialog, "open").and.returnValue({ | ||
// afterClosed: () => of({ sample: { sampleId: "testId" } }), | ||
// } as MatDialogRef<SampleEditComponent>); | ||
// component.openSampleEditDialog(); | ||
|
||
// expect(dialogOpenSpy).toHaveBeenCalledTimes(1); | ||
// expect(dialogOpenSpy).toHaveBeenCalledWith(SampleEditComponent, { | ||
// width: "1000px", | ||
// data: { ownerGroup: "test", sampleId: "testId" }, | ||
// }); | ||
// expect(dispatchSpy).toHaveBeenCalledTimes(1); | ||
// expect(dispatchSpy).toHaveBeenCalledWith( | ||
// updatePropertyAction({ pid, property }), | ||
// ); | ||
// }); | ||
// }); | ||
|
||
describe("#onSaveMetadata()", () => { | ||
it("should dispatch an updatePropertyAction", () => { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ import { ENTER, COMMA, SPACE } from "@angular/cdk/keycodes"; | |
import { MatChipInputEvent } from "@angular/material/chips"; | ||
|
||
import { MatDialog } from "@angular/material/dialog"; | ||
import { SampleEditComponent } from "datasets/sample-edit/sample-edit.component"; | ||
// import { SampleEditComponent } from "datasets/sample-edit/sample-edit.component"; | ||
import { DialogComponent } from "shared/modules/dialog/dialog.component"; | ||
import { combineLatest, fromEvent, Observable, Subscription } from "rxjs"; | ||
import { Store } from "@ngrx/store"; | ||
|
@@ -277,28 +277,31 @@ export class DatasetDetailComponent | |
this.router.navigateByUrl("/samples/" + id); | ||
} | ||
|
||
openSampleEditDialog() { | ||
if (this.dataset) { | ||
this.dialog | ||
.open(SampleEditComponent, { | ||
width: "1000px", | ||
data: { | ||
ownerGroup: this.dataset.ownerGroup, | ||
sampleId: this.sample?.sampleId, | ||
}, | ||
}) | ||
.afterClosed() | ||
.subscribe((res) => { | ||
if (res && this.dataset) { | ||
const { sample } = res; | ||
this.sample = sample; | ||
const pid = this.dataset.pid; | ||
const property = { sampleId: sample.sampleId }; | ||
this.store.dispatch(updatePropertyAction({ pid, property })); | ||
} | ||
}); | ||
} | ||
} | ||
// NOTE: Sample editing is currently disabled. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove it |
||
// This feature not only contains bugs that need to be fixed, | ||
// but we also want to have a centralized edit button in one location. | ||
// openSampleEditDialog() { | ||
// if (this.dataset) { | ||
// this.dialog | ||
// .open(SampleEditComponent, { | ||
// width: "1000px", | ||
// data: { | ||
// ownerGroup: this.dataset.ownerGroup, | ||
// sampleId: this.sample?.sampleId, | ||
// }, | ||
// }) | ||
// .afterClosed() | ||
// .subscribe((res) => { | ||
// if (res && this.dataset) { | ||
// const { sample } = res; | ||
// this.sample = sample; | ||
// const pid = this.dataset.pid; | ||
// const property = { sampleId: sample.sampleId }; | ||
// this.store.dispatch(updatePropertyAction({ pid, property })); | ||
// } | ||
// }); | ||
// } | ||
// } | ||
|
||
onSlidePublic(event: MatSlideToggleChange) { | ||
if (this.dataset) { | ||
|
@@ -351,11 +354,7 @@ export class DatasetDetailComponent | |
} | ||
|
||
getImageUrl(encoded: string) { | ||
const mimeType = this.base64MimeType(encoded); | ||
if (mimeType === "application/pdf") { | ||
return "assets/images/pdf-icon.svg"; | ||
} | ||
return encoded; | ||
return this.attachmentService.getImageUrl(encoded); | ||
} | ||
|
||
openAttachment(encoded: string) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change name to
maxFileSizeWarning