mumuki-laboratory 8.6.1 → 9.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/mumuki_laboratory/application/_layout.scss +3 -0
  3. data/app/assets/stylesheets/mumuki_laboratory/application/_modules.scss +1 -0
  4. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_content_show.scss +15 -2
  5. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_medal.scss +1 -1
  6. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_user_menu.scss +35 -0
  7. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_user_profile.scss +11 -0
  8. data/app/controllers/api/base_controller.rb +0 -1
  9. data/app/controllers/api/courses_controller.rb +1 -1
  10. data/app/controllers/api/organizations_controller.rb +5 -2
  11. data/app/controllers/api/roles_controller.rb +4 -0
  12. data/app/controllers/api/users_controller.rb +6 -1
  13. data/app/controllers/concerns/with_authorization.rb +1 -16
  14. data/app/controllers/concerns/with_user_params.rb +4 -0
  15. data/app/controllers/discussions_messages_controller.rb +0 -1
  16. data/app/controllers/users_controller.rb +8 -5
  17. data/app/helpers/breadcrumbs_helper.rb +4 -0
  18. data/app/helpers/content_view_helper.rb +19 -0
  19. data/app/helpers/links_helper.rb +2 -2
  20. data/app/helpers/menu_bar_helper.rb +1 -1
  21. data/app/helpers/user_menu_helper.rb +18 -0
  22. data/app/views/chapters/show.html.erb +15 -14
  23. data/app/views/complements/show.html.erb +1 -1
  24. data/app/views/exams/show.html.erb +1 -1
  25. data/app/views/{layouts → exercises}/_exercise_skipped.html.erb +0 -0
  26. data/app/views/exercises/_exercise_title_icons.html.erb +4 -0
  27. data/app/views/exercises/show.html.erb +4 -7
  28. data/app/views/{layouts → guides}/_guide.html.erb +0 -0
  29. data/app/views/guides/_guide_container.html.erb +24 -0
  30. data/app/views/{layouts → guides}/_guide_title_icons.html.erb +1 -3
  31. data/app/views/layouts/_progress_listing.html.erb +1 -1
  32. data/app/views/layouts/_user_menu.html.erb +21 -0
  33. data/app/views/lessons/show.html.erb +1 -1
  34. data/app/views/users/_user_form.html.erb +10 -8
  35. data/app/views/users/discussions.html.erb +28 -0
  36. data/app/views/users/edit.html.erb +1 -1
  37. data/app/views/users/messages.html.erb +27 -0
  38. data/app/views/users/show.html.erb +4 -51
  39. data/app/views/users/terms.html.erb +1 -1
  40. data/config/routes.rb +3 -0
  41. data/lib/mumuki/laboratory/locales/en.yml +3 -1
  42. data/lib/mumuki/laboratory/locales/es-CL.yml +3 -1
  43. data/lib/mumuki/laboratory/locales/es.yml +3 -1
  44. data/lib/mumuki/laboratory/locales/pt.yml +3 -1
  45. data/lib/mumuki/laboratory/version.rb +1 -1
  46. data/spec/controllers/organizations_api_controller_spec.rb +16 -9
  47. data/spec/dummy/db/schema.rb +23 -0
  48. data/spec/features/exercise_flow_spec.rb +3 -3
  49. data/spec/features/login_flow_spec.rb +1 -1
  50. data/spec/features/menu_bar_spec.rb +24 -24
  51. data/spec/features/profile_flow_spec.rb +5 -7
  52. metadata +17 -10
  53. data/app/views/layouts/_guide_container.html.erb +0 -28
@@ -71,6 +71,29 @@ ActiveRecord::Schema.define(version: 20210119190204) do
71
71
  t.index ["slug"], name: "index_books_on_slug", unique: true
72
72
  end
73
73
 
