Skip to content

Tabs for Entity Disappearing #147

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jho-md opened this issue Apr 8, 2025 · 4 comments
Open

Tabs for Entity Disappearing #147

jho-md opened this issue Apr 8, 2025 · 4 comments
Labels
bug Something isn't working state/sprint-candidate

Comments

@jho-md
Copy link

jho-md commented Apr 8, 2025

Describe the bug
When viewing an entity, configured tabs sometimes do not show up.

Steps To Reproduce
Steps to reproduce the behavior:

  1. Configure an entity with multiple tabs, and add to a collection.
  2. Create a sample entity.
  3. Navigate to the entity.
  4. See that sometimes the tabs will not appear. Upon a hard refresh, they come back again.

Expected behavior
The tabs should appear consistently.

Screenshots

When navigating to an entity.
Image

When navigating to an entity after a browser hard refresh (expected behavior)
Image

Environment (please complete the following information):

  • Server OS: Windows
  • Browser: Chrome
  • Umbraco Version: 15.3.0
  • Product Version: 15.1.2

This item has been added to our backlog AB#51755

@jho-md jho-md added the bug Something isn't working label Apr 8, 2025
@nathanwoulfe
Copy link

@jho-md are you able to share your configuration? I'm unsure as to how you've rendered those tabs, given the AddTab() method (in my testing at least) results in this:

Image

From your screenshot, those appear to be child collections, which are rendered as Context App (aka Workspace Views) on the entity.

@andrejd22
Copy link

Any updates on this issue?

Also noticed that when opening an entity with a child collection for the first time, the child collections are visible. But after closing that entity and opening another or same, the child collection tabs are gone. They only appear again after refreshing the page.

@acoumb
Copy link

acoumb commented May 5, 2025

@andrejd22 could you share a sample configuration with me?

@andrejd22
Copy link

@acoumb It's simplified (with changed field names), but there's nothing special in this configuration:

public static void ConfigureSection(this SectionConfigBuilder config) => config
	.Tree(config => config
		.AddCollection<MyClass>(o => o.Id, "My Class", "My Classes", "Example: Class, etc", "icon-stacked-disks", "icon-stacked-disks", config => config
			.SetAlias(CollectionAlias.MyClass)
			.SetOrdinal(10)
			.SetRepositoryType<MyClassRepository>()
			.ShowOnSummaryDashboard()
			.SetIconColor("orange")
			.SetNameProperty(o => o.Name)
			.AddCard("Status1", "icon-checkbox", o => o.Status == "Status1", config => config
				.SetColor("green")
			)
			.AddCard("Status2", "icon-delete", o => o.Status == "Status2", config => config
				.SetColor("pink")
			)
			.ListView(config => config
				.AddField(o => o.Status)
				.AddField(o => o.CreatedOn)
				.AddField(o => o.LastModified)
				// Temporary workaround for pagination bug (applied for each collection):
				// On first load, the frontend incorrectly uses the default page size of 10 
				// instead of applying the collection settings (which default to 20).
				// To avoid broken pagination and mismatched UI behavior,
				// we explicitly set the page size to 10 if not otherwise set.
				// TODO: Remove this when frontend correctly applies collection settings on initial load.
				.SetPageSize(10)
			)
			.SetSortProperty(o => o.CreatedOn, SortDirection.Descending)
			.AddDataView("Active", o => o.Status != "Status2")
			.AddDataView("All", o => o.Id > int.MinValue)
			.AddFilterableProperty(o => o.Status)
			.Editor(config => config
				.AddTab("General", config => config
					.AddFieldset("General", config => config
						.AddField(o => o.Status)
							.MakeRequired()
							.SetDataType(Guid.Parse("46be4ebf-ff3e-49d0-a4f3-14c10a3d0035"))
							.SetValueMapper<StatusMapper>()
					)
					.AddFieldset("Static", config => config
						.AddField(o => o.Id).MakeReadOnly()
						.AddField(o => o.CreatedOn).MakeReadOnly()
						.AddField(o => o.LastModified).MakeReadOnly()
						.SetVisibility(o => o.EditorMode == EditorMode.Edit)
					)
				)
			)
			.AddChildCollection<MyClassChild>(o => o.Id, o => o.MyClassId, "My Class Child", "My Classes Child", "Example: Class, etc", "icon-calendar", "icon-calendar", config => config
				.SetAlias(CollectionAlias.MyClassChild)
				.SetRepositoryType<MyClassChildRepository>()
				.SetIconColor("orange")
				.SetNameProperty(o => o.Name)
				.ListView(config => config
					.AddField(o => o.Status)
					.AddField(o => o.CreatedOn)
					.AddField(o => o.LastModified)
					.SetPageSize(10)
				)
				.SetSortProperty(o => o.Name, SortDirection.Descending)
				.AddDataView("All", o => o.Id > int.MinValue)
				.AddDataView("Active", o => o.Status == "Active")
				.Editor(config => config
					.AddTab("General", config => config
						.AddFieldset("General", config =>
						{
							config
								.AddField(o => o.Status)
									.MakeRequired()
									.SetDataType(Guid.Parse("01201edf-572f-43d8-b8a5-23a72554034d"))
									.SetValueMapper<StatusMapper>();
						})
						.AddFieldset("Static", config => config
							.AddField(o => o.Id).MakeReadOnly()
							.AddField(o => o.CreatedOn).MakeReadOnly()
							.AddField(o => o.LastModified).MakeReadOnly()
							.SetVisibility(o => o.EditorMode == EditorMode.Edit)
						)
					)
				)
			)
		)
	);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working state/sprint-candidate
Projects
None yet
Development

No branches or pull requests

4 participants