Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
93d9cbe
init `migrate-to-order-levels`
cihandeniz May 30, 2026
7bd6f03
migrate to order levels :warning: generate fails
cihandeniz May 30, 2026
a05b907
change theme level order after ux level
dncsvr Jun 1, 2026
7ff46b0
prototype convention matrix system
cihandeniz Jun 1, 2026
f6b48db
fix compiler errors
dncsvr Jun 1, 2026
1a81377
fix generate errors
dncsvr Jun 1, 2026
763b0d0
fix form sample page output changes
dncsvr Jun 2, 2026
56503a8
make hardcoded order fallback setup configurable
dncsvr Jun 2, 2026
1cdc9f7
edit add locate action order to fix api route changes
dncsvr Jun 3, 2026
b2644d0
change index value to immutable list
dncsvr Jun 3, 2026
4c14680
fix managing orders tests
dncsvr Jun 3, 2026
c094377
fix failing tests
dncsvr Jun 3, 2026
ff52f18
use Min for builtin types and nullable types feature convention orders
dncsvr Jun 3, 2026
744002c
add applying conventions test case for full base level extension orde…
dncsvr Jun 3, 2026
f0c9eed
use Max for ActionModel and ParameterModel attribute conventions
dncsvr Jun 3, 2026
8d3431b
use Max order in LocatableExtensions feature
dncsvr Jun 3, 2026
dbc2843
add default values for convention matrix and default leve
dncsvr Jun 3, 2026
2fd7e9b
add OrderMatrix to manage convention defaults
dncsvr Jun 5, 2026
13663b7
refactor OrderMatrix
dncsvr Jun 8, 2026
715fce2
minor edits
dncsvr Jun 8, 2026
87a5e2d
move domain model convention collection extensions to Business Extens…
dncsvr Jun 8, 2026
b4cfb24
rename User level to Custom
dncsvr Jun 8, 2026
1119e37
change OrderMatrix to private
dncsvr Jun 8, 2026
88efef8
set adding ActionAttribute order to absolut min
dncsvr Jun 8, 2026
84ef3d2
minor edits
dncsvr Jun 8, 2026
c212a93
use "Default" as default value for base, level and extensions
dncsvr Jun 8, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Baked.Architecture;
using Baked.Domain.Configuration;
using Baked.Playground.Caching;
using Baked.Ui;

Expand All @@ -16,7 +17,8 @@ public void Configure(LayerConfigurator configurator)
{
tp.Schema.Tabs[0].Contents[0].Narrow = true;
tp.Schema.Tabs[0].Contents[1].Narrow = true;
}
},
order: Order.At.Override
);
});
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Baked.Architecture;
using Baked.Domain.Configuration;
using Baked.Playground.Orm;
using Baked.RestApi;
using Baked.Theme.Default;

namespace Baked.Playground.Override.Domain;
Expand All @@ -15,12 +15,13 @@ public void Configure(LayerConfigurator configurator)

conventions.AddPropertyAttributeConfiguration<DataAttribute>(
when: c => c.Type.Is<Child>() && c.Property.PropertyType.Is<ParentWrapper>() || c.Property.PropertyType.Is<IParentInterface>(),
attribute: data => data.Visible = false
attribute: data => data.Visible = false,
order: Order.At.Override
);

conventions.RemoveMethodAttribute<ActionAttribute>(
when: c => c.Type.Is<Child>(),
order: RestApiLayer.MaxConventionOrder + 15
order: Order.At.Theme.Override
);
});
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Baked.Architecture;
using Baked.Domain.Configuration;
using Baked.Playground.Business;

