neeto-commons-backend 1.0.108 → 1.0.109

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aa90a137f6107e426359d2c895c228fe5758ca373e97a46422137752b361a5c3
4
- data.tar.gz: 2ba4b3a929ac2abb18ed52858dcb281027357f49811c376fadd24064f2e40a92
3
+ metadata.gz: fd7352b3f3f0177ac9284d8e5ee6048499d223a91abe484ce7eb0aec7de2e01d
4
+ data.tar.gz: 1cd5a44a254214877540c0b344409aa40ea05f6dd1dc7c86b5c1d7fc2115e5c2
5
5
  SHA512:
6
- metadata.gz: 725b838091d7e9313f5c17e09c390ec5b28a9bf8f4e73b7fea09c0956d802291884bd4226aff75773567a95affaa138f41872f6e88a9934aea2f990cc19ad3a6
7
- data.tar.gz: 419057034f7d5869a526a56a778c10522d2a4be5d9ae1d3532fb4be902da81a81eaeb756f16a63c92326bc1afcf2e12b79be2207bca388030a8bea4969160be0
6
+ metadata.gz: 7510f362e7b76ac4f35422e2c2bdba60eb72401842803841796c6ff62c37176514baf56eeba7c5e479f3062687f570ac450cb7a8b8d0fb09efe338406720b08a
7
+ data.tar.gz: bde249517dc70f8b4f5ca79fed0cdcd5cbbdcfcb4770c2b24f76c1e34af5ddff7bb4559d00f79908276ef4b4a5583fce04986b903d9ca2ea051cb6a1cb99aa48
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- neeto-commons-backend (1.0.108)
4
+ neeto-commons-backend (1.0.109)
5
5
  actionview
6
6
  bullet
7
7
  database_cleaner
@@ -7,9 +7,9 @@ module NeetoCommonsBackend
7
7
  before_action :load_blob!, only: %i[update destroy]
8
8
 
9
9
  def create
10
- blob = ActiveStorage::Blob.create_before_direct_upload!(**blob_args)
11
- blob_url = url_for(blob)
12
- render json: direct_upload_json(blob).merge(blob_url:)
10
+ @blob = ActiveStorage::Blob.create_before_direct_upload!(**blob_args)
11
+ blob_url = url_for(@blob)
12
+ render json: direct_upload_json(@blob).merge(blob_url:)
13
13
  end
14
14
 
15
15
  def update
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ class NeetoEditor::Api::V1::DirectUploadsController < NeetoCommonsBackend::Api::DirectUploadsController
4
+ before_action :destroy_editor_asset!, only: :destroy
5
+
6
+ def attach
7
+ blob = ActiveStorage::Blob.find(params[:id])
8
+ @organization.neeto_editor_assets.create!(blob_id: blob.id, file: blob)
9
+ render_success
10
+ end
11
+
12
+ private
13
+
14
+ def destroy_editor_asset!
15
+ @organization.neeto_editor_assets.find_by_blob_id(@blob.id)&.destroy!
16
+ end
17
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module NeetoEditor
4
+ class Asset < ApplicationRecord
5
+ belongs_to :organization
6
+ belongs_to :blob, class_name: "ActiveStorage::Blob"
7
+
8
+ has_one_attached :file
9
+ end
10
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module NeetoEditor
4
+ def self.table_name_prefix
5
+ "neeto_editor_"
6
+ end
7
+ end
@@ -28,7 +28,7 @@
28
28
  },
