Skip to content

Commit

Permalink
Fix removing file uploads when creating new notices in admin
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-hank committed Jul 8, 2022
1 parent 374b96c commit 4c01b5e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). It uses [CalVer](https://calver.org/) as of May 2019.

## [22.07c](https://github.com/berkmancenter/lumendatabase/releases/tag/2022.07c) - 2022-07-08
### Fixed
* Fixed removing `file uploads` when creating `new notices` in the `admin`.

## [22.07b](https://github.com/berkmancenter/lumendatabase/releases/tag/2022.07b) - 2022-07-08
### Added
* Made it possible to customize the `notice view` per notice.
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ gem 'jsonapi-serializer'
gem 'kaminari'
gem 'lograge'
gem 'mime-types'
gem 'nested_form', git: 'https://github.com/berkmancenter/nested_form'
gem 'oink'
# Pinned because the next step is migrating to ActiveStorage.
gem 'paperclip', '~> 5'
Expand Down
8 changes: 7 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
GIT
remote: https://github.com/berkmancenter/nested_form
revision: 46f5f658c3477f79906880a43948514f311268d5
specs:
nested_form (0.3.2)

GEM
remote: https://rubygems.org/
specs:
Expand Down Expand Up @@ -307,7 +313,6 @@ GEM
neat (1.3.0)
bourbon (>= 2.1)
sass (>= 3.2)
nested_form (0.3.2)
nio4r (2.5.8)
nokogiri (1.13.6)
mini_portile2 (~> 2.8.0)
Expand Down Expand Up @@ -571,6 +576,7 @@ DEPENDENCIES
mime-types
mini_racer
neat
nested_form!
oink
paperclip (~> 5)
parallel_tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,11 @@ class NoticeEditForm {

editor.on('ready',() => {
$('.works_json_field .card-title').first().hide();
editor.setValue(JSON.parse($(`#${field_name}`).val()));
let val_to_init = $(`#${field_name}`).val();
if (!val_to_init) {
val_to_init = '[]';
}
editor.setValue(JSON.parse(val_to_init));
});

editor.on('change',() => {
Expand Down

0 comments on commit 4c01b5e

Please sign in to comment.