@acorex/modules 19.4.8 → 19.4.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/fesm2022/{acorex-modules-auth-acorex-modules-auth-B-OllEdK.mjs → acorex-modules-auth-acorex-modules-auth-Q7plhyha.mjs} +11 -11
  2. package/fesm2022/{acorex-modules-auth-acorex-modules-auth-B-OllEdK.mjs.map → acorex-modules-auth-acorex-modules-auth-Q7plhyha.mjs.map} +1 -1
  3. package/fesm2022/{acorex-modules-auth-app-chooser.component-DNr963RR.mjs → acorex-modules-auth-app-chooser.component-3RSDJLvi.mjs} +2 -2
  4. package/fesm2022/{acorex-modules-auth-app-chooser.component-DNr963RR.mjs.map → acorex-modules-auth-app-chooser.component-3RSDJLvi.mjs.map} +1 -1
  5. package/fesm2022/{acorex-modules-auth-login.module-HfQItJY6.mjs → acorex-modules-auth-login.module--HO8WVi_.mjs} +4 -4
  6. package/fesm2022/{acorex-modules-auth-login.module-HfQItJY6.mjs.map → acorex-modules-auth-login.module--HO8WVi_.mjs.map} +1 -1
  7. package/fesm2022/{acorex-modules-auth-master.layout-DgN0Dh-I.mjs → acorex-modules-auth-master.layout-CKfLvnZR.mjs} +2 -2
  8. package/fesm2022/{acorex-modules-auth-master.layout-DgN0Dh-I.mjs.map → acorex-modules-auth-master.layout-CKfLvnZR.mjs.map} +1 -1
  9. package/fesm2022/{acorex-modules-auth-password.component-CVgNTaKI.mjs → acorex-modules-auth-password.component-D3xMo34u.mjs} +2 -2
  10. package/fesm2022/{acorex-modules-auth-password.component-CVgNTaKI.mjs.map → acorex-modules-auth-password.component-D3xMo34u.mjs.map} +1 -1
  11. package/fesm2022/{acorex-modules-auth-password.component-B-L3ksjM.mjs → acorex-modules-auth-password.component-DGzkaDZv.mjs} +2 -2
  12. package/fesm2022/{acorex-modules-auth-password.component-B-L3ksjM.mjs.map → acorex-modules-auth-password.component-DGzkaDZv.mjs.map} +1 -1
  13. package/fesm2022/{acorex-modules-auth-routes-CtoZQEq9.mjs → acorex-modules-auth-routes-Dphs3LyY.mjs} +2 -2
  14. package/fesm2022/{acorex-modules-auth-routes-CtoZQEq9.mjs.map → acorex-modules-auth-routes-Dphs3LyY.mjs.map} +1 -1
  15. package/fesm2022/{acorex-modules-auth-two-factor.module-CCP_Oovk.mjs → acorex-modules-auth-two-factor.module-CKp1SEfD.mjs} +2 -2
  16. package/fesm2022/{acorex-modules-auth-two-factor.module-CCP_Oovk.mjs.map → acorex-modules-auth-two-factor.module-CKp1SEfD.mjs.map} +1 -1
  17. package/fesm2022/{acorex-modules-auth-user-sessions.component-6jRmJGeS.mjs → acorex-modules-auth-user-sessions.component-CT6GqJHq.mjs} +2 -2
  18. package/fesm2022/{acorex-modules-auth-user-sessions.component-6jRmJGeS.mjs.map → acorex-modules-auth-user-sessions.component-CT6GqJHq.mjs.map} +1 -1
  19. package/fesm2022/acorex-modules-auth.mjs +1 -1
  20. package/fesm2022/{acorex-modules-document-management-acorex-modules-document-management-BATdoqJi.mjs → acorex-modules-document-management-acorex-modules-document-management-lAGMGi3Y.mjs} +84 -41
  21. package/fesm2022/acorex-modules-document-management-acorex-modules-document-management-lAGMGi3Y.mjs.map +1 -0
  22. package/fesm2022/{acorex-modules-document-management-attachment-widget.component-C1-gQepw.mjs → acorex-modules-document-management-attachment-widget.component-DieghltT.mjs} +2 -2
  23. package/fesm2022/{acorex-modules-document-management-attachment-widget.component-C1-gQepw.mjs.map → acorex-modules-document-management-attachment-widget.component-DieghltT.mjs.map} +1 -1
  24. package/fesm2022/{acorex-modules-document-management-create-folder-dialog.component-ZMvsadWt.mjs → acorex-modules-document-management-create-folder-dialog.component-Ddzknhp0.mjs} +2 -2
  25. package/fesm2022/{acorex-modules-document-management-create-folder-dialog.component-ZMvsadWt.mjs.map → acorex-modules-document-management-create-folder-dialog.component-Ddzknhp0.mjs.map} +1 -1
  26. package/fesm2022/{acorex-modules-document-management-details-view.component-CvHIETNf.mjs → acorex-modules-document-management-details-view.component-irEPa71J.mjs} +2 -2
  27. package/fesm2022/{acorex-modules-document-management-details-view.component-CvHIETNf.mjs.map → acorex-modules-document-management-details-view.component-irEPa71J.mjs.map} +1 -1
  28. package/fesm2022/{acorex-modules-document-management-drive-choose.component-UTy9OISj.mjs → acorex-modules-document-management-drive-choose.component-eAqk3eca.mjs} +2 -2
  29. package/fesm2022/{acorex-modules-document-management-drive-choose.component-UTy9OISj.mjs.map → acorex-modules-document-management-drive-choose.component-eAqk3eca.mjs.map} +1 -1
  30. package/fesm2022/{acorex-modules-document-management-drive.component-Crh10Z5J.mjs → acorex-modules-document-management-drive.component-TNwvgpB_.mjs} +2 -2
  31. package/fesm2022/{acorex-modules-document-management-drive.component-Crh10Z5J.mjs.map → acorex-modules-document-management-drive.component-TNwvgpB_.mjs.map} +1 -1
  32. package/fesm2022/{acorex-modules-document-management-large-icons-view.component-BuV7MPG5.mjs → acorex-modules-document-management-large-icons-view.component-iBkydbXJ.mjs} +2 -2
  33. package/fesm2022/{acorex-modules-document-management-large-icons-view.component-BuV7MPG5.mjs.map → acorex-modules-document-management-large-icons-view.component-iBkydbXJ.mjs.map} +1 -1
  34. package/fesm2022/{acorex-modules-document-management-large-tiles-view.component-CwYwVxoG.mjs → acorex-modules-document-management-large-tiles-view.component-BUnwhB1D.mjs} +2 -2
  35. package/fesm2022/{acorex-modules-document-management-large-tiles-view.component-CwYwVxoG.mjs.map → acorex-modules-document-management-large-tiles-view.component-BUnwhB1D.mjs.map} +1 -1
  36. package/fesm2022/{acorex-modules-document-management-list-view.component-BHEwRA3m.mjs → acorex-modules-document-management-list-view.component-Bu6EA_LC.mjs} +2 -2
  37. package/fesm2022/{acorex-modules-document-management-list-view.component-BHEwRA3m.mjs.map → acorex-modules-document-management-list-view.component-Bu6EA_LC.mjs.map} +1 -1
  38. package/fesm2022/{acorex-modules-document-management-permission-definition.provider-B3qaYwRL.mjs → acorex-modules-document-management-permission-definition.provider-D0O5DPux.mjs} +2 -2
  39. package/fesm2022/{acorex-modules-document-management-permission-definition.provider-B3qaYwRL.mjs.map → acorex-modules-document-management-permission-definition.provider-D0O5DPux.mjs.map} +1 -1
  40. package/fesm2022/{acorex-modules-document-management-rename-node-dialog.component-CrcJm9jP.mjs → acorex-modules-document-management-rename-node-dialog.component-CSnz9s0C.mjs} +2 -2
  41. package/fesm2022/{acorex-modules-document-management-rename-node-dialog.component-CrcJm9jP.mjs.map → acorex-modules-document-management-rename-node-dialog.component-CSnz9s0C.mjs.map} +1 -1
  42. package/fesm2022/{acorex-modules-document-management-small-icons-view.component-CD5UORaq.mjs → acorex-modules-document-management-small-icons-view.component-BvgWgPdU.mjs} +2 -2
  43. package/fesm2022/{acorex-modules-document-management-small-icons-view.component-CD5UORaq.mjs.map → acorex-modules-document-management-small-icons-view.component-BvgWgPdU.mjs.map} +1 -1
  44. package/fesm2022/{acorex-modules-document-management-small-tiles-view.component-cpc_xfbT.mjs → acorex-modules-document-management-small-tiles-view.component-CGAmXmDZ.mjs} +2 -2
  45. package/fesm2022/{acorex-modules-document-management-small-tiles-view.component-cpc_xfbT.mjs.map → acorex-modules-document-management-small-tiles-view.component-CGAmXmDZ.mjs.map} +1 -1
  46. package/fesm2022/acorex-modules-document-management.mjs +1 -1
  47. package/fesm2022/{acorex-modules-platform-management-acorex-modules-platform-management-DtXOjIIK.mjs → acorex-modules-platform-management-acorex-modules-platform-management-l00277iI.mjs} +177 -178
  48. package/fesm2022/acorex-modules-platform-management-acorex-modules-platform-management-l00277iI.mjs.map +1 -0
  49. package/fesm2022/{acorex-modules-platform-management-list-version.component-DY4yMd8n.mjs → acorex-modules-platform-management-list-version.component-CbjbxadS.mjs} +2 -2
  50. package/fesm2022/{acorex-modules-platform-management-list-version.component-DY4yMd8n.mjs.map → acorex-modules-platform-management-list-version.component-CbjbxadS.mjs.map} +1 -1
  51. package/fesm2022/{acorex-modules-platform-management-settings.provider-BO-1dmVc.mjs → acorex-modules-platform-management-settings.provider-DKwQuq9_.mjs} +2 -2
  52. package/fesm2022/{acorex-modules-platform-management-settings.provider-BO-1dmVc.mjs.map → acorex-modules-platform-management-settings.provider-DKwQuq9_.mjs.map} +1 -1
  53. package/fesm2022/acorex-modules-platform-management.mjs +1 -1
  54. package/package.json +3 -2
  55. package/fesm2022/acorex-modules-document-management-acorex-modules-document-management-BATdoqJi.mjs.map +0 -1
  56. package/fesm2022/acorex-modules-platform-management-acorex-modules-platform-management-DtXOjIIK.mjs.map +0 -1
