diff --git a/app/controllers/api/fasp/data_sharing/v0/backfill_requests_controller.rb b/app/controllers/api/fasp/data_sharing/v0/backfill_requests_controller.rb new file mode 100644 index 0000000000..c37a94f251 --- /dev/null +++ b/app/controllers/api/fasp/data_sharing/v0/backfill_requests_controller.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +class Api::Fasp::DataSharing::V0::BackfillRequestsController < Api::Fasp::BaseController + def create + backfill_request = current_provider.fasp_backfill_requests.new(backfill_request_params) + + respond_to do |format| + format.json do + if backfill_request.save + render json: { backfillRequest: { id: backfill_request.id } }, status: 201 + else + head 422 + end + end + end + end + + private + + def backfill_request_params + params + .permit(:category, :maxCount) + .to_unsafe_h + .transform_keys { |k| k.to_s.underscore } + end +end diff --git a/app/controllers/api/fasp/data_sharing/v0/continuations_controller.rb b/app/controllers/api/fasp/data_sharing/v0/continuations_controller.rb new file mode 100644 index 0000000000..eff2ac0e21 --- /dev/null +++ b/app/controllers/api/fasp/data_sharing/v0/continuations_controller.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +class Api::Fasp::DataSharing::V0::ContinuationsController < Api::Fasp::BaseController + def create + backfill_request = current_provider.fasp_backfill_requests.find(params[:backfill_request_id]) + Fasp::BackfillWorker.perform_async(backfill_request.id) + + head 204 + end +end diff --git a/app/controllers/api/fasp/data_sharing/v0/event_subscriptions_controller.rb b/app/controllers/api/fasp/data_sharing/v0/event_subscriptions_controller.rb new file mode 100644 index 0000000000..29e03d5836 --- /dev/null +++ b/app/controllers/api/fasp/data_sharing/v0/event_subscriptions_controller.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +class Api::Fasp::DataSharing::V0::EventSubscriptionsController < Api::Fasp::BaseController + def create + subscription = current_provider.fasp_subscriptions.create!(subscription_params) + + render json: { subscription: { id: subscription.id } }, status: 201 + end + + def destroy + subscription = current_provider.fasp_subscriptions.find(params[:id]) + subscription.destroy + + head 204 + end + + private + + def subscription_params + params + .permit(:category, :subscriptionType, :maxBatchSize, threshold: {}) + .to_unsafe_h + .transform_keys { |k| k.to_s.underscore } + end +end diff --git a/app/javascript/flavours/glitch/components/status.jsx b/app/javascript/flavours/glitch/components/status.jsx index 18545b79f7..fb62be9b87 100644 --- a/app/javascript/flavours/glitch/components/status.jsx +++ b/app/javascript/flavours/glitch/components/status.jsx @@ -280,9 +280,8 @@ class Status extends ImmutablePureComponent { } }; - handleMouseUp = e => { + handleHeaderClick = e => { // Only handle clicks on the empty space above the content - if (e.target !== e.currentTarget && e.detail >= 1) { return; } @@ -691,7 +690,7 @@ class Status extends ImmutablePureComponent { {(connectReply || connectUp || connectToRoot) &&
} {(!muted) && ( -