Skip to content

Commit

Permalink
KER-411 (#1098)
Browse files Browse the repository at this point in the history
* fix: fixed dependency array not having variables that require init

* fix: fixing comment tests failing if only one comment is written

* fix: fixed navigation being broken after creating hearing

* fix: removed unnecessary commitlint from pipeline
  • Loading branch information
arpargo authored Dec 10, 2024
1 parent 5aee858 commit 8733783
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,4 @@ jobs:
cache: 'yarn'
- run: yarn install --frozen-lockfile
- run: yarn lint
- name: Validate PR commits with commitlint
if: github.event_name == 'pull_request'
run: yarn commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose
- run: yarn build
6 changes: 3 additions & 3 deletions src/components/admin/HearingEditor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const HearingEditor = (props) => {
fetchEditorContactPersons();
}, [fetchEditorContactPersons]);

const checkIfEmpty = (obj) => Object.entries(obj).some(([, v]) => Object.entries(v).length > 0);
const checkIfEmpty = (obj) => !Object.entries(obj).some(([, v]) => Object.entries(v).length > 0);

/**
* Should only navigate if the hearing is valid and the editor is not saving.
Expand All @@ -88,7 +88,7 @@ const HearingEditor = (props) => {
}
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [shouldSubmit, editorErrors, errors, editorIsSaving, language, navigate]);
}, [shouldSubmit, editorIsSaving]);


/**
Expand All @@ -107,7 +107,7 @@ const HearingEditor = (props) => {
// eslint-disable-next-line no-unused-vars
setErrors(localErrors);
const containsError = checkIfEmpty(localErrors);
if (!containsError) {
if (containsError) {
dispatch(callbackAction(hearing)).then(() => setShouldSubmit(true));
} else {
dispatch(addToast(createLocalizedNotificationPayload(NOTIFICATION_TYPES.error, 'validationNotification')));
Expand Down
4 changes: 2 additions & 2 deletions src/reducers/hearingEditor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ const editorState = combineReducers({
const errors = handleActions({
[EditorActions.SAVE_HEARING_FAILED]: (state, { payload }) =>
payload.errors,
[EditorActions.POST_HEARING_SUCCESS]: () => {}
}, {});
[EditorActions.POST_HEARING_SUCCESS]: () => null
}, null);

const languages = handleActions({
receiveHearing: (state, { payload: { data: { title } } }) =>
Expand Down

0 comments on commit 8733783

Please sign in to comment.