luci-base: uci.js: fix section deletion logic
authorJo-Philipp Wich <jo@mein.io>
Sun, 26 Apr 2020 16:41:19 +0000 (18:41 +0200)
committerJo-Philipp Wich <jo@mein.io>
Thu, 7 May 2020 17:40:49 +0000 (19:40 +0200)
commit2d705b273c2fe3e818fb00489e47bec42086a44e
tree1ab03d6fc02ac9c051fc9aa6de158cbb4ba8f96f
parentb3c0560a937501b90bd94f589572aab9c2182895
luci-base: uci.js: fix section deletion logic

 - Process deletions before additions or changes, allowing user code to
   remove and recreate a section with the same name.

 - Only record section deletions when the section to be removed actually
   existed in the original config or when it was staged for creation
   earlier. This avoids stray ubus not found exception when saving.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 49c6a810e9a705217f4543099d8188f0f3158f6c)
modules/luci-base/htdocs/luci-static/resources/uci.js