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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 50abbb119f7b36db57e18758d3c51251c92c665863220161d8abba7cb7aaf31e
4
- data.tar.gz: 4b64d3ddeeb54d6c7aedb5fb7c98f254058ef0a27dd675775e97657c0d8f63c4
3
+ metadata.gz: c8bf9c7a1b99352dfd72c3cd910fa515177795e77fb80548a3307ba5930d528c
4
+ data.tar.gz: 7eba53d703c0f832c0f32f72e578562509921e79b4e07592692e30a2c00c8e1b
5
5
  SHA512:
6
- metadata.gz: 6271f9428a403873322f98e149aa909ef374d74b2c4ac5b12bce56b5b46c0097e3fd5bbcd33d6bb6b1daab176540443b5446042ee48541bd4eb40696b32d6100
7
- data.tar.gz: bd3350e3dad7fee12577adbd027f7c7861c1a3ab613889e9116650b09d3b68ee5e6d0edafdd1579a52132871dafe0cd9aafc801aee6feafcb53b48eecb49619d
6
+ metadata.gz: ff3b4728109ee79da9de02e5a2605016f648f1afb5fd6d8d435fc264edf9a62854494d010f03c178ee602743a0ccbc5945ca767f2e7921789875f17eb9635abd
7
+ data.tar.gz: 984f15e8af8e7b92dd34644caa42383b56b20b6f6e4ddd7689bd21456c99ad54298df94ef68fd57f95feca29bb1cb293e07eb7bedd60fff3b77842068313f1da
data/Gemfile CHANGED
@@ -10,3 +10,5 @@ unless ENV['CI']
10
10
  gem 'guard'
11
11
  gem 'pry'
12
12
  end
13
+
14
+ gem 'coveralls', require: false
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
  [![Gem Version](https://badge.fury.io/rb/zizia.svg)](https://badge.fury.io/rb/zizia)
13
14
  [![Build Status](https://travis-ci.org/curationexperts/zizia.svg?branch=master)](https://travis-ci.org/curationexperts/zizia)
14
- [![Yard Docs](http://img.shields.io/badge/yard-docs-blue.svg)](http://www.rubydoc.info/gems/zizia)
15
+ [![Yard Docs](http://img.shields.io/badge/yard-docs-blue.svg)](http://www.rubydoc.info/gems/zizia) [![Coverage Status](https://coveralls.io/repos/github/curationexperts/zizia/badge.svg?branch=coveralls)](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,6 @@
1
+ var Zizia = {
2
+ displayUploadedFile: function() {
3
+ var DisplayUploadedFile = require('./DisplayUploadedFile')
4
+ new DisplayUploadedFile().display()
5
+ }
6
+ }
@@ -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
+ }
@@ -10,6 +10,6 @@
10
10
  * files in this directory. Styles in this file should be added after the last require_* statement.
11
11
  * It is generally better to create a new file per style scope.
12
12
  *
13
- *= require_tree .
13
+ *= require zizia
14
14
  *= require_self
15
15
  */
@@ -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: "Tenejo.displayUploadedFile()" %>
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Zizia
4
- VERSION = '2.1.0.alpha.02'
4
+ VERSION = '2.1.0.alpha.03'
5
5
  end
data/spec/spec_helper.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
-
2
+ require 'coveralls'
3
+ Coveralls.wear!('rails')
3
4
  require 'pry' unless ENV['CI']
4
5
 
5
6
  ENV['environment'] ||= 'test'
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.02
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-07-30 00:00:00.000000000 Z
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.4
480
+ rubygems_version: 3.0.3
478
481
  signing_key:
479
482
  specification_version: 4
480
483
  summary: Hyrax importers.
@@ -1,7 +0,0 @@
1
- # frozen_string_literal: true
2
- module Zizia
3
- class ApplicationMailer < ActionMailer::Base
4
- default from: 'from@example.com'
5
- layout 'mailer'
6
- end
7
- end