cloudmr-ux 1.3.6 → 1.3.7
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/index.js +9 -1
- package/dist/index.mjs +9 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -321,6 +321,7 @@ function CmrUploadWindow({
|
|
|
321
321
|
return;
|
|
322
322
|
return fileName.split(".").pop();
|
|
323
323
|
};
|
|
324
|
+
const INVALID_ALIAS_REGEX = /[ .,:%><]/;
|
|
324
325
|
const handleConfirm = () => {
|
|
325
326
|
if (uploadedFiles.length === 0) {
|
|
326
327
|
setInfoOpen(true);
|
|
@@ -336,6 +337,13 @@ function CmrUploadWindow({
|
|
|
336
337
|
setTimeout(() => setInfoOpen(false), 2500);
|
|
337
338
|
return;
|
|
338
339
|
}
|
|
340
|
+
if (INVALID_ALIAS_REGEX.test(fileAlias)) {
|
|
341
|
+
setInfoOpen(true);
|
|
342
|
+
setInfoStyle("error");
|
|
343
|
+
setWarningText("Alias contains invalid characters ( . , : % > < or spaces )");
|
|
344
|
+
setTimeout(() => setInfoOpen(false), 3e3);
|
|
345
|
+
return;
|
|
346
|
+
}
|
|
339
347
|
setOpen(false);
|
|
340
348
|
upload(uploadedFiles[0], fileAlias, locationSelection).then((response) => {
|
|
341
349
|
console.log(response);
|
|
@@ -594,7 +602,7 @@ function CmrUploadWindow({
|
|
|
594
602
|
import_Button.default,
|
|
595
603
|
{
|
|
596
604
|
color: "inherit",
|
|
597
|
-
|
|
605
|
+
variant: "outlined",
|
|
598
606
|
disabled: UpBtnDisabled,
|
|
599
607
|
onClick: handleClose,
|
|
600
608
|
children: "Cancel"
|
package/dist/index.mjs
CHANGED
|
@@ -273,6 +273,7 @@ function CmrUploadWindow({
|
|
|
273
273
|
return;
|
|
274
274
|
return fileName.split(".").pop();
|
|
275
275
|
};
|
|
276
|
+
const INVALID_ALIAS_REGEX = /[ .,:%><]/;
|
|
276
277
|
const handleConfirm = () => {
|
|
277
278
|
if (uploadedFiles.length === 0) {
|
|
278
279
|
setInfoOpen(true);
|
|
@@ -288,6 +289,13 @@ function CmrUploadWindow({
|
|
|
288
289
|
setTimeout(() => setInfoOpen(false), 2500);
|
|
289
290
|
return;
|
|
290
291
|
}
|
|
292
|
+
if (INVALID_ALIAS_REGEX.test(fileAlias)) {
|
|
293
|
+
setInfoOpen(true);
|
|
294
|
+
setInfoStyle("error");
|
|
295
|
+
setWarningText("Alias contains invalid characters ( . , : % > < or spaces )");
|
|
296
|
+
setTimeout(() => setInfoOpen(false), 3e3);
|
|
297
|
+
return;
|
|
298
|
+
}
|
|
291
299
|
setOpen(false);
|
|
292
300
|
upload(uploadedFiles[0], fileAlias, locationSelection).then((response) => {
|
|
293
301
|
console.log(response);
|
|
@@ -546,7 +554,7 @@ function CmrUploadWindow({
|
|
|
546
554
|
Button2,
|
|
547
555
|
{
|
|
548
556
|
color: "inherit",
|
|
549
|
-
|
|
557
|
+
variant: "outlined",
|
|
550
558
|
disabled: UpBtnDisabled,
|
|
551
559
|
onClick: handleClose,
|
|
552
560
|
children: "Cancel"
|