Handle if no default HTML report template present in Solution.#4143
Conversation
WalkthroughThis update adds validation checks to ensure that a default HTML report configuration is present before proceeding with report generation and email operations. Various methods now query the solution repository for a default configuration, log error messages, and return early if the configuration is missing. Additionally, when adding new report templates, the system automatically assigns the default flag if no default exists, ensuring consistency in how report configurations are managed. Changes
Sequence Diagram(s)sequenceDiagram
participant Caller as Method Caller
participant Reporter as Report Generator/Operation
participant Repo as SolutionRepository
participant Logger as Logger
Caller->>Reporter: Initiate report/email execution
Reporter->>Repo: Query for default HTMLReportConfiguration
alt Default exists
Repo-->>Reporter: Return configuration
Reporter->>Reporter: Proceed with report generation/email sending
else No default found
Repo-->>Reporter: Return empty
Reporter->>Logger: Log error message
Reporter-->>Caller: Terminate execution (early exit)
end
sequenceDiagram
participant User as User Action
participant TreeView as Template Manager
participant Repo as SolutionRepository
User->>TreeView: Request to add new template
TreeView->>Repo: Check for existing default configuration
alt No default exists
TreeView->>TreeView: Mark new template as default
end
TreeView->>Repo: Add new HTMLReportConfiguration to repository
Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (4)
🔇 Additional comments (5)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
| { | ||
| if (RunSetActionHTMLReportSendEmail.HTMLReportTemplate == RunSetActionHTMLReportSendEmail.eHTMLReportTemplate.HTMLReport) | ||
| { | ||
| Reporter.ToLog(eLogLevel.ERROR, "Invalid Body Content type, No Default HTML Report template available to generate report. Please set a default template in Configurations -> Reports -> Reports Template."); |
There was a problem hiding this comment.
Please add this messages to Message dictionary and use from there
Handled below scenarios,
Thank you for your contribution.
Before submitting this PR, please make sure:
Summary by CodeRabbit