1.4.2 • Published 5 years ago

@navikt/arbeidsforhold v1.4.2

Weekly downloads
264
License
MIT
Repository
github
Last release
5 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

4 years ago

4.0.0-beta.0

4 years ago

1.4.2

5 years ago

1.4.2-beta.0

5 years ago

1.4.0

5 years ago

1.3.22

5 years ago

1.3.19

5 years ago

1.3.17

5 years ago

1.3.9

6 years ago

1.3.10

6 years ago

1.3.8

6 years ago

1.3.6

6 years ago

1.3.5

6 years ago

1.3.4

6 years ago

1.3.3

6 years ago

1.3.2

6 years ago

1.3.1

6 years ago

1.2.19

6 years ago

1.2.18

6 years ago

1.2.8

6 years ago

1.2.7

6 years ago

1.2.6

6 years ago

1.2.12

6 years ago

1.2.13

6 years ago

1.2.11

6 years ago

1.2.14

6 years ago

1.2.9

6 years ago

1.1.25

6 years ago

1.1.23

6 years ago

1.1.22

6 years ago

1.1.21

6 years ago

1.1.19

7 years ago

1.1.18

7 years ago

1.1.17

7 years ago

1.1.16

7 years ago

1.1.15

7 years ago

1.1.14

7 years ago

1.1.12

7 years ago

1.1.11

7 years ago

1.1.10

7 years ago

1.1.9

7 years ago

1.1.8

7 years ago

1.1.7

7 years ago

1.1.6

7 years ago

1.1.5

7 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.0.100

7 years ago

1.0.97

7 years ago

1.0.96

7 years ago

1.0.95

7 years ago

1.0.94

7 years ago

1.0.93

7 years ago

1.0.92

7 years ago

1.0.90

7 years ago

1.0.89

7 years ago

1.0.88

7 years ago

1.0.87

7 years ago

1.0.86

7 years ago

1.0.85

7 years ago

1.0.84

7 years ago

1.0.83

7 years ago

1.0.82

7 years ago

1.0.80

7 years ago

1.0.79

7 years ago

1.0.78

7 years ago

1.0.77

7 years ago

1.0.76

7 years ago

1.0.74

7 years ago

1.0.75

7 years ago

1.0.73

7 years ago

1.0.72

7 years ago

1.0.71

7 years ago

1.0.70

7 years ago

1.0.69

7 years ago

1.0.68

7 years ago

1.0.67

7 years ago

1.0.66

7 years ago

1.0.65

7 years ago

1.0.64

7 years ago

1.0.63

7 years ago

1.0.62

7 years ago

1.0.61

7 years ago

1.0.60

7 years ago

1.0.59

7 years ago

1.0.58

7 years ago

1.0.57

7 years ago

1.0.56

7 years ago

1.0.55

7 years ago

1.0.54

7 years ago

1.0.53

7 years ago

1.0.52

7 years ago

1.0.51

7 years ago

1.0.50

7 years ago

1.0.49

7 years ago

1.0.48

7 years ago

1.0.47

7 years ago

1.0.46

7 years ago

1.0.45

7 years ago

1.0.42

7 years ago

1.0.41

7 years ago

1.0.40

7 years ago

1.0.39

7 years ago

1.0.34

7 years ago

1.0.31

7 years ago

1.0.25

7 years ago

1.0.24

7 years ago

1.0.23

7 years ago

1.0.22

7 years ago

1.0.21

7 years ago

1.0.20

7 years ago

1.0.19

7 years ago

1.0.18

7 years ago

1.0.17

7 years ago

1.0.16

7 years ago

1.0.15

7 years ago

1.0.14

7 years ago

1.0.13

7 years ago

1.0.12

7 years ago

1.0.11

7 years ago

1.0.10

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago