Skip to content

Conversation

@davidfowl
Copy link
Member

@davidfowl davidfowl commented Mar 27, 2024

  • Added support for sending custom style to the dashboard via the resource server protocol.
  • Use this for azure resource to show more descriptive state updates.

Contributes to #2590
Contributes to #2415
Fixes #2816

- Added support for sending custom style to the dashboard via the resource server protocol.
- Use this for azure resource to show more descriptive state updates.
@davidfowl davidfowl requested a review from drewnoakes March 27, 2024 08:23
@ghost ghost added the area-dashboard label Mar 27, 2024
// The list of urls that this resource exposes
repeated Url urls = 13;

// The style of the state. This is used to determine the state icon.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you consider encoding a FluentUI icon name (e.g. ErrorCircle), style (e.g. Filled) and colour (e.g. Blue) here instead? That would give a lot more control over the UI to the server.

Copy link
Member Author

@davidfowl davidfowl Mar 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer that actually. So just parse the enum? Should it be something like "Icons.Filled.Size16.Warning"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like they're not enums: https://github.com/microsoft/fluentui-blazor/tree/main/src/Assets/FluentUI.Icons/Icons

This method might help, though it doesn't look cheap so results should be cached:

https://github.com/microsoft/fluentui-blazor/blob/main/src/Assets/FluentUI.Icons/Icons.cs#L20

You pass it an instance of IconInfo which takes name, size and variant (filled/regular).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I decided to stick with fixed names.

Comment on lines +161 to +162

}).ConfigureAwait(false);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To make consistent with the code below:

Suggested change
}).ConfigureAwait(false);
})
.ConfigureAwait(false);

- This avoid reusing old state styles by mistake when changing text
- Added KnownResourceStyles
@davidfowl
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@davidfowl davidfowl enabled auto-merge (squash) March 28, 2024 04:30
@davidfowl davidfowl merged commit d7474a0 into main Mar 28, 2024
@davidfowl davidfowl deleted the davidfowl/state-style branch March 28, 2024 04:50
@davidfowl
Copy link
Member Author

/backport to release/8.0-preview5

@github-actions
Copy link
Contributor

Started backporting to release/8.0-preview5: https://github.com/dotnet/aspire/actions/runs/8462618319

@davidfowl davidfowl mentioned this pull request Mar 28, 2024
6 tasks
@github-actions github-actions bot locked and limited conversation to collaborators Apr 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dashboard "Removed" state still shows green status

4 participants