@gen3/frontend 0.10.61 → 0.10.63
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.
- package/dist/cjs/index.js +15 -6
- package/dist/cjs/index.js.map +1 -1
- package/dist/dts/features/DataLibrary/selection/exportActions.d.ts.map +1 -1
- package/dist/dts/features/DataLibrary/selection/exportActions.js +20 -8
- package/dist/dts/features/DataLibrary/selection/exportActions.js.map +1 -1
- package/dist/esm/index.js +15 -6
- package/dist/esm/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exportActions.d.ts","sourceRoot":"","sources":["../../../../../src/features/DataLibrary/selection/exportActions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"exportActions.d.ts","sourceRoot":"","sources":["../../../../../src/features/DataLibrary/selection/exportActions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AA4BzD,eAAO,MAAM,oBAAoB,EAAE,kBAuElC,CAAC"}
|
|
@@ -43,8 +43,9 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
43
43
|
}
|
|
44
44
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
45
45
|
};
|
|
46
|
-
import { fetchFencePresignedURL, isFileItem } from '@gen3/core';
|
|
46
|
+
import { fetchFencePresignedURL, HTTPError, isFileItem, } from '@gen3/core';
|
|
47
47
|
import { notifications } from '@mantine/notifications';
|
|
48
|
+
import { HTTPUserFriendlyErrorMessages } from '../modals/utils';
|
|
48
49
|
var PRESIGNED_URL_TEMPLATE_VARIABLE = '{{PRESIGNED_URL}}';
|
|
49
50
|
var isSendExistingPFBToURLParameters = function (value) {
|
|
50
51
|
if (!value || typeof value !== 'object') {
|
|
@@ -60,7 +61,7 @@ export var sendExistingPFBToURL = function (validatedSelections_1, params_1) {
|
|
|
60
61
|
args_1[_i - 2] = arguments[_i];
|
|
61
62
|
}
|
|
62
63
|
return __awaiter(void 0, __spreadArray([validatedSelections_1, params_1], args_1, true), void 0, function (validatedSelections, params, done, error, onAbort, signal) {
|
|
63
|
-
var targetURLTemplate, _a, guid, id, presignedURL, signedURL, targetURL_1,
|
|
64
|
+
var targetURLTemplate, _a, guid, id, presignedURL, signedURL, targetURL_1, error_1;
|
|
64
65
|
if (done === void 0) { done = function () { return null; }; }
|
|
65
66
|
if (error === void 0) { error = function () { return null; }; }
|
|
66
67
|
if (onAbort === void 0) { onAbort = function () { return null; }; }
|
|
@@ -88,11 +89,9 @@ export var sendExistingPFBToURL = function (validatedSelections_1, params_1) {
|
|
|
88
89
|
return [2 /*return*/];
|
|
89
90
|
}
|
|
90
91
|
_a = validatedSelections[0], guid = _a.guid, id = _a.id;
|
|
91
|
-
console.log('sendExistingPFBToURL', guid, id, targetURLTemplate);
|
|
92
92
|
_b.label = 1;
|
|
93
93
|
case 1:
|
|
94
94
|
_b.trys.push([1, 3, , 4]);
|
|
95
|
-
console.log('fetchFencePresignedURL');
|
|
96
95
|
return [4 /*yield*/, fetchFencePresignedURL({
|
|
97
96
|
guid: guid !== null && guid !== void 0 ? guid : id, //TODO: fix this to use id only
|
|
98
97
|
onAbort: onAbort,
|
|
@@ -103,7 +102,6 @@ export var sendExistingPFBToURL = function (validatedSelections_1, params_1) {
|
|
|
103
102
|
console.log('received presignedURL', presignedURL);
|
|
104
103
|
signedURL = encodeURIComponent(presignedURL);
|
|
105
104
|
targetURL_1 = targetURLTemplate.replace(PRESIGNED_URL_TEMPLATE_VARIABLE, signedURL);
|
|
106
|
-
console.log('targetURL', targetURL_1);
|
|
107
105
|
return [2 /*return*/, new Promise(function () {
|
|
108
106
|
if (window)
|
|
109
107
|
window.open(targetURL_1, '_blank', 'noopener,noreferrer');
|
|
@@ -111,10 +109,24 @@ export var sendExistingPFBToURL = function (validatedSelections_1, params_1) {
|
|
|
111
109
|
done(targetURL_1);
|
|
112
110
|
})];
|
|
113
111
|
case 3:
|
|
114
|
-
|
|
115
|
-
|
|
112
|
+
error_1 = _b.sent();
|
|
113
|
+
if (error_1 instanceof HTTPError) {
|
|
114
|
+
notifications.show({
|
|
115
|
+
id: 'data-library-send-existing-pfb-to-url-validate-length',
|
|
116
|
+
position: 'bottom-center',
|
|
117
|
+
withCloseButton: true,
|
|
118
|
+
autoClose: 5000,
|
|
119
|
+
title: 'Action Error',
|
|
120
|
+
message: error_1.status in HTTPUserFriendlyErrorMessages
|
|
121
|
+
? HTTPUserFriendlyErrorMessages[error_1.status]
|
|
122
|
+
: 'An error has occured to prevent exporting PFB',
|
|
123
|
+
color: 'red',
|
|
124
|
+
loading: false,
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
console.error('Error sending PFB to URL', error_1);
|
|
116
128
|
return [2 /*return*/, new Promise(function () {
|
|
117
|
-
|
|
129
|
+
error_1(error_1);
|
|
118
130
|
})];
|
|
119
131
|
case 4: return [2 /*return*/];
|
|
120
132
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exportActions.js","sourceRoot":"","sources":["../../../../../src/features/DataLibrary/selection/exportActions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"exportActions.js","sourceRoot":"","sources":["../../../../../src/features/DataLibrary/selection/exportActions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EACL,sBAAsB,EAEtB,SAAS,EACT,UAAU,GACX,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,6BAA6B,EAAE,MAAM,iBAAiB,CAAC;AAEhE,IAAM,+BAA+B,GAAG,mBAAmB,CAAC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B,CAAC,CAAC,EAAC;;;;;CAEN,CAAC"}
|
package/dist/esm/index.js
CHANGED
|
@@ -17933,10 +17933,8 @@ const sendExistingPFBToURL = async (validatedSelections, params, done = ()=>null
|
|
|
17933
17933
|
return;
|
|
17934
17934
|
}
|
|
17935
17935
|
const { guid, id } = validatedSelections[0];
|
|
17936
|
-
console.log('sendExistingPFBToURL', guid, id, targetURLTemplate);
|
|
17937
17936
|
// get the pre-signed URL for the selected PFB
|
|
17938
17937
|
try {
|
|
17939
|
-
console.log('fetchFencePresignedURL');
|
|
17940
17938
|
const presignedURL = await fetchFencePresignedURL({
|
|
17941
17939
|
guid: guid ?? id,
|
|
17942
17940
|
onAbort: onAbort,
|
|
@@ -17947,15 +17945,26 @@ const sendExistingPFBToURL = async (validatedSelections, params, done = ()=>null
|
|
|
17947
17945
|
// variable in it.
|
|
17948
17946
|
const signedURL = encodeURIComponent(presignedURL);
|
|
17949
17947
|
const targetURL = targetURLTemplate.replace(PRESIGNED_URL_TEMPLATE_VARIABLE, signedURL);
|
|
17950
|
-
console.log('targetURL', targetURL);
|
|
17951
17948
|
return new Promise(()=>{
|
|
17952
17949
|
if (window) window.open(targetURL, '_blank', 'noopener,noreferrer');
|
|
17953
17950
|
if (done) done(targetURL);
|
|
17954
17951
|
});
|
|
17955
|
-
} catch (
|
|
17956
|
-
|
|
17952
|
+
} catch (error) {
|
|
17953
|
+
if (error instanceof HTTPError) {
|
|
17954
|
+
notifications.show({
|
|
17955
|
+
id: 'data-library-send-existing-pfb-to-url-validate-length',
|
|
17956
|
+
position: 'bottom-center',
|
|
17957
|
+
withCloseButton: true,
|
|
17958
|
+
autoClose: 5000,
|
|
17959
|
+
title: 'Action Error',
|
|
17960
|
+
message: error.status in HTTPUserFriendlyErrorMessages ? HTTPUserFriendlyErrorMessages[error.status] : 'An error has occured to prevent exporting PFB',
|
|
17961
|
+
color: 'red',
|
|
17962
|
+
loading: false
|
|
17963
|
+
});
|
|
17964
|
+
}
|
|
17965
|
+
console.error('Error sending PFB to URL', error);
|
|
17957
17966
|
return new Promise(()=>{
|
|
17958
|
-
error(
|
|
17967
|
+
error(error);
|
|
17959
17968
|
});
|
|
17960
17969
|
}
|
|
17961
17970
|
};
|