refactor(intake): extract upload storage helper
This commit is contained in:
parent
14d7ddcd4e
commit
03ac72700b
@ -536,6 +536,7 @@ import {
|
||||
} from "./previewHoleHelpers";
|
||||
import { inferUploadCategory } from "./uploadCategoryHelpers";
|
||||
import { productHasLocalAssets } from "./localAssetHelpers";
|
||||
import { shouldUseRemoteAssetStorage } from "./uploadStorageHelpers";
|
||||
import {
|
||||
buildFinishedSampleShipmentRows,
|
||||
buildSampleMeasurementRows,
|
||||
@ -4556,21 +4557,6 @@ function createInitialDocumentWorkspaceApprovedAt(
|
||||
return approvedAt;
|
||||
}
|
||||
|
||||
type NonIntegratedRemoteAssetStorageTestGlobal = typeof globalThis & {
|
||||
__NON_INTEGRATED_REMOTE_ASSET_STORAGE_TEST_OVERRIDE__?: boolean;
|
||||
};
|
||||
|
||||
function shouldUseRemoteAssetStorage() {
|
||||
if (process.env.NODE_ENV === "test") {
|
||||
return (
|
||||
(globalThis as NonIntegratedRemoteAssetStorageTestGlobal)
|
||||
.__NON_INTEGRATED_REMOTE_ASSET_STORAGE_TEST_OVERRIDE__ === true
|
||||
);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
const NON_INTEGRATED_IMAGE_UPLOAD_MAX_DIMENSION = 2048;
|
||||
|
||||
function nonIntegratedImageUploadFileName(file: File) {
|
||||
|
||||
@ -0,0 +1,14 @@
|
||||
type NonIntegratedRemoteAssetStorageTestGlobal = typeof globalThis & {
|
||||
__NON_INTEGRATED_REMOTE_ASSET_STORAGE_TEST_OVERRIDE__?: boolean;
|
||||
};
|
||||
|
||||
export function shouldUseRemoteAssetStorage() {
|
||||
if (process.env.NODE_ENV === "test") {
|
||||
return (
|
||||
(globalThis as NonIntegratedRemoteAssetStorageTestGlobal)
|
||||
.__NON_INTEGRATED_REMOTE_ASSET_STORAGE_TEST_OVERRIDE__ === true
|
||||
);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user