Skip to content

Commit

Permalink
Merge pull request #1943 from techmatters/CHI-2466-contactlesstasktab…
Browse files Browse the repository at this point in the history
…_fix

Merging despite failing E2E tests, which are broken for an unrelated rerason
  • Loading branch information
stephenhand authored Dec 14, 2023
2 parents f9dd02f + 6cd568a commit cb77862
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,16 @@ import type { DefinitionVersion } from 'hrm-form-definitions';

import { disperseInputs } from '../common/forms/formGenerators';
import { useCreateFormFromDefinition } from '../forms';
import { Container, ColumnarBlock, TwoColumnLayout, ColumnarContent } from '../../styles/HrmStyles';
import { ColumnarBlock, ColumnarContent, Container, TwoColumnLayout } from '../../styles/HrmStyles';
import { RootState } from '../../states';
import { selectWorkerSid } from '../../states/selectors/flexSelectors';
import { createContactlessTaskTabDefinition } from './ContactlessTaskTabDefinition';
import { splitDate, splitTime } from '../../utils/helpers';
import type { ContactRawJson, OfflineContactTask } from '../../types/types';
import { updateDraft } from '../../states/contacts/existingContacts';
import { configurationBase, contactFormsBase, namespace } from '../../states/storeNamespaces';
import { configurationBase, namespace } from '../../states/storeNamespaces';
import { getUnsavedContact } from '../../states/contacts/getUnsavedContact';
import selectContactByTaskSid from '../../states/contacts/selectContactByTaskSid';

type OwnProps = {
task: OfflineContactTask;
Expand All @@ -44,10 +45,7 @@ type OwnProps = {
};

const mapStateToProps = (state: RootState, { task }: OwnProps) => {
const { savedContact, draftContact } =
Object.values(state[namespace][contactFormsBase].existingContacts).find(
cs => cs.savedContact.taskId === task.taskSid,
) ?? {};
const { savedContact, draftContact } = selectContactByTaskSid(state, task.taskSid) ?? {};
return {
counselorsList: state[namespace][configurationBase].counselors.list,
unsavedContact: getUnsavedContact(savedContact, draftContact),
Expand Down

0 comments on commit cb77862

Please sign in to comment.