mumuki-laboratory 9.0.3 → 9.0.4

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: 07b2e50b039758471cfb6e6ce92b5c72de56a3d6edbcc1ddbcdfd12422b51f34
4
- data.tar.gz: 69b54d57063273a7f3dee32e42126eff821332dbe8acec8f8337f91f1b929b90
3
+ metadata.gz: c79de66ab1c8248e5715cd1e54ac8e4b1e426fb26bc0a69b35539ba19eb954da
4
+ data.tar.gz: 39cbfb28e86a6ae64f5a1164731d472ca65be3bec82d9f1ed6f159273512b078
5
5
  SHA512:
6
- metadata.gz: 4acb2a84b7b526ceebc4be7daf104e9a9d614c5659ab853da9614b16b1d3caffdc42c2cfce3fcdb22ee69e364d1339405291644dcf8b8f213e3756daf29d11de
7
- data.tar.gz: 83e3a2120935b9b87c004d11fbd599ffe3a92093ab2decc2f787a905a4d0c50edb964390275f06452883213d42c03c35832281ad5963340d8f41f5b691b1e23c
6
+ metadata.gz: ed9430f79c8f92f7b02264aa84f7dc757a7ff05915fcdd17e93a5fe4b7aaac5cfd0d87fadec66ce0d4ac204cd270f08fafc1550a986bd367314f5e7130c360d4
7
+ data.tar.gz: 8669d687ca7f70178cab77c25f698eef49a58eb74957ed274c73fe6fdf0c6f9139c5963f5c57b08a92ed874a97c6b648030c1be87cd34b107cb831db156e0113
@@ -0,0 +1,32 @@
1
+ mumuki.organization = {
2
+
3
+ /**
4
+ * The current organization's id
5
+ *
6
+ * @type {number?}
7
+ * */
8
+ _id: null,
9
+
10
+ /**
11
+ * The current organization's id
12
+ *
13
+ * @type {number?}
14
+ * */
15
+ get id() {
16
+ return this._id;
17
+ },
18
+
19
+ /**
20
+ * Set global current organization information
21
+ */
22
+ load() {
23
+ const $muOrganizationId = $('#mu-organization-id');
24
+ if ($muOrganizationId.length) {
25
+ this._id = $muOrganizationId.val();
26
+ } else {
27
+ this._id = null;
28
+ }
29
+ }
30
+ };
31
+
32
+ mumuki.load(() => mumuki.organization.load());
@@ -94,7 +94,7 @@ mumuki.SubmissionsStore = (() => {
94
94
  }
95
95
 
96
96
  _keyFor(exerciseId) {
97
- return `/exercise/${exerciseId}/submission`;
97
+ return `/organization/${mumuki.organization.id}/user/${mumuki.user.id}/exercise/${exerciseId}/submission`;
98
98
  }
99
99
  }();
100
100
 
@@ -1,3 +1,34 @@
1
+ mumuki.user = {
2
+
3
+ /**
4
+ * The current user's id
5
+ *
6
+ * @type {number?}
7
+ * */
8
+ _id: null,
9
+
10
+ /**
11
+ * The current user's id
12
+ *
13
+ * @type {number?}
14
+ * */
15
+ get id() {
16
+ return this._id;
17
+ },
18
+
19
+ /**
20
+ * Set global current user information
21
+ */
22
+ load() {
23
+ const $muUserId = $('#mu-user-id');
24
+ if ($muUserId.length) {
25
+ this._id = $muUserId.val();
26
+ } else {
27
+ this._id = null;
28
+ }
29
+ }
30
+ };
31
+
1
32
  mumuki.load(() => {
2
33
  const $userMenuHeader = $('.mu-user-menu-header');
3
34
  let onUserProfile = document.querySelector('.mu-profile-info') !== null;
@@ -17,4 +48,6 @@ mumuki.load(() => {
17
48
  $userMenuHeader.click();
18
49
  }
19
50
  });
51
+
52
+ mumuki.user.load()
20
53
  });
@@ -18,6 +18,10 @@
18
18
  <%= login_form.header_html %>
19
19
  </head>
20
20
  <body>
21
+
22
+ <%= hidden_field_tag "mu-user-id", current_user&.id %>
23
+ <%= hidden_field_tag "mu-organization-id", Organization.current.id %>
24
+
21
25
  <% if should_choose_organization? %>
22
26
  <%= render partial: 'layouts/organization_chooser' %>
23
27
  <% end %>
@@ -1,5 +1,5 @@
1
1
  module Mumuki
2
2
  module Laboratory
3
- VERSION = '9.0.3'
3
+ VERSION = '9.0.4'
4
4
  end
5
5
  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.0.3
4
+ version: 9.0.4
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-03-10 00:00:00.000000000 Z
11
+ date: 2021-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -427,6 +427,7 @@ files:
427
427
  - app/assets/javascripts/mumuki_laboratory/application/multiple-files.js
428
428
  - app/assets/javascripts/mumuki_laboratory/application/multiple-scenarios.js
429
429
  - app/assets/javascripts/mumuki_laboratory/application/number-counter.js
430
+ - app/assets/javascripts/mumuki_laboratory/application/organization.js
430
431
  - app/assets/javascripts/mumuki_laboratory/application/pin.js
431
432
  - app/assets/javascripts/mumuki_laboratory/application/popover.js
432
433
  - app/assets/javascripts/mumuki_laboratory/application/primary.js