Skip to content
Open
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 @@ -82,7 +82,10 @@ export const useWorkflowDocumentsAdapter = ({
}, [documentsV2, nonVeriffDocuments, documentPagesResults, isDocumentsV2]);

const issuerCountryCode = extractCountryCodeFromDocuments(documents ?? []);
const documentsSchemas = getDocumentsSchemas(issuerCountryCode, workflow);
const documentsSchemas = useMemo(
() => getDocumentsSchemas(issuerCountryCode, workflow),
[issuerCountryCode, workflow],
);
const isSomeFilesLoading = useMemo(
() => storageFilesQueryResult?.some(({ isLoading }) => isLoading),
[storageFilesQueryResult],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,18 +384,25 @@ export const EditableDetails: FunctionComponent<IEditableDetails> = ({
>
<FormControl>
<SelectTrigger className="w-full">
<SelectValue />
<SelectValue>
{
dropdownOptions?.find(option => option.value === field.value)
?.label
}
</SelectValue>
</SelectTrigger>
</FormControl>
<SelectContent>
{dropdownOptions?.map(({ label, value }, index) => {
{dropdownOptions?.map(({ label, value, hidden }, index) => {
const selectKey = keyFactory(
'select',
valueId,
value,
index?.toString(),
);

if (hidden) return null;

return (
<SelectItem key={selectKey} value={selectKey}>
{label}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ export type TDropdownOption = {
label: string;
dependantValue?: string;
dependantOn?: string;
hidden?: boolean;
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AnyArray, TypesafeOmit } from '../../../../common/types';
import { TypesafeOmit } from '../../../../common/types';
import { TDocument } from '@ballerine/common';
import { titleCase } from 'string-ts';
import { TDropdownOption } from '@/lib/blocks/components/EditableDetails/types';
Expand Down Expand Up @@ -30,7 +30,7 @@ export const composePickableCategoryType = (
const documentTypesDropdownOptions: TDropdownOption[] = [];

documentsSchemas.forEach(document => {
const { type, category } = document;
const { type, category, hiddenIn } = document;
const isCategoryInDropdownOptions = documentCategoryDropdownOptions.some(
option => option.value === category,
);
Expand All @@ -51,6 +51,7 @@ export const composePickableCategoryType = (
dependantValue: category,
value: type,
label: titleCase(type),
hidden: hiddenIn === 'backoffice',
});
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@ export const DocumentsSchema = Type.Array(
},
{ additionalProperties: true },
),
hiddenIn: Type.Optional(Type.String({ enum: ['backoffice'] })),
},
{
additionalProperties: false,
Expand Down
46 changes: 38 additions & 8 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion services/workflows-service/prisma/data-migrations