-
Notifications
You must be signed in to change notification settings - Fork 539
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
Add display name and priority support to endpoints #7442
base: main
Are you sure you want to change the base?
Add display name and priority support to endpoints #7442
Conversation
I'm trying to figure out if we should split the visual impact of the endpoint vs the endpoint definition. They should be different annotations. |
Why should they? If display name is a friendly name for the endpoint, that seems like an integral part of the definition itself |
This data doesn't go into the manifest right? I am thinking that there's a core annotation that is used for networking and another part of it that is used for display in the dashboard. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 12 out of 27 changed files in this pull request and generated no comments.
Files not reviewed (15)
- src/Aspire.Dashboard/Resources/ControlsStrings.Designer.cs: Language not supported
- src/Aspire.Dashboard/Resources/ControlsStrings.resx: Language not supported
- src/Aspire.Dashboard/Resources/xlf/ControlsStrings.cs.xlf: Language not supported
- src/Aspire.Dashboard/Resources/xlf/ControlsStrings.de.xlf: Language not supported
- src/Aspire.Dashboard/Resources/xlf/ControlsStrings.es.xlf: Language not supported
- src/Aspire.Dashboard/Resources/xlf/ControlsStrings.fr.xlf: Language not supported
- src/Aspire.Dashboard/Resources/xlf/ControlsStrings.it.xlf: Language not supported
- src/Aspire.Dashboard/Resources/xlf/ControlsStrings.ja.xlf: Language not supported
- src/Aspire.Dashboard/Resources/xlf/ControlsStrings.ko.xlf: Language not supported
- src/Aspire.Dashboard/Resources/xlf/ControlsStrings.pl.xlf: Language not supported
- src/Aspire.Dashboard/Resources/xlf/ControlsStrings.pt-BR.xlf: Language not supported
- src/Aspire.Dashboard/Resources/xlf/ControlsStrings.ru.xlf: Language not supported
- src/Aspire.Dashboard/Resources/xlf/ControlsStrings.tr.xlf: Language not supported
- src/Aspire.Dashboard/Resources/xlf/ControlsStrings.zh-Hans.xlf: Language not supported
- src/Aspire.Dashboard/Resources/xlf/ControlsStrings.zh-Hant.xlf: Language not supported
Comments suppressed due to low confidence (1)
src/Aspire.Dashboard/Model/ResourceViewModel.cs:330
- The constructor parameters 'displayName' and 'priority' should be renamed to 'DisplayName' and 'Priority' to match the property names.
public UrlViewModel(string name, Uri url, bool isInternal, string? displayName = null, int? priority = null)
Thinking out loud, maybe it's fine to create a nested display properties on WithEndpoint("name", e => e.DisplayName = "") |
What do other people think about having the grid in details showing a name and display name column? It feels like we lose out on the simplicit of a name/value grid. Instead, what about showing the display name as the link text in the value column? The visualizer would open to show the underlying address. That makes the details consistent with what is shown in the grid (which shows the link using the display name), lets endpoints grid still be name/value, and it makes the code simpler. On the other hand, it makes it more difficult to see the address port in details at a glance, which people might want. Thoughts? |
Not a fan of the 2 columns |
Yeah, there's a tension between showing all the data and adding more visual complexity.
was the reason I initially added the third column - I'd prefer to be able to see the endpoint URL without needing to hover over the value, but don't have a strong opinion here |
Yeah I like that idea. Done |
Add a display name to some endpoints in TestShop. I'll pull the branch and try it out tomorrow. |
/// <summary> | ||
/// Gets the display properties for this endpoint. | ||
/// </summary> | ||
public EndpointDisplayProperties DisplayProperties => EndpointAnnotation.DisplayProperties; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Who uses this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Address the breaking change and this is good to go!
|
||
public static class ResourceBuilderExtensions | ||
{ | ||
public static IResourceBuilder<T> WithModifiedEndpoints<T>(this IResourceBuilder<T> builder, Action<EndpointAnnotation> callback) where T : IResourceWithEndpoints |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need this?
.WithModifiedEndpoints(c => | ||
{ | ||
c.DisplayProperties.DisplayName = "TestShop frontend access"; | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a bit of a sledge hammer to give names to endpoints from the launch profile.
@davidfowl Do you want to be able to give names to individual endpoints from the launch profile? Is there an existing pattern for enriching EndpointAnnotation
instances created from the launch profile with extra values?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so yes.
I'd also want to use this in the |
What do you want to be displayed? |
Don't block on this. |
Description
Adds two optional properties to
Url
andEndpointAnnotation
- namely, DisplayName and Priority, that are used in the dashboard to determine 1) display order, and 2) display name.Links still show up on the dashboard, just with the text replaced with the display name if set.
![image](https://private-user-images.githubusercontent.com/20359921/410648846-b34ab4fd-d542-4e64-b049-1119714be245.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyMzQ0MzQsIm5iZiI6MTczOTIzNDEzNCwicGF0aCI6Ii8yMDM1OTkyMS80MTA2NDg4NDYtYjM0YWI0ZmQtZDU0Mi00ZTY0LWIwNDktMTExOTcxNGJlMjQ1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDAwMzUzNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTEzNWE1MmQwMGU0MTJlNTQxMzJlODgzMmEzNGQ2NGQ4YmIwYWQzMGJhOGRlZWMzNzYzMGE4MzY1ZDBjOTJjZGUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.AGaGP4nQRK_Sla5pCkStBuClZmnHOECubJ2TzTzquCY)
Additionally, adds a third Display name column to the dashboard that shows the display name of the endpoint if it is set.
![image](https://private-user-images.githubusercontent.com/20359921/410648332-7af4de2a-e76d-4dd6-8e22-6df48dfa8751.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyMzQ0MzQsIm5iZiI6MTczOTIzNDEzNCwicGF0aCI6Ii8yMDM1OTkyMS80MTA2NDgzMzItN2FmNGRlMmEtZTc2ZC00ZGQ2LThlMjItNmRmNDhkZmE4NzUxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDAwMzUzNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTUyZTEzY2QwMzFhM2E5NDA4OGEwMzdhYzYxZWQwY2YwYWJiYjExNzFhOGZlODBhZTViOTc1YWQ2YjU1YzM1MWYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.7uFrpRzRQTzeM5QitIEmzB15xruidnZliQA_Iuopnuc)
(no display names)
(pgAdmin has a display name)
![image](https://private-user-images.githubusercontent.com/20359921/410648509-22bc83fe-be2c-4707-8d80-77521c876724.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyMzQ0MzQsIm5iZiI6MTczOTIzNDEzNCwicGF0aCI6Ii8yMDM1OTkyMS80MTA2NDg1MDktMjJiYzgzZmUtYmUyYy00NzA3LThkODAtNzc1MjFjODc2NzI0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDAwMzUzNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTExYzc2MjdkNDAzZTVmZGI5MTliNzUwODRjM2U3MTkyZmNlYzY5YmVmN2I4Mjc5ZmYxNDdjMWYyNjhjZTM4NTAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.3XnbQisHQ6zy2itrC7Z2feEGTCt_v3jHVuSVr56sIkk)
Also sets the endpoint display name on the CosmosDB data explorer to "Data Explorer".
Fixes #7104
Checklist
<remarks />
and<code />
elements on your triple slash comments?breaking-change
template):doc-idea
template):