Repository: syncthing/syncthing (language: go)

Issue:
Include default ignore patterns in the GUI's advanced configuration editor
The new configuration option added in #7530 can be set through the Edit Folder Defaults button in the GUI's regular Settings dialog.  But it's missing in the Advanced Configuration modal.

Include default ignore patterns in the GUI's advanced configuration editor
The new configuration option added in #7530 can be set through the Edit Folder Defaults button in the GUI's regular Settings dialog.  But it's missing in the Advanced Configuration modal.



Discussion / hints:

Fix patch:
diff --git a/gui/default/assets/lang/lang-en.json b/gui/default/assets/lang/lang-en.json
index 843b4161206..fde2c4cce14 100644
--- a/gui/default/assets/lang/lang-en.json
+++ b/gui/default/assets/lang/lang-en.json
@@ -75,6 +75,7 @@
    "Default Device": "Default Device",
    "Default Folder": "Default Folder",
    "Default Folder Path": "Default Folder Path",
+   "Default Ignore Patterns": "Default Ignore Patterns",
    "Defaults": "Defaults",
    "Delete": "Delete",
    "Delete Unexpected Items": "Delete Unexpected Items",
diff --git a/gui/default/syncthing/core/syncthingController.js b/gui/default/syncthing/core/syncthingController.js
index e528f0f0e8a..dc023be2743 100755
--- a/gui/default/syncthing/core/syncthingController.js
+++ b/gui/default/syncthing/core/syncthingController.js
@@ -2777,6 +2777,12 @@ angular.module('syncthing.core')
             $scope.advancedConfig = angular.copy($scope.config);
             $scope.advancedConfig.devices.sort(deviceCompare);
             $scope.advancedConfig.folders.sort(folderCompare);
+            $scope.advancedConfig.defaults.ignores._lines = function (newValue) {
+                if (arguments.length) {
+                    $scope.advancedConfig.defaults.ignores.lines = newValue.split('\n');
+                }
+                return $scope.advancedConfig.defaults.ignores.lines.join('\n');
+            };
             $('#advanced').modal('show');
         };
 
diff --git a/gui/default/syncthing/settings/advancedSettingsModalView.html b/gui/default/syncthing/settings/advancedSettingsModalView.html
index 958714c5c9a..0f4832f6be6 100644
--- a/gui/default/syncthing/settings/advancedSettingsModalView.html
+++ b/gui/default/syncthing/settings/advancedSettingsModalView.html
@@ -167,6 +167,26 @@ <h4 class="panel-title" tabindex="0" translate>Default Device</h4>
                 </form>
               </div>
             </div>
+            <div class="panel panel-default">
+              <div class="panel-heading" role="tab" id="advancedDefaultIgnoresHeading" data-toggle="collapse" data-parent="#advancedDefaults" href="#advancedDefaultIgnores" aria-expanded="false" aria-controls="advancedDefaultIgnores" style="cursor: pointer;">
+                <h4 class="panel-title" tabindex="0" translate>Default Ignore Patterns</h4>
+              </div>
+              <div id="advancedDefaultIgnores" class="panel-collapse collapse" role="tabpanel" aria-labelledby="advancedDefaultIgnoresHeading">
+                <form class="form-horizontal" role="form">
+                  <div ng-repeat="(key, value) in advancedConfig.defaults.ignores" ng-if="inputTypeFor(key, value) != 'skip'" class="form-group">
+                    <label for="advancedDefaultIgnoresInput{{$index}}" class="col-sm-4 control-label">{{key | uncamel}}&nbsp;<a href="{{docsURL('users/config#config-option-defaults.ignores.')}}{{key | lowercase}}" target="_blank"><span class="fas fa-question-circle"></span></a></label>
+                    <div class="col-sm-8">
+                      <div ng-switch="key">
+                        <!-- Special case to preserve empty lines in multi-line input -->
+                        <textarea ng-switch-when="lines" id="advancedDefaultIgnoresInput{{$index}}" class="form-control" rows="5" ng-model="advancedConfig.defaults.ignores._lines" ng-model-options="{ getterSetter: true }"></textarea>
+                        <input ng-switch-default ng-if="inputTypeFor(key, value) == 'list'" id="advancedDefaultIgnoresInput{{$index}}" class="form-control" type="text" ng-model="advancedConfig.defaults.ignores[key]" ng-list />
+                        <input ng-switch-default ng-if="inputTypeFor(key, value) != 'list'" id="advancedDefaultIgnoresInput{{$index}}" class="form-control" type="{{inputTypeFor(key, value)}}" ng-model="advancedConfig.defaults.ignores[key]" />
+                      </div>
+                    </div>
+                  </div>
+                </form>
+              </div>
+            </div>
 
           </div>
         </div>


Test patch: