-
Notifications
You must be signed in to change notification settings - Fork 533
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
Update display name and description for built-in lifecycle commands #7334
base: main
Are you sure you want to change the base?
Update display name and description for built-in lifecycle commands #7334
Conversation
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 1 out of 17 changed files in this pull request and generated no comments.
Files not reviewed (16)
- src/Aspire.Dashboard/Aspire.Dashboard.csproj: Language not supported
- src/Aspire.Dashboard/Resources/Commands.Designer.cs: Language not supported
- src/Aspire.Dashboard/Resources/Commands.resx: Language not supported
- src/Aspire.Dashboard/Resources/xlf/Commands.cs.xlf: Language not supported
- src/Aspire.Dashboard/Resources/xlf/Commands.de.xlf: Language not supported
- src/Aspire.Dashboard/Resources/xlf/Commands.es.xlf: Language not supported
- src/Aspire.Dashboard/Resources/xlf/Commands.fr.xlf: Language not supported
- src/Aspire.Dashboard/Resources/xlf/Commands.it.xlf: Language not supported
- src/Aspire.Dashboard/Resources/xlf/Commands.ja.xlf: Language not supported
- src/Aspire.Dashboard/Resources/xlf/Commands.ko.xlf: Language not supported
- src/Aspire.Dashboard/Resources/xlf/Commands.pl.xlf: Language not supported
- src/Aspire.Dashboard/Resources/xlf/Commands.pt-BR.xlf: Language not supported
- src/Aspire.Dashboard/Resources/xlf/Commands.ru.xlf: Language not supported
- src/Aspire.Dashboard/Resources/xlf/Commands.tr.xlf: Language not supported
- src/Aspire.Dashboard/Resources/xlf/Commands.zh-Hans.xlf: Language not supported
- src/Aspire.Dashboard/Resources/xlf/Commands.zh-Hant.xlf: Language not supported
.ToImmutableArray(); | ||
|
||
// Use custom localizations for built-in lifecycle commands | ||
static (string DisplayName, string DisplayDescription) GetDisplayNameAndDescription(string commandName, string displayName, string description) |
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 thought we were going to add localized values to the proto, so that other resource services (like that in ACA) can also have localized command strings.
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 see James suggested this approach in the linked issue. I don't think it'd be too bad to add support for this to the proto. I would expect ACA to have loc requirements. cc @snehapar9
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 is a temporary solution for 9.1, we can improve this later @drewnoakes
@@ -30,6 +29,6 @@ | |||
|
|||
private void OnExceptionDetailsClicked(MouseEventArgs e) | |||
{ | |||
_ = TextVisualizerDialog.OpenDialogAsync(ViewportInformation, DialogService, Loc[nameof(ControlsStrings.ExceptionDetailsTitle)], ExceptionText); | |||
_ = TextVisualizerDialog.OpenDialogAsync(ViewportInformation, DialogService, DialogsLoc[nameof(Dashboard.Resources.Dialogs.DialogCloseButtonText)], Loc[nameof(ControlsStrings.ExceptionDetailsTitle)], ExceptionText); |
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.
Pass the DialogsLoc into the method and get the text from it inside the method. Removes some duplication.
const string startCommandName = "resource-start"; | ||
const string stopCommandName = "resource-stop"; | ||
const string restartCommandName = "resource-restart"; | ||
|
||
if (commandName is startCommandName) | ||
{ | ||
return (CommandsResources.StartCommandDisplayName, CommandsResources.StartCommandDisplayDescription); | ||
} | ||
|
||
if (commandName is stopCommandName) | ||
{ | ||
return (CommandsResources.StopCommandDisplayName, CommandsResources.StopCommandDisplayDescription); | ||
} | ||
|
||
if (commandName is restartCommandName) | ||
{ | ||
return (CommandsResources.RestartCommandDisplayName, CommandsResources.RestartCommandDisplayDescription); | ||
} | ||
|
||
return (displayName, description); |
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.
A switch expression would work well here.
const string startCommandName = "resource-start"; | ||
const string stopCommandName = "resource-stop"; | ||
const string restartCommandName = "resource-restart"; |
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.
Add an internal KnownResourceCommands
type in the shared folder and move the strings there (same pattern as KnownResourceTypes
, etc).
KnownResourceCommands
can be used here and in CommandsConfigurationExtensions
. This prevents the command names from accidently going out of sync between app host and dashboard.
Good to merge once changes above are made. |
Description
Fixes #6982 - sets the display name and description for the three lifecycle commands in the resource service
Checklist
<remarks />
and<code />
elements on your triple slash comments?breaking-change
template):doc-idea
template):