29
29
  "devDependencies": {
30
30
  "@babel/eslint-parser": "7.17.0",
31
- "@bigbinary/eslint-plugin-neeto": "1.0.49",
31
+ "@bigbinary/eslint-plugin-neeto": "1.0.50",
32
32
  "eslint": "8.14.0",
33
33
  "eslint-config-prettier": "8.5.0",
34
34
  "eslint-plugin-cypress": "2.12.1",
@@ -54,7 +54,6 @@
54
54
  "@bigbinary/babel-preset-neeto": "^1.0.3",
55
55
  "@babel/preset-typescript": "^7.18.6",
56
56
  "@babel/runtime": "^7.19.0",
57
- "@bigbinary/neeto-editor": "1.26.13",
58
57
  "@bigbinary/neeto-filters-frontend": "2.11.6",
59
58
  "@bigbinary/neeto-icons": "1.11.0",
60
59
  "@bigbinary/neeto-commons-frontend": "2.0.74",
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ Rails.application.routes.draw do
4
+ namespace :neeto_editor do
5
+ namespace :api do
6
+ namespace :v1 do
7
+ resources :direct_uploads, only: %i[create update destroy] do
8
+ post :attach, on: :collection
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module NeetoCommonsBackend
4
- VERSION = "1.0.108"
4
+ VERSION = "1.0.109"
5
5
  end
data/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "@babel/plugin-transform-runtime": "7.17.10",
9
9
  "@babel/preset-env": "7.17.10",
10
10
  "@babel/preset-react": "7.16.7",
11
- "@bigbinary/eslint-plugin-neeto": "1.0.49",
11
+ "@bigbinary/eslint-plugin-neeto": "1.0.50",
12
12
  "@bigbinary/neeto-commons-frontend": "2.0.74",
13
13
  "eslint": "8.14.0",
14
14
  "eslint-config-prettier": "8.5.0",
data/yarn.lock CHANGED
@@ -967,10 +967,10 @@
967
967
  "@babel/helper-validator-identifier" "^7.18.6"
968
968
  to-fast-properties "^2.0.0"
969
969
 
970
- "@bigbinary/eslint-plugin-neeto@1.0.49":
971
- version "1.0.49"
972
- resolved "https://registry.yarnpkg.com/@bigbinary/eslint-plugin-neeto/-/eslint-plugin-neeto-1.0.49.tgz#ffccd9d4eeba149a75678443a2b9a61261cbf377"
973
- integrity sha512-wfw29eDjijitPLZrbIuap6tffwT3ZnZKgQ1ZHJdUIkEiftcpI2DmIMwSqj4tpsoyDdn1KzGzwUpJSKF2q25brw==
970
+ "@bigbinary/eslint-plugin-neeto@1.0.50":
971
+ version "1.0.50"
972
+ resolved "https://registry.yarnpkg.com/@bigbinary/eslint-plugin-neeto/-/eslint-plugin-neeto-1.0.50.tgz#d5a518ef958d35f78a00ee7e6cf85cb679593e57"
973
+ integrity sha512-xQmLyj/QQ7EXtPHv51BGpHwUIgnbQmGZHJuvFQX5lOdOYAroRebnMzXXNwusY0Bs/aaWSJybrZjjvrE1G/Ldjg==
974
974
 
975
975
  "@bigbinary/neeto-commons-frontend@2.0.74":
976
976
  version "2.0.74"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: neeto-commons-backend
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.108
4
+ version: 1.0.109
5
5
  platform: ruby
6
6
  authors:
7
7
  - Prasanth Chaduvula
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-31 00:00:00.000000000 Z
11
+ date: 2023-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionview
@@ -302,9 +302,12 @@ files:
302
302
  - app/controllers/neeto_commons_backend/failures_controller.rb
303
303
  - app/controllers/neeto_commons_backend/health_check_controller.rb
304
304
  - app/controllers/neeto_commons_backend/well_knowns_controller.rb
305
+ - app/controllers/neeto_editor/api/v1/direct_uploads_controller.rb
305
306
  - app/mailers/neeto_commons_backend/application_mailer.rb
306
307
  - app/models/concerns/neeto_commons_backend/sluggable.rb
307
308
  - app/models/concerns/neeto_commons_backend/soft_deletable.rb
309
+ - app/models/neeto_editor.rb
310
+ - app/models/neeto_editor/asset.rb
308
311
  - app/services/neeto_commons_backend/sample_data/common/admin_service.rb
309
312
  - app/services/neeto_commons_backend/sample_data/common/app_organization_service.rb
310
313
  - app/services/neeto_commons_backend/sample_data/common/base.rb
@@ -457,6 +460,7 @@ files:
457
460
  - lib/neeto_commons_backend/routes/errors.rb
458
461
  - lib/neeto_commons_backend/routes/health.rb
459
462
  - lib/neeto_commons_backend/routes/letter_opener.rb
463
+ - lib/neeto_commons_backend/routes/neeto_editor.rb
460
464
  - lib/neeto_commons_backend/routes/sidekiq.rb
461
465
  - lib/neeto_commons_backend/routes/well_knowns.rb
462
466
  - lib/neeto_commons_backend/scripts/sync_with_wheel.sh