Skip to content

Commit

Permalink
clean ExceptionLogic
Browse files Browse the repository at this point in the history
  • Loading branch information
olmobrutall committed May 20, 2020
1 parent f748754 commit 0f01c7a
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions Signum.Engine/Basics/ExceptionLogic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,10 @@ static ExceptionEntity GetEntity(Exception ex)

entity.ExceptionType = ex.GetType().Name;

var agex = ex as AggregateException;
var exl = new List<Exception>();
if (agex != null)
foreach (var ex0 in agex.InnerExceptions)
{
exl.AddRange(ex0.Follow(e => e.InnerException));
}
else
exl.AddRange(ex.Follow(e => e.InnerException));
var exceptions = ex is AggregateException agex ?
agex.InnerExceptions.SelectMany(inner => inner.Follow(e => e.InnerException)).ToList() :
ex.Follow(e => e.InnerException).ToList();

var exceptions = exl.Distinct();
string messages = exceptions.ToString(e => e.Message, "\r\n\r\n");
string stacktraces = exceptions.ToString(e => e.StackTrace, "\r\n\r\n");

Expand Down

2 comments on commit 0f01c7a

@olmobrutall
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

From react-rte to draft-js-plugins

HtmlEditor is a WYSIWYG html editor currently only used by WorkflowActivityModel, but meant to be used by any application that requires rich text somewhere.

Till now it was using react-rte https://github.com/sstur/react-rte but the project looks not actively maintained and, even if based on draft-js, not so easy to customize.

I've then decided to switch to draft-js-plugins-editor https://www.draft-js-plugins.com/, a very basic editor with a plugin architecture and (partial) TS definitions.

This plugin architecture should make it easier to allows custom applications to include images, videos, or custom hashtags or user mentions, all features that require a high integration with the application.

If you want to understand more about why draft-js is a better architecture to create rich text editors and how it works under the hoods, here is a nice video: https://www.youtube.com/watch?v=vOZAO3jFSHI

How to update

If you are not using WorkflowClient in your MainAdmin.tsx, just yarn install in Signum.React.Extensions should be enough to get rid of the missing draft-js-plugins-editor error in Visual Studio.

If you are using WorkflowClient, the you also need to to add some npm dependencies in packages.json and add HtmlEditorSetup.setupStaticToolbar() to add a basic configuration.

Check signumsoftware/southwind@7bcd653 to see all the details.

Cheers!

@MehdyKarimpour
Copy link
Contributor

@MehdyKarimpour MehdyKarimpour commented on 0f01c7a May 22, 2020 via email

Choose a reason for hiding this comment

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

Please sign in to comment.