tessa 6.0.2 → 6.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/app/assets/javascripts/tessa.esm.js +11 -0
- data/app/assets/javascripts/tessa.js +8 -0
- data/app/javascript/tessa/index.ts +17 -1
- data/lib/tessa/version.rb +1 -1
- data/tessa.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 53961a60675cf2e6ae0a75270af1a0904cc5397768344109ac1e7a6e2b477c90
|
4
|
+
data.tar.gz: c8268da15058217c944f325072260d556a979aaf51e30d0d46f5d179a7c11b1e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d515730e8fa643a0d367dc1010f119abc98e9338bb501a156a30d93f0f8a79bcdbe0bc1ac3cc6a75dffa5916631ffd0b430e8444865d0c9558e1462edc44eb43
|
7
|
+
data.tar.gz: 8aedfcabf7e554d85ca08387e86c4f66d2004e7db36d6245d20349d5b7a1e50a60a960602068a80891a4717df1d0879cd3427aa0ad52372a73fe82a9605b3916
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
3.2.2
|
@@ -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
data/tessa.gemspec
CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
|
|
13
13
|
spec.homepage = "https://github.com/watermarkchurch/tessa-client"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
|
-
spec.required_ruby_version = '~>
|
16
|
+
spec.required_ruby_version = '~> 3'
|
17
17
|
|
18
18
|
spec.files = `git ls-files -z`.split("\x0").push(
|
19
19
|
'app/assets/javascripts/tessa.js',
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tessa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.0
|
4
|
+
version: 6.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Powell
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2024-02-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -226,14 +226,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
226
226
|
requirements:
|
227
227
|
- - "~>"
|
228
228
|
- !ruby/object:Gem::Version
|
229
|
-
version: '
|
229
|
+
version: '3'
|
230
230
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
231
231
|
requirements:
|
232
232
|
- - ">="
|
233
233
|
- !ruby/object:Gem::Version
|
234
234
|
version: '0'
|
235
235
|
requirements: []
|
236
|
-
rubygems_version: 3.
|
236
|
+
rubygems_version: 3.5.4
|
237
237
|
signing_key:
|
238
238
|
specification_version: 4
|
239
239
|
summary: Manage your assets.
|