
The custom connector editor in primarily manages the connector’s OpenAPI (Swagger) definition and metadata. Opening the editor, it reloads the connector definition from the stored OpenAPI JSON. If the custom code or uploaded files are not properly embedded or saved as part of the OpenAPI definition, the editor may reset or clear them! Editing non-code properties (like icons) triggers a save operation that overwrites the connector definition, causing the code to be lost. This is a limitation of the current (PA) custom connector UI and how it handles custom code or uploaded files.
Things to tackle:
1. Let's avoid modifying the edirot for minor stuff like icons. (I am sorry why we need to do that? - Actually finding no other way)
2. Let's keep custom code outside the connector eidtor - maintain code in a separate file or source control. Before editing the connector, export or back up code. After editing, re-import or paste the code back. (tedious but effective).
3. Let's report feedback to MS - this is a know UX limitation. Providing feedback through official channels may help prioritize improvements.