This repository was archived by the owner on Mar 13, 2025. It is now read-only.
File tree 3 files changed +36
-8
lines changed
routes/WorkPeriods/components 3 files changed +36
-8
lines changed Original file line number Diff line number Diff line change 17
17
box-shadow : 0px 5px 25px #c6c6c6 ;
18
18
background : #fff ;
19
19
20
+ ul {
21
+ margin : 0 ;
22
+ padding : 0 ;
23
+ // list-style: disc inside;
24
+
25
+ li {
26
+ margin : 0 ;
27
+ padding : 0 ;
28
+
29
+ & ::before {
30
+ content : " \2022\00A0 " ;
31
+ display : inline ;
32
+ margin-right : 3px ;
33
+ }
34
+ }
35
+ }
36
+
20
37
.tooltipArrow {
21
38
display : block ;
22
39
top : 100% ;
Original file line number Diff line number Diff line change @@ -15,11 +15,19 @@ import styles from "./styles.module.scss";
15
15
*/
16
16
const PeriodAlerts = ( { alerts, className } ) => {
17
17
const alertsTooltipContent = useMemo ( ( ) => {
18
- return alerts
19
- ? alerts . map ( ( alertId ) => (
20
- < div key = { alertId } > { ALERT_MESSAGE_MAP [ alertId ] } </ div >
21
- ) )
22
- : null ;
18
+ if ( ! alerts ) {
19
+ return null ;
20
+ }
21
+ if ( alerts . length === 1 ) {
22
+ return ALERT_MESSAGE_MAP [ alerts [ 0 ] ] ;
23
+ }
24
+ return (
25
+ < ul >
26
+ { alerts . map ( ( alertId ) => (
27
+ < li key = { alertId } > { ALERT_MESSAGE_MAP [ alertId ] } </ li >
28
+ ) ) }
29
+ </ ul >
30
+ ) ;
23
31
} , [ alerts ] ) ;
24
32
25
33
return (
Original file line number Diff line number Diff line change @@ -235,20 +235,23 @@ const PeriodItem = ({
235
235
* working period is disabled.
236
236
*
237
237
* @param {Array } reasonIds array of REASON_DISABLED values
238
- * @returns {?Array }
238
+ * @returns {any }
239
239
*/
240
240
function formatReasonsDisabled ( reasonIds ) {
241
241
if ( ! reasonIds ) {
242
242
return null ;
243
243
}
244
+ if ( reasonIds . length === 1 ) {
245
+ return REASON_DISABLED_MESSAGE_MAP [ reasonIds [ 0 ] ] ;
246
+ }
244
247
const reasons = [ ] ;
245
248
for ( let i = 0 , len = reasonIds . length ; i < len ; i ++ ) {
246
249
let reasonId = reasonIds [ i ] ;
247
250
reasons . push (
248
- < div key = { reasonId } > { REASON_DISABLED_MESSAGE_MAP [ reasonId ] } </ div >
251
+ < li key = { reasonId } > { REASON_DISABLED_MESSAGE_MAP [ reasonId ] } </ li >
249
252
) ;
250
253
}
251
- return reasons ;
254
+ return < ul > { reasons } </ ul > ;
252
255
}
253
256
254
257
PeriodItem . propTypes = {
You can’t perform that action at this time.
0 commit comments