[Enhancement] Model upload and delete UI#375
Conversation
birm
left a comment
There was a problem hiding this comment.
looks good to me. Liking the additional usage of the toast-style popups. :)
| if (status) { | ||
| alert('Deleted', name); | ||
| showInfo(); | ||
| modelName.splice(modelName.indexOf(name.split('/').pop().split('_').splice(2).join('_').slice(0, -3)), 1); |
There was a problem hiding this comment.
Hey @mgautam98 . I had added the line 748 to remove the model name from modelName array so that the name could be reused once that model has been deleted. Is it not required ?
There was a problem hiding this comment.
This line is not needed anymore. After deletion I am calling initUIComponent which will fill the modelName array again.
There was a problem hiding this comment.
Oh sorry for the confusion. I missed that . Thanks for clearing that for me!
|
|
||
| async function deleteModel(name) { | ||
| if (confirm('Are you sure you want to delete this model?')) { | ||
| modelName = name.split('/').pop().split('_').splice(2).join('_').slice(0, -3); |
There was a problem hiding this comment.
modelName is the global array which stores the names of the model for the checkDuplicateNameFunction . I think you should use a different variable name in line 743 or else the array is reinitialized wrongly every time deleteModel is called . Am I missing something @mgautam98 ?
There was a problem hiding this comment.
Yes, you are right. A different name should have been used I missed it. It will not cause any problem because after deleting the modelName will be reinitialized so no a problem. But It is confusing and I will correct it in next PR or you can do it too if you want in you next PR.
Description
After uploading model the form will close and a popup will show that the model is uploaded successfully. Previously, user was directed to manually refresh.
After deleting a model a popup for confirmation is shown to the user instead of alert("Deleted"). Also initialized the UI after deletion.
Deleted popup.css from apps/viewer it is not used anywhere instead css/popup.css is used
Motivation and Context
**Why is this change required? What problem does it solve?
Screenshots (if appropriate):
Types of changes
**What types of changes does your code introduce? Put an
xin all the boxes that apply:Checklist:
**Go over all the following points, and put an
xin all the boxes that apply.**(If you're unsure about any of these, don't hesitate to ask. We're here to help!)