-
Notifications
You must be signed in to change notification settings - Fork 15
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
fix: standardize custom fields for policy check #3324
Conversation
WalkthroughThe pull request introduces significant enhancements across three components: Changes
Possibly related PRs
Suggested labels
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (6)
👮 Files not reviewed due to content moderation or server errors (2)
🔇 Additional comments (4)src/app/fyle/add-edit-per-diem/add-edit-per-diem.page.ts (1)
Macha, reassigning function parameter is not the way of the Superstar! Thalaivar says, reassigning function parameter is like changing the climax of the movie halfway through. Audience will get confused, no? Use a local variable instead and keep the story straight. Apply this diff to fix the issue: - if (!customProperty.value) {
- customProperty = this.customFieldsService.setDefaultValue(customProperty, customProperty.type);
- }
+ let updatedCustomProperty = customProperty;
+ if (!customProperty.value) {
+ updatedCustomProperty = this.customFieldsService.setDefaultValue(customProperty, customProperty.type);
+ }
src/app/fyle/add-edit-mileage/add-edit-mileage.page.ts (1)
Dei, reassigning function parameter is not the style of the Superstar! Thalaivar says, reassigning function parameter is like changing the hero of the movie halfway through. Audience will feel cheated, no? Use a local variable instead and give a satisfying ending. Apply this diff to fix the issue: - if (!customProperty.value) {
- customProperty = this.customFieldsService.setDefaultValue(customProperty, customProperty.type);
- }
+ let updatedCustomProperty = customProperty;
+ if (!customProperty.value) {
+ updatedCustomProperty = this.customFieldsService.setDefaultValue(customProperty, customProperty.type);
+ }
src/app/fyle/add-edit-expense/add-edit-expense.page.ts (1)
Aye aye aye! Reassigning function parameter is not the style of the Superstar. Thalaivar says, reassigning function parameter is like changing the climax of the movie at the last minute. Audience will feel cheated, no? Use a local variable instead and give a satisfying ending. Apply this diff to fix the issue: - if (!customProperty.value) {
- customProperty = this.customFieldsService.setDefaultValue(customProperty, customProperty.type);
- }
+ let updatedCustomProperty = customProperty;
+ if (!customProperty.value) {
+ updatedCustomProperty = this.customFieldsService.setDefaultValue(customProperty, customProperty.type);
+ }
src/app/fyle/add-edit-per-diem/add-edit-per-diem.page.setup.spec.ts (1)
Thalaivar says, the CustomFieldsService spy has gained a new power - Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
📒 Files selected for processing (3)
src/app/fyle/add-edit-expense/add-edit-expense.page.ts
(1 hunks)src/app/fyle/add-edit-mileage/add-edit-mileage.page.ts
(1 hunks)src/app/fyle/add-edit-per-diem/add-edit-per-diem.page.ts
(1 hunks)
🧰 Additional context used
🪛 Biome (1.9.4)
src/app/fyle/add-edit-per-diem/add-edit-per-diem.page.ts
[error] 1701-1701: Reassigning a function parameter is confusing.
The parameter is declared here:
Use a local variable instead.
(lint/style/noParameterAssign)
src/app/fyle/add-edit-expense/add-edit-expense.page.ts
[error] 3522-3522: Reassigning a function parameter is confusing.
The parameter is declared here:
Use a local variable instead.
(lint/style/noParameterAssign)
src/app/fyle/add-edit-mileage/add-edit-mileage.page.ts
[error] 2419-2419: Reassigning a function parameter is confusing.
The parameter is declared here:
Use a local variable instead.
(lint/style/noParameterAssign)
if (!customProperty.value) { | ||
customProperty = this.customFieldsService.setDefaultValue(customProperty, customProperty.type); | ||
} |
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.
Mind it! Reassigning function parameter is not cool.
Macha, reassigning function parameter is like changing the rules of the game midway. Not fair, no?
Use a local variable instead and keep the game clean.
Apply this diff to fix the issue:
- if (!customProperty.value) {
- customProperty = this.customFieldsService.setDefaultValue(customProperty, customProperty.type);
- }
+ let updatedCustomProperty = customProperty;
+ if (!customProperty.value) {
+ updatedCustomProperty = this.customFieldsService.setDefaultValue(customProperty, customProperty.type);
+ }
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
if (!customProperty.value) { | |
customProperty = this.customFieldsService.setDefaultValue(customProperty, customProperty.type); | |
} | |
let updatedCustomProperty = customProperty; | |
if (!customProperty.value) { | |
updatedCustomProperty = this.customFieldsService.setDefaultValue(customProperty, customProperty.type); | |
} |
🧰 Tools
🪛 Biome (1.9.4)
[error] 1701-1701: Reassigning a function parameter is confusing.
The parameter is declared here:
Use a local variable instead.
(lint/style/noParameterAssign)
if (!customProperty.value) { | ||
customProperty = this.customFieldsService.setDefaultValue(customProperty, customProperty.type); | ||
} |
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.
Tch tch tch! Reassigning function parameter is not the way to go.
Macha, reassigning function parameter is like changing the hero of the movie halfway through. Audience will get confused, no?
Use a local variable instead and keep the story straight.
Apply this diff to fix the issue:
- if (!customProperty.value) {
- customProperty = this.customFieldsService.setDefaultValue(customProperty, customProperty.type);
- }
+ let updatedCustomProperty = customProperty;
+ if (!customProperty.value) {
+ updatedCustomProperty = this.customFieldsService.setDefaultValue(customProperty, customProperty.type);
+ }
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
if (!customProperty.value) { | |
customProperty = this.customFieldsService.setDefaultValue(customProperty, customProperty.type); | |
} | |
let updatedCustomProperty = customProperty; | |
if (!customProperty.value) { | |
updatedCustomProperty = this.customFieldsService.setDefaultValue(customProperty, customProperty.type); | |
} |
🧰 Tools
🪛 Biome (1.9.4)
[error] 2419-2419: Reassigning a function parameter is confusing.
The parameter is declared here:
Use a local variable instead.
(lint/style/noParameterAssign)
if (!customProperty.value) { | ||
customProperty = this.customFieldsService.setDefaultValue(customProperty, customProperty.type); | ||
} |
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.
Aye aye aye! Reassigning function parameter is not the style.
Macha, reassigning function parameter is like changing the climax of the movie at the last minute. Audience will feel cheated, no?
Use a local variable instead and give a satisfying ending.
Apply this diff to fix the issue:
- if (!customProperty.value) {
- customProperty = this.customFieldsService.setDefaultValue(customProperty, customProperty.type);
- }
+ let updatedCustomProperty = customProperty;
+ if (!customProperty.value) {
+ updatedCustomProperty = this.customFieldsService.setDefaultValue(customProperty, customProperty.type);
+ }
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
if (!customProperty.value) { | |
customProperty = this.customFieldsService.setDefaultValue(customProperty, customProperty.type); | |
} | |
let updatedCustomProperty = customProperty; | |
if (!customProperty.value) { | |
updatedCustomProperty = this.customFieldsService.setDefaultValue(customProperty, customProperty.type); | |
} |
🧰 Tools
🪛 Biome (1.9.4)
[error] 3522-3522: Reassigning a function parameter is confusing.
The parameter is declared here:
Use a local variable instead.
(lint/style/noParameterAssign)
|
Clickup
https://app.clickup.com/t/86cx8ub7w
Code Coverage
Please add code coverage here
UI Preview
Please add screenshots for UI changes
Summary by CodeRabbit
New Features
Improvements