Version: 22.10
Attachments
The attachments property is used to configure the attachments card in the Details screen.
Workspaces supports the following customization options:
duplicatesfilterhideUploadButtonrulesuploadWithoutClaim
For example:
attachments: {
filter: {
action: 'exclude',
regex: '\\.exe$',
},
hideUploadButton: true,
uploadWithoutClaim: false,
},
Attributes
All attributes are optional unless otherwise indicated.
| Attribute | Description |
|---|---|
duplicates | booleanWhen set to true, duplicate attachments are removed from the attachments UI. |
filter | CurrentSpaceAttachmentsFilterWhen configured, attachments that match the filter.regex pattern are included or excluded depending on the filter.action. |
hideUploadButton | booleanWhen set to true, the upload button is hidden in the corresponding space.Note: hideUploadButton takes precedence over rules. |
rules | GlobalRulesRules are used as an additional control to show or hide the attachment upload button. To learn more about rules, see Visibility Rules. Note: hideUploadButton takes precedence over rules. |
uploadWithoutClaim | booleanWhen set to true, the (hard-coded) claim business rule is removed from the upload button. |
info
The URL we send includes the query parameter &pageId=document so that it can be used to support special handling on the Maestro form. We also send a message using a postMessage API with the following schema:
{
pageId: 'document';
}
To review the list of supported attributes, see API Reference.
Example
The following example shows an attachments card configuration for the Process space.
src/configs/custom/process.ts
import { ConfigCurrentSpace } from '@transact-open-ux/workspaces/dist/types';
export const processConfig = ({ date }: any): ConfigCurrentSpace => ({
...
attachments: {
duplicates: true,
filter: {
action: 'exclude',
regex: '.zip',
},
uploadWithoutClaim: true,
rules: [
{
dataIndex: 'taskType',
value: ['Form', 'Review']
},
{
dataIndex: 'formCode',
value: ['Saved', 'Submitted']
}
]
},
...
});
export default processConfig;