-
Notifications
You must be signed in to change notification settings - Fork 1
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
Bugfix zms 3253 3466 3415 1891 validation opening hours of the same appointment type must not overlap #810
Changes from 122 commits
310f536
bbd32b1
5543f36
03bc86e
ffcdb0a
47565c8
3f8030e
f5e08ed
e4b36ea
e5f123c
9528271
770e847
4a79605
cdd0d8c
8a1aa79
09c10fb
afd6d5d
ce5d795
07f74c8
da65ff3
93b2820
e0d41c4
bde21f3
0cd0ad1
29b7cff
9e11157
c2df444
5faea71
4cd3618
4840338
c8262a0
8281b0a
390aba7
78013ea
8a07621
7892fe0
9522585
d65ccb8
3fa84a1
317d127
c02e4e3
c75e3c4
2b39546
acb62ac
a16b2e4
1bd40cb
4025319
95dcef0
39ef3a6
3eb8912
46c0af9
fdd0c72
f319de3
b8fd6b6
a2691c1
fc26e13
bffc9fa
5784eb4
51e25ca
4f2a125
e8cae55
e0f4fa6
d17ffa2
8a41469
e230b26
5aadb7b
246b4d1
17dcb07
e984774
d5135e2
ca99ef2
d5c6051
5527c58
ad89835
2a7d978
ea55b27
932fe5f
5aa9d6b
fb7efb7
1fd8f65
f8f536f
e4981ff
7916a70
462be60
46db273
490ddce
2ce2363
735c579
97cee9c
a11f7b8
b620a54
e3375c1
e646a4c
8b7a1f6
2a3cbb7
4cbe423
0053e60
cab1b1d
ab51699
227e741
694194b
d53b28e
088356f
484cbb4
e92684e
faa90c0
8d863ce
ff16fc0
4043a66
860abc6
3a3491f
64c884b
36724e4
ea9b087
687af94
d86c998
39759a4
65d6e79
551438b
2f92832
36e81f3
c595cad
b7d7ac8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ import PropTypes from 'prop-types' | |
import FormButtons from './formButtons' | ||
import FormContent from './content' | ||
import { getDataValuesFromForm, cleanupFormData, getFormValuesFromData } from '../helpers' | ||
import { hasSlotCountError } from '../form/validate'; | ||
|
||
class AvailabilityForm extends Component { | ||
constructor(props) { | ||
|
@@ -38,36 +39,40 @@ class AvailabilityForm extends Component { | |
} | ||
|
||
const hasConflicts = (( | ||
this.props.conflictList.itemList && | ||
Object.keys(this.props.conflictList.itemList).length | ||
) || | ||
this.props.conflictList.itemList && | ||
Object.keys(this.props.conflictList.itemList).length | ||
)) ? true : false | ||
Comment on lines
+42
to
+44
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. 🛠️ Refactor suggestion Simplify boolean expressions. Both hasConflicts and hasErrors use unnecessary ternary operators and can be simplified. - const hasConflicts = ((
- this.props.conflictList.itemList &&
- Object.keys(this.props.conflictList.itemList).length
- )) ? true : false
+ const hasConflicts = !!(
+ this.props.conflictList.itemList &&
+ Object.keys(this.props.conflictList.itemList).length
+ )
- const hasErrors = (
- (
- this.props.errorList &&
- Object.keys(this.props.errorList).length
- )) ? true : false
+ const hasErrors = !!(
+ this.props.errorList &&
+ Object.keys(this.props.errorList).length
+ ) Also applies to: 46-50 🧰 Tools🪛 Biome (1.9.4)[error] 41-44: Unnecessary use of boolean literals in conditional expression. Simplify your code by directly assigning the result without using a ternary operator. (lint/complexity/noUselessTernary) |
||
|
||
const hasErrors = ( | ||
( | ||
this.props.errorList && | ||
Object.keys(this.props.errorList).length | ||
)) ? true : false | ||
)) ? true : false | ||
|
||
return ( | ||
<div> | ||
{<FormContent | ||
today = {this.props.today} | ||
{<FormContent | ||
today={this.props.today} | ||
availabilityList={this.props.availabilityList} | ||
setErrorRef={this.props.setErrorRef} | ||
errorList={this.props.errorList} | ||
conflictList={this.props.conflictList} | ||
{... { data, onChange }} />} | ||
{<FormButtons | ||
data = {data} | ||
onCopy={this.props.onCopy} | ||
{<FormButtons | ||
data={data} | ||
onCopy={this.props.onCopy} | ||
onExclusion={this.props.onExclusion} | ||
onEditInFuture={this.props.onEditInFuture} | ||
onEditInFuture={this.props.onEditInFuture} | ||
onDelete={this.props.onDelete} | ||
onUpdateSingle={this.props.onUpdateSingle} | ||
selectedDate={this.props.selectedDate} | ||
hasConflicts={hasConflicts} | ||
hasErrors={hasErrors} | ||
hasSlotCountError={hasSlotCountError(this.props)} | ||
isCreatingExclusion={this.props.isCreatingExclusion} | ||
/>} | ||
</div> | ||
) | ||
) | ||
} | ||
} | ||
|
||
|
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.
Security: Replace dangerouslySetInnerHTML with safer alternative.
Using
dangerouslySetInnerHTML
for newline conversion poses potential XSS risks, even with server-side messages.Consider this safer alternative that splits the message into an array and maps over it:
📝 Committable suggestion
🧰 Tools
🪛 Biome (1.9.4)
[error] 33-33: Avoid passing content using the dangerouslySetInnerHTML prop.
Setting content using code can expose users to cross-site scripting (XSS) attacks
(lint/security/noDangerouslySetInnerHtml)