Skip to content

Commit 38f3cbc

Browse files
committed
Merge branch 'rc' of https://github.com/bexis2/core into rc
2 parents 80af923 + 3b554c4 commit 38f3cbc

66 files changed

Lines changed: 1810 additions & 598 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Components/DLM/BExIS.Dlm.Services/Party/PartyManager.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,10 @@ public PartyX Update(PartyX newParty)
241241
{
242242
var party = uow.GetReadOnlyRepository<PartyX>().Get(newParty.Id);
243243

244-
party.StartDate = newParty.StartDate;
245-
party.EndDate = newParty.EndDate;
244+
if (party.StartDate == null)
245+
party.StartDate = DateTime.MinValue;
246+
if (party.EndDate == null || party.EndDate == DateTime.MinValue)
247+
party.EndDate = DateTime.MaxValue;
246248

247249
if (party.StartDate > party.EndDate)
248250
BexisException.Throw(null, "End date should be greater than start date.");
@@ -1136,4 +1138,5 @@ private PartyX UpdatePartyName(PartyX party)
11361138

11371139
#endregion privateMethod
11381140
}
1139-
}
1141+
1142+
}

Components/IO/BExIS.IO.DataType.DisplayPattern/DataTypeDisplayPattern.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ public class DataTypeDisplayPattern
4141
new DataTypeDisplayPattern() {Id=27,Systemtype = DataTypeCode.DateTime, Name = "Minute", ExcelPattern=@"mm", DisplayPattern="mm", StringPattern = "mm", RegexPattern = null},
4242
new DataTypeDisplayPattern() {Id=28,Systemtype = DataTypeCode.DateTime, Name = "Secound", ExcelPattern=@"ss", DisplayPattern="ss", StringPattern = "ss", RegexPattern = null},
4343
new DataTypeDisplayPattern() {Id=29,Systemtype = DataTypeCode.DateTime, Name = "DateEu with time24", ExcelPattern=@"dd\.MM\.yyyy HH:mm:ss", DisplayPattern="dd.MM.yyyy HH:mm:ss", StringPattern = "dd.MM.yyyy HH:mm:ss", RegexPattern = null},
44-
new DataTypeDisplayPattern() {Id=30,Systemtype = DataTypeCode.DateTime, Name = "DateTimeIso without sec", ExcelPattern=@"yyyy-MM-dd\Thh:mm", DisplayPattern="yyyy-MM-ddThh:mm", StringPattern = "yyyy-MM-ddTHH:mm", RegexPattern = null}
44+
new DataTypeDisplayPattern() {Id=30,Systemtype = DataTypeCode.DateTime, Name = "DateTimeIso without sec", ExcelPattern=@"yyyy-MM-dd\Thh:mm", DisplayPattern="yyyy-MM-ddThh:mm", StringPattern = "yyyy-MM-ddTHH:mm", RegexPattern = null},
45+
new DataTypeDisplayPattern() {Id=31,Systemtype = DataTypeCode.DateTime, Name = "DateTimeIso withou T", ExcelPattern=@"yyyy-MM-dd hh:mm:ss", DisplayPattern="yyyyy-MM-dd hh:mm:ss", StringPattern = "yyyy-MM-dd hh:mm:ss", RegexPattern = null}
4546

4647
};
4748

Components/IO/BExIS.IO.Tests/IOUtilityTests.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public void OneTimeTearDown()
3434
{
3535
}
3636

37+
[TestCase("2026-12-24 05:05:50", "yyyy-MM-dd hh:mm:ss", "12/24/2026 5:05:50 AM", true, "en-US")]
3738
[TestCase("12:00 pm", "hh:mm tt", "1/1/0001 12:00:00 PM", true, "en-US")]
3839
[TestCase("12:00:00 pm", "hh:mm:ss tt", "1/1/0001 12:00:00 PM", true, "en-US")]
3940
[TestCase("2023-29-12", "yyyy-d-M", "12/29/2023 12:00:00 AM", true)]
@@ -118,6 +119,9 @@ public void ConvertStringToDateTimeWithpatternTest(string input, string pattern,
118119
else result.ToString( new CultureInfo("en-US", false)).Should().BeNullOrEmpty();
119120
}
120121
}
122+
123+
124+
[TestCase("2026-12-24 05:05:50", "yyyy-MM-dd hh:mm:ss", "12/24/2026 5:05:50 AM", true, "en-US")]
121125
[TestCase("12:00 pm", "hh:mm tt", "1/1/0001 12:00:00 PM", true, "en-US")]
122126
[TestCase("12:00:00 pm", "hh:mm:ss tt", "1/1/0001 12:00:00 PM", true, "en-US")]
123127
[TestCase("2023-29-12", "yyyy-d-M", "12/29/2023 12:00:00 AM", true)]

