Skip to content

Commit 18efcf0

Browse files
.
1 parent fbc0278 commit 18efcf0

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

roles/lib/files/FWO.Services/ModellingConnectionHandler.cs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,14 +1020,13 @@ public bool CalcVisibility()
10201020
return true;
10211021
}
10221022

1023-
private bool IsAreaForbiddenInDirection(Direction direction)
1023+
public bool IsAreaForbiddenInDirection(List<ModellingNetworkArea> oppositeNetworkAreas, Direction direction)
10241024
{
1025-
var areas = AvailableSelectedObjects.Where(_ => _.Content.GroupType == (int)ModObjectType.NetworkArea).ToList();
10261025

10271026
return direction switch
10281027
{
1029-
Direction.Source => ActConn.DestinationAreas.Count > 0,
1030-
Direction.Destination => ActConn.SourceAreas.Count > 0,
1028+
Direction.Source => oppositeNetworkAreas.Count > 0,
1029+
Direction.Destination => oppositeNetworkAreas.Count > 0,
10311030
_ => false,
10321031
};
10331032
}
@@ -1055,11 +1054,11 @@ public bool NetworkAreaUseAllowed(List<ModellingNetworkArea> networkAreas, Direc
10551054
reason.Title = userConfig.GetText("edit_connection");
10561055
}
10571056

1058-
if (IsAreaForbiddenInDirection(direction))
1059-
{
1060-
reason.Text = userConfig.GetText("direction_contain_nwarea");
1061-
return false;
1062-
}
1057+
//if (IsAreaForbiddenInDirection(direction))
1058+
//{
1059+
// reason.Text = userConfig.GetText("direction_contain_nwarea");
1060+
// return false;
1061+
//}
10631062

10641063
if (ActConn.IsInterface)
10651064
{

roles/ui/files/FWO.UI/Pages/NetworkModelling/EditConn.razor

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
@if((ConnHandler.ActConn.InterfaceIsRequested && ConnHandler.ActConn.SrcFromInterface) || (ConnHandler.ActConn.IsRequested && ConnHandler.ActConn.SourceFilled()))
120120
{
121121
@((MarkupString)ModellingHandlerBase.DisplayReqInt(userConfig, ConnHandler.ActConn.TicketId, ConnHandler.ActConn.InterfaceIsRequested,
122-
ConnHandler.ActConn.GetBoolProperty(ConState.InterfaceRejected.ToString()) || ConnHandler.ActConn.GetBoolProperty(ConState.Rejected.ToString())))
122+
ConnHandler.ActConn.GetBoolProperty(ConState.InterfaceRejected.ToString()) || ConnHandler.ActConn.GetBoolProperty(ConState.Rejected.ToString())))
123123
}
124124
else
125125
{
@@ -217,7 +217,7 @@
217217
@if(ConnHandler.ActConn.InterfaceIsRequested || ConnHandler.ActConn.IsRequested)
218218
{
219219
@((MarkupString)ModellingHandlerBase.DisplayReqInt(userConfig, ConnHandler.ActConn.TicketId, ConnHandler.ActConn.InterfaceIsRequested,
220-
ConnHandler.ActConn.GetBoolProperty(ConState.InterfaceRejected.ToString()) || ConnHandler.ActConn.GetBoolProperty(ConState.Rejected.ToString())))
220+
ConnHandler.ActConn.GetBoolProperty(ConState.InterfaceRejected.ToString()) || ConnHandler.ActConn.GetBoolProperty(ConState.Rejected.ToString())))
221221
}
222222
else
223223
{
@@ -277,7 +277,7 @@
277277
@if((ConnHandler.ActConn.InterfaceIsRequested && ConnHandler.ActConn.DstFromInterface) || (ConnHandler.ActConn.IsRequested && ConnHandler.ActConn.DestinationFilled()))
278278
{
279279
@((MarkupString)ModellingHandlerBase.DisplayReqInt(userConfig, ConnHandler.ActConn.TicketId, ConnHandler.ActConn.InterfaceIsRequested,
280-
ConnHandler.ActConn.GetBoolProperty(ConState.InterfaceRejected.ToString()) || ConnHandler.ActConn.GetBoolProperty(ConState.Rejected.ToString())))
280+
ConnHandler.ActConn.GetBoolProperty(ConState.InterfaceRejected.ToString()) || ConnHandler.ActConn.GetBoolProperty(ConState.Rejected.ToString())))
281281
}
282282
else
283283
{
@@ -506,6 +506,8 @@
506506
}
507507
if(Container.AreaElements.Count > 0)
508508
{
509+
510+
509511
if (ConnHandler is not null && !ConnHandler.NetworkAreaUseAllowed(Container.AreaElements, Direction.Source, out (string Title, string Text) reason))
510512
{
511513
DisplayMessageInUi(default, reason.Title, reason.Text, true);
@@ -548,6 +550,8 @@
548550
}
549551
if(Container.AreaElements.Count > 0)
550552
{
553+
var bla = ConnHandler.IsAreaForbiddenInDirection(Container.AreaElements, Direction.Destination);
554+
551555
if (ConnHandler is not null && !ConnHandler.NetworkAreaUseAllowed(Container.AreaElements, Direction.Destination, out (string Title, string Text) reason))
552556
{
553557
DisplayMessageInUi(default, reason.Title, reason.Text, true);

0 commit comments

Comments
 (0)