-
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
Conversation
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.
Hey @Junjiequan - I've reviewed your changes - here's some feedback:
Overall Comments:
- Please provide a proper description of the changes in the PR description. Specifically list out: 1) The removal of sample editing functionality 2) The refactoring of image URL handling 3) The improvements to large file download messages
- The documentation checkboxes are all unchecked. Since this PR removes user-facing functionality and changes UI elements, please update the relevant documentation and check the appropriate boxes.
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
7cee42d
to
1f9b433
Compare
@@ -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 comment
The 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 comment
The 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.
What's your thoughts? @nitrosx
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.
I have mixed feelings... THINKING THINKING...
Let's remove it!!!
); | ||
}); | ||
}); | ||
// NOTE: Sample editing is currently disabled. |
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.
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 comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above. Remove it.
Let's clean up the code
}); | ||
} | ||
} | ||
// NOTE: Sample editing is currently disabled. |
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.
Same here
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.
Remove it
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.
Code changes requested are not functional. They are in pseudo code, most likely need to be refactored.
src/app/app-config.service.ts
Outdated
@@ -82,6 +82,7 @@ export interface AppConfig { | |||
searchPublicDataEnabled: boolean; | |||
searchSamples: boolean; | |||
sftpHost: string | null; | |||
largeDataFileAccessInstruction?: 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
"." | ||
: "" | ||
}} | ||
<span [innerHTML]="hasTooLargeFilesMessage()"></span> |
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 hasFileAboveMaxSizeWarning()
customSourcefolder: string | null = | ||
this.appConfig.largeDataFileAccessInstruction; |
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 it to:
maxFileSizeWarning: string =
this.appConfig.maxFileSizeWarning ||
`Some files are above the max size (<maxFileSize>)`
hasTooLargeFilesMessage() { | ||
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>`; | ||
} | ||
|
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 it to:
hasFileAboveMaxSizeWarning() {
const valueMapping = {
'<sftpHost>' : this.sftpHost,
'<sourceFolder>': this.sourceFolder
// ... any other value that we think might be important ...
}
var warning = this.maxFileSizeWarning;
Object.keys(valaueMapping).forEach((key) => {
warning = warning.replace('/' + key + '/', valueMapping[key];
});
return warning;
}
This way, site admin can configure the message to their liking. They also can use <sftHost>
or <sourceFolder>
as placemarks that will be substituted in.
The code is pseudo code. Most likely it needs to be adjusted.
One more thing, with the new data file actions, some facilities will configure them to perform action which do not have size restriction.
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.
Look good.
In the furture we probably need to adjust for different download methods etc.
Description
This PR contains a couple of small UI improvements and changes:
dataset/datafiles
pageMotivation
Fixes:
Please provide a list of the fixes implemented in this PR
Changes:
Please provide a list of the changes implemented by this PR
Tests included
Documentation
official documentation info
If you have updated the official documentation, please provide PR # and URL of the pages where the updates are included
Backend version
Summary by Sourcery
Disable the sample editing feature due to bugs and the need for a centralized edit button. Refactor image URL retrieval logic to use the AttachmentService for consistency and maintainability. Update the datafiles component to dynamically replace file size warning messages with configurable values.
Bug Fixes:
Enhancements: