Skip to content

Commit eb603aa

Browse files
authored
Merge branch 'develop' into deepsource-autofix-ad5425d4
2 parents d686825 + 8da59b3 commit eb603aa

File tree

79 files changed

+2257
-2261
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+2257
-2261
lines changed

plugins/OnlineSales.Plugin.EmailSync/Controllers/ImapAccountsController.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public ImapAccountsController(EmailSyncDbContext dbContext, IMapper mapper)
3131
[SwaggerOperation(Tags = new[] { "Users" })]
3232
[HttpGet("{userId}/imap-accounts/{id}")]
3333
[ProducesResponseType(StatusCodes.Status200OK)]
34-
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
34+
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
3535
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]
3636
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status500InternalServerError)]
3737
public async Task<ActionResult<ImapAccountDetailsDto>> GetAccountForUser(string userId, int id)
@@ -115,4 +115,4 @@ private async Task<ImapAccount> FindOrThrowNotFound(string userId, int id)
115115

116116
return result;
117117
}
118-
}
118+
}

plugins/OnlineSales.Plugin.EmailSync/DTOs/ImapAccountDtos.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public class ImapAccountUpdateDto
3333

3434
public string? UserName { get; set; }
3535

36-
public string? Password { get; set; }
36+
public string? Password { get; set; }
3737

3838
public int? Port { get; set; }
3939

@@ -47,4 +47,4 @@ public class ImapAccountDetailsDto : ImapAccountBaseDto
4747
public DateTime CreatedAt { get; set; }
4848

4949
public DateTime? UpdatedAt { get; set; }
50-
}
50+
}

plugins/OnlineSales.Plugin.EmailSync/Tasks/EmailSyncTask.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public EmailSyncTask(IConfiguration configuration, EmailSyncDbContext dbContext,
4040
this.domainService = domainService;
4141
this.contactsService = contactsService;
4242

43-
var config = configuration.GetSection(configKey)!.Get<TaskWithBatchConfig>();
43+
var config = configuration.GetSection(configKey)!.Get<TaskWithBatchConfig>();
4444
if (config is not null)
4545
{
4646
batchSize = config.BatchSize;
@@ -57,7 +57,7 @@ public EmailSyncTask(IConfiguration configuration, EmailSyncDbContext dbContext,
5757
ignoredEmails = (ignored != null) ? ignored : new string[0];
5858

5959
domainService.SetDBContext(dbContext);
60-
contactsService.SetDBContext(dbContext);
60+
contactsService.SetDBContext(dbContext);
6161
}
6262

6363
public override async Task<bool> Execute(TaskExecutionLog currentJob)
@@ -95,7 +95,7 @@ public override async Task<bool> Execute(TaskExecutionLog currentJob)
9595
}
9696
}
9797

98-
return true;
98+
return true;
9999
}
100100

101101
private async Task DeleteUnexistedFolders(List<ImapAccountFolder> imapAccountFolders, IList<IMailFolder> folders)
@@ -201,7 +201,7 @@ private async Task GetEmailLogs(string userName, ImapAccountFolder dbFolder, IMa
201201

202202
emailLogs.Add(emailLog);
203203
}
204-
}
204+
}
205205
}
206206
}
207207

@@ -273,5 +273,4 @@ private bool IsInternalEmails(string fromEmail, List<string> toEmails)
273273
return IsInternalDomain(fromEmail) && toEmails.TrueForAll(email => IsInternalDomain(email));
274274
}
275275
}
276-
}
277-
276+
}

plugins/OnlineSales.Plugin.SendGrid/Controllers/SendgridController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public SendgridController(SendgridDbContext dbContext, IContactService contactSe
3636
this.contactService.SetDBContext(this.dbContext);
3737
}
3838

39-
[HttpPost]
39+
[HttpPost]
4040
[Route("import")]
4141
[Authorize(Roles = "Admin")]
4242
[ProducesResponseType(StatusCodes.Status200OK)]

plugins/OnlineSales.Plugin.SendGrid/SendGridPlugin.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
// Licensed under the MIT license. See LICENSE file in the samples root for full license information.
33
// </copyright>
44

5-
using Microsoft.Extensions.Configuration;
5+
using Microsoft.Extensions.Configuration;
66
using Microsoft.Extensions.DependencyInjection;
7-
using OnlineSales.Data;
7+
using OnlineSales.Data;
88
using OnlineSales.Interfaces;
99
using OnlineSales.Plugin.SendGrid.Configuration;
1010
using OnlineSales.Plugin.SendGrid.Data;
1111
using OnlineSales.Plugin.SendGrid.Tasks;
12-
using OnlineSales.SendGrid.Tasks;
13-
12+
using OnlineSales.SendGrid.Tasks;
13+
1414
namespace OnlineSales.Plugin.SendGrid;
1515

1616
public class SendGridPlugin : IPlugin
@@ -24,12 +24,12 @@ public void ConfigureServices(IServiceCollection services, IConfiguration config
2424
if (pluginConfig != null)
2525
{
2626
Configuration = pluginConfig;
27-
}
28-
27+
}
28+
2929
services.AddScoped<PluginDbContextBase, SendgridDbContext>();
30-
services.AddScoped<SendgridDbContext, SendgridDbContext>();
31-
32-
services.AddScoped<ITask, SyncSuppressionsTask>();
33-
services.AddScoped<ITask, SyncActivityLogTask>();
30+
services.AddScoped<SendgridDbContext, SendgridDbContext>();
31+
32+
services.AddScoped<ITask, SyncSuppressionsTask>();
33+
services.AddScoped<ITask, SyncActivityLogTask>();
3434
}
3535
}

plugins/OnlineSales.Plugin.Sms/Controllers/MessagesController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Licensed under the MIT license. See LICENSE file in the samples root for full license information.
33
// </copyright>
44

5-
using Microsoft.AspNetCore.Authorization;
5+
using Microsoft.AspNetCore.Authorization;
66
using Microsoft.AspNetCore.Http;
77
using Microsoft.AspNetCore.Mvc;
88
using OnlineSales.Exceptions;

plugins/OnlineSales.Plugin.Sms/Services/SmsService.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Licensed under the MIT license. See LICENSE file in the samples root for full license information.
33
// </copyright>
44

5-
using Microsoft.Extensions.Configuration;
5+
using Microsoft.Extensions.Configuration;
66
using OnlineSales.Plugin.Sms.Configuration;
77
using OnlineSales.Plugin.Sms.Exceptions;
88

@@ -36,14 +36,14 @@ public Task SendAsync(string recipient, string message)
3636
return smsService.SendAsync(recipient, message);
3737
}
3838

39-
public string GetSender(string recipient)
40-
{
41-
var smsService = GetSmsService(recipient);
39+
public string GetSender(string recipient)
40+
{
41+
var smsService = GetSmsService(recipient);
4242

4343
return smsService != null ? smsService.GetSender(recipient) : string.Empty;
4444
}
4545

46-
private ISmsService? GetSmsService(string recipient)
46+
private ISmsService? GetSmsService(string recipient)
4747
{
4848
var key = countrySmsServices.Keys.FirstOrDefault(key => recipient.StartsWith(key));
4949

@@ -57,7 +57,7 @@ public string GetSender(string recipient)
5757
return smsService;
5858
}
5959

60-
return null;
60+
return null;
6161
}
6262

6363
private void InitGateways()
@@ -78,7 +78,7 @@ private void InitGateways()
7878
break;
7979
case "NotifyLk":
8080
gatewayService = new NotifyLkService(pluginSettings.SmsGateways.NotifyLk);
81-
break;
81+
break;
8282
case "Getshoutout":
8383
gatewayService = new GetshoutoutService(pluginSettings.SmsGateways.Getshoutout);
8484
break;
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
// <copyright file="SmsPlugin.cs" company="WavePoint Co. Ltd.">
22
// Licensed under the MIT license. See LICENSE file in the samples root for full license information.
33
// </copyright>
4-
4+
55
using Microsoft.Extensions.Configuration;
66
using Microsoft.Extensions.DependencyInjection;
7-
using OnlineSales.Data;
7+
using OnlineSales.Data;
88
using OnlineSales.Plugin.Sms.Configuration;
9-
using OnlineSales.Plugin.Sms.Data;
10-
using OnlineSales.Plugin.Sms.Services;
11-
using OnlineSales.Plugin.Sms.Tasks;
12-
9+
using OnlineSales.Plugin.Sms.Data;
10+
using OnlineSales.Plugin.Sms.Services;
11+
using OnlineSales.Plugin.Sms.Tasks;
12+
1313
namespace OnlineSales.Plugin.Sms;
1414

