Skip to content

Commit 3f73c0b

Browse files
authored
feat: Enables page instruction generation of attachments (#522)
* feat: Enables page instruction generation of attachments * fix: file utility updates attachments
1 parent dc4a995 commit 3f73c0b

File tree

9 files changed

+739
-329
lines changed

9 files changed

+739
-329
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/react-sdk-components/src/components/field/SelectableCard/utils.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@ import { Link } from '@mui/material';
22

33
import { Utils } from '../../helpers/utils';
44

5-
export const getResolvedConstantValue = (pConnect, key) => {
6-
return pConnect.getValue(PCore.getResolvedConstantValue(key)) || pConnect.getValue(key);
7-
};
8-
95
export const resolveReferencedPConnect = pConnect => {
106
if (!pConnect || !pConnect.meta) return undefined;
117
const type = pConnect?._type ?? undefined;

packages/react-sdk-components/src/components/helpers/attachmentHelpers.ts

Lines changed: 0 additions & 97 deletions
This file was deleted.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
const megabyteSize = 1048576;
2+
3+
export const validateMaxSize = (fileObj: Record<string, number>, maxSizeInMB: string) => {
4+
const fileSize = (fileObj.size / megabyteSize).toFixed(2);
5+
return parseFloat(fileSize) < parseFloat(maxSizeInMB);
6+
};
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/**
2+
* Returns the value of the key from objectInfo/caseInfo
3+
* Added fallback to retrieve from caseInfo if objectInfo not present.
4+
* @param pConnect
5+
* @param key
6+
* @returns the value of key
7+
*/
8+
export const getResolvedConstantValue = (pConnect: typeof PConnect, key: string) => {
9+
return pConnect.getValue(PCore.getResolvedConstantValue(key)) || pConnect.getValue(key);
10+
};

0 commit comments

Comments
 (0)