Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .osv-detector.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
ignore:
- GHSA-mwcw-c2x4-8c55
- GHSA-vh95-rmgr-6w4m
- GHSA-xvch-5gv4-984h
ignore: []
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ GEM
pundit (2.1.1)
activesupport (>= 3.0.0)
racc (1.8.1)
rack (2.2.14)
rack (2.2.18)
rack-canonical-host (1.1.0)
addressable (> 0, < 3)
rack (>= 1.0.0, < 3)
Expand Down
13 changes: 5 additions & 8 deletions app/frontend/components/uppy/ActiveStorageUpload.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { BasePlugin } from '@uppy/core';
import { nanoid } from 'nanoid';
import settle from '@uppy/utils/lib/settle';
import EventTracker from '@uppy/utils/lib/EventTracker';
import EventManager from '@uppy/utils/lib/EventManager';
import ProgressTimeout from '@uppy/utils/lib/ProgressTimeout';
import {
RateLimitedQueue,
Expand Down Expand Up @@ -62,8 +61,6 @@ class ActiveStorageUpload extends BasePlugin {

this.uppy.log(`uploading ${current} of ${total}`);
return new Promise((resolve, reject) => {
this.uppy.emit('upload-started', file);

var directHandlers = {
directUploadWillStoreFileWithXHR: null,
directUploadDidProgress: null
Expand Down Expand Up @@ -101,7 +98,7 @@ class ActiveStorageUpload extends BasePlugin {
this.opts.directUploadUrl,
directHandlers
);
this.uploaderEvents[file.id] = new EventTracker(this.uppy);
this.uploaderEvents[file.id] = new EventManager(this.uppy);

const timer = new ProgressTimeout(opts.timeout, () => {
upload.abort();
Expand Down Expand Up @@ -143,8 +140,6 @@ class ActiveStorageUpload extends BasePlugin {
};

const queuedRequest = this.requests.run(() => {
this.uppy.emit('upload-started', file);

upload.create(handleDirectUpload);

return () => {
Expand All @@ -166,6 +161,8 @@ class ActiveStorageUpload extends BasePlugin {
}

uploadFiles(files) {
this.uppy.emit('upload-start', files);

const promises = files.map((file, i) => {
const current = parseInt(i, 10) + 1;
const total = files.length;
Expand All @@ -176,7 +173,7 @@ class ActiveStorageUpload extends BasePlugin {
return this.upload(file, current, total);
});

return settle(promises);
return Promise.all(promises);
}

onFileRemove(fileID, cb) {
Expand Down
2 changes: 1 addition & 1 deletion app/frontend/packs/administration.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ require('@rails/activestorage').start();
import 'foundation';
import '../application.scss';
import '../components/header';
import 'selectize/dist/js/selectize.min.js';
import '@selectize/selectize/dist/js/selectize.min.js';
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@
"@rails/activestorage": "^7.0.4",
"@rails/request.js": "^0.0.8",
"@rails/ujs": "^7.0.4",
"@selectize/selectize": "^0.15.2",
"@types/babel__core": "^7.0.0",
"@types/webpack": "^5.0.0",
"@uppy/core": "^3.13.0",
"@uppy/dashboard": "^3.9.0",
"@uppy/core": "^4.0.0",
"@uppy/dashboard": "^4.0.0",
"@uppy/drop-target": "^3.0.0",
"@uppy/webcam": "^3.4.0",
"@uppy/utils": "^6.2.2",
"@uppy/webcam": "^4.0.0",
"babel-loader": "^9.0.0",
"chosen-js": "^1.8.7",
"compression-webpack-plugin": "^9.0.0",
Expand All @@ -39,11 +41,11 @@
"foundation-sites": "~6.8.0",
"jquery": "^3.4.1",
"mini-css-extract-plugin": "^2.7.6",
"nanoid": "^5.1.6",
"react": "^16.10.2",
"react-dom": "^16.10.2",
"sass": "^1.69.5",
"sass-loader": "^13.0.0",
"selectize": "^0.12.6",
"shakapacker": "^7.0.0",
"terser-webpack-plugin": "^5.0.0",
"turbolinks": "^5.2.0",
Expand Down
16 changes: 10 additions & 6 deletions spec/system/approved_user_application_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,21 @@
it "sends an email to the user after submitting" do
subject.fill_in_mandatory_fields
perform_enqueued_jobs { subject.submit }
mail = ActionMailer::Base.deliveries[-2]
expect(mail.to).to eq [user.email]
expect(mail.subject).to eq I18n.t("approved_user_mailer.submitted.subject")

mails = ActionMailer::Base.deliveries.select { |mail| mail.to.include?(user.email) }

expect(mails.length).to be(1)
expect(mails.first.subject).to eq I18n.t("approved_user_mailer.submitted.subject")
end

it "sends an email to the admin after submitting" do
subject.fill_in_mandatory_fields
perform_enqueued_jobs { subject.submit }
mail = ActionMailer::Base.deliveries[-1]
expect(mail.to).to eq [admin.email]
expect(mail.subject).to eq I18n.t("approved_user_mailer.admin_submitted.subject")

mails = ActionMailer::Base.deliveries.select { |mail| mail.to.include?(admin.email) }

expect(mails.length).to be(1)
expect(mails.first.subject).to eq I18n.t("approved_user_mailer.admin_submitted.subject")
end

it "leaves a required field blank" do
Expand Down
Loading
Loading