1515
public class SmsPlugin : IPlugin
@@ -27,9 +27,9 @@ public void ConfigureServices(IServiceCollection services, IConfiguration config
2727

2828
services.AddScoped<PluginDbContextBase, SmsDbContext>();
2929
services.AddScoped<SmsDbContext, SmsDbContext>();
30-
31-
services.AddSingleton<ISmsService, SmsService>();
32-
33-
services.AddScoped<ITask, SyncSmsLogTask>();
34-
}
30+
31+
services.AddSingleton<ISmsService, SmsService>();
32+
33+
services.AddScoped<ITask, SyncSmsLogTask>();
34+
}
3535
}

plugins/OnlineSales.Plugin.TestPlugin/Data/TestPluginDbContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,6 @@ private string FindMigration(string name)
6969
throw new TestDbContextException($"Cannot find migration with name containig '{name}'");
7070
}
7171

72-
return migration;
72+
return migration;
7373
}
7474
}

plugins/OnlineSales.Plugin.Vsto/VstoPlugin.cs

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
// Licensed under the MIT license. See LICENSE file in the samples root for full license information.
33
// </copyright>
44

5-
using Microsoft.AspNetCore.Builder;
6-
using Microsoft.AspNetCore.Http;
7-
using Microsoft.Extensions.Configuration;
5+
using Microsoft.AspNetCore.Builder;
6+
using Microsoft.AspNetCore.Http;
7+
using Microsoft.Extensions.Configuration;
88
using Microsoft.Extensions.DependencyInjection;
9-
using Microsoft.Net.Http.Headers;
9+
using Microsoft.Net.Http.Headers;
1010
using OnlineSales.Data;
1111
using OnlineSales.Plugin.Vsto.Configuration;
1212
using OnlineSales.Plugin.Vsto.Data;
@@ -30,41 +30,41 @@ public void ConfigureServices(IServiceCollection services, IConfiguration config
3030
if (pluginConfig != null)
3131
{
3232
Configuration = pluginConfig;
33-
}
34-
35-
var assemblyPath = typeof(VstoDbContext).Assembly.Location;
36-
var pluginDirectory = Path.GetDirectoryName(assemblyPath);
37-
38-
VstoLocalPath = Path.Combine(pluginDirectory!, Configuration.Vsto.LocalPath);
39-
33+
}
34+
35+
var assemblyPath = typeof(VstoDbContext).Assembly.Location;
36+
var pluginDirectory = Path.GetDirectoryName(assemblyPath);
37+
38+
VstoLocalPath = Path.Combine(pluginDirectory!, Configuration.Vsto.LocalPath);
39+
4040
services.AddScoped<PluginDbContextBase, VstoDbContext>();
4141
services.AddSingleton<IVariablesProvider, VstoVariablesProvider>();
4242

4343
this.services = services;
4444
}
4545

4646
public void ConfigureApplication(IApplicationBuilder application)
47-
{
48-
var httpContextHelper = application.ApplicationServices.GetRequiredService<IHttpContextHelper>();
49-
47+
{
48+
var httpContextHelper = application.ApplicationServices.GetRequiredService<IHttpContextHelper>();
49+
5050
application.UseStaticFiles(new StaticFileOptions
5151
{
5252
RequestPath = Configuration.Vsto.RequestPath,
5353
FileProvider = new VstoFileProvider(VstoLocalPath, httpContextHelper, services!),
5454
ServeUnknownFileTypes = true,
55-
OnPrepareResponse = (context) =>
56-
{
57-
var headers = context.Context.Response.GetTypedHeaders();
58-
headers.CacheControl = new CacheControlHeaderValue
59-
{
60-
Public = true,
61-
NoCache = true,
62-
NoStore = true,
63-
};
55+
OnPrepareResponse = (context) =>
56+
{
57+
var headers = context.Context.Response.GetTypedHeaders();
58+
headers.CacheControl = new CacheControlHeaderValue
59+
{
60+
Public = true,
61+
NoCache = true,
62+
NoStore = true,
63+
};
6464
},
65-
});
66-
67-
localLinksWatcher = new VstoLocalLinksWatcher(VstoLocalPath, Configuration.Vsto.RequestPath, services!);
65+
});
66+
67+
localLinksWatcher = new VstoLocalLinksWatcher(VstoLocalPath, Configuration.Vsto.RequestPath, services!);
6868
}
6969

7070
public void Dispose()

0 commit comments

Comments
 (0)