@@ -3605,6 +3605,7 @@ function sanitizeForStorage(obj) {
3605
3605
  }
3606
3606
  async function promotionEntityFactory(injector) {
3607
3607
  const dataService = injector.get(AXMAppPromotionService);
3608
+ const fileStorageService = injector.get(AXPFileStorageService);
3608
3609
  const i18n = RootConfig.config.i18n;
3609
3610
  const entityDef = {
3610
3611
  module: RootConfig.module.name,
@@ -3699,7 +3700,7 @@ async function promotionEntityFactory(injector) {
3699
3700
  interface: {
3700
3701
  type: AXPWidgetsCatalog.fileUploader,
3701
3702
  options: {
3702
- multiple: false,
3703
+ multiple: true,
3703
3704
  },
3704
3705
  },
3705
3706
  },
@@ -3840,87 +3841,100 @@ async function promotionEntityFactory(injector) {
3840
3841
  commands: {
3841
3842
  create: {
3842
3843
  execute: async (data) => {
3843
- // First deeply sanitize the data object to remove non-serializable content
3844
3844
  data = sanitizeForStorage(data);
3845
- // Convert array of File objects to serializable format for IndexedDB storage
3846
- if (data.imageId && Array.isArray(data.imageId)) {
3847
- const processedFiles = await Promise.all((data.imageId || []).map(async (file) => {
3848
- if (file instanceof File) {
3849
- return {
3850
- name: file.name,
3851
- type: file.type,
3852
- size: file.size,
3853
- lastModified: file.lastModified,
3854
- // Convert File to base64 string for storage
3855
- data: await new Promise((resolve) => {
3856
- const reader = new FileReader();
3857
- reader.onloadend = () => resolve(reader.result);
3858
- reader.readAsDataURL(file);
3859
- })
3860
- };
3845
+ const entityPayload = { ...data };
3846
+ const filesToUploadAfterSave = [];
3847
+ // const originalImageIdArray = Array.isArray(entityPayload.imageId) ? [...entityPayload.imageId] : [];
3848
+ if (entityPayload.imageId && Array.isArray(entityPayload.imageId)) {
3849
+ const processedImageIdForEntitySave = [];
3850
+ for (const fileItem of entityPayload.imageId) {
3851
+ if (fileItem.source?.kind === 'blob' && fileItem.source.value instanceof Blob) {
3852
+ filesToUploadAfterSave.push({ fileItem, blob: fileItem.source.value });
3853
+ processedImageIdForEntitySave.push({
3854
+ tempId: fileItem.id,
3855
+ name: fileItem.name,
3856
+ size: fileItem.size,
3857
+ type: fileItem.source.value.type, // Type from blob is reliable
3858
+ status: 'pending_upload'
3859
+ });
3861
3860
  }
3862
- // Handle new file structure with source.value containing the blob
3863
- else if (file && file.source && file.source.value) {
3864
- try {
3865
- const blob = file.source.value;
3866
- // Ensure we're working with a proper Blob object
3867
- if (blob instanceof Blob) {
3868
- return {
3869
- id: file.id || null,
3870
- name: file.name || 'file',
3871
- type: file.type || blob.type || 'application/octet-stream',
3872
- size: file.size || blob.size || 0,
3873
- status: file.status || 'attached',
3874
- // Convert Blob to base64 string for storage
3875
- data: await new Promise((resolve) => {
3876
- const reader = new FileReader();
3877
- reader.onloadend = () => resolve(reader.result);
3878
- reader.readAsDataURL(blob);
3879
- })
3880
- };
3881
- }
3882
- else {
3883
- console.warn('Invalid blob in file.source.value', file);
3884
- return {
3885
- name: file.name || 'file',
3886
- type: file.type || 'application/octet-stream',
3887
- size: file.size || 0,
3888
- status: file.status || 'attached'
3889
- };
3890
- }
3891
- }
3892
- catch (error) {
3893
- console.error('Error processing file for storage', error);
3894
- return {
3895
- name: file.name || 'file',
3896
- type: file.type || 'application/octet-stream',
3897
- size: file.size || 0,
3898
- status: file.status || 'attached'
3899
- };
3900
- }
3861
+ else if (fileItem.source?.kind === 'fileId' && fileItem.id && typeof fileItem.source.value === 'string') {
3862
+ // If it's a fileId, we assume it's already processed. We don't have type directly on AXPFileListItem.
3863
+ // We'll reconstruct it from fileStorageService or it should be part of what's saved if needed.
3864
+ processedImageIdForEntitySave.push({
3865
+ id: fileItem.id,
3866
+ name: fileItem.name,
3867
+ size: fileItem.size,
3868
+ // type: fileItem.type, // Removed: AXPFileListItem does not have .type
3869
+ status: 'uploaded',
3870
+ source: { kind: 'fileId', value: fileItem.source.value }
3871
+ });
3901
3872
  }
3902
- // If it's already a serialized object with data property, keep it as is
3903
- else if (file && file.data && typeof file.data === 'string') {
3904
- return file;
3873
+ else if (fileItem.id && fileItem.name) { // Fallback for items that might be from a previous save
3874
+ processedImageIdForEntitySave.push({
3875
+ id: fileItem.id,
3876
+ name: fileItem.name,
3877
+ size: fileItem.size,
3878
+ // type: fileItem.type, // Removed: AXPFileListItem does not have .type
3879
+ status: fileItem.status, // Preserve existing status
3880
+ source: fileItem.source ? { kind: fileItem.source.kind, value: fileItem.source.value } : undefined
3881
+ });
3905
3882
  }
3906
- // For any other format, return a clean version without complex objects
3907
- else if (file) {
3908
- return {
3909
- id: file.id || null,
3910
- name: file.name || 'unknown',
3911
- type: file.type || 'application/octet-stream',
3912
- size: file.size || 0,
3913
- status: file.status || 'attached'
3914
- };
3883
+ }
3884
+ entityPayload.imageId = processedImageIdForEntitySave;
3885
+ }
3886
+ const savedEntityId = await dataService.insertOne(entityPayload);
3887
+ // const entityId = savedEntity.id; // Corrected based on typical service return
3888
+ const finalImageIdReferences = (entityPayload.imageId || [])
3889
+ .filter((f) => f.status !== 'pending_upload');
3890
+ for (const { fileItem, blob } of filesToUploadAfterSave) {
3891
+ try {
3892
+ if (!fileStorageService) {
3893
+ throw new Error('fileStorageService is not available.');
3915
3894
  }
3916
- return null;
3917
- }));
3918
- // Filter out nulls after awaiting the promise
3919
- data.imageId = processedFiles.filter(Boolean);
3895
+ const fileStorageInfo = await fileStorageService.save({
3896
+ file: blob,
3897
+ refId: savedEntityId,
3898
+ refType: `${RootConfig.module.name}.${RootConfig.entities.promotion.name}`,
3899
+ category: '',
3900
+ name: blob.name,
3901
+ });
3902
+ finalImageIdReferences.push({
3903
+ id: fileStorageInfo.fileId,
3904
+ name: fileStorageInfo.name || blob.name,
3905
+ size: fileStorageInfo.size || blob.size,
3906
+ type: fileStorageInfo.mimeType || blob.type,
3907
+ status: 'uploaded',
3908
+ source: { kind: 'fileId', value: fileStorageInfo.fileId }
3909
+ });
3910
+ }
3911
+ catch (err) { // Typed error
3912
+ console.error('Error uploading file to FileStorage for entityId:', savedEntityId, 'file:', fileItem.name, err);
3913
+ finalImageIdReferences.push({
3914
+ tempId: fileItem.id,
3915
+ name: fileItem.name,
3916
+ size: fileItem.size,
3917
+ type: blob.type, // Correctly access type from Blob/File
3918
+ status: 'upload_failed',
3919
+ error: err.message
3920
+ });
3921
+ }
3920
3922
  }
3921
- const res = await dataService.insertOne(data);
3922
- // Return the same ID format that was used for storage
3923
- return { id: res };
3923
+ if (filesToUploadAfterSave.length > 0) {
3924
+ let needsUpdate = true;
3925
+ if (entityPayload.imageId && entityPayload.imageId.length === finalImageIdReferences.length) {
3926
+ const oldIds = entityPayload.imageId.map((f) => f.id || f.tempId).sort().join(',');
3927
+ const newIds = finalImageIdReferences.map((f) => f.id || f.tempId).sort().join(',');
3928
+ if (oldIds === newIds && !finalImageIdReferences.some((f) => f.status === 'upload_failed')) {
3929
+ needsUpdate = false;
3930
+ }
3931
+ }
3932
+ if (needsUpdate) {
3933
+ // Assuming updateOne takes the ID and an object of fields to update
3934
+ await dataService.updateOne(savedEntityId, { imageId: finalImageIdReferences });
3935
+ }
3936
+ }
3937
+ return { id: savedEntityId };
3924
3938
  },
3925
3939
  },
3926
3940
  delete: {
@@ -3930,85 +3944,93 @@ async function promotionEntityFactory(injector) {
3930
3944
  },
3931
3945
  update: {
3932
3946
  execute: async (data) => {
3933
- // First deeply sanitize the data object to remove non-serializable content
3934
- data = sanitizeForStorage(data);
3935
- // Convert array of File objects to serializable format for IndexedDB storage
3947
+ const entityId = data.id;
3948
+ const filesToUpload = [];
3949
+ const processedImageReferences = []; // Will hold final file objects for DB
3950
+ // Ensure fileStorageService is available (it's injected at the factory level)
3951
+ // const fileStorageService = injector.get(AXPFileStorageService); // Already available in this scope from factory
3936
3952
  if (data.imageId && Array.isArray(data.imageId)) {
3937
- const processedFiles = await Promise.all((data.imageId || []).map(async (file) => {
3938
- if (file instanceof File) {
3939
- return {
3940
- name: file.name,
3941
- type: file.type,
3942
- size: file.size,
3943
- lastModified: file.lastModified,
3944
- // Convert File to base64 string for storage
3945
- data: await new Promise((resolve) => {
3946
- const reader = new FileReader();
3947
- reader.onloadend = () => resolve(reader.result);
3948
- reader.readAsDataURL(file);
3949
- })
3950
- };
3953
+ for (const fileItem of data.imageId) {
3954
+ if (fileItem.status === 'deleted') {
3955
+ // File marked for deletion. Skip.
3956
+ // Optionally, you might want to call fileStorageService.delete(fileId) here
3957
+ // if fileItem.id points to an existing stored file and actual deletion is needed.
3958
+ // For now, we just disassociate it from the entity.
3959
+ continue;
3951
3960
  }
3952
- // Handle new file structure with source.value containing the blob
3953
- else if (file && file.source && file.source.value) {
3954
- try {
3955
- const blob = file.source.value;
3956
- // Ensure we're working with a proper Blob object
3957
- if (blob instanceof Blob) {
3958
- return {
3959
- id: file.id || null,
3960
- name: file.name || 'file',
3961
- type: file.type || blob.type || 'application/octet-stream',
3962
- size: file.size || blob.size || 0,
3963
- status: file.status || 'attached',
3964
- // Convert Blob to base64 string for storage
3965
- data: await new Promise((resolve) => {
3966
- const reader = new FileReader();
3967
- reader.onloadend = () => resolve(reader.result);
3968
- reader.readAsDataURL(blob);
3969
- })
3970
- };
3971
- }
3972
- else {
3973
- console.warn('Invalid blob in file.source.value', file);
3974
- return {
3975
- name: file.name || 'file',
3976
- type: file.type || 'application/octet-stream',
3977
- size: file.size || 0,
3978
- status: file.status || 'attached'
3979
- };
3980
- }
3981
- }
3982
- catch (error) {
3983
- console.error('Error processing file for storage', error);
3984
- return {
3985
- name: file.name || 'file',
3986
- type: file.type || 'application/octet-stream',
3987
- size: file.size || 0,
3988
- status: file.status || 'attached'
3989
- };
3990
- }
3961
+ if (fileItem.source?.kind === 'blob' && fileItem.source.value instanceof Blob) {
3962
+ filesToUpload.push({ fileItem, blob: fileItem.source.value });
3963
+ // Actual reference will be added to processedImageReferences after successful upload.
3991
3964
  }
3992
- // If it's already a serialized object with data property, keep it as is
3993
- else if (file && file.data && typeof file.data === 'string') {
3994
- return file;
3965
+ else if (fileItem.source?.kind === 'fileId' && fileItem.id && typeof fileItem.source.value === 'string') {
3966
+ // This is an existing file, keep its reference.
3967
+ processedImageReferences.push({
3968
+ id: fileItem.id,
3969
+ name: fileItem.name,
3970
+ size: fileItem.size,
3971
+ status: fileItem.status || 'uploaded', // Default to 'uploaded' if status is missing
3972
+ source: { kind: 'fileId', value: fileItem.source.value }
3973
+ // 'type' is not typically part of AXPFileListItem for existing fileIds in 'create'
3974
+ });
3995
3975
  }
3996
- // For any other format, return a clean version without complex objects
3997
- else if (file) {
3998
- return {
3999
- id: file.id || null,
4000
- name: file.name || 'unknown',
4001
- type: file.type || 'application/octet-stream',
4002
- size: file.size || 0,
4003
- status: file.status || 'attached'
4004
- };
3976
+ else if (fileItem.id && fileItem.name) {
3977
+ // Fallback for items that might be from a previous save state (already processed)
3978
+ // These are likely already processed files that are being kept.
3979
+ processedImageReferences.push({
3980
+ id: fileItem.id,
3981
+ name: fileItem.name,
3982
+ size: fileItem.size,
3983
+ status: fileItem.status || 'uploaded',
3984
+ source: fileItem.source ? { kind: fileItem.source.kind, value: fileItem.source.value } : undefined
3985
+ });
4005
3986
  }
4006
- return null;
4007
- }));
4008
- // Filter out nulls after awaiting the promise
4009
- data.imageId = processedFiles.filter(Boolean);
3987
+ // Else: unknown fileItem structure, it will be ignored or you can log an error.
3988
+ }
4010
3989
  }
4011
- return await dataService.updateOne(data.id, data);
3990
+ // Upload new files and add their successful/failed info to processedImageReferences
3991
+ for (const { fileItem, blob } of filesToUpload) {
3992
+ try {
3993
+ if (!fileStorageService) {
3994
+ throw new Error('fileStorageService is not available.');
3995
+ }
3996
+ const fileStorageInfo = await fileStorageService.save({
3997
+ file: blob,
3998
+ refId: entityId, // ID of the entity being updated
3999
+ refType: `${RootConfig.module.name}.${RootConfig.entities.promotion.name}`,
4000
+ category: '', // Add category if applicable
4001
+ name: blob.name,
4002
+ });
4003
+ processedImageReferences.push({
4004
+ id: fileStorageInfo.fileId,
4005
+ name: fileStorageInfo.name || blob.name,
4006
+ size: fileStorageInfo.size || blob.size,
4007
+ type: fileStorageInfo.mimeType || blob.type, // Store MIME type
4008
+ status: 'uploaded',
4009
+ source: { kind: 'fileId', value: fileStorageInfo.fileId }
4010
+ });
4011
+ }
4012
+ catch (err) {
4013
+ console.error('Error uploading file to FileStorage during update for entityId:', entityId, 'file:', fileItem.name, err);
4014
+ processedImageReferences.push({
4015
+ tempId: fileItem.id, // Use fileItem.id if it's a unique temp client-side ID, or generate one
4016
+ name: fileItem.name,
4017
+ size: fileItem.size,
4018
+ type: blob.type,
4019
+ status: 'upload_failed',
4020
+ error: err.message
4021
+ });
4022
+ }
4023
+ }
4024
+ // Construct the final data payload for the update.
4025
+ // Create a mutable copy of the input data.
4026
+ const finalUpdatePayload = { ...data };
4027
+ // Replace the original imageId array with the newly processed one.
4028
+ finalUpdatePayload.imageId = processedImageReferences;
4029
+ // Sanitize the entire payload before sending it to dataService.updateOne.
4030
+ // This ensures that the processedImageReferences (which are plain objects)
4031
+ // and all other fields in the payload are clean and serializable.
4032
+ const fullySanitizedPayload = sanitizeForStorage(finalUpdatePayload);
4033
+ return await dataService.updateOne(entityId, fullySanitizedPayload);
4012
4034
  },
4013
4035
  },
4014
4036
  },
@@ -4048,29 +4070,6 @@ async function promotionEntityFactory(injector) {
4048
4070
  console.warn(`No record found with id: ${validId}`);
4049
4071
  return null;
4050
4072
  }
4051
- // Deserialize imageId field if it contains serialized file objects
4052
- if (data.imageId && Array.isArray(data.imageId)) {
4053
- data.imageId = await Promise.all(data.imageId.map(async (fileData) => {
4054
- // Check if this is a serialized file
4055
- if (fileData && fileData.data && fileData.name && fileData.type) {
4056
- try {
4057
- // Convert base64 string back to a Blob
4058
- const response = await fetch(fileData.data);
4059
- const blob = await response.blob();
4060
- // Create a new File object
4061
- return new File([blob], fileData.name, {
4062
- type: fileData.type,
4063
- lastModified: fileData.lastModified
4064
- });
4065
- }
4066
- catch (error) {
4067
- console.error('Failed to deserialize file:', fileData.name, error);
4068
- return fileData; // Return original data if deserialization fails
4069
- }
4070
- }
4071
- return fileData; // Return as is if not a serialized file
4072
- })); // Cast to any to avoid type conflict
4073
- }
4074
4073
  return data;
4075
4074
  }
4076
4075
  catch (error) {
@@ -4387,8 +4386,8 @@ async function promotionEntityFactory(injector) {
4387
4386
  options: {
4388
4387
  id: '{{ context.eval("id") }}',
4389
4388
  files: '{{ context.eval("imageId") }}',
4390
- multiple: false,
4391
- accept: 'image/*',
4389
+ multiple: true,
4390
+ accept: '.jpg,.jpeg,.png,.gif,.webp',
4392
4391
  key: 'imageId',
4393
4392
  }
4394
4393
  },
@@ -4805,7 +4804,7 @@ class AXMPlatformManagementCommonModule {
4805
4804
  provide: AXP_SETTING_DEFINITION_PROVIDER,
4806
4805
  useFactory: async () => {
4807
4806
  const injector = inject(Injector);
4808
- const provider = (await import('./acorex-modules-platform-management-settings.provider-BO-1dmVc.mjs')).AXMRegionalSettingProvider;
4807
+ const provider = (await import('./acorex-modules-platform-management-settings.provider-DKwQuq9_.mjs')).AXMRegionalSettingProvider;
4809
4808
  return new provider(injector);
4810
4809
  },
4811
4810
  multi: true
@@ -4844,7 +4843,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
4844
4843
  provide: AXP_SETTING_DEFINITION_PROVIDER,
4845
4844
  useFactory: async () => {
4846
4845
  const injector = inject(Injector);
4847
- const provider = (await import('./acorex-modules-platform-management-settings.provider-BO-1dmVc.mjs')).AXMRegionalSettingProvider;
4846
+ const provider = (await import('./acorex-modules-platform-management-settings.provider-DKwQuq9_.mjs')).AXMRegionalSettingProvider;
4848
4847
  return new provider(injector);
4849
4848
  },
4850
4849
  multi: true
@@ -5089,7 +5088,7 @@ class AXMShowReleaseNotesPopupAction extends AXPWorkflowAction {
5089
5088
  }
5090
5089
  async execute(context) {
5091
5090
  const scope = RootConfig.config.i18n;
5092
- const comp = await (await import('./acorex-modules-platform-management-list-version.component-DY4yMd8n.mjs')).AXMListVersionComponent;
5091
+ const comp = await (await import('./acorex-modules-platform-management-list-version.component-CbjbxadS.mjs')).AXMListVersionComponent;
5093
5092
  this.popupService.open(comp, {
5094
5093
  title: `t('release-notes',{scope: "${scope}"})`,
5095
5094
  });
@@ -5748,4 +5747,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
5748
5747
  */
5749
5748
 
5750
5749
  export { AXPRegionalSetting as A, AXMGlossaryServiceImpl as B, metaDataDefinitionFactory as C, AXMMetaDataDefinitionService as D, AXMPMetaDataDefinitionServiceImpl as E, metaDataDefinitionCategoryEntityFactory as F, AXMMetaDataDefinitionCategoryService as G, AXMMetaDataDefinitionCategoryServiceImpl as H, AXMPromotionSlotComponent as I, promotionEntityFactory as J, AXMAppPromotionService as K, AXMPromotionServiceImpl as L, AXPRegionalStoreService as M, AXMUpdaterModule as N, AXPUpdaterService as O, RootConfig as R, AXMAppVersionService as a, AXMPlatformManagementModule as b, appTermEntityEntityFactory as c, AXMAppTermService as d, AXMAppTermServiceImpl as e, AXMListTermsComponent as f, AXMNotifyNewTermPopupAction as g, AXMTermUpdateSettingAction as h, AXMNewTermWorkflow as i, appVersionEntityEntityFactory as j, AXMAppVersionServiceImpl as k, AXMNotifyAppComponent as l, AXMAppVersionSlotComponent as m, AXMChangeLogPopupAction as n, AXMChangeLogUpdateSettingAction as o, AXMWhatsNewWorkflow as p, AXMCheckNewVersionAction as q, AXMCheckNewVersionWorkflow as r, dataSourceEntityFactory as s, AXMDataSourceService as t, AXMDataSourceServiceImpl as u, globalVariableEntityFactory as v, AXMGlobalVariablesService as w, AXMGlobalVariablesServiceImpl as x, glossaryEntityFactory as y, AXMGlossaryService as z };
5751
- //# sourceMappingURL=acorex-modules-platform-management-acorex-modules-platform-management-DtXOjIIK.mjs.map
5750
+ //# sourceMappingURL=acorex-modules-platform-management-acorex-modules-platform-management-l00277iI.mjs.map