generator-esri-appbuilder-js icon indicating copy to clipboard operation
generator-esri-appbuilder-js copied to clipboard

widget config.json does not grunt

Open tyler-austin opened this issue 8 years ago • 4 comments

current WAB dev edition saves a widgets config.json file in:

\server\apps#\configs\WidgetName\config_widgetname.json

so grunt will not update the config.json file in directory:

\server\apps#\widgets\WidgetName

You must copy the config_WidgetName.json then use it to replace the config.json in the widget development folder. then remember to update the app's "main" config.json to point to the correct location of the config_widgetname.json file:

      {
        "position": {
          "right": 110,
          "top": 10,
          "relativeTo": "map"
        },
        "placeholderIndex": 1,
        "id": "_12",
        "name": "WidgetName",
        "version": "0.0.0",
        "IsController": false,
        "uri": "widgets/WidgetName/Widget",
        "config": "widgets/WidgetName/config_widgetname.json",
        "icon": "widgets/WidgetName/images/icon_widgetname.png"
      }

tyler-austin avatar Feb 16 '17 16:02 tyler-austin

@tyler-austin thank you for posting this issue.

Maybe we should solve this by having the grunt task automatically copy widgets/MyWidget/config.json to apps/Z/configs/MyWidget/config_MyWidget.json when it detects changes. Would that solve the problem here?

gavinr avatar Feb 16 '17 16:02 gavinr

That would probably be the best approach. I should add that I experienced this when using the generator for 2D apps and widgets. I have yet to try 3D maps and widgets so I don't know if the behavior has has changed for both.

tyler-austin avatar Feb 16 '17 17:02 tyler-austin

Any reason why this was dropped from the milestone. Just tried the generator at WAB 2.8 and I am seeing the same thing.

ryansutc avatar May 29 '18 17:05 ryansutc

I think I'm late, but add some lines to the Gruntfile.js file, specifically inside the copy key sample: { src: 'widgets/widgetname/config.json', dest: appDir + '/configs/widgetname/config_widgets_widgetname_Widget_id.json'}

If you have a better solution please let me know. 👍

danielgis avatar Aug 04 '20 03:08 danielgis