Not sure if this should be a bug report or feature request, but I’m leaning towards a bug since we have the ability to duplicate a file.
I use Wappler mainly in the code editor view. I also duplicate pages to speed up development (e.g., Create a Contact page and duplicate it for the Company page).
Then in the code view of the duplicated page, I will find/replace all references to switch from one page to another (e.g. Replace Contact with Company).
The issue with this approach is that the dmxAppConnect config.js file is not updated, which leads to UI issues in Wappler when trying to use components like the Formatter on the new page, as I reported in Add New Formetter button not working.
This means I have to also make manual updates to the config.js file to copy all of the items to the new page’s section and rename them.
Is there a way for Wappler to check, or just update, the config.js file when I perform a save on the file? Currently, it seems the config file is only updated when you perform certain actions in the UI (e.g. creating a page flow and adding actions to it, or adding a component like query manager and adding variables to it).
I realise I’m probably missing the point, but, if I understand correctly, you would like a new App ID to be created when you duplicate a page, and the corresponding entries to be created in config.js. I would prefer it as it is - and have the same App ID for every page, at least in most cases, and have access to the settings in config.js available to every page.
If you usually duplicate a page instead of creating a new one (as I do), wouldn’t every page have a different App ID if your request were implemented - which would probably require much duplication of the settings in config.js. Or do you not mean this and just want config.js updated (but then I don’t see why it would need updating)?
I realise part of my reply was rather careless and ambiguous. When I wrote 'as do I', I was referring to the whole of that sentence - in other words, I do exactly as you do: I almost never create a page from scratch; I always duplicate existing pages.
I would have thought that it's an advantage for every page to have the same App ID, so metadata for the UI is available to all pages. If you have different IDs for each page, surely there would be a lot of duplication within config.js and additional maintenance.
The meta data is changing as well. Plus there may be divergences in the pages in the future, so having them as separate sections in config.js seems appropriate.
As an example, on my Contacts page, I have a ContactsFlow that has a contactId. Both of those would change to company (i.e. CompanyFlow and companyId).
I could try to rewrite them to use more generalized names and parameters (e.g. PageFlow and recordId), but at this point that would require too much rework.
I think there can be advantages to either approach: either every page having a unique App ID or every page having the same ID (or perhaps a combination of the two). Having said that, I don’t think I’ve ever found a need to use different IDs.
I would have thought in most cases you would want metadata for the UI to be available to all or at least most pages - eg cookies or datastores. If duplicating a page meant a unique ID was assigned each time, should such data be duplicated within the context of the new page, or should it be only added manually each time? Should renaming of variables etc. apply to the current page or to corresponding definitions in other contexts (ie within config.js)?
I would have thought what you’re suggesting makes things more complicated. I have sometimes thought it more of a bug that each page is created with a new App ID. One solution might be to add a new option: to create new pages with a site App ID or a page-specific one.