Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SM-3617: UAT fixes #377

Merged
merged 2 commits into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ const useApplicationStatus = (select, isEnabled = true, statusMap=[]) => {
};

const defaultSelect = (WorkflowService) => {
let applicationStatus = WorkflowService.filter((state) => state.applicationStatus).map((state) => {
const roles = state.actions?.map((e) => e.roles)?.flat();
let applicationStatus = WorkflowService?.filter((state) => state?.applicationStatus)?.map((state) => {
const roles = state?.actions?.map((e) => e.roles)?.flat();
return {
name: t(`CS_COMMON_FSM_${state.applicationStatus}`),
code: state.applicationStatus,
id: (statusMap?.filter(e => e.applicationstatus === state.applicationStatus)?.[0]?.statusid) || state.uuid,
name: t(`CS_COMMON_FSM_${state?.applicationStatus}`),
code: state?.applicationStatus,
id: (statusMap?.filter(e => e?.applicationstatus === state?.applicationStatus)?.[0]?.statusid) || state?.uuid,
roles,
};
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ const WorkerConfig = ({ t, disabled = false, skillsOption = [], employer = [] })
type: "documentUpload",
withoutLabel: true,
module: "Photograph",
master: "FSM",
error: "WORKS_REQUIRED_ERR",
name: "documents",
customClass: "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@ export const FormComposerV2 = (props) => {
return (
<UploadFileComposer
module={config?.module}
master={config?.master}
config={config}
Controller={Controller}
register={register}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ import { Loader } from '../atoms/Loader'
import MultiUploadWrapper from '../molecules/MultiUploadWrapper'
import TextInput from '../atoms/TextInput'

const UploadFileComposer = ({module, config, Controller, control, register, formData, errors, localePrefix, customClass, customErrorMsg}) => {
const UploadFileComposer = ({master= "works", module, config, Controller, control, register, formData, errors, localePrefix, customClass, customErrorMsg}) => {
const { t } = useTranslation()

//fetch mdms config based on module name
const tenant = Digit.ULBService.getStateId();
const { isLoading, data } = Digit.Hooks.useCustomMDMS(
tenant,
"works",
master,
[
{
"name": "DocumentConfig",
Expand All @@ -27,7 +27,7 @@ const UploadFileComposer = ({module, config, Controller, control, register, form



const docConfig = data?.works?.DocumentConfig?.[0]
const docConfig = data?.[master]?.DocumentConfig?.[0]

let documentFileTypeMappings = {
docx : "vnd.openxmlformats-officedocument.wordprocessingml.document",
Expand Down