Components/JSON/BEXIS.JSON.Helpers/MetadataStructureConverter.cs

Lines changed: 63 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,37 @@ private JSchema addPackageUsage(MetadataPackageUsage usage, JSchema schema, out
102102
current = addMetadataAttrUsage(metadataAttrUsage, current, out _childRequired);
103103

104104
// if current is required add it to the parent
105-
if (_childRequired) current.Required.Add(metadataAttrUsage.Label);
106-
if (IsChoice(usage.Extra) && getMaxCardinality(usage) > 1) current.AnyOf.Add(current.Properties.Last().Value);
107-
else if (IsChoice(usage.Extra)) current.OneOf.Add(current.Properties.Last().Value);
105+
//if (_childRequired) current.Required.Add(metadataAttrUsage.Label);
106+
//if (IsChoice(usage.Extra) && getMaxCardinality(usage) > 1) current.AnyOf.Add(current.Properties.Last().Value);
107+
//else if (IsChoice(usage.Extra)) current.OneOf.Add(current.Properties.Last().Value);
108+
109+
var lastPropName = metadataAttrUsage.Label; // z.B. "Kreditkarte"
110+
var lastPropSchema = current.Properties[lastPropName];
111+
112+
// falls das Kind für sich Required-Kinder hat, hast du das schon in lastPropSchema gesetzt
113+
114+
if (IsChoice(usage.Extra))
115+
{
116+
// Subschema für den Choice-Fall
117+
var choiceSchema = new JSchema
118+
{
119+
Type = JSchemaType.Object
120+
};
121+
122+
// gleiche Properties wie im Parent (damit die Validierung Sinn ergibt)
123+
// minimal reicht i.d.R. das eine relevante Property:
124+
choiceSchema.Properties.Add(lastPropName, lastPropSchema);
125+
choiceSchema.Required.Add(lastPropName);
126+
127+
if (getMaxCardinality(usage) > 1)
128+
current.AnyOf.Add(choiceSchema);
129+
else
130+
current.OneOf.Add(choiceSchema);
131+
}
132+
else if (_childRequired)
133+
{
134+
current.Required.Add(lastPropName);
135+
}
108136
}
109137
}
110138

@@ -217,10 +245,38 @@ private JSchema addMetadataAttrUsage(BaseUsage usage, JSchema schema, out bool r
217245
{
218246
bool _childIsRequired = false;
219247
current = addMetadataAttrUsage(mnau, current, out _childIsRequired);
220-
// if current is required add it to the parent
221-
if (_childIsRequired) current.Required.Add(mnau.Label);
222-
if (IsChoice(usage.Extra) && getMaxCardinality(usage) > 1) current.AnyOf.Add(current.Properties.Last().Value);
223-
else if (IsChoice(usage.Extra)) current.OneOf.Add(current.Properties.Last().Value);
248+
//// if current is required add it to the parent
249+
//if (_childIsRequired) current.Required.Add(mnau.Label);
250+
//if (IsChoice(usage.Extra) && getMaxCardinality(usage) > 1) current.AnyOf.Add(current.Properties.Last().Value);
251+
//else if (IsChoice(usage.Extra)) current.OneOf.Add(current.Properties.Last().Value);
252+
253+
var lastPropName = mnau.Label; // z.B. "Kreditkarte"
254+
var lastPropSchema = current.Properties[lastPropName];
255+
256+
// falls das Kind für sich Required-Kinder hat, hast du das schon in lastPropSchema gesetzt
257+
258+
if (IsChoice(usage.Extra))
259+
{
260+
// Subschema für den Choice-Fall
261+
var choiceSchema = new JSchema
262+
{
263+
Type = JSchemaType.Object
264+
};
265+
266+
// gleiche Properties wie im Parent (damit die Validierung Sinn ergibt)
267+
// minimal reicht i.d.R. das eine relevante Property:
268+
choiceSchema.Properties.Add(lastPropName, lastPropSchema);
269+
choiceSchema.Required.Add(lastPropName);
270+
271+
if (getMaxCardinality(usage) > 1)
272+
current.AnyOf.Add(choiceSchema);
273+
else
274+
current.OneOf.Add(choiceSchema);
275+
}
276+
else if (_childIsRequired)
277+
{
278+
current.Required.Add(lastPropName);
279+
}
224280
}
225281
}
226282
}

Components/Utils/BExIS.Utils/BExIS.Utils.csproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,10 +408,18 @@
408408
<Project>{0815d220-3625-4e23-bbbc-8152345637fe}</Project>
409409
<Name>Vaiona.Entities</Name>
410410
</ProjectReference>
411+
<ProjectReference Include="..\..\Vaiona\Vaiona.Utils\Vaiona.Utils.csproj">
412+
<Project>{63FCACAA-9534-4FDD-A082-78DCC06BAF28}</Project>
413+
<Name>Vaiona.Utils</Name>
414+
</ProjectReference>
411415
<ProjectReference Include="..\..\Vaiona\Vaiona.Web.Mvc.Modularity\Vaiona.Web.Mvc.Modularity.csproj">
412416
<Project>{705f8751-e58a-453e-a7fd-0c310fd3cae8}</Project>
413417
<Name>Vaiona.Web.Mvc.Modularity</Name>
414418
</ProjectReference>
419+
<ProjectReference Include="..\BExIS.Utils.Config\BExIS.Utils.Config.csproj">
420+
<Project>{6EAD7D02-02F7-42FF-85E4-90BB892D3846}</Project>
421+
<Name>BExIS.Utils.Config</Name>
422+
</ProjectReference>
415423
</ItemGroup>
416424
<ItemGroup>
417425
<None Include="app.config" />

Components/Utils/BExIS.Utils/WebHelpers/HtmlNavigationExtensions.cs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using BExIS.Security.Entities.Subjects;
22
using BExIS.Security.Services.Authorization;
33
using BExIS.Security.Services.Objects;
4+
using BExIS.Utils.Config;
45
using System;
56
using System.Collections.Generic;
67
using System.Linq;
@@ -31,6 +32,8 @@ public static MvcHtmlString LaunchBar(this HtmlHelper htmlHelper)
3132

3233
foreach (var launchBarItem in lunchBarRoot.Elements())
3334
{
35+
36+
3437
if (launchBarItem.HasElements)
3538
{
3639
sb.Append($"<li class='dropdown'><a href='#' class='dropdown-toggle' data-toggle='dropdown' role='button' aria-haspopup='true' aria-expanded='false'>{launchBarItem.Attribute("title").Value}<span class='caret'></span></a><ul class='dropdown-menu'>");
@@ -47,12 +50,21 @@ public static MvcHtmlString LaunchBar(this HtmlHelper htmlHelper)
4750
if (!string.IsNullOrWhiteSpace(child.Attribute("action").Value))
4851
sb.Append(@"/").Append(child.Attribute("action").Value.ToLower());
4952

50-
if (child.Attribute("argument") != null && !string.IsNullOrWhiteSpace(child.Attribute("argument").Value))
53+
if (child.Attribute("argument") != null && !string.IsNullOrWhiteSpace(child.Attribute("argument").Value))
5154
sb.Append(@"/").Append(child.Attribute("argument").Value.ToLower());
5255

5356
sb.Append("' target=\"_blank\" >").Append(child.Attribute("title").Value).Append("</a></li>");
5457
}
5558

59+
if (launchBarItem.HasAttributes && launchBarItem.Attribute("id").Value.Equals("help"))
60+
{
61+
var help_list = GeneralSettings.GetValueByKey("help") as List<Vaiona.Utils.Cfg.Entry>;
62+
foreach (var help in help_list)
63+
{
64+
sb.Append($"<li><a href='{help.Value}' target=\"_blank\" >{help.Description}</a></li>");
65+
}
66+
}
67+
5668
sb.Append($"</ul></li>");
5769
}
5870
else
@@ -72,6 +84,7 @@ public static MvcHtmlString LaunchBar(this HtmlHelper htmlHelper)
7284

7385
sb.Append("'>").Append(launchBarItem.Attribute("title").Value).Append("</a></li>");
7486
}
87+
7588
}
7689

7790
return new MvcHtmlString(sb.ToString());

Components/XML/BExIS.Xml.Helpers/XmlMetadataConverter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,7 @@ public bool HasValidStructure(JObject metadataJson, long metadataStructureId, ou
623623

624624
// load example xml based on metadata structure
625625
var xmlMetadatWriter = new XmlMetadataWriter(BExIS.Xml.Helpers.XmlNodeMode.xPath);
626-
var metadataExample = xmlMetadatWriter.CreateMetadataXml(metadataStructureId);
626+
var metadataExample = xmlMetadatWriter.CreateTempMetadataXmlWithChoiceChildrens(metadataStructureId);
627627

628628
// get all elements from xml documents to compare
629629
var listOfElementsInput = XmlUtility.GetAllChildren(XmlUtility.ToXDocument(metadataInput).Root).Select(e => e.Name.LocalName);

Components/XML/BExIS.Xml.Helpers/XmlMetadataWriter.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ public XDocument CreateTempMetadataXmlWithChoiceChildrens(long metadataStructure
160160
package.SetAttributeValue("number", "1");
161161
role.Add(package);
162162

163-
setChildren(package, mpu);
163+
setChildren(package, mpu, null, true);
164164
}
165165

166166
return doc;
@@ -177,7 +177,7 @@ private bool IsChoice(XmlNode xmlNode)
177177
return false;
178178
}
179179

180-
private XElement setChildren(XElement element, BaseUsage usage, XDocument importDocument = null)
180+
private XElement setChildren(XElement element, BaseUsage usage, XDocument importDocument = null, bool withChoiceChildren = false )
181181
{
182182
MetadataAttribute metadataAttribute = null;
183183
MetadataPackage metadataPackage = null;
@@ -235,7 +235,7 @@ private XElement setChildren(XElement element, BaseUsage usage, XDocument import
235235

236236
foreach (var type in typeList)
237237
{
238-
setChildren(type, nestedUsage, importDocument);
238+
setChildren(type, nestedUsage, importDocument, withChoiceChildren);
239239
}
240240
}
241241
else
@@ -245,7 +245,7 @@ private XElement setChildren(XElement element, BaseUsage usage, XDocument import
245245
typeList = addAndReturnAttribute(element, nestedUsage, 1, 1);
246246

247247
if (nestedUsage.Extra == null || !IsChoice(nestedUsage.Extra))
248-
setChildren(typeList.FirstOrDefault(), nestedUsage, importDocument);
248+
setChildren(typeList.FirstOrDefault(), nestedUsage, importDocument, withChoiceChildren);
249249
}
250250
}
251251
}
@@ -286,7 +286,7 @@ private XElement setChildren(XElement element, BaseUsage usage, XDocument import
286286

287287
foreach (var type in typeList)
288288
{
289-
setChildren(type, attrUsage, importDocument);
289+
setChildren(type, attrUsage, importDocument, withChoiceChildren);
290290
}
291291
}
292292
else
@@ -295,8 +295,8 @@ private XElement setChildren(XElement element, BaseUsage usage, XDocument import
295295

296296
typeList = addAndReturnAttribute(element, attrUsage, 1, 1);
297297

298-
if (attrUsage.Extra == null || !IsChoice(attrUsage.Extra))
299-
setChildren(typeList.FirstOrDefault(), attrUsage, importDocument);
298+
if (attrUsage.Extra == null || (!IsChoice(attrUsage.Extra)|| withChoiceChildren))
299+
setChildren(typeList.FirstOrDefault(), attrUsage, importDocument, withChoiceChildren);
300300
}
301301
}
302302
}

Console/BExIS.Web.Shell.Svelte/package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Console/BExIS.Web.Shell.Svelte/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
},
5353
"type": "module",
5454
"dependencies": {
55-
"@bexis2/bexis2-core-ui": "0.4.68",
55+
"@bexis2/bexis2-core-ui": "0.4.74",
5656
"@sveltejs/adapter-static": "3.0.2",
5757
"buffer": "6.0.3",
5858
"gray-matter": "4.0.3",

0 commit comments

Comments
 (0)