Skip to content

Commit 3c5f297

Browse files
Clupaimaplefoxgitronitkhokharrgauravmyana2002
committed
feat(demo): demo scenarios and sample data tasks
Brings the T2 2026 demo work from ontrack-features-t2-2026 11.0.x (reviewed and merged work) onto thoth-tech 11.0.x. Co-authored-by: maplefoxgit <s223932052@deakin.edu.au> Co-authored-by: Ronit Khokhar <ronitkhokharr@gmail.com> Co-authored-by: Gaurav Myana <s225108954@deakin.edu.au>
1 parent dc76a5a commit 3c5f297

7 files changed

Lines changed: 1848 additions & 4 deletions

File tree

‎app/api/demo_scenario_api.rb‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# frozen_string_literal: true
2+
3+
require 'grape'
4+
require Rails.root.join('lib/demo_data/all_features_scenario')
5+
6+
class DemoScenarioApi < Grape::API
7+
helpers AuthenticationHelpers
8+
9+
before do
10+
header 'Cache-Control', 'private, no-store'
11+
authenticated?
12+
end
13+
14+
desc 'Get the guarded local mobile-feedback demo scenario contract',
15+
tags: ['demo'],
16+
summary: 'Get guarded local demo scenario'
17+
get '/demo/scenario' do
18+
DemoData::AllFeaturesScenario.contract_for(user: current_user)
19+
rescue DemoData::AllFeaturesScenario::SafetyError
20+
error!({ error: 'Not found.' }, 404)
21+
end
22+
end

0 commit comments

Comments
 (0)