mumuki-laboratory 9.2.0 → 9.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/mumuki_laboratory/application/profile.js +7 -15
- data/app/controllers/concerns/organizations_controller_template.rb +1 -0
- data/app/helpers/profile_helper.rb +1 -1
- data/lib/mumuki/laboratory/locales/en.yml +1 -0
- data/lib/mumuki/laboratory/locales/es-CL.yml +1 -0
- data/lib/mumuki/laboratory/locales/es.yml +1 -0
- data/lib/mumuki/laboratory/locales/pt.yml +1 -0
- data/lib/mumuki/laboratory/version.rb +1 -1
- data/spec/controllers/organizations_api_controller_spec.rb +3 -1
- data/spec/features/profile_flow_spec.rb +2 -9
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7fcf8057854fbb65bd0ddb801770c0d7a9de320735217bb50ac239d3c303651d
|
4
|
+
data.tar.gz: 6466a0bfca548fce3eb105daa98b9f9790616ad0009928efd7c46719fc9526d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fe7ff6eb305b615a33cea3d90be11d06b58acbeb7e6e6add7049bf632055d676e6a9cc475c88649a8341ca8038fe7d8b6ce7b8616ceef1a6d3094bdffba75422
|
7
|
+
data.tar.gz: d7fba0d3d8a4e3223efc8987649a482794be90958d5e6b618b4bce519e72b72b7e42cddaecf8f4f151ca864a8caa9a4b18369abe2c281c5c5d9e9cba99ca4f6a
|
@@ -9,11 +9,10 @@ mumuki.load(function() {
|
|
9
9
|
let avatarId = "";
|
10
10
|
let avatarType = "";
|
11
11
|
|
12
|
-
|
13
|
-
let originalProfilePicture = $userAvatar.attr('src');
|
12
|
+
toggleEditButtonIfRequiredFieldsNotCompleted();
|
14
13
|
|
15
14
|
$userForm.on('change keyup', function() {
|
16
|
-
|
15
|
+
toggleEditButtonIfRequiredFieldsNotCompleted();
|
17
16
|
});
|
18
17
|
|
19
18
|
$avatarItem.on('keypress click', function(e) {
|
@@ -25,26 +24,19 @@ mumuki.load(function() {
|
|
25
24
|
const clickedAvatarType = $(this).attr('type');
|
26
25
|
avatarId = clickedAvatarId || "";
|
27
26
|
avatarType = clickedAvatarType || "";
|
28
|
-
|
29
|
-
toggleEditButtonIfThereAreChanges();
|
30
27
|
});
|
31
28
|
});
|
32
29
|
|
33
|
-
function
|
34
|
-
|
35
|
-
|
36
|
-
$editButton.prop('disabled', !shouldEnable);
|
30
|
+
function toggleEditButtonIfRequiredFieldsNotCompleted() {
|
31
|
+
$editButton.prop('disabled', !requiredFieldsAreCompleted());
|
37
32
|
}
|
38
33
|
|
39
|
-
|
40
|
-
$userForm.find('select, textarea, input').toArray().every(elem => {
|
34
|
+
function requiredFieldsAreCompleted() {
|
35
|
+
return $userForm.find('select, textarea, input').toArray().every(elem => {
|
41
36
|
const $elem = $(elem);
|
42
37
|
return !($elem.prop('required')) || !!$elem.val();
|
43
38
|
});
|
44
|
-
|
45
|
-
const dataChanged = () => $userForm.serialize() !== originalData;
|
46
|
-
|
47
|
-
const avatarChanged = () => $userAvatar.attr('src') !== originalProfilePicture;
|
39
|
+
}
|
48
40
|
|
49
41
|
$('#mu-user-image').on('keypress click', function(e){
|
50
42
|
onClickOrSpacebarOrEnter($(this), e, function() {
|
@@ -26,6 +26,7 @@ module OrganizationsControllerTemplate
|
|
26
26
|
.require(:organization)
|
27
27
|
.permit(:book,
|
28
28
|
:name,
|
29
|
+
:faqs,
|
29
30
|
*Mumuki::Domain::Organization::Profile.attributes,
|
30
31
|
*Mumuki::Domain::Organization::Theme.attributes,
|
31
32
|
*(Mumuki::Domain::Organization::Settings.attributes - [:login_methods]),
|
@@ -118,6 +118,7 @@ en:
|
|
118
118
|
exam_registration_explanation_html: You have until <strong>%{date}</strong> to register. After that date, your request will be processed and you will receive a confirmation. <br> Don't forget to check the notifications!
|
119
119
|
exam_registration_open: Registrations open for %{description}!
|
120
120
|
exam_registration_to: Registration to %{description}
|
121
|
+
exams_will_be_here: Your exams in the organization will appear here.
|
121
122
|
exams: Exams
|
122
123
|
exercise: Exercise
|
123
124
|
exercises: Exercises
|
@@ -118,6 +118,7 @@ es-CL:
|
|
118
118
|
exam_registration_explanation_html: Tienes tiempo hasta el <strong>%{date}</strong> para inscribirte. Pasada esa fecha, tu solicitud será evaluada y recibirás una confirmación. <br> ¡No olvides revisar las notificaciones!
|
119
119
|
exam_registration_open: ¡Ya puedes inscribirte a %{description}!
|
120
120
|
exam_registration_to: Inscripción a %{description}
|
121
|
+
exams_will_be_here: Tus exámenes en esta organización aparecerán acá
|
121
122
|
exams: Exámenes
|
122
123
|
exercise: Ejercicio
|
123
124
|
exercise_count: ejercicios
|
@@ -126,6 +126,7 @@ es:
|
|
126
126
|
exam_registration_explanation_html: Tenés tiempo hasta el <strong>%{date}</strong> para inscribirte. Pasada esa fecha, tu solicitud será evaluada y recibirás una confirmación. <br> ¡No te olvides de revisar las notificaciones!
|
127
127
|
exam_registration_open: ¡Ya podés inscribirte a %{description}!
|
128
128
|
exam_registration_to: Inscripción a %{description}
|
129
|
+
exams_will_be_here: Tus exámenes en esta organización aparecerán acá
|
129
130
|
exams: Exámenes
|
130
131
|
exercise: Ejercicio
|
131
132
|
exercise_count: ejercicios
|
@@ -121,6 +121,7 @@ pt:
|
|
121
121
|
exam_registration_explanation_html: Você tem tempo até <strong>%{date}</strong> para se inscrever. Após essa data, sua inscrição será avaliada e você receberá uma confirmação. <br> Não se esqueça de verificar as notificações!
|
122
122
|
exam_registration_open: "¡Inscrições abertas para %{description}!"
|
123
123
|
exam_registration_to: Inscrição a %{description}
|
124
|
+
exams_will_be_here: Seus Examesca nesta organização aparecerão aqui
|
124
125
|
exams: Examesca
|
125
126
|
exercise: Exercício
|
126
127
|
exercise_count: exercícios
|
@@ -143,7 +143,8 @@ describe Api::OrganizationsController, type: :controller, organization_workspace
|
|
143
143
|
logo_url: 'http://a-logo-url.com',
|
144
144
|
theme_stylesheet: '.theme { color: red }',
|
145
145
|
extension_javascript: 'window.a = function() { }',
|
146
|
-
terms_of_service: 'A TOS'
|
146
|
+
terms_of_service: 'A TOS',
|
147
|
+
faqs: 'some faqs'}
|
147
148
|
end
|
148
149
|
|
149
150
|
it { expect(organization.public?).to eq false }
|
@@ -153,6 +154,7 @@ describe Api::OrganizationsController, type: :controller, organization_workspace
|
|
153
154
|
it { expect(organization.theme_stylesheet).to eq ".theme { color: red }" }
|
154
155
|
it { expect(organization.extension_javascript).to eq "window.a = function() { }" }
|
155
156
|
it { expect(organization.terms_of_service).to eq 'A TOS' }
|
157
|
+
it { expect(organization.faqs).to eq 'some faqs' }
|
156
158
|
end
|
157
159
|
|
158
160
|
context 'with missing values' do
|
@@ -73,19 +73,12 @@ feature 'Profile Flow', organization_workspace: :test do
|
|
73
73
|
context 'user with uncompleted profile after saving' do
|
74
74
|
before { user.update! last_name: 'last_name', birthdate: Time.now - 20.years, gender: 'female' }
|
75
75
|
|
76
|
-
let(:button_options) do
|
77
|
-
# Match :first is used because there are two buttons: mobile and desktop.
|
78
|
-
{ class: 'mu-edit-profile-btn', match: :first }.tap do |options|
|
79
|
-
options.merge!(disabled: true) unless run_with_selenium?
|
80
|
-
end
|
81
|
-
end
|
82
|
-
|
83
76
|
context 'when visiting an exercise' do
|
84
77
|
scenario 'is redirected to previous path' do
|
85
78
|
visit "/exercises/#{exercise.transparent_id}"
|
86
79
|
fill_in('user_first_name', with: 'first_name')
|
87
80
|
|
88
|
-
click_on(
|
81
|
+
click_on(class: 'mu-edit-profile-btn', match: :first)
|
89
82
|
expect(page).to have_text(exercise.description)
|
90
83
|
end
|
91
84
|
end
|
@@ -95,7 +88,7 @@ feature 'Profile Flow', organization_workspace: :test do
|
|
95
88
|
visit "/user/edit"
|
96
89
|
fill_in('user_first_name', with: 'first_name')
|
97
90
|
|
98
|
-
click_on(
|
91
|
+
click_on(class: 'mu-edit-profile-btn', match: :first)
|
99
92
|
expect(page).to have_text('Your data was updated successfully')
|
100
93
|
expect(page).to have_text('My profile')
|
101
94
|
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: 9.
|
4
|
+
version: 9.3.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-05-
|
11
|
+
date: 2021-05-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|