1.4.2 • Published 3 years ago

@navikt/arbeidsforhold v1.4.2

Weekly downloads
264
License
MIT
Repository
github
Last release
3 years ago

NAV Arbeidsforhold

npm version | Deploy-to-npm | Deploy-to-dev

React moduler / mikro-frontends som viser brukerens arbeidsforhold

Installasjon

npm install @navikt/arbeidsforhold

Komponenter

Prosjektet er delt opp i uavhengige moduler som kan importeres

Liste med arbeidsforhold

import { ListeMedArbeidsforhold } from "@navikt/arbeidsforhold";

Eksempel

  onClick = {
    type: "KNAPP",
    getId: (arbeidsforholdId: string) => console.log(arbeidsforholdId)
  };

  return <ListeMedArbeidsforhold
            locale={"nb" as "nb" | "en"}
            miljo={"DEV" as "LOCAL" | "DEV" | "PROD"}
            onClick={this.onClick} />;

Onclick støtter følgende variasjoner

  | {
      type: "INGEN_ON_CLICK";
    }
  | {
      type: "LENKE";
      href: string;
    }
  | {
      type: "REACT_ROUTER_LENKE";
      Component: typeof Link;
      to: string;
    }
  | {
      type: "KNAPP";
      getId: (navArbeidsforholdId: number) => void;
    };

Ved implementasjon av REACT_ROUTER_LENKE må {Link} importeres fra react-router-dom i rot-applikasjonen. Se komplett eksempel under mappen /example

Detaljert arbeidsforhold

import { DetaljertArbeidsforhold } from "@navikt/arbeidsforhold";

Eksempel

render = () => {
  const id = "82421242";
  const locale = "nb" as "nb" | "en";
  const miljo = "DEV" as "LOCAL" | "DEV" | "PROD";
  const rolle = "ARBEIDSTAKER" as "ARBEIDSTAKER" | "ARBEIDSGIVER"

  return <DetaljertArbeidsforhold
            navArbeidsforholdId={id}
            locale={locale}
            miljo={miljo}
            rolle={rolle} />;
};

Komponenten vil hente data fra arbeidsforhold-api basert på miljo-variabelen, med mindre customApiUrl er satt. CustomApiUrl må inneholde {id} som erstattes av navArbeidsforholdId. Eksempel: "https://din-api-proxy.nav.no/arbeidsforhold/{id}"

Videreutvikling / test

  • Hent repoet fra github
git clone https://github.com/navikt/arbeidsforhold.git
  • Installer nødvendige pakker, start mock-container og start applikasjonen
npm install && docker-compose up -d && npm start

Test-applikasjonen består av en simpel create-react-app som importerer og benytter pakkene Prosjektet støtter hot-reloading, endringer i komponentene vil føre til at test-applikasjonen oppdateres

Deployering

Applikasjonen bygges til dev ved git tag på formatet vX.X.X-dev.

npm version patch -m "Din melding"

Push deretter den nye versjonen til Github, som vil plukkes opp av Github Actions.

git push && git push --tags

Release

Logg på npmjs

npm login

Patch

npm run release-patch

Minor

npm run release-minor

Major

npm run release-major

Logging

Vi bruker fo-frontendlogger for logging. For oppslag i kibana:

application:frontendlogger AND x_appname:arbeidsforhold

Henvendelser

Spørsmål knyttet til koden eller prosjektet kan rettes mot https://github.com/orgs/navikt/teams/team-personbruker

For NAV-ansatte

Interne henvendelser kan sendes via Slack i kanalen #team-personbruker.

3.0.0-beta.0

1 year ago

4.0.0-beta.0

1 year ago

1.4.2

3 years ago

1.4.2-beta.0

3 years ago

1.4.0

3 years ago

1.3.22

3 years ago

1.3.19

3 years ago

1.3.17

3 years ago

1.3.9

4 years ago

1.3.10

4 years ago

1.3.8

4 years ago

1.3.6

4 years ago

1.3.5

4 years ago

1.3.4

4 years ago

1.3.3

4 years ago

1.3.2

4 years ago

1.3.1

4 years ago

1.2.19

4 years ago

1.2.18

4 years ago

1.2.8

4 years ago

1.2.7

4 years ago

1.2.6

4 years ago

1.2.12

4 years ago

1.2.13

4 years ago

1.2.11

4 years ago

1.2.14

4 years ago

1.2.9

4 years ago

1.1.25

4 years ago

1.1.23

4 years ago

1.1.22

4 years ago

1.1.21

4 years ago

1.1.19

4 years ago

1.1.18

4 years ago

1.1.17

4 years ago

1.1.16

4 years ago

1.1.15

4 years ago

1.1.14

4 years ago

1.1.12

4 years ago

1.1.11

4 years ago

1.1.10

4 years ago

1.1.9

4 years ago

1.1.8

5 years ago

1.1.7

5 years ago

1.1.6

5 years ago

1.1.5

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.0.100

5 years ago

1.0.97

5 years ago

1.0.96

5 years ago

1.0.95

5 years ago

1.0.94

5 years ago

1.0.93

5 years ago

1.0.92

5 years ago

1.0.90

5 years ago

1.0.89

5 years ago

1.0.88

5 years ago

1.0.87

5 years ago

1.0.86

5 years ago

1.0.85

5 years ago

1.0.84

5 years ago

1.0.83

5 years ago

1.0.82

5 years ago

1.0.80

5 years ago

1.0.79

5 years ago

1.0.78

5 years ago

1.0.77

5 years ago

1.0.76

5 years ago

1.0.74

5 years ago

1.0.75

5 years ago

1.0.73

5 years ago

1.0.72

5 years ago

1.0.71

5 years ago

1.0.70

5 years ago

1.0.69

5 years ago

1.0.68

5 years ago

1.0.67

5 years ago

1.0.66

5 years ago

1.0.65

5 years ago

1.0.64

5 years ago

1.0.63

5 years ago

1.0.62

5 years ago

1.0.61

5 years ago

1.0.60

5 years ago

1.0.59

5 years ago

1.0.58

5 years ago

1.0.57

5 years ago

1.0.56

5 years ago

1.0.55

5 years ago

1.0.54

5 years ago

1.0.53

5 years ago

1.0.52

5 years ago

1.0.51

5 years ago

1.0.50

5 years ago

1.0.49

5 years ago

1.0.48

5 years ago

1.0.47

5 years ago

1.0.46

5 years ago

1.0.45

5 years ago

1.0.42

5 years ago

1.0.41

5 years ago

1.0.40

5 years ago

1.0.39

5 years ago

1.0.34

5 years ago

1.0.31

5 years ago

1.0.25

5 years ago

1.0.24

5 years ago

1.0.23

5 years ago

1.0.22

5 years ago

1.0.21

5 years ago

1.0.20

5 years ago

1.0.19

5 years ago

1.0.18

5 years ago

1.0.17

5 years ago

1.0.16

5 years ago

1.0.15

5 years ago

1.0.14

5 years ago

1.0.13

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago