Merge pull request #3436 from LacunaSoftware/fix-description-mismatch

Make description an optional field for backups
This commit is contained in:
Rune Henriksen
2018-10-17 15:22:37 +02:00
committed by GitHub
5 changed files with 16 additions and 8 deletions
+1 -1
View File
@@ -518,7 +518,7 @@ namespace Duplicati.Server.Database
return new object[] {
n.Name,
n.Description,
n.Description == null ? "" : n.Description, // Description is optional but the column is set to NOT NULL, an additional check is welcome
string.Join(",", n.Tags ?? new string[0]),
n.TargetURL,
update ? (object)item.ID : (object)n.DBPath
@@ -1 +1 @@
ALTER TABLE "Backup" ADD COLUMN "Description" TEXT NULL;
ALTER TABLE "Backup" ADD COLUMN "Description" TEXT NOT NULL DEFAULT '';
@@ -221,7 +221,6 @@ backupApp.controller('EditBackupController', function ($rootScope, $scope, $rout
return;
}
if (encryptionEnabled) {
if ($scope.PassphraseScore === '') {
DialogService.dialog(gettextCatalog.getString('Missing passphrase'), gettextCatalog.getString('You must enter a passphrase or disable encryption'));
@@ -487,6 +486,13 @@ backupApp.controller('EditBackupController', function ($rootScope, $scope, $rout
var filters = $scope.Backup.Filters;
$scope.Backup.Filters = [];
// If Description is anything other than a string, we are either creating a new
// backup or something went wrong when retrieving an existing one
// Either way we should set it to an empty string
if (typeof $scope.Backup.Description !== 'string') {
$scope.Backup.Description = '';
}
$scope.Backup.Sources = $scope.Backup.Sources || [];
for(var ix in filters)
@@ -40,7 +40,7 @@
<input type="text" name="name" id="name" ng-model="Backup.Name" placeholder="{{'My Photos' | translate}}" />
</div>
<div class="input textarea">
<label for="description" translate>Description</label>
<label for="description" translate>Description (optional)</label>
<textarea name="description" id="description" ng-model="Backup.Description"></textarea>
</div>
<div class="input select" ng-hide="SystemInfo.EncryptionModules.length == 0">
@@ -13,10 +13,12 @@
</a>
<dl class="taskmenu" ng-show="$parent.TaskMenuID == item.Backup.ID">
<dt translate>Description:</dt>
<dd>
{{item.Backup.Description}}
</dd>
<span ng-show="item.Backup.Description">
<dt translate>Description:</dt>
<dd>
{{item.Backup.Description}}
</dd>
</span>
<dt translate>Operations:</dt>
<dd>