Skip to content

Commit

Permalink
feat: make attachment type field list configurable in config (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
erral authored May 29, 2023
1 parent b76c1ec commit 55cfe9d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/View.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,9 @@ const View = ({ data, id, path }) => {
let name = getFieldName(subblock.label, subblock.id);
if (formattedFormData[name]?.value) {
formattedFormData[name].field_id = subblock.field_id;
const isAttachment = subblock.field_type === 'attachment';
const isAttachment = config.blocks.blocksConfig.form.attachment_fields.includes(
subblock.field_type,
);
const isDate = subblock.field_type === 'date';

if (isAttachment) {
Expand Down
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const applyConfig = (config) => {
multiple_choice: SelectionSchemaExtender,
from: FromSchemaExtender,
},
attachment_fields: ['attachment'],
restricted: false,
mostUsed: true,
security: {
Expand Down

0 comments on commit 55cfe9d

Please sign in to comment.