74
+ create_table "certificate_programs", force: :cascade do |t|
75
+ t.string "title"
76
+ t.string "template_html_erb"
77
+ t.text "description"
78
+ t.string "background_image_url"
79
+ t.bigint "organization_id"
80
+ t.datetime "created_at", null: false
81
+ t.datetime "updated_at", null: false
82
+ t.index ["organization_id"], name: "index_certificate_programs_on_organization_id"
83
+ end
84
+
85
+ create_table "certificates", force: :cascade do |t|
86
+ t.bigint "user_id"
87
+ t.bigint "certificate_program_id"
88
+ t.datetime "start_date"
89
+ t.datetime "end_date"
90
+ t.string "code"
91
+ t.datetime "created_at", null: false
92
+ t.datetime "updated_at", null: false
93
+ t.index ["certificate_program_id"], name: "index_certificates_on_certificate_program_id"
94
+ t.index ["user_id"], name: "index_certificates_on_user_id"
95
+ end
96
+
74
97
  create_table "chapters", id: :serial, force: :cascade do |t|
75
98
  t.datetime "created_at"
76
99
  t.datetime "updated_at"
@@ -106,19 +106,19 @@ feature 'Exercise Flow', organization_workspace: :test do
106
106
  scenario 'visit exercise by id, standalone mode' do
107
107
  visit "/exercises/#{problem_1.id}"
108
108
  expect(page).to have_text('Functional Programming 1')
109
- expect(page).to have_text('Profile')
109
+ expect(page).to have_text('My account')
110
110
  end
111
111
  scenario 'visit exercise by id, embedded mode in non embeddable organization' do
112
112
  visit "/exercises/#{problem_1.id}?embed=true"
113
113
  expect(page).to have_text('Functional Programming 1')
114
- expect(page).to have_text('Profile')
114
+ expect(page).to have_text('My account')
115
115
  end
116
116
  scenario 'visit exercise by id, embedded mode in embeddable organization' do
117
117
  Organization.current.tap { |it| it.embeddable = true }.save!
118
118
 
119
119
  visit "/exercises/#{problem_1.id}?embed=true"
120
120
  expect(page).to_not have_text('Functional Programming 1')
121
- expect(page).to_not have_text('Profile')
121
+ expect(page).to_not have_text('My account')
122
122
  end
123
123
  end
124
124
 
@@ -64,6 +64,6 @@ feature 'Login Flow', organization_workspace: :test do
64
64
 
65
65
  expect(page).to_not have_text('Sign in')
66
66
  expect(page).to have_text('Sign Out')
67
- expect(page).to have_text('Profile')
67
+ expect(page).to have_text('My profile')
68
68
  end
69
69
  end
@@ -16,7 +16,7 @@ feature 'menu bar' do
16
16
  scenario 'should not see menu bar' do
17
17
  visit '/'
18
18
 
19
- expect(page).not_to have_text('Profile')
19
+ expect(page).not_to have_text('My account')
20
20
  expect(page).not_to have_text('Classroom')
21
21
  expect(page).not_to have_text('Bibliotheca')
22
22
  end
@@ -30,7 +30,7 @@ feature 'menu bar' do
30
30
  scenario 'should not see menu bar' do
31
31
  visit '/'
32
32
 
33
- expect(page).not_to have_text('Profile')
33
+ expect(page).not_to have_text('My account')
34
34
  expect(page).not_to have_text('Classroom')
35
35
  expect(page).not_to have_text('Bibliotheca')
36
36
  expect(page).not_to have_text('Solve other\'s doubts')
@@ -48,11 +48,11 @@ feature 'menu bar' do
48
48
  let(:admin) { create(:user, permissions: {student: 'private/*', admin: 'private/*'}) }
49
49
  let(:owner) { create(:user, permissions: {student: 'private/*', owner: 'private/*'}) }
50
50
 
51
- scenario 'visitor should only see profile' do
51
+ scenario 'visitor should only see their account' do
52
52
  set_current_user! visitor
53
53
 
54
54
  visit '/'
55
- expect(page).to have_text('Profile')
55
+ expect(page).to have_text('My account')
56
56
  expect(page).not_to have_text('Classroom')
57
57
  expect(page).not_to have_text('Bibliotheca')
58
58
  expect(page).not_to have_text('Solve other\'s doubts')
@@ -60,23 +60,23 @@ feature 'menu bar' do
60
60
  end
61
61
 
62
62
  context 'student with no discussions should' do
63
- scenario 'only see profile if forum is not enabled' do
63
+ scenario 'only see their account if forum is not enabled' do
64
64
  set_current_user! student
65
65
 
66
66
  visit '/'
