@@ -2,25 +2,19 @@ import { EntryList } from '@app/components/gosys/beskrivelse/entry-list';
2
2
import { GosysBeskrivelseFormat } from '@app/components/gosys/beskrivelse/format-enum' ;
3
3
import type { GosysBeskrivelseEntry } from '@app/components/gosys/beskrivelse/parsing/type' ;
4
4
import { useGosysBeskrivelseTab } from '@app/hooks/settings/use-setting' ;
5
- import { pushLog , usePushEvent } from '@app/observability' ;
5
+ import { usePushEvent } from '@app/observability' ;
6
6
import { BulletListIcon , CaptionsIcon } from '@navikt/aksel-icons' ;
7
7
import { BodyLong , Tabs } from '@navikt/ds-react' ;
8
- import { useCallback , useEffect } from 'react' ;
8
+ import { useCallback } from 'react' ;
9
9
import { styled } from 'styled-components' ;
10
- import { simpleHeaderPrecheck } from './parsing/parse-header' ;
11
10
import { splitBeskrivelse } from './parsing/split-beskrivelse' ;
12
11
13
12
interface Props {
14
- id : number ;
15
13
beskrivelse ?: string | null ;
16
14
entries ?: GosysBeskrivelseEntry [ ] ;
17
15
}
18
16
19
- export const GosysBeskrivelseTabs = ( {
20
- id,
21
- beskrivelse = '' ,
22
- entries = splitBeskrivelse ( beskrivelse ?? '' ) ,
23
- } : Props ) => {
17
+ export const GosysBeskrivelseTabs = ( { beskrivelse = '' , entries = splitBeskrivelse ( beskrivelse ?? '' ) } : Props ) => {
24
18
const [ format , setFormat ] = usePreferredFormat ( ) ;
25
19
const pushEvent = usePushEvent ( ) ;
26
20
@@ -32,21 +26,6 @@ export const GosysBeskrivelseTabs = ({
32
26
[ setFormat , pushEvent ] ,
33
27
) ;
34
28
35
- const expectedEntries = getExpectedEntries ( beskrivelse ) ;
36
- const hasExpectedEntries = entries . length === expectedEntries ;
37
-
38
- useEffect ( ( ) => {
39
- if ( ! hasExpectedEntries ) {
40
- const context = {
41
- expectedEntries : expectedEntries . toString ( 10 ) ,
42
- actualEntries : entries . length . toString ( 10 ) ,
43
- gosysOppgaveId : id . toString ( 10 ) ,
44
- } ;
45
- pushLog ( 'Unexpected number of entries in Gosys description' , { context } ) ;
46
- pushEvent ( 'unexpected-gosys-description' , context ) ;
47
- }
48
- } , [ entries . length , expectedEntries , hasExpectedEntries , pushEvent , id ] ) ;
49
-
50
29
return (
51
30
< Tabs size = "small" value = { format } onChange = { onChange } className = "flex h-full flex-col" >
52
31
< Tabs . List >
@@ -71,9 +50,6 @@ export const GosysBeskrivelseTabs = ({
71
50
) ;
72
51
} ;
73
52
74
- const getExpectedEntries = ( beskrivelse : string | null | undefined ) : number =>
75
- beskrivelse ?. split ( '\n' ) . filter ( ( l ) => simpleHeaderPrecheck ( l ) && l . split ( '' ) . some ( ( c ) => c !== '-' ) ) . length ?? 0 ;
76
-
77
53
const usePreferredFormat = ( ) : [ GosysBeskrivelseFormat , ( format : GosysBeskrivelseFormat ) => void ] => {
78
54
const { value, setValue } = useGosysBeskrivelseTab ( ) ;
79
55
0 commit comments