Skip to content

Commit 007e418

Browse files
committed
Fjern antall stillinger for jobbmesse
1 parent e968a41 commit 007e418

File tree

5 files changed

+30
-22
lines changed

5 files changed

+30
-22
lines changed

.github/workflows/deploy.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
deploy-til-dev:
4646
name: Deploy til dev-gcp
4747
needs: bygg-og-push-docker-image
48-
if: github.event_name == 'workflow_dispatch' || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/legger-til-ferdigstilt-hendelse-varsling'
48+
if: github.event_name == 'workflow_dispatch' || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/jobbmesse-antall'
4949
runs-on: ubuntu-latest
5050
steps:
5151
- uses: actions/checkout@v3

src/stilling/stilling/Stilling.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ const Stilling = () => {
5656
const stillingsinfo = useSelector((state: State) => state.stillingsinfoData);
5757

5858
const erFormidling = stillingsinfo.stillingskategori === Stillingskategori.Formidling;
59+
const erJobbmesse = stillingsinfo.stillingskategori === Stillingskategori.Jobbmesse;
5960

6061
const { kandidatlisteId, mutate } = useKandidatlisteId(uuid);
6162

@@ -185,6 +186,7 @@ const Stilling = () => {
185186
) : (
186187
<Edit
187188
erFormidling={erFormidling}
189+
erJobbmesse={erJobbmesse}
188190
innloggetBruker={navIdent}
189191
onPreviewAdClick={onPreviewAdClick}
190192
/>

src/stilling/stilling/adValidationReducer.ts

+10-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Privacy } from 'felles/domene/stilling/Stilling';
1+
import { Privacy, Stillingskategori } from 'felles/domene/stilling/Stilling';
22
import moment from 'moment';
33
import { put, select, takeLatest } from 'redux-saga/effects';
44
import { State } from '../redux/store';
@@ -400,16 +400,17 @@ function* validateEngagementType(): Generator<unknown, any, any> {
400400
function* validatePositionCount() {
401401
const state: State = yield select();
402402
const positioncount = state.adData?.properties.positioncount;
403-
404403
const error = positioncount && !positioncount.match(/^[1-9]\d*$/);
405404

406-
if (valueIsNotSet(positioncount) || error) {
407-
yield addValidationError({
408-
field: 'positioncount',
409-
message: 'Antall stillinger mangler',
410-
});
411-
} else {
412-
yield removeValidationError({ field: 'positioncount' });
405+
if (state.stillingsinfoData.stillingskategori !== Stillingskategori.Jobbmesse) {
406+
if (valueIsNotSet(positioncount) || error) {
407+
yield addValidationError({
408+
field: 'positioncount',
409+
message: 'Antall stillinger mangler',
410+
});
411+
} else {
412+
yield removeValidationError({ field: 'positioncount' });
413+
}
413414
}
414415
}
415416

src/stilling/stilling/edit/Edit.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ type Props = {
2626
resetValidation: () => void;
2727
stilling: Stilling;
2828
erFormidling: boolean;
29+
erJobbmesse: boolean;
2930
};
3031

3132
const Edit = ({
@@ -34,6 +35,7 @@ const Edit = ({
3435
onPreviewAdClick,
3536
resetValidation,
3637
erFormidling,
38+
erJobbmesse,
3739
}: Props) => {
3840
const stillingenErEkstern = stilling.createdBy !== System.Rekrutteringsbistand;
3941

@@ -78,7 +80,7 @@ const Edit = ({
7880
</Accordion>
7981
<Accordion className={classNames(css.høyre, css.accordions)}>
8082
<Seksjon spacing tittel="Praktiske opplysninger">
81-
<PraktiskeOpplysninger />
83+
<PraktiskeOpplysninger erJobbmesse={erJobbmesse} />
8284
</Seksjon>
8385
<Seksjon spacing tittel="Kontaktinformasjon">
8486
<Kontaktinformasjon innloggetBruker={innloggetBruker} />

src/stilling/stilling/edit/praktiske-opplysninger/PraktiskeOpplysninger.tsx

+14-11
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ type Props = {
3939
setStartTime: (value?: string) => void;
4040
setApplicationDue: (value: string) => void;
4141
validation: Record<ValidertFelt, string | undefined>;
42+
erJobbmesse: boolean;
4243
};
4344

4445
class PraktiskeOpplysninger extends React.Component<Props> {
@@ -100,7 +101,7 @@ class PraktiskeOpplysninger extends React.Component<Props> {
100101
};
101102

102103
render() {
103-
const { ad, workday, workhours } = this.props;
104+
const { ad, workday, workhours, erJobbmesse } = this.props;
104105

105106
const workdayAsArray: string[] | undefined = workday
106107
? isJson(workday)
@@ -175,16 +176,18 @@ class PraktiskeOpplysninger extends React.Component<Props> {
175176
<Radio value="Ikke oppgitt">Ikke oppgitt</Radio>
176177
</RadioGroup>
177178
<div className={css.skillelinje} />
178-
<div>
179-
<TextField
180-
label={<Skjemalabel påkrevd>Antall stillinger</Skjemalabel>}
181-
value={ad.properties.positioncount}
182-
onChange={this.onPositioncountChange}
183-
error={this.props.validation.positioncount}
184-
type="number"
185-
min="1"
186-
/>
187-
</div>
179+
{!erJobbmesse && (
180+
<div>
181+
<TextField
182+
label={<Skjemalabel påkrevd>Antall stillinger</Skjemalabel>}
183+
value={ad.properties.positioncount}
184+
onChange={this.onPositioncountChange}
185+
error={this.props.validation.positioncount}
186+
type="number"
187+
min="1"
188+
/>
189+
</div>
190+
)}
188191
<Fieldset
189192
className={css.datepickerOgCheckbox}
190193
legend={<Skjemalabel påkrevd>Søknadsfrist</Skjemalabel>}

0 commit comments

Comments
 (0)