67
- expect(page).to have_text('Profile')
67
+ expect(page).to have_text('My account')
68
68
  expect(page).not_to have_text('Classroom')
69
69
  expect(page).not_to have_text('Bibliotheca')
70
70
  expect(page).not_to have_text('Solve other\'s doubts')
71
71
  expect(page).not_to have_text('My doubts')
72
72
  end
73
73
 
74
- scenario 'see profile and solve_other_doubts links if forum is enabled' do
74
+ scenario 'see their account and solve_other_doubts links if forum is enabled' do
75
75
  set_current_user! student
76
76
  private_organization.update! forum_enabled: true
77
77
 
78
78
  visit '/'
79
- expect(page).to have_text('Profile')
79
+ expect(page).to have_text('My account')
80
80
  expect(page).not_to have_text('Classroom')
81
81
  expect(page).not_to have_text('Bibliotheca')
82
82
  expect(page).to have_text('Solve other\'s doubts')
@@ -87,12 +87,12 @@ feature 'menu bar' do
87
87
  context 'student with discussions should' do
88
88
  let(:discussion) { create(:discussion, item: lesson.exercises.last, initiator: student)}
89
89
 
90
- scenario 'only see profile if forum is not enabled' do
90
+ scenario 'only see their account if forum is not enabled' do
91
91
  set_current_user! student
92
92
  student.subscribe_to! discussion
93
93
 
94
94
  visit '/'
95
- expect(page).to have_text('Profile')
95
+ expect(page).to have_text('My account')
96
96
  expect(page).not_to have_text('Classroom')
97
97
  expect(page).not_to have_text('Bibliotheca')
98
98
  expect(page).not_to have_text('Solve other\'s doubts')
@@ -105,21 +105,21 @@ feature 'menu bar' do
105
105
  student.subscribe_to! discussion
106
106
 
107
107
  visit '/'
108
- expect(page).to have_text('Profile')
108
+ expect(page).to have_text('My account')
109
109
  expect(page).not_to have_text('Classroom')
110
110
  expect(page).not_to have_text('Bibliotheca')
111
111
  expect(page).to have_text('Solve other\'s doubts')
112
112
  expect(page).to have_text('My doubts')
113
113
  end
114
114
 
115
- scenario 'only see profile if forum is enabled in a forum_only_for_trusted organization' do
115
+ scenario 'only see their account if forum is enabled in a forum_only_for_trusted organization' do
116
116
  set_current_user! student
117
117
  student.subscribe_to! discussion
118
118
  private_organization.update! forum_enabled: true
119
119
  private_organization.update! forum_only_for_trusted: true
120
120
 
121
121
  visit '/'
122
- expect(page).to have_text('Profile')
122
+ expect(page).to have_text('My account')
123
123
  expect(page).not_to have_text('Classroom')
124
124
  expect(page).not_to have_text('Bibliotheca')
125
125
  expect(page).not_to have_text('Solve other\'s doubts')
@@ -134,7 +134,7 @@ feature 'menu bar' do
134
134
  private_organization.update! forum_only_for_trusted: true
135
135
 
136
136
  visit '/'
137
- expect(page).to have_text('Profile')
137
+ expect(page).to have_text('My account')
138
138
  expect(page).not_to have_text('Classroom')
139
139
  expect(page).not_to have_text('Bibliotheca')
140
140
  expect(page).to have_text('Solve other\'s doubts')
@@ -142,54 +142,54 @@ feature 'menu bar' do
142
142
  end
143
143
  end
144
144
 
145
- scenario 'teacher should see profile and classroom' do
145
+ scenario 'teacher should see their account and classroom' do
146
146
  set_current_user! teacher
147
147
 
148
148
  visit '/'
149
149
 
150
- expect(page).to have_text('Profile')
150
+ expect(page).to have_text('My account')
151
151
  expect(page).to have_text('Classroom')
152
152
  expect(page).not_to have_text('Bibliotheca')
153
153
  expect(page).not_to have_text('Solve other\'s doubts')
154
154
  expect(page).not_to have_text('My doubts')
155
155
  end
156
156
 
157
- scenario 'writer should see profile and bibliotheca' do
157
+ scenario 'writer should see their account and bibliotheca' do
158
158
  set_current_user! writer
159
159
 
160
160
  visit '/'
161
161
 
162
- expect(page).to have_text('Profile')
162
+ expect(page).to have_text('My account')
163
163
  expect(page).not_to have_text('Classroom')
164
164
  expect(page).to have_text('Bibliotheca')
165
165
  end
166
166
 
167
- scenario 'janitor should see profile and classroom' do
167
+ scenario 'janitor should see their account and classroom' do
168
168
  set_current_user! janitor
169
169
 
170
170
  visit '/'
171
171
 
172
- expect(page).to have_text('Profile')
172
+ expect(page).to have_text('My account')
173
173
  expect(page).to have_text('Classroom')
174
174
  expect(page).not_to have_text('Bibliotheca')
175
175
  end
176
176
 
177
- scenario 'admin should see profile, classroom and bibliotheca' do
177
+ scenario 'admin should their account, classroom and bibliotheca' do
178
178
  set_current_user! admin
179
179
 
180
180
  visit '/'
181
181
 
182
- expect(page).to have_text('Profile')
182
+ expect(page).to have_text('My account')
183
183
  expect(page).to have_text('Classroom')
184
184
  expect(page).to have_text('Bibliotheca')
185
185
  end
186
186
 
187
- scenario 'owner should see profile, classroom and bibliotheca' do
187
+ scenario 'owner should see their account, classroom and bibliotheca' do
188
188
  set_current_user! owner
189
189
 
190
190
  visit '/'
191
191
 
192
- expect(page).to have_text('Profile')
192
+ expect(page).to have_text('My account')
193
193
  expect(page).to have_text('Classroom')
194
194
  expect(page).to have_text('Bibliotheca')
195
195
  end
@@ -97,31 +97,29 @@ feature 'Profile Flow', organization_workspace: :test do
97
97
 
98
98
  click_on(button_options)
99
99
  expect(page).to have_text('Your data was updated successfully')
100
- expect(page).to have_text('Profile')
100
+ expect(page).to have_text('My profile')
101
101
  end
102
102
  end
103
103
  end
104
104
 
105
105
  context 'with no messages' do
106
-
107
- scenario 'visit messages tab' do
108
- visit "/user#messages"
106
+ scenario 'visit messages' do
107
+ visit "/user/messages"
109
108
 
110
109
  expect(page).to have_text('It seems you don\'t have any messages yet!')
111
110
  end
112
111
  end
113
112
 
114
113
  context 'with messages' do
115
- scenario 'visit messages tab' do
114
+ scenario 'visit messages' do
116
115
  Organization.find_by_name('test').switch!
117
116
  problem.submit_solution! user, {content: 'something'}
118
117
  Message.import_from_resource_h! message
119
- visit "/user#messages"
118
+ visit "/user/messages"
120
119
 
121
120
  expect(page).to_not have_text('It seems you don\'t have any messages yet!')
122
121
  expect(page).to have_text(problem.name)
123
122
  end
124
123
  end
125
124
  end
126
-
127
125
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mumuki-laboratory
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.6.1
4
+ version: 9.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Franco Bulgarelli
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-26 00:00:00.000000000 Z
11
+ date: 2021-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 8.6.0
33
+ version: 9.0.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 8.6.0
40
+ version: 9.0.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: mumukit-bridge
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '7.3'
61
+ version: '7.6'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '7.3'
68
+ version: '7.6'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: mumukit-nuntius
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -440,6 +440,7 @@ files:
440
440
  - app/assets/stylesheets/mumuki_laboratory/application/modules/_terms.scss
441
441
  - app/assets/stylesheets/mumuki_laboratory/application/modules/_timer.scss
442
442
  - app/assets/stylesheets/mumuki_laboratory/application/modules/_upload.scss
443
+ - app/assets/stylesheets/mumuki_laboratory/application/modules/_user_menu.scss
443
444
  - app/assets/stylesheets/mumuki_laboratory/application/modules/_user_profile.scss
444
445
  - app/controllers/ajax_controller.rb
445
446
  - app/controllers/api/base_controller.rb
@@ -495,6 +496,7 @@ files:
495
496
  - app/helpers/concerns/with_student_path_navigation/finish_navigation.rb
496
497
  - app/helpers/concerns/with_student_path_navigation/navigation.rb
497
498
  - app/helpers/concerns/with_student_path_navigation/revisit_navigation.rb
499
+ - app/helpers/content_view_helper.rb
498
500
  - app/helpers/contextualization_result_helper.rb
499
501
  - app/helpers/discussions_helper.rb
500
502
  - app/helpers/editor_helper.rb
@@ -518,6 +520,7 @@ files:
518
520
  - app/helpers/progress_bar_helper.rb
519
521
  - app/helpers/progress_helper.rb
520
522
  - app/helpers/runner_assets_helper.rb
523
+ - app/helpers/user_menu_helper.rb
521
524
  - app/mailers/application_mailer.rb
522
525
  - app/mailers/user_mailer.rb
523
526
  - app/views/appendixes/show.html.erb
@@ -555,18 +558,19 @@ files:
555
558
  - app/views/exercise_solutions/_results_hidden.html.erb
556
559
  - app/views/exercise_solutions/_results_title.html.erb
557
560
  - app/views/exercises/_exercise_assignment.html.erb
561
+ - app/views/exercises/_exercise_skipped.html.erb
562
+ - app/views/exercises/_exercise_title_icons.html.erb
558
563
  - app/views/exercises/_read_only.html.erb
559
564
  - app/views/exercises/show.html.erb
565
+ - app/views/guides/_guide.html.erb
566
+ - app/views/guides/_guide_container.html.erb
567
+ - app/views/guides/_guide_title_icons.html.erb
560
568
  - app/views/invitations/_invitation_form.html.erb
561
569
  - app/views/invitations/show.html.erb
562
570
  - app/views/layouts/_authoring.html.erb
563
571
  - app/views/layouts/_copyright.html.erb
564
572
  - app/views/layouts/_discussions.html.erb
565
573
  - app/views/layouts/_error.html.erb
566
- - app/views/layouts/_exercise_skipped.html.erb
567
- - app/views/layouts/_guide.html.erb
568
- - app/views/layouts/_guide_container.html.erb
569
- - app/views/layouts/_guide_title_icons.html.erb
570
574
  - app/views/layouts/_kids.html.erb
571
575
  - app/views/layouts/_kindergarten.html.erb
572
576
  - app/views/layouts/_main.html.erb
@@ -585,6 +589,7 @@ files:
585
589
  - app/views/layouts/_terms_acceptance_disclaimer.html.erb
586
590
  - app/views/layouts/_test_results.html.erb
587
591
  - app/views/layouts/_timer.html.erb
592
+ - app/views/layouts/_user_menu.html.erb
588
593
  - app/views/layouts/application.html.erb
589
594
  - app/views/layouts/embedded.html.erb
590
595
  - app/views/layouts/exercise_inputs/editors/_code.html.erb
@@ -645,7 +650,9 @@ files:
645
650
  - app/views/users/_profile_fields.html.erb
646
651
  - app/views/users/_term.html.erb
647
652
  - app/views/users/_user_form.html.erb
653
+ - app/views/users/discussions.html.erb
648
654
  - app/views/users/edit.html.erb
655
+ - app/views/users/messages.html.erb
649
656
  - app/views/users/show.html.erb
650
657
  - app/views/users/terms.html.erb
651
658
  - config/i18n-tasks.yml
@@ -1,28 +0,0 @@
1
- <%= content_for :breadcrumbs do %>
2
- <%= breadcrumbs subject %>
3
- <% end %>
4
-
5
- <%= render layout: 'layouts/guide', locals: { subject: subject } do %>
6
-
7
- <div class="row">
8
- <div class="mu-inline-block-right">
9
- <h1><%= language_icon @guide.language %></h1>
10
- </div>
11
- <div class="mu-inline-block-left guide-header">
12
- <h1 class="pull-left">
13
- <span class="pull-left">
14
- <%= subject.name %>
15
- </span>
16
- <%= render partial: 'layouts/guide_title_icons' %>
17
- </h1>
18
- </div>
19
- </div>
20
- <div class="row">
21
- <div class="col-md-12">
22
- <div class="text-box">
23
- <%= @guide.description_html %>
24
- </div>
25
- </div>
26
- </div>
27
-
28
- <% end %>