zizia 2.1.0.alpha.02 → 2.1.0.alpha.03
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.
- checksums.yaml +4 -4
- data/Gemfile +2 -0
- data/README.md +2 -1
- data/app/assets/javascripts/zizia/DisplayUploadedFile.es6 +43 -0
- data/app/assets/javascripts/zizia/zizia.js +6 -0
- data/app/assets/stylesheets/zizia/_file_upload.scss +17 -0
- data/app/assets/stylesheets/zizia/application.css +1 -1
- data/app/assets/stylesheets/zizia/zizia.scss +1 -0
- data/app/views/zizia/csv_imports/_file_upload.html.erb +1 -1
- data/lib/zizia/version.rb +1 -1
- data/spec/spec_helper.rb +2 -1
- metadata +7 -4
- data/app/mailers/zizia/application_mailer.rb +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c8bf9c7a1b99352dfd72c3cd910fa515177795e77fb80548a3307ba5930d528c
|
4
|
+
data.tar.gz: 7eba53d703c0f832c0f32f72e578562509921e79b4e07592692e30a2c00c8e1b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff3b4728109ee79da9de02e5a2605016f648f1afb5fd6d8d435fc264edf9a62854494d010f03c178ee602743a0ccbc5945ca767f2e7921789875f17eb9635abd
|
7
|
+
data.tar.gz: 984f15e8af8e7b92dd34644caa42383b56b20b6f6e4ddd7689bd21456c99ad54298df94ef68fd57f95feca29bb1cb293e07eb7bedd60fff3b77842068313f1da
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -4,6 +4,7 @@
|
|
4
4
|
<tr><td>
|
5
5
|
<img alt="Zizia image" src="https://camo.githubusercontent.com/87eafa4a5b6a84802eab583e532bb33881b8a7ab/68747470733a2f2f7777772e706572766572646f6e6b2e636f6d2f77696c64253230666c6f776572732f506172736e69702f476f6c64656e253230416c6578616e646572732f323030383038253230476f6c64656e253230416c6578616e646572253230285a697a69612532306175726561292532302d2532304e47532532302d253230746865253230426f6f6b2532306f6625323057696c64253230466c6f776572732e6a7067" width="500px">
|
6
6
|
</td><td>
|
7
|
+
|
7
8
|
Object import for Hyrax. See the <a href="https://www.rubydoc.info/gems/zizia">API documentation</a> for more
|
8
9
|
information. See the <a href="https://curationexperts.github.io/zizia/">Getting Started</a> guide for a gentle introduction.
|
9
10
|
<br/><br/>
|
@@ -11,7 +12,7 @@ information. See the <a href="https://curationexperts.github.io/zizia/">Getting
|
|
11
12
|
|
12
13
|
[](https://badge.fury.io/rb/zizia)
|
13
14
|
[](https://travis-ci.org/curationexperts/zizia)
|
14
|
-
[](http://www.rubydoc.info/gems/zizia)
|
15
|
+
[](http://www.rubydoc.info/gems/zizia) [](https://coveralls.io/github/curationexperts/zizia?branch=coveralls)
|
15
16
|
|
16
17
|
</td></tr>
|
17
18
|
</table>
|
@@ -0,0 +1,43 @@
|
|
1
|
+
export default class DisplayUploadedFile {
|
2
|
+
constructor() {
|
3
|
+
this.regexp = /[^a-zA-Z0-9\.\-\+_]/g
|
4
|
+
}
|
5
|
+
replaceWhitespace(input) {
|
6
|
+
return input.replace(this.regexp, '_')
|
7
|
+
}
|
8
|
+
|
9
|
+
requiresEscape(input) {
|
10
|
+
return this.regexp.test(input)
|
11
|
+
}
|
12
|
+
|
13
|
+
displayReplaceMessage(input) {
|
14
|
+
if (this.requiresEscape(input)) {
|
15
|
+
return `<b> Note: </b> Your file name contained spaces, which have been replaced by underscores.
|
16
|
+
This will have no effect on your import.`
|
17
|
+
} else {
|
18
|
+
return ''
|
19
|
+
}
|
20
|
+
}
|
21
|
+
|
22
|
+
display() {
|
23
|
+
var fileInput = document.querySelector('#file-upload')
|
24
|
+
var files = fileInput.files
|
25
|
+
for (var i = 0; i < files.length; i++) {
|
26
|
+
var file = files[i]
|
27
|
+
document.querySelector('#file-upload-display').innerHTML = `
|
28
|
+
<div class="row">
|
29
|
+
<div class="col-md-12">
|
30
|
+
<div class="well style="
|
31
|
+
background-color: #dff0d8;
|
32
|
+
border-color: #d6e9c6;
|
33
|
+
color: #3c763d;">
|
34
|
+
<p>You sucessfully uploaded this CSV: <b> ${this.replaceWhitespace(file.name)} </b>
|
35
|
+
</p>
|
36
|
+
${this.displayReplaceMessage(file.name)}
|
37
|
+
<p>
|
38
|
+
</div>
|
39
|
+
</div>
|
40
|
+
</div>`
|
41
|
+
}
|
42
|
+
}
|
43
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
.file-upload {
|
2
|
+
width: 0.1px;
|
3
|
+
height: 0.1px;
|
4
|
+
opacity: 0;
|
5
|
+
overflow: hidden;
|
6
|
+
position: absolute;
|
7
|
+
z-index: -1;
|
8
|
+
}
|
9
|
+
|
10
|
+
.file-upload + label {
|
11
|
+
margin-bottom: 1em;
|
12
|
+
}
|
13
|
+
|
14
|
+
.file-upload:focus + label {
|
15
|
+
outline: 1px dotted #000;
|
16
|
+
outline: -webkit-focus-ring-color auto 5px;
|
17
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
@require 'file-upload';
|
@@ -1,3 +1,3 @@
|
|
1
|
-
<%= form.file_field :manifest, required: true, id: 'file-upload', class: "file-upload form-control", onchange: "
|
1
|
+
<%= form.file_field :manifest, required: true, id: 'file-upload', class: "file-upload form-control", onchange: "Zizia.displayUploadedFile()" %>
|
2
2
|
<label for="file-upload" class="btn btn-lg btn-primary"><span class="glyphicon glyphicon-upload"></span> Upload Your CSV</label>
|
3
3
|
<div id="file-upload-display"></div>
|
data/lib/zizia/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zizia
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.0.alpha.
|
4
|
+
version: 2.1.0.alpha.03
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Data Curation Experts
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-08-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active-fedora
|
@@ -266,8 +266,12 @@ files:
|
|
266
266
|
- Rakefile
|
267
267
|
- app/assets/config/zizia_manifest.js
|
268
268
|
- app/assets/images/zizia/.keep
|
269
|
+
- app/assets/javascripts/zizia/DisplayUploadedFile.es6
|
269
270
|
- app/assets/javascripts/zizia/application.js
|
271
|
+
- app/assets/javascripts/zizia/zizia.js
|
272
|
+
- app/assets/stylesheets/zizia/_file_upload.scss
|
270
273
|
- app/assets/stylesheets/zizia/application.css
|
274
|
+
- app/assets/stylesheets/zizia/zizia.scss
|
271
275
|
- app/controllers/zizia/application_controller.rb
|
272
276
|
- app/controllers/zizia/csv_imports_controller.rb
|
273
277
|
- app/controllers/zizia/importer_documentation_controller.rb
|
@@ -276,7 +280,6 @@ files:
|
|
276
280
|
- app/importers/modular_importer.rb
|
277
281
|
- app/jobs/zizia/application_job.rb
|
278
282
|
- app/jobs/zizia/start_csv_import_job.rb
|
279
|
-
- app/mailers/zizia/application_mailer.rb
|
280
283
|
- app/models/zizia/application_record.rb
|
281
284
|
- app/models/zizia/csv_import.rb
|
282
285
|
- app/uploaders/zizia/csv_manifest_uploader.rb
|
@@ -474,7 +477,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
474
477
|
- !ruby/object:Gem::Version
|
475
478
|
version: 1.3.1
|
476
479
|
requirements: []
|
477
|
-
rubygems_version: 3.0.
|
480
|
+
rubygems_version: 3.0.3
|
478
481
|
signing_key:
|
479
482
|
specification_version: 4
|
480
483
|
summary: Hyrax importers.
|