namespace Baked.Playground.Override.Domain;
Expand All @@ -11,52 +12,60 @@ public void Configure(LayerConfigurator configurator)
{
conventions.SetTypeAttribute(
attribute: () => new CustomAttribute(),
when: c => c.Type.Is<Class>()
when: c => c.Type.Is<Class>(),
order: Order.At.Override
);
conventions.AddTypeAttributeConfiguration<CustomAttribute>(
attribute: attr => attr.Value = "FROM CONVENTION",
when: c => c.Type.Is<Class>()
when: c => c.Type.Is<Class>(),
order: Order.At.Override
);

conventions.SetPropertyAttribute(
attribute: () => new CustomAttribute(),
when: c =>
c.Type.Is<Record>() &&
c.Property.Name == nameof(Record.Text)
c.Property.Name == nameof(Record.Text),
order: Order.At.Override
);
conventions.AddPropertyAttributeConfiguration<CustomAttribute>(
attribute: attr => attr.Value = "FROM CONVENTION",
when: c =>
c.Type.Is<Record>() &&
c.Property.Name == nameof(Record.Text)
c.Property.Name == nameof(Record.Text),
order: Order.At.Override
);

conventions.SetMethodAttribute(
attribute: () => new CustomAttribute(),
when: c =>
c.Type.Is<Class>() &&
c.Method.Name == nameof(Class.Method)
c.Method.Name == nameof(Class.Method),
order: Order.At.Override
);
conventions.AddMethodAttributeConfiguration<CustomAttribute>(
attribute: attr => attr.Value = "FROM CONVENTION",
when: c =>
c.Type.Is<Class>() &&
c.Method.Name == nameof(Class.Method)
c.Method.Name == nameof(Class.Method),
order: Order.At.Override
);

conventions.SetParameterAttribute(
attribute: () => new CustomAttribute(),
when: c =>
c.Type.Is<MethodSamples>() &&
c.Method.Name == nameof(MethodSamples.PrimitiveParameters) &&
c.Parameter.Name == "string"
c.Parameter.Name == "string",
order: Order.At.Override
);
conventions.AddParameterAttributeConfiguration<CustomAttribute>(
attribute: attr => attr.Value = "FROM CONVENTION",
when: c =>
c.Type.Is<MethodSamples>() &&
c.Method.Name == nameof(MethodSamples.PrimitiveParameters) &&
c.Parameter.Name == "string"
c.Parameter.Name == "string",
order: Order.At.Override
);
});
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Baked.Architecture;
using Baked.Business;
using Baked.Domain.Configuration;
using Baked.Playground.CodingStyle.Id;

namespace Baked.Playground.Override.Domain;
Expand All @@ -12,7 +13,8 @@ public void Configure(LayerConfigurator configurator)
{
conventions.AddPropertyAttributeConfiguration<IdAttribute>(
when: c => c.Type.Is<EntityWithAssignedGuidId>(),
attribute: id => id.AssignedGuid()
attribute: id => id.AssignedGuid(),
order: Order.At.Override
);
});
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Baked.Architecture;
using Baked.Business;
using Baked.Domain.Configuration;
using Baked.Playground.CodingStyle.Id;

namespace Baked.Playground.Override.Domain;
Expand All @@ -12,7 +13,8 @@ public void Configure(LayerConfigurator configurator)
{
conventions.AddPropertyAttributeConfiguration<IdAttribute>(
when: c => c.Type.Is<EntityWithAssignedId>(),
attribute: id => id.Assigned()
attribute: id => id.Assigned(),
order: Order.At.Override
);
});
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Baked.Architecture;
using Baked.Business;
using Baked.Domain.Configuration;
using Baked.Playground.CodingStyle.Id;

namespace Baked.Playground.Override.Domain;
Expand All @@ -12,7 +13,8 @@ public void Configure(LayerConfigurator configurator)
{
conventions.AddPropertyAttributeConfiguration<IdAttribute>(
when: c => c.Type.Is<EntityWithAutoIncrementId>(),
attribute: id => id.AutoIncrement()
attribute: id => id.AutoIncrement(),
order: Order.At.Override
);
});
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Baked.Architecture;
using Baked.Business;
using Baked.Domain.Configuration;
using Baked.Playground.Orm;
using Baked.Playground.Theme;
using Baked.Theme;
Expand All @@ -18,17 +19,20 @@ public void Configure(LayerConfigurator configurator)
{
conventions.AddMethodAttributeConfiguration<ActionAttribute>(
when: c => c.Type.Is<FormSample>() && c.Method.Name == nameof(FormSample.NewParent),
attribute: (a, c) => a.RoutePathBack = "/form-sample"
attribute: (a, c) => a.RoutePathBack = "/form-sample",
order: Order.At.Override
);

conventions.AddMethodAttributeConfiguration<ActionAttribute>(
when: c => c.Type.Is<Parent>() && c.Method.Name.Contains("Child"),
attribute: a => a.HideInLists = true
attribute: a => a.HideInLists = true,
order: Order.At.Override
);

conventions.SetMethodAttribute(
when: c => c.Type.Is<FormSample>() && c.Method.Name == nameof(FormSample.GetParents),
attribute: () => new QueryMethodAttribute()
attribute: () => new QueryMethodAttribute(),
order: Order.At.Defaults
);

conventions.AddMethodComponentConfiguration<FormPage>(
Expand All @@ -37,14 +41,16 @@ public void Configure(LayerConfigurator configurator)
{
fp.Schema.ForEachInputGroup(g => g.Wide = true);
fp.Schema.Sections[0].InputGroups.Move("name", toTop: true);
}
},
order: Order.At.Override
);

// Properties
conventions.AddPropertyComponent(
when: c => c.Property.PropertyType.SkipNullable().IsEnum,
where: cc => cc.Path.StartsWith(nameof(Page), nameof(FormSample)),
component: () => B.Text()
component: () => B.Text(),
order: Order.At.Override
);
});
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Baked.Architecture;
using Baked.Business;
using Baked.Domain.Configuration;
using Baked.Playground.CodingStyle.Locatable;

namespace Baked.Playground.Override.Domain;
Expand All @@ -12,7 +13,8 @@ public void Configure(LayerConfigurator configurator)
{
conventions.SetTypeAttribute(
when: c => c.Type.Is<ILocatable>(),
attribute: () => new LocatableAttribute()
attribute: () => new LocatableAttribute(),
order: Order.At.Override
);
});
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Baked.Architecture;
using Baked.Business;
using Baked.Domain.Configuration;
using Baked.Playground.Orm;
using Baked.RestApi;
using Baked.RestApi.Model;
using Baked.Theme.Default;
using Baked.Ui;
Expand All @@ -20,12 +20,13 @@ public void Configure(LayerConfigurator configurator)

conventions.SetPropertyAttribute(
when: c => c.Type.Is<Parent>() && c.Property.Name == nameof(Parent.Surname),
attribute: () => new LabelAttribute()
attribute: () => new LabelAttribute(),
order: Order.At.Override
);

conventions.RemoveMethodAttribute<ActionAttribute>(
when: c => c.Type.Is<Parent>() && c.Method.Name == nameof(Parent.RemoveChild),
order: RestApiLayer.MaxConventionOrder + 15
order: Order.At.Theme.Override
);

// Move `AddChild` action to contents
Expand All @@ -38,7 +39,8 @@ public void Configure(LayerConfigurator configurator)
var addChildRoute = addChild.Get<ActionModelAttribute>().GetRoute();

pt.Schema.Actions.RemoveAll(a => a.Action is RemoteAction ra && ra.Path == addChildRoute);
}
},
order: Order.At.Override
);

conventions.AddTypeComponentConfiguration<SimplePage>(
Expand All @@ -50,23 +52,27 @@ public void Configure(LayerConfigurator configurator)
dp.Schema.Contents.Add(
addChild.GenerateRequiredSchema<Content>(cc.Drill(nameof(SimplePage), nameof(SimplePage.Contents)))
);
}
},
order: Order.At.Override
);
}

conventions.AddMethodSchemaConfiguration<Content>(
when: c => c.Type.Is<Parent>() && c.Method.Name == nameof(Parent.AddChild),
schema: s => s.Side = true
schema: s => s.Side = true,
order: Order.At.Override
);

conventions.AddTypeComponentConfiguration<Fieldset>(
when: c => c.Type.Is<Parent>(),
component: dt => dt.ReloadOn(nameof(Parent.Update).Kebaberize())
component: dt => dt.ReloadOn(nameof(Parent.Update).Kebaberize()),
order: Order.At.Override
);

conventions.AddMethodComponentConfiguration<DataTable>(
when: c => c.Type.Is<Parent>() && c.Method.Name == nameof(Parent.GetChildren),
component: dt => dt.ReloadOn(nameof(Parent.AddChild).Kebaberize())
component: dt => dt.ReloadOn(nameof(Parent.AddChild).Kebaberize()),
order: Order.At.Override
);
});
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Baked.Architecture;
using Baked.Business;
using Baked.Domain.Configuration;
using Baked.Playground.Theme;
using Baked.Ui;

Expand All @@ -19,37 +20,44 @@ public void Configure(LayerConfigurator configurator)
// Tabs
conventions.AddMethodAttributeConfiguration<GroupAttribute>(
when: c => c.Type.Is<ReportPageSample>() && c.Method.DefaultOverload.ReturnType.SkipTask().Is<string>(),
attribute: group => group.TabName = "SingleValue"
attribute: group => group.TabName = "SingleValue",
order: Order.At.Override
);
conventions.AddMethodAttributeConfiguration<GroupAttribute>(
when: c => c.Type.Is<ReportPageSample>() && c.Method.DefaultOverload.ReturnsList(),
attribute: group => group.TabName = "DataTable"
attribute: group => group.TabName = "DataTable",
order: Order.At.Override
);
conventions.AddTypeComponent(
when: c => c.Type.Is<ReportPageSample>(),
where: cc => cc.Path.EndsWith("SingleValue", nameof(Tab.Icon)),
component: () => B.Icon("pi-box")
component: () => B.Icon("pi-box"),
order: Order.At.Override
);
conventions.AddTypeComponent(
when: c => c.Type.Is<ReportPageSample>(),
where: cc => cc.Path.EndsWith("DataTable", nameof(Tab.Icon)),
component: () => B.Icon("pi-table")
component: () => B.Icon("pi-table"),
order: Order.At.Override
);

// Allowing admin token for report api
conventions.AddMethodSchemaConfiguration<RemoteData>(
when: c => c.Type.Is<ReportPageSample>(),
schema: rd => rd.Headers = Inline(new { Authorization = "token-admin-ui" })
schema: rd => rd.Headers = Inline(new { Authorization = "token-admin-ui" }),
order: Order.At.Override
);

// Parameter overrides
conventions.AddParameterComponent(
when: c => c.Type.Is<ReportPageSample>() && c.Method.Name == nameof(ReportPageSample.With) && !c.Parameter.IsNullable,
component: (c, cc) => ParameterSelect(c.Parameter, cc)
component: (c, cc) => ParameterSelect(c.Parameter, cc),
order: Order.At.Override
);
conventions.AddParameterComponent(
when: c => c.Type.Is<ReportPageSample>() && c.Method.Name == nameof(ReportPageSample.GetFirst) && c.Parameter.Name == "count",
component: (c, cc) => ParameterSelect(c.Parameter, cc)
component: (c, cc) => ParameterSelect(c.Parameter, cc),
order: Order.At.Override
);

// Page overrides
Expand All @@ -63,7 +71,8 @@ public void Configure(LayerConfigurator configurator)
tp.Schema.Tabs[0].Contents[1].Component.Schema.As<DataPanel>().Collapsed = true;
tp.Schema.Tabs[0].Contents[2].Component.Schema.As<DataPanel>().Collapsed = true;
tp.Schema.Tabs[1].Contents[1].Component.Schema.As<DataPanel>().Collapsed = true;
}
},
order: Order.At.Override
);
});
}
Expand Down
Loading