Skip to content

Commit

Permalink
Merge pull request #5752 from abpframework/issue/5751
Browse files Browse the repository at this point in the history
Docs Module: Merge "Remove from cache" & "Delete from database" buttons
  • Loading branch information
maliming authored Oct 10, 2020
2 parents 799fdcd + 481da3b commit 4361f9c
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,5 @@ public interface IDocumentAdminAppService : IApplicationService
Task RemoveFromCacheAsync(Guid documentId);

Task ReindexAsync(Guid documentId);

Task DeleteFromDatabaseAsync(Guid documentId);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
"RemovedFromCache": "تم الحذف من ذاكرة التخزين",
"RemoveFromCacheConfirmation": "هل أنت متأكد من حذف هذا العنصر من ذاكرة التخزين؟",
"ReIndexDocumentConfirmation": "هل أنت متأكد من إعادة فهرسة هذا العنصر؟",
"DeleteDocumentFromDbConfirmation": "هل أنت متأكد من حذف هذا العنصر من قاعدة البيانات؟",
"DeleteFromDatabase": "حذف من قاعدة البيانات",
"Deleted": "محذوف",
"Search": "بحث",
Expand All @@ -57,4 +56,4 @@
"FileName": "اسم الملف",
"LastCachedTime": "وقت ذاكرة التخزين"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
"RemovedFromCache": "Odebráno z mezipaměti",
"RemoveFromCacheConfirmation": "Opravdu chcete tuto položku odebrat z mezipaměti?",
"ReIndexDocumentConfirmation": "Opravdu chcete tuto položku reindexovat?",
"DeleteDocumentFromDbConfirmation": "Opravdu chcete tuto položku odstranit z databáze?",
"DeleteFromDatabase": "Odstranit z databáze",
"Deleted": "Vymazáno",
"Search": "Vyhledávání",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
"RemovedFromCache": "Removed from cache",
"RemoveFromCacheConfirmation": "Are you sure you want to remove this item from cache?",
"ReIndexDocumentConfirmation": "Are you sure you want to reindex this item?",
"DeleteDocumentFromDbConfirmation": "Are you sure you want to delete this item from database?",
"DeleteFromDatabase": "Delete from database",
"Deleted": "Deleted",
"Search": "Search",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@
"RemovedFromCache": "Önbellekten kaldırıldı",
"RemoveFromCacheConfirmation": "Bu maddeyi önbellekten kaldırmak istediğiniz emin misiniz?",
"ReIndexDocumentConfirmation": "Bu maddeyi yeniden indekslemek istediğinize emin misiniz?",
"DeleteDocumentFromDbConfirmation": "Bu maddeyi veritabanından silmek istediğinize emin misiniz?",
"DeleteFromDatabase": "Veritabanından sil",
"Deleted": "Silindi"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,7 @@ public async Task RemoveFromCacheAsync(Guid documentId)
);

await _documentUpdateCache.RemoveAsync(documentUpdateInfoCacheKey);

document.LastCachedTime = DateTime.MinValue;

await _documentRepository.UpdateAsync(document);
await _documentRepository.DeleteAsync(document);
}

public async Task ReindexAsync(Guid documentId)
Expand All @@ -218,12 +215,6 @@ public async Task ReindexAsync(Guid documentId)
await _documentFullSearch.AddOrUpdateAsync(document);
}

public async Task DeleteFromDatabaseAsync(Guid documentId)
{
var document = await _documentRepository.GetAsync(documentId);
await _documentRepository.DeleteAsync(document);
}

private async Task UpdateDocumentUpdateInfoCache(Document document)
{
var cacheKey = $"DocumentUpdateInfo{document.ProjectId}#{document.Name}#{document.LanguageCode}#{document.Version}";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,5 @@ public async Task ReindexAsync(Guid documentId)
{
await _documentAdminAppService.ReindexAsync(documentId);
}

[HttpDelete]
[Route("DeleteDocumentFromDatabase")]
public async Task DeleteFromDatabaseAsync(Guid documentId)
{
await _documentAdminAppService.DeleteFromDatabaseAsync(documentId);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -80,26 +80,7 @@
dataTable.ajax.reload();
});
},
},
{
text: l('DeleteFromDatabase'),
visible: abp.auth.isGranted(
'Docs.Admin.Documents'
),
confirmMessage: function (data) {
return l(
'DeleteDocumentFromDbConfirmation'
);
},
action: function (data) {
service
.deleteFromDatabase(data.record.id)
.then(function () {
abp.message.success(l('Deleted'));
dataTable.ajax.reload();
});
},
},
}
],
},
},
Expand Down

0 comments on commit 4361f9c

Please sign in to comment.