This commit is contained in:
Sipke Schoorstra 2018-10-20 23:24:41 +02:00
parent 98f40cbbc1
commit 5998cae2dd
286 changed files with 868 additions and 595 deletions

4
.gitignore vendored
View file

@ -49,4 +49,6 @@ node_modules/
.eslintrc.yml
#github
.github/
.github/
App_Data/

View file

@ -3,9 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28010.2036
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flowsharp.Core", "src\Flowsharp.Core\Flowsharp.Core.csproj", "{300EE2D5-54C5-46F2-AD03-BB43589EA074}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flowsharp.Core", "src\core\Flowsharp.Core\Flowsharp.Core.csproj", "{300EE2D5-54C5-46F2-AD03-BB43589EA074}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flowsharp.Samples.Console", "src\Flowsharp.Samples.Console\Flowsharp.Samples.Console.csproj", "{48EDB976-3227-4DFD-BBB3-3BC9AEA19A88}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flowsharp.Samples.Console", "src\samples\Flowsharp.Samples.Console\Flowsharp.Samples.Console.csproj", "{48EDB976-3227-4DFD-BBB3-3BC9AEA19A88}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{DA71CDAA-8DD3-4D5F-9FBD-8E4B37A2D925}"
EndProject
@ -17,19 +17,15 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "items", "items", "{7165BB9E
README.md = README.md
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flowsharp.Abstractions", "src\Flowsharp.Abstractions\Flowsharp.Abstractions.csproj", "{3130C574-557C-4DA2-933E-AED7A9EBE48A}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flowsharp.Abstractions", "src\core\Flowsharp.Abstractions\Flowsharp.Abstractions.csproj", "{3130C574-557C-4DA2-933E-AED7A9EBE48A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flowsharp.Persistence.Abstractions", "src\Flowsharp.Persistence.Abstractions\Flowsharp.Persistence.Abstractions.csproj", "{A5829896-89C5-4C4E-ADC7-C806C8077316}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flowsharp.Persistence.Abstractions", "src\core\Flowsharp.Persistence.Abstractions\Flowsharp.Persistence.Abstractions.csproj", "{A5829896-89C5-4C4E-ADC7-C806C8077316}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flowsharp.Persistence.InMemory", "src\Flowsharp.Persistence.InMemory\Flowsharp.Persistence.InMemory.csproj", "{E93A1A6B-708F-4DCC-A399-1B8EC7682F92}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flowsharp.Persistence.InMemory", "src\core\Flowsharp.Persistence.InMemory\Flowsharp.Persistence.InMemory.csproj", "{E93A1A6B-708F-4DCC-A399-1B8EC7682F92}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flowsharp.Runtime", "src\Flowsharp.Runtime\Flowsharp.Runtime.csproj", "{3C1DCAA2-D77E-4F96-9899-DA8E0E0C757F}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flowsharp.Runtime", "src\core\Flowsharp.Runtime\Flowsharp.Runtime.csproj", "{3C1DCAA2-D77E-4F96-9899-DA8E0E0C757F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flowsharp.Runtime.Abstractions", "src\Flowsharp.Runtime.Abstractions\Flowsharp.Runtime.Abstractions.csproj", "{792362BF-D26D-46E9-8970-E5668941AA75}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flowsharp.Web.Dashboard", "src\Flowsharp.Web.Dashboard\Flowsharp.Web.Dashboard.csproj", "{11836D0B-9EFF-4C84-A075-90DCB4B48EB6}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flowsharp.Web.Components", "src\Flowsharp.Web.Components\Flowsharp.Web.Components.csproj", "{61F479BD-6DE3-4E2F-A980-80EC121E159B}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flowsharp.Runtime.Abstractions", "src\core\Flowsharp.Runtime.Abstractions\Flowsharp.Runtime.Abstractions.csproj", "{792362BF-D26D-46E9-8970-E5668941AA75}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Core", "Core", "{35F44BE9-13D0-417C-A01A-F0787BEE6DC3}"
EndProject
@ -37,6 +33,24 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Web", "Web", "{B33F1927-FF0
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{D15B5282-5CBE-4DFB-AF3B-F4B28CFA55AB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Flowsharp.Web.OrchardCore", "src\web\modules\Flowsharp.Web.OrchardCore\Flowsharp.Web.OrchardCore.csproj", "{34812116-2B6D-4B6E-9F03-E40F7A082D74}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TheAdminatorTheme", "src\web\themes\TheAdminatorTheme\TheAdminatorTheme.csproj", "{BFA6473C-809D-42F6-ADD3-80A3118B999C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Flowsharp.Web.Management", "src\web\modules\Flowsharp.Web.Management\Flowsharp.Web.Management.csproj", "{A00D0A17-CD30-49DF-908E-85744FA55A1A}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Modules", "Modules", "{DE9B2BDA-F1C3-44EB-9B13-9A59A14F2018}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Themes", "Themes", "{38C559D5-F121-482B-BBD7-8FAFDB63B2F1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Flowsharp.Web.ViewComponents", "src\web\modules\Flowsharp.Web.ViewComponents\Flowsharp.Web.ViewComponents.csproj", "{71687B0E-37D1-4AEB-A620-1F884CAC4C8E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Flowsharp.Web.Persistence.FileSystem", "src\web\modules\Flowsharp.Web.Persistence.FileSystem\Flowsharp.Web.Persistence.FileSystem.csproj", "{7A30960A-1B95-4564-B2C8-2DFDDB06C594}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Flowsharp.Persistence.FileSystem", "src\core\Flowsharp.Persistence.FileSystem\Flowsharp.Persistence.FileSystem.csproj", "{1579117E-229F-4E48-812B-7A235A4DB7E5}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Flowsharp.Web", "src\web\portal\Flowsharp.Web.csproj", "{597099E3-F287-4947-9C32-5362A64C8C44}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -71,14 +85,34 @@ Global
{792362BF-D26D-46E9-8970-E5668941AA75}.Debug|Any CPU.Build.0 = Debug|Any CPU
{792362BF-D26D-46E9-8970-E5668941AA75}.Release|Any CPU.ActiveCfg = Release|Any CPU
{792362BF-D26D-46E9-8970-E5668941AA75}.Release|Any CPU.Build.0 = Release|Any CPU
{11836D0B-9EFF-4C84-A075-90DCB4B48EB6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{11836D0B-9EFF-4C84-A075-90DCB4B48EB6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{11836D0B-9EFF-4C84-A075-90DCB4B48EB6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{11836D0B-9EFF-4C84-A075-90DCB4B48EB6}.Release|Any CPU.Build.0 = Release|Any CPU
{61F479BD-6DE3-4E2F-A980-80EC121E159B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{61F479BD-6DE3-4E2F-A980-80EC121E159B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{61F479BD-6DE3-4E2F-A980-80EC121E159B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{61F479BD-6DE3-4E2F-A980-80EC121E159B}.Release|Any CPU.Build.0 = Release|Any CPU
{34812116-2B6D-4B6E-9F03-E40F7A082D74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{34812116-2B6D-4B6E-9F03-E40F7A082D74}.Debug|Any CPU.Build.0 = Debug|Any CPU
{34812116-2B6D-4B6E-9F03-E40F7A082D74}.Release|Any CPU.ActiveCfg = Release|Any CPU
{34812116-2B6D-4B6E-9F03-E40F7A082D74}.Release|Any CPU.Build.0 = Release|Any CPU
{BFA6473C-809D-42F6-ADD3-80A3118B999C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BFA6473C-809D-42F6-ADD3-80A3118B999C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BFA6473C-809D-42F6-ADD3-80A3118B999C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BFA6473C-809D-42F6-ADD3-80A3118B999C}.Release|Any CPU.Build.0 = Release|Any CPU
{A00D0A17-CD30-49DF-908E-85744FA55A1A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A00D0A17-CD30-49DF-908E-85744FA55A1A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A00D0A17-CD30-49DF-908E-85744FA55A1A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A00D0A17-CD30-49DF-908E-85744FA55A1A}.Release|Any CPU.Build.0 = Release|Any CPU
{71687B0E-37D1-4AEB-A620-1F884CAC4C8E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{71687B0E-37D1-4AEB-A620-1F884CAC4C8E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{71687B0E-37D1-4AEB-A620-1F884CAC4C8E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{71687B0E-37D1-4AEB-A620-1F884CAC4C8E}.Release|Any CPU.Build.0 = Release|Any CPU
{7A30960A-1B95-4564-B2C8-2DFDDB06C594}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7A30960A-1B95-4564-B2C8-2DFDDB06C594}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7A30960A-1B95-4564-B2C8-2DFDDB06C594}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7A30960A-1B95-4564-B2C8-2DFDDB06C594}.Release|Any CPU.Build.0 = Release|Any CPU
{1579117E-229F-4E48-812B-7A235A4DB7E5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1579117E-229F-4E48-812B-7A235A4DB7E5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1579117E-229F-4E48-812B-7A235A4DB7E5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1579117E-229F-4E48-812B-7A235A4DB7E5}.Release|Any CPU.Build.0 = Release|Any CPU
{597099E3-F287-4947-9C32-5362A64C8C44}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{597099E3-F287-4947-9C32-5362A64C8C44}.Debug|Any CPU.Build.0 = Debug|Any CPU
{597099E3-F287-4947-9C32-5362A64C8C44}.Release|Any CPU.ActiveCfg = Release|Any CPU
{597099E3-F287-4947-9C32-5362A64C8C44}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -91,11 +125,18 @@ Global
{E93A1A6B-708F-4DCC-A399-1B8EC7682F92} = {35F44BE9-13D0-417C-A01A-F0787BEE6DC3}
{3C1DCAA2-D77E-4F96-9899-DA8E0E0C757F} = {35F44BE9-13D0-417C-A01A-F0787BEE6DC3}
{792362BF-D26D-46E9-8970-E5668941AA75} = {35F44BE9-13D0-417C-A01A-F0787BEE6DC3}
{11836D0B-9EFF-4C84-A075-90DCB4B48EB6} = {B33F1927-FF0A-4826-80C6-F480E9C43892}
{61F479BD-6DE3-4E2F-A980-80EC121E159B} = {B33F1927-FF0A-4826-80C6-F480E9C43892}
{35F44BE9-13D0-417C-A01A-F0787BEE6DC3} = {DA71CDAA-8DD3-4D5F-9FBD-8E4B37A2D925}
{B33F1927-FF0A-4826-80C6-F480E9C43892} = {DA71CDAA-8DD3-4D5F-9FBD-8E4B37A2D925}
{D15B5282-5CBE-4DFB-AF3B-F4B28CFA55AB} = {DA71CDAA-8DD3-4D5F-9FBD-8E4B37A2D925}
{DE9B2BDA-F1C3-44EB-9B13-9A59A14F2018} = {B33F1927-FF0A-4826-80C6-F480E9C43892}
{38C559D5-F121-482B-BBD7-8FAFDB63B2F1} = {B33F1927-FF0A-4826-80C6-F480E9C43892}
{A00D0A17-CD30-49DF-908E-85744FA55A1A} = {DE9B2BDA-F1C3-44EB-9B13-9A59A14F2018}
{34812116-2B6D-4B6E-9F03-E40F7A082D74} = {DE9B2BDA-F1C3-44EB-9B13-9A59A14F2018}
{BFA6473C-809D-42F6-ADD3-80A3118B999C} = {38C559D5-F121-482B-BBD7-8FAFDB63B2F1}
{71687B0E-37D1-4AEB-A620-1F884CAC4C8E} = {DE9B2BDA-F1C3-44EB-9B13-9A59A14F2018}
{7A30960A-1B95-4564-B2C8-2DFDDB06C594} = {DE9B2BDA-F1C3-44EB-9B13-9A59A14F2018}
{1579117E-229F-4E48-812B-7A235A4DB7E5} = {35F44BE9-13D0-417C-A01A-F0787BEE6DC3}
{597099E3-F287-4947-9C32-5362A64C8C44} = {B33F1927-FF0A-4826-80C6-F480E9C43892}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {8B0975FD-7050-48B0-88C5-48C33378E158}

View file

@ -2,5 +2,6 @@
<configuration>
<packageSources>
<add key="NuGet" value="https://api.nuget.org/v3/index.json" />
<add key="OrchardCore Preview" value="https://www.myget.org/F/orchardcore-preview/api/v3/index.json" />
</packageSources>
</configuration>

View file

@ -1,24 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<LangVersion>7.1</LangVersion>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Flowsharp.Core\Flowsharp.Core.csproj" />
<ProjectReference Include="..\Flowsharp.Persistence.Abstractions\Flowsharp.Persistence.Abstractions.csproj" />
<ProjectReference Include="..\Flowsharp.Persistence.InMemory\Flowsharp.Persistence.InMemory.csproj" />
<ProjectReference Include="..\Flowsharp.Runtime.Abstractions\Flowsharp.Runtime.Abstractions.csproj" />
<ProjectReference Include="..\Flowsharp.Runtime\Flowsharp.Runtime.csproj" />
</ItemGroup>
<ItemGroup>
<None Remove="SampleWorkflow.json" />
<EmbeddedResource Include="SampleWorkflow.json" />
<None Remove="SampleWorkflow.yaml" />
<EmbeddedResource Include="SampleWorkflow.yaml" />
</ItemGroup>
</Project>

View file

@ -1,18 +0,0 @@
import React from 'react';
import dotnetify from 'dotnetify';
export default class Activity extends React.Component {
constructor(props) {
super(props);
dotnetify.react.connect('Activity', this);
this.state = { Title: 'Activity 1' };
}
render() {
return (
<div className="activity">
<div>Content</div>
</div>
);
}
}

View file

@ -1,67 +0,0 @@
import React from 'react';
import dotnetify from 'dotnetify';
import { jsPlumb, jsPlumbInstance, Connection, ConnectionMadeEventInfo } from 'jsplumb';
import * as ReactDOM from "react-dom";
import * as Flowsharp from './flowsharp';
import Activity from "./Activity";
export default class WorkflowCanvas extends React.Component {
constructor(props) {
super(props);
dotnetify.react.connect('WorkflowCanvas', this);
this.state = { workflow: null };
jsPlumb.ready(() => {
this.container = ReactDOM.findDOMNode(this);
this.plumber = WorkflowCanvas.createPlumber(this.container);
});
}
render() {
return (
<div className='workflow-canvas'>
Workfow Canvas
<Activity/>
<Activity/>
</div>
);
}
static createPlumber(container: HTMLDivElement){
return jsPlumb.getInstance({
Anchor: "Continuous",
DragOptions: {
cursor: 'pointer', zIndex: 2000
},
EndpointStyles: [{ fillStyle: '#225588' }],
Endpoints: [["Dot", { radius: 7 }], ["Blank"]],
ConnectionOverlays: [
['Arrow', {
location: 1,
visible: true,
width: 11,
length: 11
}],
['Label', {
location: 0.5,
id: 'label',
cssClass: 'connection-label'
}]
],
ConnectorZIndex: 5,
Container: container
});
}
static setupJsPlumb(plumber: jsPlumbInstance){
// Listen for new connections.
plumber.bind('connection', function (connectionInfo: ConnectionMadeEventInfo, originalEvent: Event) {
const connection: Connection = connectionInfo.connection;
const endpoint: Flowsharp.Endpoint = connection.getParameters().endpoint;
const label: any = connection.getOverlay('label');
label.setLabel(endpoint.Name);
});
}
}

View file

@ -1,21 +0,0 @@
import React from 'react';
import dotnetify from 'dotnetify';
import WorkflowCanvas from "./WorkflowCanvas";
export default class WorkflowEditor extends React.Component {
constructor(props) {
super(props);
dotnetify.react.connect('WorkflowEditor', this);
this.state = { Greetings: '', ServerTime: '' };
}
render() {
return (
<div>
<p>{this.state.Greetings}</p>
<p>Server time is: {this.state.ServerTime}</p>
<WorkflowCanvas/>
</div>
);
}
}

View file

@ -1,7 +0,0 @@
const Endpoint = {
Name: ''
};
module.exports = {
Endpoint: Endpoint
};

View file

@ -1,5 +0,0 @@
import React from 'react';
import ReactDOM from 'react-dom';
import WorkflowEditor from './WorkflowEditor';
ReactDOM.render(<WorkflowEditor/>, document.getElementById('FlowsharpWorkflowEditor'));

View file

@ -1,99 +0,0 @@
.workflow-container {
.workflow-canvas-container {
border: 1px solid #e4e5e6;
border-radius: 0.25em;
padding: 15px;
}
}
.modal-activities {
h4.card-title {
.fa {
margin-right: 0.5em;
}
}
}
.workflow-canvas {
overflow: auto !important;
position: relative;
touch-action: none;
min-height: 400px;
.activity {
display: none;
border: 1px solid #346789;
box-shadow: 2px 2px 19px #aaa;
-o-box-shadow: 2px 2px 9px #aaa;
-webkit-box-shadow: 2px 2px 9px #aaa;
-moz-box-shadow: 2px 2px 9px #aaa;
-moz-border-radius: 0.5em;
border-radius: 0.5em;
opacity: 0.8;
min-width: 80px;
min-height: 80px;
text-align: left;
z-index: 20;
position: absolute;
background-color: #eeeeef;
color: #000000;
font-family: helvetica, sans-serif;
padding: 1em;
font-size: 0.7em;
-webkit-transition: -webkit-box-shadow 0.15s ease-in;
-moz-transition: -moz-box-shadow 0.15s ease-in;
-o-transition: -o-box-shadow 0.15s ease-in;
transition: box-shadow 0.15s ease-in;
&.activity-task {
border: 1px solid #7ab02c;
}
&.activity-event {
border: 1px solid #3a8acd;
}
&.activity-start, &.activity-blocking {
background-color: #7ab02c;
color: #ffffff;
border: 1px solid #507b11;
}
header {
h4 {
font-size: 1.4em;
.fa {
margin-right: 0.5em;
}
}
}
}
.jtk-connector {
z-index: 4;
}
.jtk-endpoint, .endpointTargetLabel, .endpointSourceLabel {
z-index: 21;
cursor: pointer;
}
.endpointTargetLabel, .endpointSourceLabel {
font-size: 8px;
}
.jtk-overlay {
background-color: transparent;
}
.connection-label {
z-index: 31;
border: 1px solid #cccccc;
padding: 0 0.5em;
-moz-border-radius: 2px;
-webkit-border-radius: 2px;
border-radius: 2px;
background-color: white;
}
}

View file

@ -1,26 +0,0 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.StaticFiles;
using Microsoft.Extensions.FileProviders;
using Microsoft.Extensions.Options;
namespace Flowsharp.Web.Components.Configuration
{
internal class EmbeddedFilesConfigureOptions : IPostConfigureOptions<StaticFileOptions>
{
private readonly IHostingEnvironment environment;
public EmbeddedFilesConfigureOptions(IHostingEnvironment environment)
{
this.environment = environment;
}
public void PostConfigure(string name, StaticFileOptions options)
{
options.ContentTypeProvider = options.ContentTypeProvider ?? new FileExtensionContentTypeProvider();
options.FileProvider = options.FileProvider ?? environment.WebRootFileProvider;
var embeddedFileProvider = new ManifestEmbeddedFileProvider(GetType().Assembly, "wwwroot");
options.FileProvider = new CompositeFileProvider(options.FileProvider, embeddedFileProvider);
}
}
}

View file

@ -1,17 +0,0 @@
using DotNetify;
using Flowsharp.Web.Components.ViewModels;
// ReSharper disable once CheckNamespace
namespace Microsoft.AspNetCore.Builder
{
public static class ApplicationBuilderExtensions
{
public static IApplicationBuilder UseFlowsharpComponents(this IApplicationBuilder app)
{
return app
.UseWebSockets()
.UseSignalR(routes => routes.MapDotNetifyHub())
.UseDotNetify(options => options.RegisterAssembly(typeof(WorkflowEditor).Assembly));
}
}
}

View file

@ -1,19 +0,0 @@
using DotNetify;
using Flowsharp.Web.Components.Configuration;
// ReSharper disable once CheckNamespace
namespace Microsoft.Extensions.DependencyInjection
{
public static class ServiceCollectionExtensions
{
public static IServiceCollection AddFlowsharpComponents(this IServiceCollection services)
{
services.AddSignalR();
services.ConfigureOptions(typeof(EmbeddedFilesConfigureOptions));
return services
.AddMemoryCache()
.AddDotNetify();
}
}
}

View file

@ -1,49 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<GenerateEmbeddedFilesManifest>true</GenerateEmbeddedFilesManifest>
<DisableFastUpToDateCheck>true</DisableFastUpToDateCheck>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="DotNetify.SignalR" Version="3.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.1.3" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="2.1.0" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="wwwroot\**\*" />
</ItemGroup>
<ItemGroup>
<Content Update="Pages\_ViewImports.cshtml">
<Pack>$(IncludeRazorContentInPack)</Pack>
</Content>
<Content Remove="ClientApp\node_modules\**" />
</ItemGroup>
<ItemGroup>
<UpToDateCheckInput Remove="Areas\MyFeature\Pages\Page1.cshtml" />
<UpToDateCheckInput Remove="Shared\Components\WorkflowEditor\Default.cshtml" />
</ItemGroup>
<ItemGroup>
<Compile Remove="ClientApp\node_modules\**" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Remove="ClientApp\node_modules\**" />
</ItemGroup>
<ItemGroup>
<None Remove="ClientApp\node_modules\**" />
</ItemGroup>
<ItemGroup>
<Reference Include="Microsoft.Extensions.FileProviders.Embedded, Version=2.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60">
<HintPath>..\..\..\..\..\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.extensions.fileproviders.embedded\2.1.1\lib\netstandard2.0\Microsoft.Extensions.FileProviders.Embedded.dll</HintPath>
</Reference>
</ItemGroup>
</Project>

View file

@ -1,12 +0,0 @@
using Microsoft.AspNetCore.Mvc;
namespace Flowsharp.Web.Components.ViewComponents
{
public class WorkflowEditor : ViewComponent
{
public IViewComponentResult Invoke()
{
return View();
}
}
}

View file

@ -1,11 +0,0 @@
using DotNetify;
namespace Flowsharp.Web.Components.ViewModels
{
public class Activity : BaseVM
{
public Activity()
{
}
}
}

View file

@ -1,11 +0,0 @@
using DotNetify;
namespace Flowsharp.Web.Components.ViewModels
{
public class WorkflowCanvas : BaseVM
{
public WorkflowCanvas()
{
}
}
}

View file

@ -1,24 +0,0 @@
using System;
using System.Threading;
using DotNetify;
namespace Flowsharp.Web.Components.ViewModels
{
public class WorkflowEditor : BaseVM
{
private Timer _timer;
public string Greetings => "Hello World!";
public DateTime ServerTime => DateTime.Now;
public WorkflowEditor()
{
_timer = new Timer(state =>
{
Changed(nameof(ServerTime));
PushUpdates();
}, null, 0, 1000);
}
public override void Dispose() => _timer.Dispose();
}
}

View file

@ -1,4 +0,0 @@
@model dynamic
<div id="FlowsharpWorkflowEditor"></div>
<script src="~/main.js" charset="UTF-8"></script>

View file

@ -1,2 +0,0 @@
@namespace Flowsharp.Web.Components.Pages
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers

View file

@ -1,22 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Flowsharp.Web.Components\Flowsharp.Web.Components.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Remove="ClientApp\node_modules\"/>
</ItemGroup>
<ItemGroup>
<Folder Remove="wwwroot\"/>
</ItemGroup>
</Project>

View file

@ -1,6 +0,0 @@
@page
@{
ViewBag.Title = "Dashboard";
}
<h2>FlowSharp Dashboard</h2>

View file

@ -1,15 +0,0 @@
@page
@{
ViewBag.Title = "Index";
}
<div class="masonry-item col-md-12">
<div class="bgc-white p-20 bd"><h6 class="c-grey-900">Workflow 1</h6>
<div class="mT-30">
<form>
<div class="form-group">@await Component.InvokeAsync("WorkflowEditor")</div>
<button type="submit" class="btn btn-primary">Save</button>
</form>
</div>
</div>
</div>

View file

@ -1,3 +0,0 @@
@* @using Flowsharp.Web.Components.ViewComponents *@
@namespace Flowsharp.Web.Dashboard.Pages
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers

View file

@ -1,3 +0,0 @@
@{
Layout = "_Layout";
}

View file

@ -1,35 +0,0 @@
using System.Collections.Generic;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.SpaServices.Webpack;
using Microsoft.Extensions.DependencyInjection;
namespace Flowsharp.Web.Dashboard
{
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddFlowsharpComponents();
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
}
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions
{
HotModuleReplacement = true,
HotModuleReplacementClientOptions = new Dictionary<string, string> { { "reload", "true" } },
});
}
app.UseFlowsharpComponents();
app.UseStaticFiles();
app.UseMvc();
}
}
}

View file

@ -7,7 +7,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Jint" Version="2.11.58" />
<PackageReference Include="Jint" Version="3.0.0-beta-1294" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.Localization.Abstractions" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="2.1.1" />

View file

@ -10,5 +10,6 @@ namespace Flowsharp.Persistence
{
Task<IEnumerable<WorkflowDefinition>> GetManyAsync(ISpecification<WorkflowDefinition, IWorkflowDefinitionSpecificationVisitor> specification, CancellationToken cancellationToken);
Task AddAsync(WorkflowDefinition value, CancellationToken cancellationToken);
Task<WorkflowDefinition> GetAsync(string id, CancellationToken cancellationToken);
}
}

View file

@ -0,0 +1,38 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Flowsharp.Persistence.Models;
using Flowsharp.Persistence.Specifications;
namespace Flowsharp.Persistence.FileSystem
{
public class FileSystemWorkflowDefinitionStore : IWorkflowDefinitionStore
{
public FileSystemWorkflowDefinitionStore()
{
WorkflowDefinitions = new List<WorkflowDefinition>();
}
public IList<WorkflowDefinition> WorkflowDefinitions { get; }
public Task<IEnumerable<WorkflowDefinition>> GetManyAsync(ISpecification<WorkflowDefinition, IWorkflowDefinitionSpecificationVisitor> specification, CancellationToken cancellationToken)
{
var query = WorkflowDefinitions.AsQueryable().Where(x => specification.IsSatisfiedBy(x));
var matches = query.Distinct().ToList();
return Task.FromResult<IEnumerable<WorkflowDefinition>>(matches);
}
public Task AddAsync(WorkflowDefinition value, CancellationToken cancellationToken)
{
WorkflowDefinitions.Add(value);
return Task.CompletedTask;
}
public Task<WorkflowDefinition> GetAsync(string id, CancellationToken cancellationToken)
{
var item = WorkflowDefinitions.SingleOrDefault(x => x.Id == id);
return Task.FromResult(item);
}
}
}

View file

@ -0,0 +1,37 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Flowsharp.Persistence.Models;
using Flowsharp.Persistence.Specifications;
namespace Flowsharp.Persistence.FileSystem
{
public class FileSystemWorkflowInstanceStore : IWorkflowInstanceStore
{
public FileSystemWorkflowInstanceStore()
{
WorkflowInstances = new List<WorkflowInstance>();
}
public IList<WorkflowInstance> WorkflowInstances { get; }
public Task<IEnumerable<WorkflowInstance>> GetManyAsync(ISpecification<WorkflowInstance, IWorkflowInstanceSpecificationVisitor> specification, CancellationToken cancellationToken)
{
var query = WorkflowInstances.AsQueryable().Where(x => specification.IsSatisfiedBy(x));
var matches = query.Distinct().ToList();
return Task.FromResult<IEnumerable<WorkflowInstance>>(matches);
}
public Task AddAsync(WorkflowInstance value, CancellationToken cancellationToken)
{
WorkflowInstances.Add(value);
return Task.CompletedTask;
}
public Task UpdateAsync(WorkflowInstance value, CancellationToken cancellationToken)
{
return Task.CompletedTask;
}
}
}

View file

@ -0,0 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Flowsharp.Persistence.Abstractions\Flowsharp.Persistence.Abstractions.csproj" />
</ItemGroup>
</Project>

Some files were not shown because too many files have changed in this diff Show more