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

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.

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.

}

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.

{
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.

}

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.

4 participants