Skip to content

Commit

Permalink
chore(deps): update nuget non-major dependencies (#13286)
Browse files Browse the repository at this point in the history
* chore(deps): update nuget non-major dependencies

* Fix errors

* Cleanup imports

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Queyrichon <[email protected]>
  • Loading branch information
renovate[bot] and mlqn authored Aug 10, 2024
1 parent 6f23e3e commit 42b6beb
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 21 deletions.
12 changes: 6 additions & 6 deletions backend/packagegroups/NuGet.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

<ItemGroup Label="Altinn specific packages">
<PackageReference Update="Altinn.App.Core" Version="8.0.0-rc1" />
<PackageReference Update="Altinn.Common.AccessToken" Version="4.4.4" />
<PackageReference Update="Altinn.Common.AccessTokenClient" Version="3.0.5" />
<PackageReference Update="Altinn.Common.AccessToken" Version="4.5.0" />
<PackageReference Update="Altinn.Common.AccessTokenClient" Version="3.0.6" />
<PackageReference Update="Altinn.Platform.Storage.Interface" Version="3.30.0" />
</ItemGroup>

Expand All @@ -24,20 +24,20 @@
<PackageReference Update="Microsoft.Azure.Security.KeyVault.Secrets" Version="4.5.0" />
<PackageReference Update="Microsoft.Azure.Services.AppAuthentication" Version="1.6.2" />
<PackageReference Update="Microsoft.Extensions.Configuration.AzureKeyVault" Version="3.1.24" />
<PackageReference Update="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="8.0.6" />
<PackageReference Update="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="8.0.7" />
<PackageReference Update="Microsoft.VisualStudio.Web.BrowserLink" Version="2.2.0" />
<PackageReference Update="HtmlAgilityPack" Version="1.11.61" />
<PackageReference Update="HtmlAgilityPack" Version="1.11.62" />
<PackageReference Update="Microsoft.DiaSymReader.Native" Version="1.7.0" />
<PackageReference Update="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.4" />
<PackageReference Update="Microsoft.EntityFrameworkCore.Tools" Version="8.0.7" />
<PackageReference Update="Microsoft.FeatureManagement.AspNetCore" Version="3.5.0" />
<PackageReference Update="Scrutor" Version="4.2.2" />
<PackageReference Update="Swashbuckle.AspNetCore" Version="6.6.2" />
<PackageReference Update="Swashbuckle.AspNetCore" Version="6.7.0" />
<PackageReference Update="Polly" Version="8.4.1" />
<PackageReference Update="Altinn.Authorization.ABAC" Version="0.0.8" />
<PackageReference Update="Altinn.ApiClients.Maskinporten" Version="9.1.0" />
<PackageReference Update="MediatR" Version="12.4.0" />
<PackageReference Update="DotNetEnv" Version="3.0.0" />
<PackageReference Update="DotNetEnv" Version="3.1.0" />
<PackageReference Update="NuGet.Versioning" Version="6.10.1" />
</ItemGroup>

Expand Down
3 changes: 1 addition & 2 deletions backend/src/Designer/Controllers/TextKeysController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.IdentityModel.Tokens;

namespace Altinn.Studio.Designer.Controllers
{
Expand Down Expand Up @@ -106,7 +105,7 @@ public async Task<ActionResult<KeyValuePair<string, string>>> Put(string org, st
}
catch (ArgumentException)
{
string errorMessage = !newKey.IsNullOrEmpty() && !oldKey.IsNullOrEmpty()
string errorMessage = !string.IsNullOrEmpty(newKey) && !string.IsNullOrEmpty(oldKey)
? $"It looks like the key, {newKey}, that you tried to insert already exists in one or more texts files."
: "The arguments sent to this request was illegal.";
return BadRequest(errorMessage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
using Altinn.Studio.Designer.Models.App;
using Altinn.Studio.Designer.TypedHttpClients.Exceptions;
using LibGit2Sharp;
using Microsoft.IdentityModel.Tokens;
using JsonSerializer = System.Text.Json.JsonSerializer;
using LayoutSets = Altinn.Studio.Designer.Models.LayoutSets;

Expand Down Expand Up @@ -845,7 +844,7 @@ private static string GetPathToImage(string imageFilePath)

private static string GetPathToJsonTextsFile(string fileName)
{
return fileName.IsNullOrEmpty() ?
return string.IsNullOrEmpty(fileName) ?
Path.Combine(ConfigFolderPath, LanguageResourceFolderName) :
Path.Combine(ConfigFolderPath, LanguageResourceFolderName, fileName);
}
Expand All @@ -859,23 +858,23 @@ private static string GetPathToMarkdownTextFile(string fileName)
private static string GetPathToLayoutSet(string layoutSetName, bool excludeLayoutsFolderName = false)
{
var layoutFolderName = excludeLayoutsFolderName ? string.Empty : LayoutsInSetFolderName;
return layoutSetName.IsNullOrEmpty() ?
return string.IsNullOrEmpty(layoutSetName) ?
Path.Combine(LayoutsFolderName, layoutFolderName) :
Path.Combine(LayoutsFolderName, layoutSetName, layoutFolderName);
}

// can be null if app does not use layout set
private static string GetPathToLayoutFile(string layoutSetName, string fileName)
{
return layoutSetName.IsNullOrEmpty() ?
return string.IsNullOrEmpty(layoutSetName) ?
Path.Combine(LayoutsFolderName, LayoutsInSetFolderName, fileName) :
Path.Combine(LayoutsFolderName, layoutSetName, LayoutsInSetFolderName, fileName);
}

// can be null if app does not use layout set
private static string GetPathToLayoutSettings(string layoutSetName)
{
return layoutSetName.IsNullOrEmpty() ?
return string.IsNullOrEmpty(layoutSetName) ?
Path.Combine(LayoutsFolderName, LayoutSettingsFilename) :
Path.Combine(LayoutsFolderName, layoutSetName, LayoutSettingsFilename);
}
Expand All @@ -892,14 +891,14 @@ private static string GetPathToFooterFile()

private static string GetPathToRuleHandler(string layoutSetName)
{
return layoutSetName.IsNullOrEmpty() ?
return string.IsNullOrEmpty(layoutSetName) ?
Path.Combine(LayoutsFolderName, RuleHandlerFilename) :
Path.Combine(LayoutsFolderName, layoutSetName, RuleHandlerFilename);
}

private static string GetPathToRuleConfiguration(string layoutSetName)
{
return layoutSetName.IsNullOrEmpty() ?
return string.IsNullOrEmpty(layoutSetName) ?
Path.Combine(LayoutsFolderName, RuleConfigurationFilename) :
Path.Combine(LayoutsFolderName, layoutSetName, RuleConfigurationFilename);
}
Expand Down
11 changes: 5 additions & 6 deletions backend/src/Designer/Services/Implementation/TextsService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
using Altinn.Studio.Designer.Infrastructure.GitRepository;
using Altinn.Studio.Designer.Models;
using Altinn.Studio.Designer.Services.Interfaces;
using Microsoft.IdentityModel.Tokens;

namespace Altinn.Studio.Designer.Services.Implementation
{
Expand Down Expand Up @@ -116,7 +115,7 @@ public async Task<Dictionary<string, string>> GetTextsV2(string org, string repo
/// <inheritdoc />
public async Task<List<string>> GetKeys(string org, string repo, string developer, IList<string> languages)
{
if (languages.IsNullOrEmpty())
if (languages == null || languages.Count == 0)
{
throw new FileNotFoundException();
}
Expand Down Expand Up @@ -237,7 +236,7 @@ public async Task UpdateTextsForKeys(string org, string repo, string developer,
/// <inheritdoc />
public async Task<string> UpdateKey(string org, string repo, string developer, IList<string> languages, string oldKey, string newKey)
{
if (languages.IsNullOrEmpty())
if (languages == null || languages.Count == 0)
{
throw new FileNotFoundException();
}
Expand All @@ -252,12 +251,12 @@ public async Task<string> UpdateKey(string org, string repo, string developer, I
{
Dictionary<string, string> jsonTexts = await altinnAppGitRepository.GetTextsV2(languageCode);
oldKeyExistsOriginally = jsonTexts.ContainsKey(oldKey) || oldKeyExistsOriginally;
if (!newKey.IsNullOrEmpty() && jsonTexts.ContainsKey(newKey) && jsonTexts.ContainsKey(oldKey))
if (!string.IsNullOrEmpty(newKey) && jsonTexts.ContainsKey(newKey) && jsonTexts.ContainsKey(oldKey))
{
throw new ArgumentException();
}

if (!newKey.IsNullOrEmpty() && jsonTexts.ContainsKey(oldKey))
if (!string.IsNullOrEmpty(newKey) && jsonTexts.ContainsKey(oldKey))
{
string value = jsonTexts[oldKey];
jsonTexts[newKey] = value;
Expand All @@ -267,7 +266,7 @@ public async Task<string> UpdateKey(string org, string repo, string developer, I
tempUpdatedTexts[languageCode] = jsonTexts;
}

response = newKey.IsNullOrEmpty() ? $"the key, {oldKey}, was deleted." : $"The old key, {oldKey}, have been replaced with the new key, {newKey}.";
response = string.IsNullOrEmpty(newKey) ? $"the key, {oldKey}, was deleted." : $"The old key, {oldKey}, have been replaced with the new key, {newKey}.";

if (!oldKeyExistsOriginally)
{
Expand Down

0 comments on commit 42b6beb

Please sign in to comment.