added new fileds to display properties#30
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 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 (
|
There was a problem hiding this comment.
Hello @vignesh-kandula-shipsy, 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!
Summary of Changes
This pull request adds new fields to the display properties for issues. Specifically, it introduces 'hub_name', 'customer_name', 'vendor_name', and 'worker_name' as new displayable properties. The changes involve modifying the issue model in the API server, updating constants in the web core, and adjusting the issue helper to include these new properties.
Highlights
- New Display Properties: Adds 'hub_name', 'customer_name', 'vendor_name', and 'worker_name' to the issue display properties.
- API Server Update: Modifies the
get_default_display_propertiesfunction inapiserver/plane/db/models/issue.pyto include the new properties. - Web Core Constants: Updates
web/core/constants/issue.tsandweb/core/constants/spreadsheet.tsto define the new properties and their associated metadata. - Issue Helper: Adjusts
web/helpers/issue.helper.tsto incorporate the new properties into the computed display properties.
Changelog
- apiserver/plane/db/models/issue.py
- Added 'hub_name', 'customer_name', 'vendor_name', and 'worker_name' to the default display properties in
get_default_display_propertiesfunction (lines 85-88).
- Added 'hub_name', 'customer_name', 'vendor_name', and 'worker_name' to the default display properties in
- web/core/constants/issue.ts
- Added new properties ('hub_name', 'customer_name', 'vendor_name', 'worker_name') to the
whileListedCustomPropertiesarray (lines 120-123).
- Added new properties ('hub_name', 'customer_name', 'vendor_name', 'worker_name') to the
- web/core/constants/spreadsheet.ts
- Added definitions for 'hub_name', 'customer_name', 'vendor_name', and 'worker_name' in the
SPREADSHEET_PROPERTY_DETAILSobject, including titles, order keys, and icons (lines 235-270). - Added 'hub_name', 'customer_name', 'vendor_name', and 'worker_name' to the
SPREADSHEET_PROPERTY_LISTarray (lines 294-297).
- Added definitions for 'hub_name', 'customer_name', 'vendor_name', and 'worker_name' in the
- web/helpers/issue.helper.ts
- Included 'hub_name', 'customer_name', 'vendor_name', and 'worker_name' in the
getComputedDisplayPropertiesfunction, setting their default value totrue(lines 316-319).
- Included 'hub_name', 'customer_name', 'vendor_name', and 'worker_name' in the
Using Gemini Code Assist
The 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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and 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 to provide feedback.
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.
Trivia time!
What is TypeScript, and what problem does it solve?
Click here for the answer
TypeScript is a superset of JavaScript that adds static typing. It helps catch errors during development, improves code readability, and enables better tooling support.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Code Review
The pull request adds new fields to display properties, enhancing the issue model and spreadsheet functionality. The changes seem well-organized and consistent across the files. However, a few potential improvements could be considered.
Summary of Findings
- Consistency in naming: While the new fields are added, ensure that the naming conventions are consistent across the codebase. For example, using
Refinstead ofReferenceor vice versa. - Potential for code duplication: The addition of similar blocks of code for each new field in
web/core/constants/spreadsheet.tsmight indicate a need for refactoring to reduce duplication.
Merge Readiness
The pull request is almost ready for merging. Addressing the naming consistency and potential code duplication issues would further improve the code quality. I am unable to directly approve this pull request, and recommend that others review and approve this code before merging. Given the medium severity comment, I recommend that the author address it before merging.
| "hub_name":True, | ||
| "customer_name":True, | ||
| "vendor_name":True, | ||
| "worker_name":True, |
There was a problem hiding this comment.
| hub_name: { | ||
| title: "Hub Name", | ||
| ascendingOrderKey: "hub_name", | ||
| ascendingOrderTitle: "A", | ||
| descendingOrderKey: "-hub_name", | ||
| descendingOrderTitle: "Z", | ||
| icon: Tags, | ||
| Column: SpreadsheetStandardPropertyColumn, | ||
| }, | ||
| customer_name: { | ||
| title: "Customer Name", | ||
| ascendingOrderKey: "customer_name", | ||
| ascendingOrderTitle: "A", | ||
| descendingOrderKey: "-customer_name", | ||
| descendingOrderTitle: "Z", | ||
| icon: Tags, | ||
| Column: SpreadsheetStandardPropertyColumn, | ||
| }, | ||
| vendor_name: { | ||
| title: "Vendor Name", | ||
| ascendingOrderKey: "vendor_name", | ||
| ascendingOrderTitle: "A", | ||
| descendingOrderKey: "-vendor_name", | ||
| descendingOrderTitle: "Z", | ||
| icon: Tags, | ||
| Column: SpreadsheetStandardPropertyColumn, | ||
| }, | ||
| worker_name: { | ||
| title: "Worker Name", | ||
| ascendingOrderKey: "worker_name", | ||
| ascendingOrderTitle: "A", | ||
| descendingOrderKey: "-worker_name", | ||
| descendingOrderTitle: "Z", | ||
| icon: Tags, | ||
| Column: SpreadsheetStandardPropertyColumn, | ||
| }, |
There was a problem hiding this comment.
This block of code is repeated for each new field. Consider refactoring this into a reusable function or component to reduce code duplication and improve maintainability. You could create a function that takes the title and key as arguments and returns the object.
const createPropertyDetails = (title: string, key: string) => ({
title: title,
ascendingOrderKey: key,
ascendingOrderTitle: "A",
descendingOrderKey: `-${key}` as TIssueOrderByOptions,
descendingOrderTitle: "Z",
icon: Tags,
Column: SpreadsheetStandardPropertyColumn,
});
hub_name: createPropertyDetails("Hub Name", "hub_name"),
customer_name: createPropertyDetails("Customer Name", "customer_name"),
vendor_name: createPropertyDetails("Vendor Name", "vendor_name"),
worker_name: createPropertyDetails("Worker Name", "worker_name"),
No description provided.