Skip to content

Commit

Permalink
v24.9 (#60)
Browse files Browse the repository at this point in the history
* Updated GroupDocs.Viewer for .NET to 24.9 + Fixes.
* Fixed references to Azure and S3 SDKs.
  • Loading branch information
vladimir-litvinchik authored Sep 30, 2024
1 parent 023dede commit 0f974f8
Show file tree
Hide file tree
Showing 15 changed files with 199 additions and 137 deletions.
31 changes: 15 additions & 16 deletions build/dependencies.props
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@
</PropertyGroup>

<PropertyGroup Label="Package Versions">
<GroupDocsViewer>24.8.0</GroupDocsViewer>
<GroupDocsViewer>24.9.0</GroupDocsViewer>

<MicrosoftExtensionsHttp>6.0.0</MicrosoftExtensionsHttp>
<MicrosoftAspNetCoreMvcCore>2.2.5</MicrosoftAspNetCoreMvcCore>
<MicrosoftExtensionsDependencyInjectionAbstractions>6.0.0</MicrosoftExtensionsDependencyInjectionAbstractions>
<MicrosoftExtensionsConfiguration>6.0.1</MicrosoftExtensionsConfiguration>
<MicrosoftExtensionsConfigurationBinder>6.0.0</MicrosoftExtensionsConfigurationBinder>
Expand All @@ -28,25 +27,25 @@
<NewtonsoftJson>13.0.3</NewtonsoftJson>
<SystemTextJson>6.0.5</SystemTextJson>

<AzureBlobs>12.14.1</AzureBlobs>
<AwsSdkS3>3.7.9.4</AwsSdkS3>
<AzureBlobs>12.22.1</AzureBlobs>
<AwsSdkS3>3.7.403.5</AwsSdkS3>

<MicrosoftSourceLinkGithub>1.1.1</MicrosoftSourceLinkGithub>
</PropertyGroup>

<PropertyGroup Label="GroupDocs.Viewer UI Package Versions">
<GroupDocsViewerUI>6.0.26</GroupDocsViewerUI>
<GroupDocsViewerUIApi>6.0.9</GroupDocsViewerUIApi>
<GroupDocsViewerUIApiLocalCache>6.0.3</GroupDocsViewerUIApiLocalCache>
<GroupDocsViewerUIApiInMemoryCache>6.0.3</GroupDocsViewerUIApiInMemoryCache>
<GroupDocsViewerUIApiLocalStorage>6.0.3</GroupDocsViewerUIApiLocalStorage>
<GroupDocsViewerUIApiCloudStorage>6.0.4</GroupDocsViewerUIApiCloudStorage>
<GroupDocsViewerUIApiAzureStorage>6.0.3</GroupDocsViewerUIApiAzureStorage>
<GroupDocsViewerUIApiAwsS3Storage>6.0.3</GroupDocsViewerUIApiAwsS3Storage>
<GroupDocsViewerUICore>6.0.5</GroupDocsViewerUICore>
<GroupDocsViewerUISelfHostApi>6.0.29</GroupDocsViewerUISelfHostApi>
<GroupDocsViewerUISelfHostApiCrossPlatform>6.0.4</GroupDocsViewerUISelfHostApiCrossPlatform>
<GroupDocsViewerUICloudApi>6.0.8</GroupDocsViewerUICloudApi>
<GroupDocsViewerUI>6.0.27</GroupDocsViewerUI>
<GroupDocsViewerUIApi>6.0.10</GroupDocsViewerUIApi>
<GroupDocsViewerUIApiLocalCache>6.0.4</GroupDocsViewerUIApiLocalCache>
<GroupDocsViewerUIApiInMemoryCache>6.0.4</GroupDocsViewerUIApiInMemoryCache>
<GroupDocsViewerUIApiLocalStorage>6.0.4</GroupDocsViewerUIApiLocalStorage>
<GroupDocsViewerUIApiCloudStorage>6.0.5</GroupDocsViewerUIApiCloudStorage>
<GroupDocsViewerUIApiAzureStorage>6.0.4</GroupDocsViewerUIApiAzureStorage>
<GroupDocsViewerUIApiAwsS3Storage>6.0.4</GroupDocsViewerUIApiAwsS3Storage>
<GroupDocsViewerUICore>6.0.6</GroupDocsViewerUICore>
<GroupDocsViewerUISelfHostApi>6.0.30</GroupDocsViewerUISelfHostApi>
<GroupDocsViewerUISelfHostApiCrossPlatform>6.0.5</GroupDocsViewerUISelfHostApiCrossPlatform>
<GroupDocsViewerUICloudApi>6.0.9</GroupDocsViewerUICloudApi>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public IActionResult LoadConfig()
Browse = _config.IsBrowse,
Rewrite = _config.Rewrite,
EnableRightClick = _config.IsEnableRightClick,
PreventLinkClick = _config.IsPreventLinkClick,
DefaultDocument = _config.DefaultDocument,
PreloadPageCount = _config.PreloadPageCount,
Zoom = _config.IsZoom,
Expand Down
6 changes: 6 additions & 0 deletions src/GroupDocs.Viewer.UI.API/Models/LoadConfigResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ public class LoadConfigResponse
[JsonPropertyName("enableRightClick")]
public bool EnableRightClick { get; set; }

/// <summary>
/// When enabled prevents links to be clicked.
/// </summary>
[JsonPropertyName("preventLinkClick")]
public bool PreventLinkClick { get; set; }

/// <summary>
/// The default document to view.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@

<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="$(MicrosoftAspNetCoreMvcCore)" />
<PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJson)" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="$(MicrosoftAspNetCoreMvcCore)" />
<FrameworkReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJson)" />
</ItemGroup>

