Skip to content
This repository has been archived by the owner on Jul 26, 2021. It is now read-only.

Editor on .NET Core. #13

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Editor on .NET Core. #13

wants to merge 3 commits into from

Conversation

kegor
Copy link
Contributor

@kegor kegor commented Mar 13, 2020

Please, do not merge this PR yet.

Problem:
We would like to have implementation for the Editor app on .NET Core.

Solution:

  • Solution on .NET Core was implemented.
  • It was additionally improved for possibility to run on Ubuntu (Linux).

Screenshots:

Take a look

How it works on Ubuntu right after re-clone and click RUN in VS Code:

image

general_case_on_ubuntu_1

@bobkovalex
Copy link
Contributor

Codacy Here is an overview of what got changed by this pull request:

Issues
======
- Added 12
           

Complexity increasing per file
==============================
- GroupDocs.Editor.MVC/Products/Common/Config/CommonConfiguration.cs  1
- GroupDocs.Editor.MVC/Program.cs  1
- GroupDocs.Editor.MVC/Products/Common/Config/GlobalConfiguration.cs  1
- GroupDocs.Editor.MVC/Products/Common/Config/ApplicationConfiguration.cs  5
- GroupDocs.Editor.MVC/Products/Editor/Config/EditorConfiguration.cs  4
- GroupDocs.Editor.MVC/Products/Common/Entity/Web/FileDescriptionEntity.cs  1
- GroupDocs.Editor.MVC/Products/Common/Util/Parser/YamlParser.cs  2
- GroupDocs.Editor.MVC/Products/Common/Config/ServerConfiguration.cs  1
- GroupDocs.Editor.MVC/Startup.cs  2
- GroupDocs.Editor.MVC/Controllers/EditorController.cs  1
- GroupDocs.Editor.MVC/AppDomainGenerator/DomainGenerator.cs  1
- GroupDocs.Editor.MVC/Products/Editor/Controllers/EditorApiController.cs  19
         

Clones added
============
- GroupDocs.Editor.MVC/Products/Common/Config/ApplicationConfiguration.cs  1
- GroupDocs.Editor.MVC/Products/Editor/Config/EditorConfiguration.cs  1
         

See the complete overview on Codacy

}

// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


namespace GroupDocs.Editor.MVC
{
public class Program
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -10,7 +10,8 @@ namespace GroupDocs.Editor.MVC.Products.Common.Util.Parser
{
public class YamlParser
{
private static string YamlPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "configuration.yml");
private static string appRoot = AppContext.BaseDirectory.Substring(0, AppContext.BaseDirectory.LastIndexOf("bin"));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return format;
}

private dynamic GetSaveOptions(string saveFilePath)
private ILoadOptions GetLoadOptions(string guid)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

string license = valuesGetter.GetStringPropertyValue("licensePath");
if (String.IsNullOrEmpty(license))
string licPath = valuesGetter.GetStringPropertyValue("licensePath");
var appRoot = AppContext.BaseDirectory.Substring(0, AppContext.BaseDirectory.LastIndexOf("bin"));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{
Mock<IConfigurationSection> mockServerConfSection;
Mock<IConfigurationSection> mockCommonConfSection;
Mock<IConfiguration> mockConfig;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

public IConfiguration Configuration { get; }

// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -37,7 +38,9 @@ public EditorConfiguration()
filesDirectory = valuesGetter.GetStringPropertyValue("filesDirectory", filesDirectory);
if (!IsFullPath(filesDirectory))
{
filesDirectory = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, filesDirectory);
// TODO: check for more cross-platform solution
var appRoot = AppContext.BaseDirectory.Substring(0, AppContext.BaseDirectory.LastIndexOf("bin"));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


public class EditorControllerTest
{
Mock<IConfigurationSection> mockServerConfSection;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

public class EditorControllerTest
{
Mock<IConfigurationSection> mockServerConfSection;
Mock<IConfigurationSection> mockCommonConfSection;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return options;
}

private ISaveOptions GetSaveOptions(string saveFilePath)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return options;
}

private static List<string> PrepareFormats()
private IEditOptions GetEditOptions(string guid)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants