-
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -2415,6 +2415,9 @@ export class AddEditMileagePage implements OnInit { | |||||||||||||||
const formValue = this.getFormValues(); | ||||||||||||||||
let customProperties = res.customProperties; | ||||||||||||||||
customProperties = customProperties?.map((customProperty) => { | ||||||||||||||||
if (!customProperty.value) { | ||||||||||||||||
customProperty = this.customFieldsService.setDefaultValue(customProperty, customProperty.type); | ||||||||||||||||
} | ||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Suggested change
🧰 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.type === 'DATE') { | ||||||||||||||||
customProperty.value = | ||||||||||||||||
customProperty.value && this.dateService.getUTCDate(new Date(customProperty.value as string)); | ||||||||||||||||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -1697,6 +1697,9 @@ export class AddEditPerDiemPage implements OnInit { | |||||||||||||||
const isAdvanceWalletEnabled = res.orgSettings?.advances?.advance_wallets_enabled; | ||||||||||||||||
let customProperties = res.customProperties; | ||||||||||||||||
customProperties = customProperties.map((customProperty) => { | ||||||||||||||||
if (!customProperty.value) { | ||||||||||||||||
customProperty = this.customFieldsService.setDefaultValue(customProperty, customProperty.type); | ||||||||||||||||
} | ||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Suggested change
🧰 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.type === 'DATE') { | ||||||||||||||||
customProperty.value = | ||||||||||||||||
customProperty.value && this.dateService.getUTCDate(new Date(customProperty.value as string)); | ||||||||||||||||
|
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:
📝 Committable suggestion
🧰 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)