Skip to content
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 property outputTitle to CustomCommand #3579

Merged
merged 1 commit into from
May 20, 2024

Conversation

stefanhaller
Copy link
Collaborator

@stefanhaller stefanhaller commented May 19, 2024

  • PR Description

Add property outputTitle to CustomCommand. It can optionally be used to set the title of the panel that shows the output of a command (when showOutput is true). If left unset, the command string is used as the title.

Closes #3576.

  • Please check if the PR fulfills these requirements
  • Cheatsheets are up-to-date (run go generate ./...)
  • Code has been formatted (see here)
  • Tests have been added/updated (see here for the integration test guide)
  • Text is internationalised (see here)
  • Docs (specifically docs/Config.md) have been updated if necessary
  • You've read through your own file changes for silly mistakes etc

Copy link

codacy-production bot commented May 19, 2024

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for 6343fb51 96.00%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (6343fb5) Report Missing Report Missing Report Missing
Head commit (22a38c9) 51247 43158 84.22%

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#3579) 50 48 96.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Codacy will stop sending the deprecated coverage status from June 5th, 2024. Learn more

Footnotes

  1. Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.

Copy link
Contributor

@AzraelSec AzraelSec left a comment

Choose a reason for hiding this comment

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

LGTM, @stefanhaller. I've left a small suggestion comment, but the feature works as expected; nice work!

return err
}
} else {
title = cmdStr
Copy link
Contributor

Choose a reason for hiding this comment

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

We could avoid having the else branch here by just assigning the cmdStr value to title as a default value and letting the conditional to override it if customCommand.OutputTitle != "". What do you think?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure, why not. Changed in ba35802.

It can optionally be used to set the title of the panel that shows the output of
a command (when showOutput is true). If left unset, the command string is used
as the title.
Copy link
Contributor

@AzraelSec AzraelSec left a comment

Choose a reason for hiding this comment

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

LGTM - I'll approve this to set my review as completed explicitly! 👍🏻

@stefanhaller stefanhaller merged commit 0fbed71 into master May 20, 2024
14 checks passed
@stefanhaller stefanhaller deleted the custom-command-output-title branch May 20, 2024 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: Allow defining custom popup title when using showOutput
2 participants