-
Notifications
You must be signed in to change notification settings - Fork 15
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
[DLT-1110] Mapped Collection Endpoint Browse (1/4) #1208
[DLT-1110] Mapped Collection Endpoint Browse (1/4) #1208
Conversation
Reviewer's Guide by SourceryThis PR refactors the data transfer dialog to use a new component-based architecture. It introduces a new Sequence diagram for the transfer dialog initialization flowsequenceDiagram
participant App
participant TD as TransferDialog
participant TC as TransferDialogController
participant TM as TransferModel
participant TEM as TransferEndpointManager
participant TUM as TransferUIManager
App->>TD: show(mode, records, callback)
activate TD
TD->>TC: new TransferDialogController(mode, records, callback)
activate TC
TC->>TM: new TransferModel(mode, records)
TC->>TEM: new TransferEndpointManager()
TC->>TUM: new TransferUIManager()
TC->>TUM: initializeComponents()
TUM->>TUM: createDialog()
TUM->>TUM: initializeButtons()
TUM->>TUM: initializeRecordDisplay()
TUM->>TUM: initializeEndpointInput()
TC->>TEM: initialized = true
TC->>TUM: showDialog()
deactivate TC
deactivate TD
Class diagram for the new TransferDialog componentclassDiagram
class TransferDialog {
-currentDialog: TransferDialogController
+show(mode, records, callback)
}
class TransferDialogController {
-model: TransferModel
-endpointManager: TransferEndpointManager
-uiManager: TransferUIManager
-ids: Array
-callback: Function
-services: Object
+show()
}
class TransferModel {
-mode: TransferMode
-records: Array
-selectedIds: Set
-transferConfig: Object
-stats: Object
+isRecordValid(record)
+getRecordInfo(item)
}
class TransferEndpointManager {
-initialized: boolean
-currentEndpoint: Object
-endpointManagerList: Array
-currentSearchToken: string
-searchTokenIterator: number
+searchEndpoint(endpoint, searchToken)
+handlePathInput(searchToken)
}
class TransferUIManager {
-state: Object
-inputTimer: number
+initializeComponents()
+showDialog()
+handleTransfer()
}
TransferDialog --> TransferDialogController
TransferDialogController --> TransferModel
TransferDialogController --> TransferEndpointManager
TransferDialogController --> TransferUIManager
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
d0215b7
to
db9280d
Compare
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 @AronPerez - I've reviewed your changes and they look great!
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.
@sourcery-ai review |
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 @AronPerez - I've reviewed your changes and they look great!
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.
All comments from AI are about if statement styling |
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 added a couple of comments, still trying to look through the ui manager and check diffs vs dlg_start_xfer.js
const titleText = `${item.id}   <span style='display:inline-block;width:9ch'>${info.info}</span> ${item.title}`; | ||
return info.selectable ? titleText : `<span style='color:#808080'>${titleText}</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.
please run the escapeHTML function on these to prevent injection attacks. title titleText are controlled by the user.
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.
Updated
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.
Excellent addition, minor nitpicks, the only item that is blocking this pr from my point of view, is you need to escape the HTML for some of the userinfo, to avoid injection attacks.
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 think it would be helpful to have some visual demonstration such as screenshots or a brief gif to show that the changes are equivalent.
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.
Here's the original uses https://confluence.ccs.ornl.gov/display/DATAFED/OVERVIEW+-+Use+Cases
Will add artifacts soon
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.
db75bd9
to
5a57e0d
Compare
[DLT-1110] Add controller unit tests [DLT-1110] Remove debug [DLT-1110] Correct import statements, endpoint list [DLT-1110] Refactor out into MVC [DLT-1110] Add debug [DLT-1110] Functioning modal, needs refactoring [DLT-1110] Refactor dlg start transfer using OOO programming. Should be MVC cased on what I'm seeing but we'll see
…ransfer request when update or get
dbe7432
to
3679a4f
Compare
@sourcery-ai review |
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 @AronPerez - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider adding unit tests for the new transfer components to ensure the complex transfer logic remains stable as the codebase evolves
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 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.
ArtifactsNew Data RecordScreen.Recording.2025-01-14.at.2.46.19.PM.movUpload/Update Data RecordScreen.Recording.2025-01-14.at.2.48.27.PM.movDownload/Get Data RecordUpdatedScreen.Recording.2025-01-14.at.1.27.00.PM.mov |
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.
Approved on condition of the CI passing.
PR Description
This PR refactors out
web/static/dlg_start_xfer.js
Tasks
Summary by Sourcery
Refactor the file transfer dialog into a reusable component.
New Features:
TransferDialog
class to manage the transfer dialog.Enhancements:
Tests:
TransferDialog
component.