Hi,
It was hard to articulate the problem in the title so apologies for that. I have been following the tutorial for Getting Started with Custom Widgets. I've installed Developer Edition, I'm using VSCode, I've the client and server running all fine.
My goal is to create a version of the Survey123 widget where there is a toggle and setting so that you can set the autorefresh/reload within the setting panel when setting up your survey. Whether that's doable (or worth doing) is quite another question because I can't actually get ExB to show my custom widget properly at all.
I have my 'refreshable-survey' widget under client/your-extensions/widgets as intended. I actually copied the entire survey123 widget folder so I have manifest etc., which I've edited to have the new name. And I've made a couple of changes:
1. I've duplicated one of the toggles from the Appearance section - so I would expect there to be two instances of 'Show survey footer'.
2. I've edited some of the label text both in setting.js and default.ts - so it should say 'Show survey footer?'
3. I changed the icon from the survey one to a checkmark
None of these things are being applied. What I notice is that when I do npm start is that it copies over my custom widget folder into client/dist/widgets and whenever I update my files in your-extensions/widgets it appears to be updating them in dist/widgets. Which would be fine and seem like a pretty logical workflow, except that the version that is in dist/widgets is not showing any of my changes. Even if I delete that folder so the one that appears on running npm start is brand new after changes, they don't appear. The files and code are the exact same as the ones inside dist/widgets/survey123
(Worth noting that that workflow I don't think is explained in the documentation so it confused me at first)
If I make changes to the starter-widget then they show up so I know the process is working but no changes display in my refreshable-survey widget.
Is is not recommended to copy an existing widget and edit it? Is there some other setting or bit of code I need to tweak that I've missed. Is there straight up a better way to do this?
I have done web development before but I was mostly writing in VueJS or C#/ASP not React so I'll gladly allow that I don't have perfect insight. Plus the setting.js file for the survey123 widget is more than 4000 lines long so I haven't read all of it.
Happy to hear either answers that explain what I've done wrong or that say "oh my gosh, don't do that" if I've gone about this completely bass ackwards.
Thanks for reading.
Kate