tessa 6.0.2 → 6.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d040e7a0fa04eead3454cadf4e255c8b7ba12e5b5aaf8fd56c5450a674c2727c
4
- data.tar.gz: 21cbcffa7525a138438d1ec86ed3023758a7ccb0461b6e9554a09286068cfc58
3
+ metadata.gz: 195c947f914e8b899ea4fa8b6cea489d7a8f8292e573f4090fde8759f820fb9a
4
+ data.tar.gz: 8dbaaceb8252224077755508be5e01b08bbeb93c46f5a37d141596826b54f5d3
5
5
  SHA512:
6
- metadata.gz: c56c4573c7c2240b192ed81a04f66beec67501dcc2446f594c6f10cf3447d7198784ffada9783b2636cb6f2d6f9c2b6bb5d46872ab9853ac5ff02f33b6d5dad9
7
- data.tar.gz: 77b5273e3f1411348dcbb41c4cd0000ae8c64293afeff0289fe602fdd5aaee0fa5cc4490d83a946376aa64f16b2c25c490eb3de1d5566bc56d9236a599a4b134
6
+ metadata.gz: 79912868222e71679ed0422041df9165070625ca1d5723ec5de78f47995f348ca61ce007fb70f470e45f0ae2a78330b560edc4f93e2ed650d08bcd8927db0b4c
7
+ data.tar.gz: b33ab283bf19599fb16ca5751beb078c34712f7195b35a0bc3b4b9e1855279fc331046f82c25cdd0717b6151a0870cb5d6d7ea15b6540032f3e63a4fc419e79c
@@ -612,12 +612,19 @@ var WCCDropzone = function(_super) {
612
612
 
613
613
  var uploadPendingWarning = "File uploads have not yet completed. If you submit the form now they will not be saved. Are you sure you want to continue?";
614
614
 
615
+ var kb = 1e3;
616
+
617
+ var mb = 1e3 * kb;
618
+
619
+ var gb = 1e3 * mb;
620
+
615
621
  function tessaInit() {
616
622
  $(".tessa-upload").each((function(i, item) {
617
623
  var $item = $(item);
618
624
  var directUploadURL = $item.data("direct-upload-url") || "/rails/active_storage/direct_uploads";
619
625
  var options = __assign({
620
626
  maxFiles: 1,
627
+ maxFilesize: 5 * gb,
621
628
  addRemoveLinks: true,
622
629
  url: "UNUSED",
623
630
  dictDefaultMessage: "Drop files or click to upload.",
@@ -671,6 +678,10 @@ function tessaInit() {
671
678
  function createAcceptFn(_a) {
672
679
  var directUploadURL = _a.directUploadURL;
673
680
  return function(file, done) {
681
+ console.log("check file size", file.size, this.options.maxFilesize);
682
+ if (this.options.maxFilesize && file.size > this.options.maxFilesize) {
683
+ return done("Uploads are limited to ".concat(Math.floor(this.options.maxFilesize / gb), " Gigabytes.") + " Your file is ".concat((file.size / gb).toFixed(2), " GB.") + " Please contact helpdesk for assistance.");
684
+ }
674
685
  var postData = {
675
686
  blob: {
676
687
  filename: file.name,
@@ -603,12 +603,16 @@
603
603
  return WCCDropzone;
604
604
  }(BaseDropzone);
605
605
  var uploadPendingWarning = "File uploads have not yet completed. If you submit the form now they will not be saved. Are you sure you want to continue?";
606
+ var kb = 1e3;
607
+ var mb = 1e3 * kb;
608
+ var gb = 1e3 * mb;
606
609
  function tessaInit() {
607
610
  $(".tessa-upload").each((function(i, item) {
608
611
  var $item = $(item);
609
612
  var directUploadURL = $item.data("direct-upload-url") || "/rails/active_storage/direct_uploads";
610
613
  var options = __assign({
611
614
  maxFiles: 1,
615
+ maxFilesize: 5 * gb,
612
616
  addRemoveLinks: true,
613
617
  url: "UNUSED",
614
618
  dictDefaultMessage: "Drop files or click to upload.",
@@ -661,6 +665,10 @@
661
665
  function createAcceptFn(_a) {
662
666
  var directUploadURL = _a.directUploadURL;
663
667
  return function(file, done) {
668
+ console.log("check file size", file.size, this.options.maxFilesize);
669
+ if (this.options.maxFilesize && file.size > this.options.maxFilesize) {
670
+ return done("Uploads are limited to ".concat(Math.floor(this.options.maxFilesize / gb), " Gigabytes.") + " Your file is ".concat((file.size / gb).toFixed(2), " GB.") + " Please contact helpdesk for assistance.");
671
+ }
664
672
  var postData = {
665
673
  blob: {
666
674
  filename: file.name,
@@ -133,6 +133,10 @@ class WCCDropzone extends BaseDropzone {
133
133
 
134
134
  const uploadPendingWarning = "File uploads have not yet completed. If you submit the form now they will not be saved. Are you sure you want to continue?"
135
135
 
136
+ const kb = 1000
137
+ const mb = 1000 * kb
138
+ const gb = 1000 * mb
139
+
136
140
  /**
137
141
  * Called on page load to initialize the Dropzone
138
142
  */
@@ -144,6 +148,9 @@ function tessaInit() {
144
148
 
145
149
  const options: WCCDropzoneOptions = {
146
150
  maxFiles: 1,
151
+ // With a single PUT operation, you can upload a single object up to 5 GB in size.
152
+ // https://docs.aws.amazon.com/AmazonS3/latest/userguide/upload-objects.html
153
+ maxFilesize: 5 * gb,
147
154
  addRemoveLinks: true,
148
155
  url: 'UNUSED',
149
156
  dictDefaultMessage: 'Drop files or click to upload.',
@@ -221,7 +228,16 @@ interface AcceptOptions {
221
228
  * @param done Callback when file is accepted or rejected by the Tessa::RackUploadProxy
222
229
  */
223
230
  function createAcceptFn({ directUploadURL }: AcceptOptions) {
224
- return function(file: WCCDropzoneFile, done: (error?: string | Error) => void) {
231
+ return function(this: WCCDropzone, file: WCCDropzoneFile, done: (error?: string | Error) => void) {
232
+ console.log('check file size', file.size, this.options.maxFilesize)
233
+ if (this.options.maxFilesize && file.size > this.options.maxFilesize) {
234
+ return done(
235
+ `Uploads are limited to ${Math.floor(this.options.maxFilesize / gb)} Gigabytes.` +
236
+ ` Your file is ${(file.size / gb).toFixed(2)} GB.` +
237
+ ` Please contact helpdesk for assistance.`
238
+ )
239
+ }
240
+
225
241
  const postData: ActiveStorageDirectUploadParams = {
226
242
  blob: {
227
243
  filename: file.name,
data/lib/tessa/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Tessa
2
- VERSION = "6.0.2"
2
+ VERSION = "6.0.3"
3
3
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tessa
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.2
4
+ version: 6.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Powell
8
8
  - Travis Petticrew
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-08-14 00:00:00.000000000 Z
12
+ date: 2023-12-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -218,7 +218,7 @@ homepage: https://github.com/watermarkchurch/tessa-client
218
218
  licenses:
219
219
  - MIT
220
220
  metadata: {}
221
- post_install_message:
221
+ post_install_message:
222
222
  rdoc_options: []
223
223
  require_paths:
224
224
  - lib
@@ -234,7 +234,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
234
234
  version: '0'
235
235
  requirements: []
236
236
  rubygems_version: 3.0.3.1
237
- signing_key:
237
+ signing_key:
238
238
  specification_version: 4
239
239
  summary: Manage your assets.
240
240
  test_files: