Skip to content

Commit

Permalink
add ConcurrentUser
Browse files Browse the repository at this point in the history
  • Loading branch information
olmobrutall committed Mar 29, 2022
1 parent fc8342a commit 66e0909
Show file tree
Hide file tree
Showing 7 changed files with 90 additions and 43 deletions.
18 changes: 15 additions & 3 deletions Modules.xml
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@
<RemoveLine Path="Southwind.Terminal\UserAssets.xml" Line="&lt;ToolbarElement Type=&quot;Item&quot; Content=&quot;SessionLog&quot; />" />
</Module>

<Module Name="Alerts">
<Module Name="Alerts" DependsOn="SignalR">
<RemoveLine Path="Southwind.Logic\Starter.cs" Line="AlertLogic.Start(sb, typeof(UserEntity), /*Alert*/typeof(OrderEntity));"/>
<RemoveSpanInLines Path="Southwind.Logic\Starter.cs" Span=", /*Alert*/typeof(OrderEntity)" DependsOn="ExampleEntities" />
<RemoveLine Path="Southwind.Logic\Starter.cs" Line="sb.Schema.Settings.FieldAttributes((AlertEntity a) => a.CreatedBy).Replace(new ImplementedByAttribute(typeof(UserEntity)));"/>
Expand All @@ -397,11 +397,23 @@
<RemoveLine Path="Southwind.React\App\Layout.tsx" Line="{hasUser &amp;&amp; &lt;React.Suspense fallback={null}>&lt;AlertDropdown />&lt;/React.Suspense>}"/>
<RemoveLine Path="Southwind.React\App\MainAdmin.tsx" Line="import * as AlertsClient from &quot;@extensions/Alerts/AlertsClient&quot;"/>
<RemoveLine Path="Southwind.React\App\MainAdmin.tsx" Line="AlertsClient.start({ routes });"/>
<RemoveLine Path="Southwind.React\package.json" Line="&quot;@microsoft/signalr&quot;: &quot;6.0.1&quot;,"/>
<RemoveLine Path="Southwind.React\Startup.cs" Line="services.AddSignalR();"/>
<RemoveLine Path="Southwind.React\Startup.cs" Line="AlertsServer.MapAlertsHub(endpoints);"/>
<RemoveLine Path="Southwind.React\Startup.cs" Line="AlertsServer.Start(app);"/>
</Module>

<Module Name="SignalR" DependsOn="Auth">
<RemoveLine Path="Southwind.React\package.json" Line="&quot;@microsoft/signalr&quot;: &quot;6.0.1&quot;,"/>
<RemoveLine Path="Southwind.React\Startup.cs" Line="services.AddSignalR();"/>
<RemoveLine Path="Southwind.React\Views\Home\Index.cshtml" Line="var __disableSignalR = @Json.Serialize(Signum.React.ConcurrentUser.ConcurrentUserServer.DisableSignalR);"/>
</Module>

<Module Name="ConcurrentUser" DependsOn="SignalR">
<RemoveLine Path="Southwind.Logic\Starter.cs" Line="ConcurrentUserLogic.Start(sb);"/>
<RemoveLine Path="Southwind.React\App\MainAdmin.tsx" Line="import * as ConcurrentUserClient from &quot;@extensions/ConcurrentUser/ConcurrentUserClient&quot;"/>
<RemoveLine Path="Southwind.React\App\MainAdmin.tsx" Line="ConcurrentUserClient.start({ routes });"/>
<RemoveLine Path="Southwind.React\Startup.cs" Line="ConcurrentUserServer.MapConcurrentUserHub(endpoints);"/>
<RemoveLine Path="Southwind.React\Startup.cs" Line="ConcurrentUserServer.Start(app);"/>
</Module>

<Module Name="Notes">
<RemoveLine Path="Southwind.Logic\Starter.cs" Line="NoteLogic.Start(sb, typeof(UserEntity), /*Note*/typeof(OrderEntity));"/>
Expand Down
3 changes: 3 additions & 0 deletions Southwind.Logic/Starter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
using Signum.Engine.Omnibox;
using Signum.Engine.MachineLearning.TensorFlow;
using Azure.Storage.Blobs;
using Signum.Engine.ConcurrentUser;

