Custom Reproducibility Checklists , Attributes and their Unit testing. - #445
Custom Reproducibility Checklists , Attributes and their Unit testing.#445dibyanshu-pal-kushwaha wants to merge 5 commits into
Conversation
Built Custom Template Builder
…tes and their unit tests
lrasmus
left a comment
There was a problem hiding this comment.
I started reviewing the custom attribute and found something with the use of localStorage I wanted to report right away. I'll keep reviewing the rest of the code for the checklist items as you work on this.
| setNewAttributeName(''); | ||
| } | ||
|
|
||
| const handleDeleteCustomAttribute = (attributeId) => { |
There was a problem hiding this comment.
I think we want to give the user a pop-up warning and confirmation here. Something like:
Are you sure you want to delete this custom attribute?
Note: This will delete the custom attribute for all assets in this project.
I want the user to be sure they know it's not deleting it for just a single attribute - that if they proceed, it disappears for everything.
| > | ||
| <DialogTitle className={styles.dialogTitle}>Custom Attributes</DialogTitle> | ||
| <DialogContent className={styles.dialogContent}> | ||
| <label className={styles.formLabel}>Name of Attributes</label> |
There was a problem hiding this comment.
Very minor - remove "s" on "Attributes" ("Name of Attribute")
| <label className={styles.formLabel}>Name of Attributes</label> | ||
| <TextField | ||
| autoFocus | ||
| placeholder='Attributes like "Experimental"' |
There was a problem hiding this comment.
Change to:
'e.g., "Experimental"'
| */ | ||
| function loadCustomAttributes(projectId) { | ||
| try { | ||
| const stored = localStorage.getItem(`statwrap_custom_attrs_${projectId}`); |
There was a problem hiding this comment.
Unfortunately I don't think the localStorage is going to work as a solution, and we will need to rethink this.
I was able to test this out where I access the same project directory from two different systems. In the first system, I ran StatWrap and defined a new custom attribute:
I then opened StatWrap on the second system and accessed the project. You can see the custom attribute isn't available:
Instead of using localStorage, can you look at writing this to the StatWrap project? This could be a new file in the .statwrap folder specific to the customization. That way, anyone who accesses the project will have access to the configuration details.
Reproducibility checklists