@windward/integrations 0.0.7 → 0.0.8

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.
@@ -60,6 +60,21 @@
60
60
  )
61
61
  }}
62
62
  </v-alert>
63
+ <v-alert
64
+ v-else-if="
65
+ !$PermissionService.userHasAccessTo(
66
+ 'plugin.windward.integrations.course.externalIntegration',
67
+ 'readable'
68
+ )
69
+ "
70
+ type="error"
71
+ >
72
+ {{
73
+ $t(
74
+ 'windward.integrations.components.content.blocks.external_integration.lti_consumer.no_access'
75
+ )
76
+ }}
77
+ </v-alert>
63
78
  <v-alert v-else-if="consumer === null" type="warning">
64
79
  {{
65
80
  $t(
@@ -11,12 +11,12 @@
11
11
  v-model="consumer.target"
12
12
  :label="
13
13
  $t(
14
- 'windward.integrations.components.external_integration.driver.lti1p1.target_url'
14
+ 'windward.integrations.components.external_integration.target_url'
15
15
  )
16
16
  "
17
17
  :hint="
18
18
  $t(
19
- 'windward.integrations.components.external_integration.driver.lti1p1.target_url'
19
+ 'windward.integrations.components.external_integration.target_url'
20
20
  )
21
21
  "
22
22
  ></v-text-field>
@@ -38,11 +38,7 @@
38
38
 
39
39
  <v-switch
40
40
  v-model="consumer.enabled"
41
- :label="
42
- $t(
43
- 'windward.integrations.components.external_integration.driver.lti1p1.enabled'
44
- )
45
- "
41
+ :label="$t('shared.forms.enabled')"
46
42
  />
47
43
 
48
44
  <v-text-field
@@ -11,7 +11,11 @@
11
11
  'windward.integrations.components.external_integration.driver.lti1p1.new'
12
12
  )
13
13
  }}</template>
14
- <template #trigger>{{ $t('shared.forms.new') }}</template>
14
+ <template #trigger>{{
15
+ $t(
16
+ 'windward.integrations.components.external_integration.driver.lti1p1.new'
17
+ )
18
+ }}</template>
15
19
  <template #form="{ on, attrs }"
16
20
  ><ManageConsumer v-bind="attrs" v-on="on"></ManageConsumer
17
21
  ></template>
@@ -32,9 +36,7 @@
32
36
  >{{ item.enabled ? 'mdi-check' : 'mdi-close' }}
33
37
  </v-icon>
34
38
  <span v-if="!item.enabled" class="sr-only">{{
35
- $t(
36
- 'windward.integrations.components.external_integration.driver.lti1p1.enabled'
37
- )
39
+ $t('shared.forms.enabled')
38
40
  }}</span>
39
41
  </template>
40
42
 