<ItemGroup>
Expand Down
14 changes: 14 additions & 0 deletions src/GroupDocs.Viewer.UI.Core/Configuration/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public class Config
internal bool IsSearch { get; set; } = true;
internal bool IsShowToolBar { get; set; } = true;
internal bool IsEnableRightClick { get; set; } = true;
internal bool IsPreventLinkClick { get; set; } = false;
//Client-side and server-side config
internal bool IsDownload { get; set; } = true;
internal bool IsUpload { get; set; } = true;
Expand Down Expand Up @@ -307,5 +308,18 @@ public Config SetSupportedLanguages(params Language[] languages)
SupportedLanguages = languages.Select(l => l.Code).ToArray();
return this;
}

/// <summary>
/// Configures the UI to prevent link clicks.
/// By default, link clicks are allowed <c>preventLinkClick</c> setting is set to <c>false</c>.
/// This method sets the <c>preventLinkClick</c> to <c>true</c>
/// and returns the updated configuration object.
/// </summary>
/// <returns>Returns the current configuration object with link click prevention enabled.</returns>
public Config PreventLinkClick()
{
IsPreventLinkClick = true;
return this;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

<ItemGroup>
<PackageReference Include="GroupDocs.Viewer.CrossPlatform" Version="$(GroupDocsViewer)" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="$(MicrosoftAspNetCoreMvcCore)" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,47 @@ namespace GroupDocs.Viewer.UI.SelfHost.Api.Configuration
public class Config
{
internal string LicensePath = string.Empty;

internal ViewerType ViewerType = ViewerType.HtmlWithEmbeddedResources;
internal readonly HtmlViewOptions HtmlViewOptions = HtmlViewOptions.ForEmbeddedResources();
internal readonly PngViewOptions PngViewOptions = new PngViewOptions();
internal readonly JpgViewOptions JpgViewOptions = new JpgViewOptions();
internal readonly PdfViewOptions PdfViewOptions = new PdfViewOptions();

internal readonly SpreadsheetOptions SpreadsheetOptions = CreateSpreadsheetOptions();

internal readonly HtmlViewOptions HtmlViewOptions = CreateHtmlViewOptions();

internal readonly PngViewOptions PngViewOptions = new PngViewOptions
{
SpreadsheetOptions = CreateSpreadsheetOptions()
};

internal readonly JpgViewOptions JpgViewOptions = new JpgViewOptions
{
SpreadsheetOptions = CreateSpreadsheetOptions()
};

internal readonly PdfViewOptions PdfViewOptions = new PdfViewOptions
{
SpreadsheetOptions = CreateSpreadsheetOptions()
};

internal readonly InternalCacheOptions InternalCacheOptions = InternalCacheOptions.CacheForFiveMinutes;

private static SpreadsheetOptions CreateSpreadsheetOptions()
{
SpreadsheetOptions spreadsheetOptions = SpreadsheetOptions.ForOnePagePerSheet();
spreadsheetOptions.RenderGridLines = true;
spreadsheetOptions.RenderHeadings = true;

return spreadsheetOptions;
}

private static HtmlViewOptions CreateHtmlViewOptions()
{
HtmlViewOptions htmlViewOptions = HtmlViewOptions.ForEmbeddedResources();
htmlViewOptions.SpreadsheetOptions = CreateSpreadsheetOptions();

return htmlViewOptions;
}

public Config SetLicensePath(string licensePath)
{
LicensePath = licensePath;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,17 @@ private static void CopyBaseViewOptions(this BaseViewOptions dst, BaseViewOption
dst.CadOptions = src.CadOptions;
dst.EmailOptions = src.EmailOptions;
dst.OutlookOptions = src.OutlookOptions;
dst.MailStorageOptions = src.MailStorageOptions;
dst.PdfOptions = src.PdfOptions;
#if !CROSS_PLATFORM
dst.ProjectManagementOptions = src.ProjectManagementOptions;
#endif
dst.SpreadsheetOptions = src.SpreadsheetOptions;
dst.WordProcessingOptions = src.WordProcessingOptions;
dst.VisioRenderingOptions = src.VisioRenderingOptions;
dst.TextOptions = src.TextOptions;
dst.PresentationOptions = src.PresentationOptions;
dst.WebDocumentOptions = src.WebDocumentOptions;
}

private static void CopyHtmlViewOptions(this HtmlViewOptions dst, HtmlViewOptions src)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
</ItemGroup>

<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="GroupDocs.Viewer" Version="$(GroupDocsViewer)" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="$(MicrosoftAspNetCoreMvcCore)" />
</ItemGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/GroupDocs.Viewer.UI/Middleware/UISettingsMiddleware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ private static dynamic GetUIOutputSettings()
Browse = Config.IsBrowse,
Rewrite = Config.Rewrite,
EnableRightClick = Config.IsEnableRightClick,
PreventLinkClick = Config.IsPreventLinkClick,
DefaultDocument = Config.DefaultDocument,
PreloadPageCount = Config.PreloadPageCount,
Zoom = Config.IsZoom,
Expand Down
Loading

0 comments on commit 0f974f8

Please sign in to comment.