mumukit-platform 3.2.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/mumukit/platform.rb +2 -2
- data/lib/mumukit/platform/course/helpers.rb +5 -5
- data/lib/mumukit/platform/organization.rb +0 -4
- data/lib/mumukit/platform/organization/helpers.rb +5 -5
- data/lib/mumukit/platform/user/helpers.rb +11 -19
- data/lib/mumukit/platform/version.rb +1 -1
- data/lib/mumukit/platform/with_applications.rb +4 -5
- data/mumukit-platform.gemspec +1 -1
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 37d749c01796bf6f90b8f862490cfa60ce0ec6f599688c52d7cd67880de8343e
|
4
|
+
data.tar.gz: b49509bfff79f36916fb9c7ff41742ca8d2b8153b0b4c3ebec6810236f0fc2d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 481bd7a6f8b30aff029a1d812e78d53f4eedd4bbd62320c2e28e134bcf41685b460e4a6692c743229715093ed2ab89a0e038dab97af1cb5cc1c0de529d03413a
|
7
|
+
data.tar.gz: 4d57b6ba0ae70b58bf6ddd217d87ea84a27d5eb663f90e514ea25dc30689d11a5226525ff7afd97662080c65f244abaeece053e07f72775eec4d6fbaa1ff7fc2
|
data/lib/mumukit/platform.rb
CHANGED
@@ -17,9 +17,9 @@ module Mumukit::Platform
|
|
17
17
|
|
18
18
|
config.laboratory_url = ENV['MUMUKI_LABORATORY_URL'] || "http://#{domain}"
|
19
19
|
config.thesaurus_url = ENV['MUMUKI_THESAURUS_URL'] || "http://thesaurus.#{domain}"
|
20
|
-
config.
|
20
|
+
config.bibliotheca_ui_url = ENV['MUMUKI_BIBLIOTHECA_UI_URL'] || "http://bibliotheca.#{domain}"
|
21
21
|
config.bibliotheca_api_url = ENV['MUMUKI_BIBLIOTHECA_API_URL'] || "http://bibliotheca-api.#{domain}"
|
22
|
-
config.
|
22
|
+
config.classroom_ui_url = ENV['MUMUKI_CLASSROOM_UI_URL'] || "http://classroom.#{domain}"
|
23
23
|
config.classroom_api_url = ENV['MUMUKI_CLASSROOM_API_URL'] || "http://classroom-api.#{domain}"
|
24
24
|
config.organization_mapping = Mumukit::Platform::OrganizationMapping.from_env
|
25
25
|
end
|
@@ -20,10 +20,10 @@ module Mumukit::Platform::Course::Helpers
|
|
20
20
|
slug
|
21
21
|
end
|
22
22
|
|
23
|
-
##
|
23
|
+
## Resource Hash
|
24
24
|
|
25
|
-
def self.
|
26
|
-
|
25
|
+
def self.slice_resource_h(resource_h)
|
26
|
+
resource_h.slice(:slug, :shifts, :code, :days, :period, :description)
|
27
27
|
end
|
28
28
|
|
29
29
|
def to_resource_h
|
@@ -34,10 +34,10 @@ module Mumukit::Platform::Course::Helpers
|
|
34
34
|
days: days,
|
35
35
|
period: period,
|
36
36
|
description: description
|
37
|
-
}.except(*
|
37
|
+
}.except(*protected_resource_fields).compact
|
38
38
|
end
|
39
39
|
|
40
|
-
def
|
40
|
+
def protected_resource_fields
|
41
41
|
[]
|
42
42
|
end
|
43
43
|
end
|
@@ -12,10 +12,6 @@ module Mumukit::Platform::Organization
|
|
12
12
|
Thread.current[:organization] || raise('organization not selected')
|
13
13
|
end
|
14
14
|
|
15
|
-
def self.current?
|
16
|
-
!!Thread.current[:organization]
|
17
|
-
end
|
18
|
-
|
19
15
|
def self.current_locale
|
20
16
|
Thread.current[:organization]&.locale || 'en'
|
21
17
|
end
|
@@ -76,10 +76,10 @@ module Mumukit::Platform::Organization::Helpers
|
|
76
76
|
/([-a-z0-9_]+(\.[-a-z0-9_]+)*)?/
|
77
77
|
end
|
78
78
|
|
79
|
-
##
|
79
|
+
## Resource Hash
|
80
80
|
|
81
|
-
def self.
|
82
|
-
|
81
|
+
def self.slice_resource_h(resource_h)
|
82
|
+
resource_h.slice(:name, :book, :profile, :settings, :theme)
|
83
83
|
end
|
84
84
|
|
85
85
|
def to_resource_h
|
@@ -89,10 +89,10 @@ module Mumukit::Platform::Organization::Helpers
|
|
89
89
|
profile: profile,
|
90
90
|
settings: settings,
|
91
91
|
theme: theme
|
92
|
-
}.except(*
|
92
|
+
}.except(*protected_resource_fields).compact
|
93
93
|
end
|
94
94
|
|
95
|
-
def
|
95
|
+
def protected_resource_fields
|
96
96
|
[]
|
97
97
|
end
|
98
98
|
|
@@ -2,8 +2,6 @@ module Mumukit::Platform::User::Helpers
|
|
2
2
|
include Mumukit::Auth::Roles
|
3
3
|
include Mumukit::Platform::Notifiable
|
4
4
|
|
5
|
-
extend Gem::Deprecate
|
6
|
-
|
7
5
|
## Implementors must declare the following methods:
|
8
6
|
#
|
9
7
|
# * permissions
|
@@ -69,28 +67,22 @@ module Mumukit::Platform::User::Helpers
|
|
69
67
|
|
70
68
|
## Accesible organizations
|
71
69
|
|
72
|
-
def
|
73
|
-
permissions.
|
70
|
+
def accessible_organizations
|
71
|
+
permissions.accessible_organizations.map do |org|
|
74
72
|
Mumukit::Platform::Organization.find_by_name!(org) rescue nil
|
75
73
|
end.compact
|
76
74
|
end
|
77
75
|
|
78
|
-
def
|
79
|
-
|
80
|
-
end
|
81
|
-
|
82
|
-
[[:accessible_organizations, :student_granted_organizations],
|
83
|
-
[:has_accessible_organizations?, :has_student_granted_organizations?]].each do |it, replacement|
|
84
|
-
alias_method it, replacement
|
85
|
-
deprecate it, replacement, 2019, 6
|
76
|
+
def has_accessible_organizations?
|
77
|
+
accessible_organizations.present?
|
86
78
|
end
|
87
79
|
|
88
80
|
def main_organization
|
89
|
-
|
81
|
+
accessible_organizations.first
|
90
82
|
end
|
91
83
|
|
92
84
|
def has_main_organization?
|
93
|
-
|
85
|
+
accessible_organizations.length == 1
|
94
86
|
end
|
95
87
|
|
96
88
|
def has_immersive_main_organization?
|
@@ -103,10 +95,10 @@ module Mumukit::Platform::User::Helpers
|
|
103
95
|
uid
|
104
96
|
end
|
105
97
|
|
106
|
-
##
|
98
|
+
## Resource Hash
|
107
99
|
|
108
|
-
def self.
|
109
|
-
|
100
|
+
def self.slice_resource_h(resource_h)
|
101
|
+
resource_h.slice(:uid, :social_id, :image_url, :email, :first_name, :last_name, :permissions)
|
110
102
|
end
|
111
103
|
|
112
104
|
def to_resource_h
|
@@ -118,10 +110,10 @@ module Mumukit::Platform::User::Helpers
|
|
118
110
|
first_name: first_name,
|
119
111
|
last_name: last_name,
|
120
112
|
permissions: permissions
|
121
|
-
}.except(*
|
113
|
+
}.except(*protected_resource_fields).compact
|
122
114
|
end
|
123
115
|
|
124
|
-
def
|
116
|
+
def protected_resource_fields
|
125
117
|
[]
|
126
118
|
end
|
127
119
|
end
|
@@ -1,21 +1,20 @@
|
|
1
1
|
module Mumukit::Platform::WithApplications
|
2
2
|
delegate :application, to: :config
|
3
|
-
delegate :url_for, :organic_url_for, to: :application
|
4
3
|
|
5
4
|
def laboratory
|
6
5
|
Mumukit::Platform::Application::Organic.new config.laboratory_url, organization_mapping
|
7
6
|
end
|
8
7
|
|
9
|
-
def
|
10
|
-
Mumukit::Platform::Application::Organic.new config.
|
8
|
+
def classroom_ui
|
9
|
+
Mumukit::Platform::Application::Organic.new config.classroom_ui_url, organization_mapping
|
11
10
|
end
|
12
11
|
|
13
12
|
def classroom_api
|
14
13
|
Mumukit::Platform::Application::Organic.new config.classroom_api_url, organization_mapping
|
15
14
|
end
|
16
15
|
|
17
|
-
def
|
18
|
-
Mumukit::Platform::Application::Basic.new config.
|
16
|
+
def bibliotheca_ui
|
17
|
+
Mumukit::Platform::Application::Basic.new config.bibliotheca_ui_url
|
19
18
|
end
|
20
19
|
|
21
20
|
def bibliotheca_api
|
data/mumukit-platform.gemspec
CHANGED
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
|
|
23
23
|
|
24
24
|
spec.add_dependency 'mumukit-nuntius', '~> 6.0'
|
25
25
|
spec.add_dependency 'mumukit-core', '~> 1.2'
|
26
|
-
spec.add_dependency 'mumukit-auth', '~> 7.
|
26
|
+
spec.add_dependency 'mumukit-auth', '~> 7.0'
|
27
27
|
spec.add_dependency 'mumukit-bridge', '~> 3.5'
|
28
28
|
spec.add_dependency 'activemodel', '>= 4.0'
|
29
29
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mumukit-platform
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Franco Leonardo Bulgarelli
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-11-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mumukit-nuntius
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '7.
|
47
|
+
version: '7.0'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '7.
|
54
|
+
version: '7.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: mumukit-bridge
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -184,7 +184,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
184
184
|
- !ruby/object:Gem::Version
|
185
185
|
version: '0'
|
186
186
|
requirements: []
|
187
|
-
|
187
|
+
rubyforge_project:
|
188
|
+
rubygems_version: 2.7.8
|
188
189
|
signing_key:
|
189
190
|
specification_version: 4
|
190
191
|
summary: Shared Mumuki Platform Components
|