@@ -92,26 +94,20 @@ export default {
92
94
  headers: [
93
95
  {
94
96
  text: this.$t(
95
- 'windward.integrations.components.external_integration.driver.lti1p1.target_url'
97
+ 'windward.integrations.components.external_integration.target_url'
96
98
  ),
97
99
  value: 'target',
98
100
  },
99
101
  {
100
- text: this.$t(
101
- 'windward.integrations.components.external_integration.driver.lti1p1.name'
102
- ),
102
+ text: this.$t('shared.forms.name'),
103
103
  value: 'name',
104
104
  },
105
105
  {
106
- text: this.$t(
107
- 'windward.integrations.components.external_integration.driver.lti1p1.description'
108
- ),
106
+ text: this.$t('shared.forms.description'),
109
107
  value: 'description',
110
108
  },
111
109
  {
112
- text: this.$t(
113
- 'windward.integrations.components.external_integration.driver.lti1p1.enabled'
114
- ),
110
+ text: this.$t('shared.forms.enabled'),
115
111
  value: 'enabled',
116
112
  },
117
113
  { text: this.$t('shared.forms.created'), value: 'created_at' },
@@ -8,8 +8,7 @@
8
8
  <v-row justify="center" align="center">
9
9
  <v-col cols="12">
10
10
  <ProviderTargetPicker
11
- :target.sync="provider.target"
12
- :metadata.sync="provider.metadata"
11
+ v-model="provider"
13
12
  ></ProviderTargetPicker>
14
13
 
15
14
  <v-text-field
@@ -18,12 +17,12 @@
18
17
  disabled
19
18
  :label="
20
19
  $t(
21
- 'windward.integrations.components.external_integration.driver.lti1p1.target_url'
20
+ 'windward.integrations.components.external_integration.target_url'
22
21
  )
23
22
  "
24
23
  :hint="
25
24
  $t(
26
- 'windward.integrations.components.external_integration.driver.lti1p1.target_url'
25
+ 'windward.integrations.components.external_integration.target_url'
27
26
  )
28
27
  "
29
28
  :rules="validation.existsRules"
@@ -31,9 +30,14 @@
31
30
 
32
31
  <v-switch
33
32
  v-model="provider.enabled"
33
+ :label="$t('shared.forms.enabled')"
34
+ />
35
+
36
+ <v-switch
37
+ v-model="provider.grade_sync"
34
38
  :label="
35
39
  $t(
36
- 'windward.integrations.components.external_integration.driver.lti1p1.enabled'
40
+ 'windward.integrations.components.external_integration.send_grades'
37
41
  )
38
42
  "
39
43
  />
@@ -87,7 +91,7 @@
87
91
  <v-expansion-panel-header>
88
92
  {{
89
93
  $t(
90
- 'windward.integrations.components.external_integration.driver.lti1p1.role_map_panel'
94
+ 'windward.integrations.components.external_integration.role_map_panel'
91
95
  )
92
96
  }}
93
97
  </v-expansion-panel-header>
@@ -96,7 +100,7 @@
96
100
  <strong>
97
101
  {{
98
102
  $t(
99
- 'windward.integrations.components.external_integration.driver.lti1p1.role_map_instructions'
103
+ 'windward.integrations.components.external_integration.role_map_instructions'
100
104
  )
101
105
  }}
102
106
  </strong>
@@ -104,7 +108,7 @@
104
108
  <p>
105
109
  {{
106
110
  $t(
107
- 'windward.integrations.components.external_integration.driver.lti1p1.role_map_warning'
111
+ 'windward.integrations.components.external_integration.role_map_warning'
108
112
  )
109
113
  }}
110
114
  </p>
@@ -115,14 +119,14 @@
115
119
  <th>
116
120
  {{
117
121
  $t(
118
- 'windward.integrations.components.external_integration.driver.lti1p1.role_in_host'
122
+ 'windward.integrations.components.external_integration.role_in_host'
119
123
  )
120
124
  }}
121
125
  </th>
122
126
  <th>
123
127
  {{
124
128
  $t(
125
- 'windward.integrations.components.external_integration.driver.lti1p1.role_in_local'
129
+ 'windward.integrations.components.external_integration.role_in_local'
126
130
  )
127
131
  }}
128
132
  </th>
@@ -155,7 +159,7 @@
155
159
  item-text="name"
156
160
  :label="
157
161
  $t(
158
- 'windward.integrations.components.external_integration.driver.lti1p1.map_to_role'
162
+ 'windward.integrations.components.external_integration.map_to_role'
159
163
  )
160
164
  "
161
165
  ></v-select>
@@ -177,7 +181,7 @@
177
181
  >
178
182
  {{
179
183
  $t(
180
- 'windward.integrations.components.external_integration.driver.lti1p1.delete_role_map_item'
184
+ 'windward.integrations.components.external_integration.delete_role_map_item'
181
185
  )
182
186
  }}
183
187
  </span>
@@ -192,7 +196,7 @@
192
196
  "
193
197
  :label="
194
198
  $t(
195
- 'windward.integrations.components.external_integration.driver.lti1p1.remote_role'
199
+ 'windward.integrations.components.external_integration.remote_role'
196
200
  )
197
201
  "
198
202
  ></v-text-field>
@@ -203,7 +207,7 @@
203
207
  :items="roles"
204
208
  :label="
205
209
  $t(
206
- 'windward.integrations.components.external_integration.driver.lti1p1.map_to_role'
210
+ 'windward.integrations.components.external_integration.map_to_role'
207
211
  )
208
212
  "
209
213
  item-value="id"
@@ -227,7 +231,7 @@
227
231
  >
228
232
  {{
229
233
  $t(
230
- 'windward.integrations.components.external_integration.driver.lti1p1.add_role_map_item'
234
+ 'windward.integrations.components.external_integration.add_role_map_item'
231
235
  )
232
236
  }}
233
237
  </span>
@@ -44,14 +44,23 @@
44
44
  >{{ item.enabled ? 'mdi-check' : 'mdi-close' }}
45
45
  </v-icon>
46
46
  <span v-if="!item.enabled" class="sr-only">{{
47
+ $t('shared.forms.enabled')
48
+ }}</span>
49
+ </template>
50
+
51
+ <template #[`item.grade_sync`]="{ item }">
52
+ <v-icon :color="item.grade_sync ? 'success' : 'error'"
53
+ >{{ item.grade_sync ? 'mdi-check' : 'mdi-close' }}
54
+ </v-icon>
55
+ <span v-if="!item.grade_sync" class="sr-only">{{
47
56
  $t(
48
- 'windward.integrations.components.external_integration.driver.lti1p1.enabled'
57
+ 'windward.integrations.components.external_integration.grade_sync'
49
58
  )
50
59
  }}</span>
51
60
  </template>
52
61
 
53
62
  <template #[`item.created_at`]="{ item }">
54
- {{ $d(new Date(item.created_at), 'shorttime') }}
63
+ {{ $d(new Date(item.created_at), 'short') }}
55
64
  </template>
56
65
  <template #[`item.actions`]="{ index, item }">
57
66
  <Dialog color="primary" action-save @click:save="onSaved">
@@ -106,7 +115,7 @@ export default {
106
115
  headers: [
107
116
  {
108
117
  text: this.$t(
109
- 'windward.integrations.components.external_integration.driver.lti1p1.target'
118
+ 'windward.integrations.components.external_integration.target'
110
119
  ),
111
120
  value: 'target',
112
121
  },
@@ -124,15 +133,19 @@ export default {
124
133
  },
125
134
  {
126
135
  text: this.$t(
127
- 'windward.integrations.components.external_integration.driver.lti1p1.launch_url'
136
+ 'windward.integrations.components.external_integration.launch_url'
128
137
  ),
129
138
  value: 'url',
130
139
  },
140
+ {
141
+ text: this.$t('shared.forms.enabled'),
142
+ value: 'enabled',
143
+ },
131
144
  {
132
145
  text: this.$t(
133
- 'windward.integrations.components.external_integration.driver.lti1p1.enabled'
146
+ 'windward.integrations.components.external_integration.grade_sync'
134
147
  ),
135
- value: 'enabled',
148
+ value: 'grade_sync',
136
149
  },
137
150
  { text: this.$t('shared.forms.created'), value: 'created_at' },
138
151
  {
@@ -5,7 +5,7 @@
5
5
  <v-expansion-panel-header>
6
6
  {{
7
7
  $t(
8
- 'windward.integrations.components.external_integration.driver.lti1p1.provider_panel'
8
+ 'windward.integrations.components.external_integration.provider_panel_title'
9
9
  )
10
10
  }}
11
11
  </v-expansion-panel-header>
@@ -17,7 +17,7 @@
17
17
  <v-expansion-panel-header>
18
18
  {{
19
19
  $t(
20
- 'windward.integrations.components.external_integration.driver.lti1p1.consumer_panel'
20
+ 'windward.integrations.components.external_integration.consumer_panel_title'
21
21
  )
22
22
  }}
23
23
  </v-expansion-panel-header>
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div>
3
3
  <v-radio-group
4
- v-model="localMetadata.target_type"
4
+ v-model="provider.target_type"
5
5
  row
6
6
  @change="onTargetTypeChange"
7
7
  >
@@ -50,10 +50,9 @@
50
50
 
51
51
  <div
52
52
  v-if="
53
- localMetadata.target_type === 'course_content' ||
54
- localMetadata.target_type ===
55
- 'locked_course_content_children' ||
56
- localMetadata.target_type === 'locked_course_content'
53
+ provider.target_type === 'course_content' ||
54
+ provider.target_type === 'locked_course_content_children' ||
55
+ provider.target_type === 'locked_course_content'
57
56
  "
58
57
  class="content-tree secondary"
59
58
  >
@@ -91,15 +90,13 @@ import { mapGetters } from 'vuex'
91
90
  export default {
92
91
  name: 'ExternalIntegrationProviderTargetPicker',
93
92
  props: {
94
- target: { type: String, required: true, default: '' },
95
- metadata: { type: Object, required: true, default: () => {} },
93
+ value: { type: Object, required: true },
96
94
  },
97
95
  data() {
98
96
  return {
99
97
  selectedContent: null,
100
98
  selectedTreeviewContent: [],
101
- localTarget: '',
102
- localMetadata: {},
99
+ provider: {},
103
100
  }
104
101
  },
105
102
  computed: {
@@ -110,41 +107,28 @@ export default {
110
107
  },
111
108
  watch: {
112
109
  // Apply any changes coming up
113
- target: {
110
+ value: {
114
111
  handler(value) {
115
- this.localTarget = _.cloneDeep(value)
116
- },
117
- },
118
- metadata: {
119
- deep: true,
120
- handler(value) {
121
- this.localMetadata = _.cloneDeep(value)
112
+ this.provider = _.cloneDeep(value)
122
113
  },
123
114
  },
124
115
  },
125
116
  mounted() {
126
117
  // Init our local vars
127
- this.localTarget = _.cloneDeep(this.target)
128
- this.localMetadata = _.cloneDeep(this.metadata)
118
+ this.provider = _.cloneDeep(this.value)
129
119
 
130
120
  // Set the target_type key if it doesn't exist
131
- if (!this.localMetadata.target_type) {
132
- this.localMetadata.target_type = ''
121
+ if (!this.provider.target_type) {
122
+ this.provider.target_type = 'course'
133
123
  }
134
124
 
135
125
  // Preset the selected content
136
- if (this.localTarget) {
137
- const match = this.localTarget.match(
138
- /\/content\/(?<content_id>[a-zA-Z0-9-]{36})/i
139
- )
140
-
141
- if (!_.isEmpty(match) && _.get(match, 'groups.content_id', null)) {
142
- this.setSelectedContentById(
143
- _.get(match, 'groups.content_id', null)
144
- )
126
+ if (this.provider.target) {
127
+ if (!_.isEmpty(this.provider.course_content_id)) {
128
+ this.setSelectedContentById(this.provider.course_content_id)
145
129
  }
146
130
  }
147
- this.sync(this.localMetadata.target_type)
131
+ this.sync(this.provider.target_type)
148
132
  },
149
133
  methods: {
150
134
  setSelectedContentById(id) {
@@ -161,13 +145,14 @@ export default {
161
145
  targetType === 'locked_course_content_children')
162
146
  ) {
163
147
  url = `/course/${this.course.id}/content/${this.selectedContent.id}`
148
+ this.provider.course_content_id = this.selectedContent.id
164
149
  } else if (targetType === 'course') {
165
150
  url = `/course/${this.course.id}/`
151
+ this.provider.course_content_id = null
166
152
  }
167
- this.localTarget = url
153
+ this.provider.target = url
168
154
  // Sync up the changes to the parent component
169
- this.$emit('update:target', this.localTarget)
170
- this.$emit('update:metadata', this.localMetadata)
155
+ this.$emit('input', this.provider)
171
156
  },
172
157
  onTargetTypeChange(e) {
173
158
  // Reset the selected content if you pick by course
@@ -182,8 +167,7 @@ export default {
182
167
  let isIncluded = false
183
168
  // If we aren't including children then return hard false
184
169
  if (
185
- this.localMetadata.target_type !==
186
- 'locked_course_content_children'
170
+ this.provider.target_type !== 'locked_course_content_children'
187
171
  ) {
188
172
  return false
189
173
  }
@@ -220,7 +204,7 @@ export default {
220
204
  this.selectedContent = null
221
205
  }
222
206
 
223
- this.sync(this.localMetadata.target_type)
207
+ this.sync(this.provider.target_type)
224
208
  },
225
209
  },
226
210
  }
@@ -2,6 +2,8 @@ export default {
2
2
  launch: 'Launch',
3
3
  configure_warning:
4
4
  'This block needs to be configured. Please select a LTI tool in the settings panel.',
5
+ no_access:
6
+ 'You do not have permissions to launch this link. Please contact your system administrator.',
5
7
  missing_tool: 'The tool id {0} is missing',
6
8
  unknown_error: 'Something went wrong! Could not launch this link!',
7
9
  link_disabled: 'Link disabled',
@@ -1,6 +1,4 @@
1
1
  export default {
2
- name: 'Name',
3
- description: 'Description',
4
2
  key: 'Key',
5
3
  secret: 'Secret',
6
4
  parameter_name: 'Custom Parameter Name',
@@ -11,25 +9,6 @@ export default {
11
9
  change_secret: 'Change Secret',
12
10
  new_key: 'New Key',
13
11
  new_secret: 'New Secret',
14
- target: 'Target',
15
- target_url: 'Target Url',
16
- launch_url: 'Launch Url',
17
12
  new: 'New LTI Link',
18
13
  edit: 'Edit LTI Link',
19
- enabled: 'Enabled',
20
- provider: 'Provider',
21
- consumer: 'Consumer',
22
- provider_panel: 'Provider (Students incoming to Windward)',
23
- consumer_panel: 'Consumer (Students outgoing from Windward)',
24
- role_map_panel: 'Role map',
25
- role_in_host: 'Role in Host LMS',
26
- role_in_local: 'Role in Windward',
27
- remote_role: 'Remote Role name',
28
- map_to_role: 'Map to Windward Role',
29
- delete_role_map_item: 'Delete role map item',
30
- add_role_map_item: 'Add role map item',
31
- role_map_instructions:
32
- 'Only add roles to the below map if the host LMS uses different role names that you want to elevated permissions. Eg "Mentor" that you want to elevate to "External Instructor"',
33
- role_map_warning:
34
- 'Only add roles to the below map if the host LMS uses different role names that you want to elevated permissions. Eg "Mentor" that you want to elevate to "External Instructor"',
35
14
  }
@@ -3,4 +3,28 @@ import providerTarget from './provider_target'
3
3
  export default {
4
4
  driver: { lti1p1 },
5
5
  provider_target: providerTarget,
6
+
7
+ provider_panel_title: 'Provider (Students incoming to Windward)',
8
+ consumer_panel_title: 'Consumer (Students outgoing from Windward)',
9
+
10
+ target: 'Target',
11
+ target_url: 'Target Url',
12
+ launch_url: 'Launch Url',
13
+
14
+ send_grades: 'Send grades to host LMS',
15
+ grade_sync: 'Grade Sync',
16
+ provider: 'Provider',
17
+ consumer: 'Consumer',
18
+
19
+ role_map_panel: 'Role map',
20
+ role_in_host: 'Role in Host LMS',
21
+ role_in_local: 'Role in Windward',
22
+ remote_role: 'Remote Role name',
23
+ map_to_role: 'Map to Windward Role',
24
+ delete_role_map_item: 'Delete role map item',
25
+ add_role_map_item: 'Add role map item',
26
+ role_map_instructions:
27
+ 'Only add roles to the below map if the host LMS uses different role names that you want to elevated permissions. Eg "Mentor" that you want to elevate to "External Instructor"',
28
+ role_map_warning:
29
+ 'Only add roles to the below map if the host LMS uses different role names that you want to elevated permissions. Eg "Mentor" that you want to elevate to "External Instructor"',
6
30
  }
@@ -4,7 +4,7 @@ export default {
4
4
  missing_title: 'The below fields are missing:',
5
5
  error_title: 'The below errors occurred:',
6
6
  error: {
7
- unknown: 'An unknown error occurred',
7
+ unknown: 'An unknown communication error occurred',
8
8
  organization: 'Invalid organization',
9
9
  tool: 'Invalid tool id',
10
10
  tool_organization: 'This tool does not belong to this organization',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@windward/integrations",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "description": "Windward UI Plugin Integrations for 3rd Party Systems",
5
5
  "main": "plugin.js",
6
6
  "scripts": {
@@ -14,7 +14,7 @@ describe('ProviderTargetPicker', () => {
14
14
  vuetify: new Vuetify(),
15
15
  mocks: defaultMocks,
16
16
  propsData: {
17
- metadata: {},
17
+ value: {},
18
18
  },
19
19
  })
20
20
  expect(wrapper.vm).toBeTruthy()