namespace Southwind.Logic;

Expand Down Expand Up @@ -194,6 +195,8 @@ public static void Start(string connectionString, bool isPostgres, string? azure
heavyProfiler: true,
overrideSessionTimeout: true);

ConcurrentUserLogic.Start(sb);

// Southwind modules

EmployeeLogic.Start(sb);
Expand Down
2 changes: 2 additions & 0 deletions Southwind.React/App/MainAdmin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import * as WorkflowClient from "@extensions/Workflow/WorkflowClient"
import * as PredictorClient from "@extensions/MachineLearning/PredictorClient"
import * as RestClient from "@extensions/Rest/RestClient"
import * as AlertsClient from "@extensions/Alerts/AlertsClient"
import * as ConcurrentUserClient from "@extensions/ConcurrentUser/ConcurrentUserClient"

import * as ToolbarClient from "@extensions/Toolbar/ToolbarClient"
import QueryToolbarConfig from "@extensions/Toolbar/QueryToolbarConfig"
Expand Down Expand Up @@ -92,6 +93,7 @@ export function startFull(routes: JSX.Element[]) {
);
RestClient.start({ routes });
AlertsClient.start({ routes });
ConcurrentUserClient.start({ routes });

/* LightDynamic
DynamicClient.start({ routes, withCodeGen: false });
Expand Down
3 changes: 3 additions & 0 deletions Southwind.React/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
using Signum.Engine.Rest;
using Southwind.Entities.Public;
using Signum.React.Alerts;
using Signum.React.ConcurrentUser;

namespace Southwind.React;

Expand Down Expand Up @@ -225,6 +226,7 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IHostApp
app.UseEndpoints(endpoints =>
{
AlertsServer.MapAlertsHub(endpoints);
ConcurrentUserServer.MapConcurrentUserHub(endpoints);
endpoints.MapControllers();
endpoints.MapControllerRoute(
name: "spa-fallback",
Expand Down Expand Up @@ -304,6 +306,7 @@ public static void WebStart(IApplicationBuilder app, IWebHostEnvironment env, IH
RestLogServer.Start(app);
PredictorServer.Start(app);
WorkflowServer.Start(app);
ConcurrentUserServer.Start(app);
AlertsServer.Start(app);
DynamicServer.Start(app);

Expand Down
1 change: 1 addition & 0 deletions Southwind.React/Views/Home/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@
var __serverName = @Json.Serialize(Configuration.GetValue<string>("ServerName", "none"));
var __azureApplicationId = @Json.Serialize(Starter.Configuration.Value.ActiveDirectory.Azure_ApplicationID);
var __azureTenantId = @Json.Serialize(Starter.Configuration.Value.ActiveDirectory.Azure_DirectoryID);
var __disableSignalR = @Json.Serialize(Signum.React.ConcurrentUser.ConcurrentUserServer.DisableSignalR);
</script>
</body>
</html>
104 changes: 65 additions & 39 deletions Southwind.React/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,20 @@
dependencies:
regenerator-runtime "^0.13.4"

"@babel/runtime@^7.12.13", "@babel/runtime@^7.13.16", "@babel/runtime@^7.14.0", "@babel/runtime@^7.6.2":
"@babel/runtime@^7.12.13", "@babel/runtime@^7.13.16", "@babel/runtime@^7.6.2":
version "7.16.0"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.16.0.tgz#e27b977f2e2088ba24748bf99b5e1dece64e4f0b"
integrity sha512-Nht8L0O8YCktmsDV6FqFue7vQLRx3Hb0B37lS5y0jDRqRxlBG4wIJHnf9/bgSE2UyipKFA01YtS+npRdTWBUyw==
dependencies:
regenerator-runtime "^0.13.4"

"@babel/runtime@^7.17.2":
version "7.17.8"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.17.8.tgz#3e56e4aff81befa55ac3ac6a0967349fd1c5bca2"
integrity sha512-dQpEpK0O9o6lj6oPu0gRDbbnk+4LeHlNcBpspf6Olzt3GIX4P1lWF1gS+pHLDFlaJvbR6q7jCfQ08zA4QJBnmA==
dependencies:
regenerator-runtime "^0.13.4"

"@discoveryjs/json-ext@^0.5.0":
version "0.5.2"
resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.2.tgz#8f03a22a04de437254e8ce8cc84ba39689288752"
Expand Down Expand Up @@ -103,11 +110,6 @@
dependencies:
"@babel/runtime" "^7.6.2"

"@restart/context@^2.1.4":
version "2.1.4"
resolved "https://registry.yarnpkg.com/@restart/context/-/context-2.1.4.tgz#a99d87c299a34c28bd85bb489cb07bfd23149c02"
integrity sha512-INJYZQJP7g+IoDUh/475NlGiTeMfwTXUEr3tmRneckHIxNolGOW9CTq83S8cxq0CgJwwcMzMJFchxvlwe7Rk8Q==

"@restart/hooks@^0.3.26":
version "0.3.26"
resolved "https://registry.yarnpkg.com/@restart/hooks/-/hooks-0.3.26.tgz#ade155a7b0b014ef1073391dda46972c3a14a129"
Expand All @@ -123,10 +125,17 @@
dependencies:
dequal "^2.0.2"

"@restart/ui@^0.2.3":
version "0.2.3"
resolved "https://registry.yarnpkg.com/@restart/ui/-/ui-0.2.3.tgz#8b68aa2ca07af799a65b288cc3c6039915c46a4c"
integrity sha512-FDhtjIR9QvUfMwvFsgVurRA1qdYxM0F0S07acywjG7gNI2YmQo78rtCYIe553V/pyBjEjaKAg3fzBFCocFTqyQ==
"@restart/hooks@^0.4.5":
version "0.4.5"
resolved "https://registry.yarnpkg.com/@restart/hooks/-/hooks-0.4.5.tgz#e7acbea237bfc9e479970500cf87538b41a1ed02"
integrity sha512-tLGtY0aHeIfT7aPwUkvQuhIy3+q3w4iqmUzFLPlOAf/vNUacLaBt1j/S//jv/dQhenRh8jvswyMojCwmLvJw8A==
dependencies:
dequal "^2.0.2"

"@restart/ui@^1.0.2":
version "1.2.0"
resolved "https://registry.yarnpkg.com/@restart/ui/-/ui-1.2.0.tgz#fb90251aa25f99b41ccedc78a91d2a15f3c5e0fb"
integrity sha512-oIh2t3tG8drZtZ9SlaV5CY6wGsUViHk8ZajjhcI+74IQHyWy+AnxDv8rJR5wVgsgcgrPBUvGNkC1AEdcGNPaLQ==
dependencies:
"@babel/runtime" "^7.13.16"
"@popperjs/core" "^2.10.1"
Expand All @@ -135,7 +144,6 @@
"@types/warning" "^3.0.0"
dequal "^2.0.2"
dom-helpers "^5.2.0"
prop-types "^15.7.2"
uncontrollable "^7.2.1"
warning "^4.0.3"

Expand Down Expand Up @@ -178,10 +186,10 @@
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.50.tgz#1e0caa9364d3fccd2931c3ed96fdbeaa5d4cca83"
integrity sha512-C6N5s2ZFtuZRj54k2/zyRhNDjJwwcViAM3Nbm8zjBpbqAdZ00mr0CFxvSKeO8Y/e03WVFLpQMdHYVfUd6SB+Hw==

"@types/invariant@^2.2.33":
version "2.2.34"
resolved "https://registry.yarnpkg.com/@types/invariant/-/invariant-2.2.34.tgz#05e4f79f465c2007884374d4795452f995720bbe"
integrity sha512-lYUtmJ9BqUN688fGY1U1HZoWT1/Jrmgigx2loq4ZcJpICECm/Om3V314BxdzypO0u5PORKGMM6x0OXaljV1YFg==
"@types/invariant@^2.2.35":
version "2.2.35"
resolved "https://registry.yarnpkg.com/@types/invariant/-/invariant-2.2.35.tgz#cd3ebf581a6557452735688d8daba6cf0bd5a3be"
integrity sha512-DxX1V9P8zdJPYQat1gHyY0xj3efl8gnMVjiM9iCY6y27lj+PoQWkgjt8jDqmovPqULkKVpKRg8J36iQiA+EtEg==

"@types/json-schema@*", "@types/json-schema@^7.0.6":
version "7.0.6"
Expand All @@ -203,12 +211,12 @@
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.14.tgz#f7fd5f3cc8521301119f63910f0fb965c7d761ae"
integrity sha512-UHnOPWVWV1z+VV8k6L1HhG7UbGBgIdghqF3l9Ny9ApPghbjICXkUJSd/b9gOgQfjM1r+37cipdw/HJ3F6ICEnQ==

"@types/prop-types@*", "@types/prop-types@^15.7.3":
"@types/prop-types@*":
version "15.7.3"
resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.3.tgz#2ab0d5da2e5815f94b0b9d4b95d1e5f243ab2ca7"
integrity sha512-KfRL3PuHmqQLOG+2tGpRO26Ctg+Cq1E01D2DMriKEATHgWLfeNDmq9e29Q9WIky0dQ3NPkd1mzYH8Lm936Z9qw==

"@types/[email protected]":
"@types/[email protected]", "@types/prop-types@^15.7.4":
version "15.7.4"
resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.4.tgz#fcf7205c25dff795ee79af1e30da2c9790808f11"
integrity sha512-rZ5drC/jWjrArrS8BR6SIr4cWpW09RNTYt9AMZo3Jwwif+iacXAqgVjm0B0Bv/S1jhDXKHqRVNCbACkJ89RAnQ==
Expand All @@ -220,10 +228,10 @@
dependencies:
"@types/react" "*"

"@types/react-transition-group@^4.4.1":
version "4.4.1"
resolved "https://registry.yarnpkg.com/@types/react-transition-group/-/react-transition-group-4.4.1.tgz#e1a3cb278df7f47f17b5082b1b3da17170bd44b1"
integrity sha512-vIo69qKKcYoJ8wKCJjwSgCTM+z3chw3g18dkrDfVX665tMH7tmbDxEAnPdey4gTlwZz5QuHGzd+hul0OVZDqqQ==
"@types/react-transition-group@^4.4.4":
version "4.4.4"
resolved "https://registry.yarnpkg.com/@types/react-transition-group/-/react-transition-group-4.4.4.tgz#acd4cceaa2be6b757db61ed7b432e103242d163e"
integrity sha512-7gAPz7anVK5xzbeQW9wFBDg7G++aPLAFY0QaSMOou9rJZpbuI58WAuJrgu+qR92l61grlnCUe7AFX8KGahAgug==
dependencies:
"@types/react" "*"

Expand Down Expand Up @@ -1903,6 +1911,15 @@ [email protected], prop-types@^15.6.2, prop-types@^15.7.2:
object-assign "^4.1.1"
react-is "^16.8.1"

prop-types@^15.8.1:
version "15.8.1"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5"
integrity sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==
dependencies:
loose-envify "^1.4.0"
object-assign "^4.1.1"
react-is "^16.13.1"

psl@^1.1.33:
version "1.8.0"
resolved "https://registry.yarnpkg.com/psl/-/psl-1.8.0.tgz#9326f8bcfb013adcc005fdff056acce020e51c24"
Expand Down Expand Up @@ -1933,26 +1950,25 @@ [email protected]:
loader-utils "^2.0.0"
schema-utils "^3.0.0"

react-bootstrap@2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/react-bootstrap/-/react-bootstrap-2.0.2.tgz#ec3492513066038bcf612ab8fcab46f88d254ab9"
integrity sha512-QuMqJ+WJmd6dUyOys6OF3nr6T/FjUVAoEMbSjsFrwVufJtvMox0SU1Dvz/cDID+Dl6Rz2RLcJzyqkdl+DEK2Gg==
react-bootstrap@2.2.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/react-bootstrap/-/react-bootstrap-2.2.1.tgz#2a6ad0931e9367882ec3fc88a70ed0b8ace90b26"
integrity sha512-x8lpVQflsbevphuWbTnTNCatcbKyPJNrP2WyQ1MJYmFEcVjbTbai1yZhdlXr0QUxLQLxA8g5hQWb5TwJtaZoCA==
dependencies:
"@babel/runtime" "^7.14.0"
"@restart/context" "^2.1.4"
"@restart/hooks" "^0.3.26"
"@restart/ui" "^0.2.3"
"@types/invariant" "^2.2.33"
"@types/prop-types" "^15.7.3"
"@babel/runtime" "^7.17.2"
"@restart/hooks" "^0.4.5"
"@restart/ui" "^1.0.2"
"@types/invariant" "^2.2.35"
"@types/prop-types" "^15.7.4"
"@types/react" ">=16.14.8"
"@types/react-transition-group" "^4.4.1"
"@types/react-transition-group" "^4.4.4"
"@types/warning" "^3.0.0"
classnames "^2.3.1"
dom-helpers "^5.2.1"
invariant "^2.2.4"
prop-types "^15.7.2"
prop-types "^15.8.1"
prop-types-extra "^1.1.0"
react-transition-group "^4.4.1"
react-transition-group "^4.4.2"
uncontrollable "^7.2.1"
warning "^4.0.3"

Expand All @@ -1965,7 +1981,7 @@ [email protected]:
object-assign "^4.1.1"
scheduler "^0.20.2"

react-is@^16.3.2, react-is@^16.6.0, react-is@^16.7.0, react-is@^16.8.1:
react-is@^16.13.1, react-is@^16.3.2, react-is@^16.6.0, react-is@^16.7.0, react-is@^16.8.1:
version "16.13.1"
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4"
integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==
Expand Down Expand Up @@ -2014,10 +2030,20 @@ react-transition-group@^4.4.1:
loose-envify "^1.4.0"
prop-types "^15.6.2"

[email protected]:
version "5.5.0"
resolved "https://registry.yarnpkg.com/react-widgets/-/react-widgets-5.5.0.tgz#e8ce492fb1315b965427e6c0824a3aa0d296b5c7"
integrity sha512-OeBbywP1kmnZBQdd6pnl7nYU74YZ45KcoS6M1Wd9yWOC8TlZUDh24I7pBk4PV9ncB90WmczaPLSJKSguAGnGDQ==
react-transition-group@^4.4.2:
version "4.4.2"
resolved "https://registry.yarnpkg.com/react-transition-group/-/react-transition-group-4.4.2.tgz#8b59a56f09ced7b55cbd53c36768b922890d5470"
integrity sha512-/RNYfRAMlZwDSr6z4zNKV6xu53/e2BuaBbGhbyYIXTrmgu/bGHzmqOs7mJSJBHy9Ud+ApHx3QjrkKSp1pxvlFg==
dependencies:
"@babel/runtime" "^7.5.5"
dom-helpers "^5.0.1"
loose-envify "^1.4.0"
prop-types "^15.6.2"

[email protected]:
version "5.8.3"
resolved "https://registry.yarnpkg.com/react-widgets/-/react-widgets-5.8.3.tgz#1c0100f39740a5664c6dac4d025486f11af24354"
integrity sha512-xDEw5iXGESVNH+11O4hX+g/ybJSvGjiBpoq01IQbNGQPFQSvHXOg5GQgQdtC0WP7yudLGXHQat/oHZbxkjailg==
dependencies:
"@restart/hooks" "^0.3.26"
"@types/classnames" "^2.2.11"
Expand Down

0 comments on commit 66e0909

Please sign in to comment.