Extract common HTML templates and add address map links.#180
Extract common HTML templates and add address map links.#180supermartzin merged 3 commits intomainfrom
Conversation
Moved shared HTML templates to a new CommonHtmlTemplateElements class in a dedicated Templates project, referenced by both Email and File AdPostsHandlers. Enhanced the ad post template to include clickable map links (Google Maps, Mapy.com, Apple Maps) for addresses, updating both code and the sample HTML template. Updated project files and solution to include the new Templates project.
Summary of ChangesHello @supermartzin, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly improves the modularity and user experience of the ad post handling system. By extracting shared HTML templates into a new, centralized project, it reduces code duplication and simplifies future template modifications. The addition of interactive map links directly within the ad post displays provides a valuable new feature for users, allowing for quick navigation to property locations. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request successfully refactors the HTML templates into a shared project, which is a great improvement for maintainability. The addition of map links for addresses is also a useful feature.
My review includes two main points:
- There is significant code duplication between
EmailNotifyingAdPostsHandlerandLocalFileAdPostsHandlerfor generating the HTML for a single ad post. This has already introduced several bugs. I've recommended extracting this logic into a shared helper method in the newTemplatesproject. - A minor security improvement to use
https://for the Apple Maps link.
Overall, this is a good change that will be even better after addressing the code duplication.
Handlers/RealEstatesWatcher.AdPostsHandlers.File/LocalFileAdPostsHandler.cs
Show resolved
Hide resolved
Handlers/RealEstatesWatcher.AdPostsHandlers.Templates/CommonHtmlTemplateElements.cs
Outdated
Show resolved
Hide resolved
Replaced string.Replace chains with StringBuilder for building HTML post templates in both EmailNotifyingAdPostsHandler and LocalFileAdPostsHandler. Also updated Apple Maps link to use https instead of http in CommonHtmlTemplateElements and post-email-template.html for improved security.
Replaces 'postHtml' with 'postHtmlBuilder' in the fallback case for floor area replacement to ensure the correct variable is used for string replacement.
|


Moved shared HTML templates to a new CommonHtmlTemplateElements class in a dedicated Templates project, referenced by both Email and File AdPostsHandlers. Enhanced the ad post template to include clickable map links (Google Maps, Mapy.com, Apple Maps) for addresses, updating both code and the sample HTML template. Updated project files and solution to include the new Templates project.