Skip to content

Commit

Permalink
analizators/s2326
Browse files Browse the repository at this point in the history
  • Loading branch information
SuhorukovAnton committed Jan 21, 2022
1 parent d86085d commit 8d0324e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion common/ASC.Core.Common/EF/Context/DbContextManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public MultiRegionalDbContextManager(IOptionsFactory<MultiRegionalDbContext<T>>

public static class DbContextManagerExtension
{
public static DIHelper AddDbContextManagerService<T>(this DIHelper services) where T : BaseDbContext, new()
public static DIHelper AddDbContextManagerService(this DIHelper services)
{
//TODO
//services.TryAddScoped<MultiRegionalDbContextManager<T>>();
Expand Down
4 changes: 2 additions & 2 deletions products/ASC.Files/Core/Core/FileStorageService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1214,7 +1214,7 @@ public List<FileEntry> GetThirdPartyFolder(int folderType = 0)

var folders = providersInfo.Select(providerInfo =>
{
var folder = EntryManager.GetFakeThirdpartyFolder<T>(providerInfo);
var folder = EntryManager.GetFakeThirdpartyFolder(providerInfo);
folder.NewForMe = folder.RootFolderType == FolderType.COMMON ? 1 : 0;
return folder;
});
Expand Down Expand Up @@ -1309,7 +1309,7 @@ public object DeleteThirdParty(string providerId)
var curProviderId = Convert.ToInt32(providerId);
var providerInfo = providerDao.GetProviderInfo(curProviderId);

var folder = EntryManager.GetFakeThirdpartyFolder<T>(providerInfo);
var folder = EntryManager.GetFakeThirdpartyFolder(providerInfo);
ErrorIf(!FileSecurity.CanDelete(folder), FilesCommonResource.ErrorMassage_SecurityException_DeleteFolder);

if (providerInfo.RootFolderType == FolderType.COMMON)
Expand Down
6 changes: 3 additions & 3 deletions products/ASC.Files/Core/HttpHandlers/SearchHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public SearchResultItem[] Search(string text)
Additional = new Dictionary<string, object>
{
{ "Author", file.CreateByString.HtmlEncode() },
{ "Path", FolderPathBuilder<int>(EntryManager.GetBreadCrumbs(file.FolderID, folderDao)) },
{ "Path", FolderPathBuilder(EntryManager.GetBreadCrumbs(file.FolderID, folderDao)) },
{ "Size", FileSizeComment.FilesSizeToString(file.ContentLength) }
}
};
Expand All @@ -162,7 +162,7 @@ public SearchResultItem[] Search(string text)
Additional = new Dictionary<string, object>
{
{ "Author", folder.CreateByString.HtmlEncode() },
{ "Path", FolderPathBuilder<int>(EntryManager.GetBreadCrumbs(folder.ID, folderDao)) },
{ "Path", FolderPathBuilder(EntryManager.GetBreadCrumbs(folder.ID, folderDao)) },
{ "IsFolder", true }
}
};
Expand All @@ -172,7 +172,7 @@ public SearchResultItem[] Search(string text)
return list.ToArray();
}

private static string FolderPathBuilder<T>(IEnumerable<FileEntry> folders)
private static string FolderPathBuilder(IEnumerable<FileEntry> folders)
{
var titles = folders.Select(f => f.Title).ToList();
const string separator = " \\ ";
Expand Down
4 changes: 2 additions & 2 deletions products/ASC.Files/Core/Utils/EntryManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ public IEnumerable<Folder<string>> GetThirpartyFolders<T>(Folder<T> parent, stri

var providers = providerDao.GetProvidersInfo(parent.RootFolderType, searchText);
folderList = providers
.Select(providerInfo => GetFakeThirdpartyFolder<T>(providerInfo, parent.ID.ToString()))
.Select(providerInfo => GetFakeThirdpartyFolder(providerInfo, parent.ID.ToString()))
.Where(r => fileSecurity.CanRead(r)).ToList();

if (folderList.Count > 0)
Expand Down Expand Up @@ -829,7 +829,7 @@ public IEnumerable<FileEntry> SortEntries<T>(IEnumerable<FileEntry> entries, Ord
return result;
}

public Folder<string> GetFakeThirdpartyFolder<T>(IProviderInfo providerInfo, string parentFolderId = null)
public Folder<string> GetFakeThirdpartyFolder(IProviderInfo providerInfo, string parentFolderId = null)
{
//Fake folder. Don't send request to third party
var folder = ServiceProvider.GetService<Folder<string>>();
Expand Down

0 comments on commit 8d0324e

Please sign in to comment.