File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
src/components/dialogs/limits Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -16,17 +16,20 @@ export interface OperationalLimitsId {
16
16
export const areOperationalLimitsGroupUnique = ( array : OperationalLimitsId [ ] ) => {
17
17
const equipmentApplicabilityElements : string [ ] = array
18
18
. filter ( ( item : OperationalLimitsId ) => item . applicability === APPLICABILITY . EQUIPMENT . id )
19
- . map ( ( item ) => item . name ) ;
19
+ . map ( ( item : OperationalLimitsId ) => item . name ) ;
20
20
21
21
if (
22
- equipmentApplicabilityElements . map ( ( item ) => array . filter ( ( arrayItem ) => arrayItem . name === item ) . length > 1 )
23
- . length > 0
22
+ // never more than one EQUIPMENT limit set of a given name
23
+ equipmentApplicabilityElements . filter (
24
+ ( item : string ) =>
25
+ array . filter ( ( arrayItem : OperationalLimitsId ) : boolean => arrayItem . name === item ) . length > 1
26
+ ) . length > 0
24
27
) {
25
28
return false ;
26
29
}
27
30
28
31
const otherApplicabilityElements : string [ ] = array
29
32
. filter ( ( item : OperationalLimitsId ) => item . applicability !== APPLICABILITY . EQUIPMENT . id )
30
- . map ( ( item ) => item . name + item . applicability ) ;
33
+ . map ( ( item : OperationalLimitsId ) => item . name + item . applicability ) ;
31
34
return areArrayElementsUnique ( otherApplicabilityElements ) ;
32
35
} ;
You can’t perform that action at this time.
0 commit comments