@windward/integrations 0.0.8 → 0.0.10

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.
Files changed (49) hide show
  1. package/components/ExternalIntegration/Driver/Lti1p1/ManageProvider.vue +9 -6
  2. package/components/ExternalIntegration/Driver/Lti1p1/ManageProviders.vue +6 -5
  3. package/components/ExternalIntegration/Driver/Lti1p3/ManageProvider.vue +445 -0
  4. package/components/ExternalIntegration/Driver/Lti1p3/ManageProviders.vue +259 -0
  5. package/components/ExternalIntegration/Driver/ManageLti1p3.vue +45 -0
  6. package/components/FileImport/Dropbox.vue +9 -0
  7. package/components/FileImport/FileImportMenu.vue +111 -0
  8. package/components/FileImport/GoogleDrive.vue +9 -0
  9. package/components/FileImport/Resourcespace.vue +202 -0
  10. package/components/Integration/Driver/ManageAtutor.vue +35 -12
  11. package/components/Integration/Driver/ManageResourcespace.vue +137 -0
  12. package/components/Integration/JobLog.vue +281 -0
  13. package/components/Integration/JobTable.vue +15 -1
  14. package/components/SecretField.vue +1 -0
  15. package/config/integration.config.js +2 -0
  16. package/helpers/Driver/Resourcespace.ts +15 -0
  17. package/i18n/en-US/components/external_integration/driver/lti1p3.ts +13 -0
  18. package/i18n/en-US/components/external_integration/index.ts +2 -1
  19. package/i18n/en-US/components/file_import/index.ts +5 -0
  20. package/i18n/en-US/components/file_import/resourcespace.ts +4 -0
  21. package/i18n/en-US/components/index.ts +2 -0
  22. package/i18n/en-US/components/integration/driver.ts +8 -0
  23. package/i18n/en-US/components/integration/index.ts +2 -0
  24. package/i18n/en-US/components/integration/job.ts +1 -0
  25. package/i18n/en-US/components/integration/job_log.ts +8 -0
  26. package/i18n/en-US/shared/error.ts +1 -0
  27. package/i18n/en-US/shared/file.ts +5 -0
  28. package/i18n/en-US/shared/index.ts +2 -0
  29. package/models/ExternalIntegration/{Lti1p1Provider.ts → LtiProvider.ts} +2 -2
  30. package/models/OrganizationIntegration.ts +5 -0
  31. package/models/RemoteFile.ts +12 -0
  32. package/package.json +1 -1
  33. package/pages/admin/importCourse.vue +8 -2
  34. package/pages/admin/vendors.vue +3 -2
  35. package/pages/course/externalIntegration/index.vue +4 -3
  36. package/plugin.js +84 -1
  37. package/test/Components/ExternalIntegration/Lti1p3/ManageProvider.spec.js +19 -0
  38. package/test/Components/ExternalIntegration/Lti1p3/ManageProviders.spec.js +19 -0
  39. package/test/Components/ExternalIntegration/ManageLti1p3.spec.js +19 -0
  40. package/test/Components/FileImport/Dropbox.spec.js +24 -0
  41. package/test/Components/FileImport/GoogleDrive.spec.js +24 -0
  42. package/test/Components/FileImport/Resourcespace.spec.js +24 -0
  43. package/test/Components/Integration/Driver/ManageAtutor.spec.js +22 -0
  44. package/test/Components/Integration/Driver/ManageResourcespace.spec.js +22 -0
  45. package/test/Components/Integration/JobLog.spec.js +22 -0
  46. package/test/Components/Integration/JobTable.spec.js +23 -0
  47. package/test/__mocks__/componentsMock.js +24 -0
  48. package/test/__mocks__/modelMock.js +1 -0
  49. package/test/mocks.js +12 -0
@@ -8,6 +8,7 @@ export default {
8
8
  progress: 'Progress',
9
9
  created: 'Created',
10
10
  details: 'Details',
11
+ started: 'Date started',
11
12
  job_details: {
12
13
  none: 'No details available',
13
14
  import_course: "Importing Course Id {0} '{1}'",
@@ -0,0 +1,8 @@
1
+ export default {
2
+ view_log: 'View Log',
3
+ no_results: 'No results found',
4
+ remote_course_id: 'Remote Course Id',
5
+ remote_content_id: 'Remtote Content Id',
6
+ remote_url: 'Remote Url',
7
+ remote_code: 'Remote Code',
8
+ }
@@ -5,4 +5,5 @@ export default {
5
5
  load_remote_content_failed: 'Could not load remote content',
6
6
  connect_success: 'Successfully connected',
7
7
  connect_fail: 'Failed to connect',
8
+ unknown: 'An unknown error occurred when trying to connect',
8
9
  }
@@ -0,0 +1,5 @@
1
+ export default {
2
+ import_resourcespace: 'Import from Resourcespace',
3
+ import_google_drive: 'Import from Google Drive',
4
+ import_dropbox: 'Import from Dropbox',
5
+ }
@@ -2,6 +2,7 @@ import contentBlocks from './content_blocks'
2
2
  import settings from './settings'
3
3
  import menu from './menu'
4
4
  import permission from './permission'
5
+ import file from './file'
5
6
  import error from './error'
6
7
 
7
8
  export default {
@@ -9,5 +10,6 @@ export default {
9
10
  settings,
10
11
  menu,
11
12
  permission,
13
+ file,
12
14
  error,
13
15
  }
@@ -1,13 +1,13 @@
1
1
  // @ts-ignore
2
2
  import Model from '~/models/Model'
3
3
 
4
- export default class Lti1p1Provider extends Model {
4
+ export default class LtiProvider extends Model {
5
5
  get required(): string[] {
6
6
  return []
7
7
  }
8
8
 
9
9
  // Set the resource route of the model
10
10
  resource() {
11
- return 'external-integrations/lti/1.1/providers'
11
+ return 'external-integrations/lti/providers'
12
12
  }
13
13
  }
@@ -1,5 +1,6 @@
1
1
  import Model from '~/models/Model'
2
2
  import RemoteOrganization from './RemoteOrganization'
3
+ import RemoteFile from './RemoteFile'
3
4
 
4
5
  export default class OrganizationIntegration extends Model {
5
6
  get required(): string[] {
@@ -14,4 +15,8 @@ export default class OrganizationIntegration extends Model {
14
15
  remoteOrganizations() {
15
16
  return this.hasMany(RemoteOrganization)
16
17
  }
18
+
19
+ remoteFiles() {
20
+ return this.hasMany(RemoteFile)
21
+ }
17
22
  }
@@ -0,0 +1,12 @@
1
+ import Model from '~/models/Model'
2
+
3
+ export default class RemoteFile extends Model {
4
+ get required(): string[] {
5
+ return []
6
+ }
7
+
8
+ // Set the resource route of the model
9
+ resource() {
10
+ return 'remote-files'
11
+ }
12
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@windward/integrations",
3
- "version": "0.0.8",
3
+ "version": "0.0.10",
4
4
  "description": "Windward UI Plugin Integrations for 3rd Party Systems",
5
5
  "main": "plugin.js",
6
6
  "scripts": {
@@ -164,13 +164,13 @@
164
164
  <script>
165
165
  import _ from 'lodash'
166
166
  import { mapGetters } from 'vuex'
167
- import Course from '~/models/Course'
168
167
  import Organization from '../../models/Organization'
169
168
  import OrganizationIntegration from '../../models/OrganizationIntegration'
170
169
  import RemoteOrganization from '../../models/RemoteOrganization'
171
170
  import RemoteCourse from '../../models/RemoteCourse'
172
171
  import RemoteContent from '../../models/RemoteContent'
173
172
  import IntegrationJobTable from '../../components/Integration/JobTable.vue'
173
+ import Course from '~/models/Course'
174
174
 
175
175
  export default {
176
176
  name: 'PluginIntegrationsAdminImportCoursePage',
@@ -210,13 +210,19 @@ export default {
210
210
  },
211
211
  async fetch() {
212
212
  this.loading.integration = true
213
- this.organizationIntegrations = await new Organization({
213
+ const organizationIntegrations = await new Organization({
214
214
  id: this.organization.id,
215
215
  })
216
216
  .integrations()
217
217
  .with(['vendor'])
218
218
  .where('enabled', true)
219
219
  .get()
220
+
221
+ // Filter out any vendors that don't support course imports
222
+ this.organizationIntegrations = organizationIntegrations.filter((o) => {
223
+ return _.get(o, 'vendor.driver.course_import', false)
224
+ })
225
+
220
226
  this.loading.integration = false
221
227
  },
222
228
  computed: {
@@ -1,5 +1,6 @@
1
1
  <template>
2
2
  <div>
3
+ <Breadcrumbs></Breadcrumbs>
3
4
  <v-row justify="center" align="center">
4
5
  <v-col cols="12">
5
6
  <div class="d-flex mb-5">
@@ -150,14 +151,14 @@
150
151
  <script>
151
152
  import _ from 'lodash'
152
153
  import { mapGetters } from 'vuex'
153
-
154
+ import Breadcrumbs from '~/components/Breadcrumbs.vue'
154
155
  import Dialog from '~/components/Dialog.vue'
155
156
  import Organization from '../../models/Organization'
156
157
  import IntegrationJobTable from '../../components/Integration/JobTable.vue'
157
158
 
158
159
  export default {
159
160
  name: 'PluginIntegrationsAdminVendorsPage',
160
- components: { Dialog, IntegrationJobTable },
161
+ components: { Dialog, IntegrationJobTable, Breadcrumbs },
161
162
  layout: 'authenticated',
162
163
  meta: {
163
164
  privilege: {
@@ -38,7 +38,8 @@
38
38
  <v-tabs-items v-model="tab">
39
39
  <v-tab-item> <ManageLti1p1></ManageLti1p1> </v-tab-item>
40
40
  <v-tab-item>
41
- <p class="ma-5">LTI 1.3 Not yet implemented</p>
41
+ <ManageLti1p3 />
42
+ <!-- <p class="ma-5">LTI 1.3 Not yet implemented</p>-->
42
43
  </v-tab-item>
43
44
  <v-tab-item>
44
45
  <p class="ma-5">SCORM 1.2 Not yet implemented</p>
@@ -49,10 +50,10 @@
49
50
 
50
51
  <script>
51
52
  import ManageLti1p1 from '../../../components/ExternalIntegration/Driver/ManageLti1p1.vue'
52
-
53
+ import ManageLti1p3 from '../../../components/ExternalIntegration/Driver/ManageLti1p3.vue'
53
54
  export default {
54
55
  name: 'PluginIntegrationsExternalIntegrationIndexPage',
55
- components: { ManageLti1p1 },
56
+ components: { ManageLti1p1, ManageLti1p3 },
56
57
  layout: 'authenticated',
57
58
  meta: {
58
59
  privilege: {
package/plugin.js CHANGED
@@ -9,6 +9,11 @@ import IntegrationHelper from './helpers/IntegrationHelper'
9
9
  import LtiConsumerBlock from './components/Content/Blocks/ExternalIntegration/LtiConsumer'
10
10
  import LtiConsumerBlockSettings from './components/Settings/ExternalIntegration/LtiConsumerSettings'
11
11
 
12
+ import FileImportMenu from './components/FileImport/FileImportMenu.vue'
13
+ import FileImportResourcespace from './components/FileImport/Resourcespace.vue'
14
+ import FileImportGoogleDrive from './components/FileImport/GoogleDrive.vue'
15
+ import FileImportDropbox from './components/FileImport/Dropbox.vue'
16
+
12
17
  export default {
13
18
  name: 'windward.integrations.name',
14
19
  hooks: {
@@ -68,7 +73,7 @@ export default {
68
73
  ref_page: 'admin',
69
74
  children: [
70
75
  {
71
- i18n: 'windward.integrations.components.navigation.integrations.manage_integrations',
76
+ i18n: 'windward.integrations.components.navigation.integrations.title',
72
77
  path: '/admin/integrations/vendors',
73
78
  context: ['home'],
74
79
  permissions: {
@@ -133,6 +138,53 @@ export default {
133
138
  */
134
139
  ],
135
140
  },
141
+ {
142
+ ref_page: 'course_settings',
143
+ children: [
144
+ {
145
+ i18n: 'windward.integrations.components.navigation.integrations.manage_integrations',
146
+ path: '/admin/integrations/vendors',
147
+ context: ['home'],
148
+ permissions: {
149
+ 'plugin.windward.integrations.organization.integration':
150
+ {
151
+ writable: true,
152
+ },
153
+ },
154
+ },
155
+ {
156
+ i18n: 'windward.integrations.components.navigation.integrations.import_course',
157
+ path: '/admin/integrations/import-course',
158
+ context: ['home'],
159
+ permissions: {
160
+ 'plugin.windward.integrations.course': {
161
+ writable: true,
162
+ },
163
+ },
164
+ },
165
+ {
166
+ i18n: 'windward.integrations.components.navigation.integrations.import_content',
167
+ path: '/course/{course.id}/integrations/import-content',
168
+ context: ['course'],
169
+ permissions: {
170
+ 'plugin.windward.integrations.course': {
171
+ writable: true,
172
+ },
173
+ },
174
+ },
175
+ {
176
+ i18n: 'windward.integrations.pages.course.external_integration.title',
177
+ path: '/course/{course.id}/integrations/external',
178
+ context: ['course'],
179
+ permissions: {
180
+ 'plugin.windward.integrations.course.externalIntegration':
181
+ {
182
+ readable: true,
183
+ },
184
+ },
185
+ },
186
+ ],
187
+ },
136
188
  ],
137
189
  contentBlock: [
138
190
  {
@@ -157,6 +209,37 @@ export default {
157
209
  },
158
210
  },
159
211
  ],
212
+ fileImport: [
213
+ {
214
+ tag: 'windward-integrations-file-import-menu',
215
+ template: FileImportMenu,
216
+ metadata: {
217
+ vendors: [
218
+ {
219
+ template: FileImportResourcespace,
220
+ i18n: 'windward.integrations.shared.file.import_resourcespace',
221
+ icon: 'mdi-cube',
222
+ product_code: 'resourcespace',
223
+ disabled: false,
224
+ },
225
+ {
226
+ template: FileImportGoogleDrive,
227
+ i18n: 'windward.integrations.shared.file.import_google_drive',
228
+ icon: 'mdi-google-drive',
229
+ product_code: 'google_drive',
230
+ disabled: true,
231
+ },
232
+ {
233
+ template: FileImportDropbox,
234
+ i18n: 'windward.integrations.shared.file.import_dropbox',
235
+ icon: 'mdi-dropbox',
236
+ product_code: 'dropbox',
237
+ disabled: true,
238
+ },
239
+ ],
240
+ },
241
+ },
242
+ ],
160
243
  },
161
244
  services: {
162
245
  Integration: IntegrationHelper,
@@ -0,0 +1,19 @@
1
+ import { shallowMount } from '@vue/test-utils'
2
+
3
+ import Vue from 'vue'
4
+ import Vuetify from 'vuetify'
5
+ import { defaultMocks } from '@/test/mocks'
6
+
7
+ import ManageProvider from '@/components/ExternalIntegration/Driver/Lti1p3/ManageProvider.vue'
8
+
9
+ Vue.use(Vuetify)
10
+
11
+ describe('ManageProvider', () => {
12
+ test('ManageProvider is a Vue instance', () => {
13
+ const wrapper = shallowMount(ManageProvider, {
14
+ vuetify: new Vuetify(),
15
+ mocks: defaultMocks,
16
+ })
17
+ expect(wrapper.vm).toBeTruthy()
18
+ })
19
+ })
@@ -0,0 +1,19 @@
1
+ import { shallowMount } from '@vue/test-utils'
2
+
3
+ import Vue from 'vue'
4
+ import Vuetify from 'vuetify'
5
+ import { defaultMocks } from '@/test/mocks'
6
+
7
+ import ManageProviders from '@/components/ExternalIntegration/Driver/Lti1p3/ManageProviders.vue'
8
+
9
+ Vue.use(Vuetify)
10
+
11
+ describe('ManageProviders', () => {
12
+ test('ManageProviders is a Vue instance', () => {
13
+ const wrapper = shallowMount(ManageProviders, {
14
+ vuetify: new Vuetify(),
15
+ mocks: defaultMocks,
16
+ })
17
+ expect(wrapper.vm).toBeTruthy()
18
+ })
19
+ })
@@ -0,0 +1,19 @@
1
+ import { shallowMount } from '@vue/test-utils'
2
+
3
+ import Vue from 'vue'
4
+ import Vuetify from 'vuetify'
5
+ import { defaultMocks } from '@/test/mocks'
6
+
7
+ import ManageLti1p1 from '@/components/ExternalIntegration/Driver/ManageLti1p3.vue'
8
+
9
+ Vue.use(Vuetify)
10
+
11
+ describe('ManageLti1p3', () => {
12
+ test('ManageLti1p3 is a Vue instance', () => {
13
+ const wrapper = shallowMount(ManageLti1p1, {
14
+ vuetify: new Vuetify(),
15
+ mocks: defaultMocks,
16
+ })
17
+ expect(wrapper.vm).toBeTruthy()
18
+ })
19
+ })
@@ -0,0 +1,24 @@
1
+ import { shallowMount } from '@vue/test-utils'
2
+
3
+ import Vue from 'vue'
4
+ import Vuetify from 'vuetify'
5
+ import { defaultMocks } from '@/test/mocks'
6
+
7
+ import Dropbox from '@/components/FileImport/Dropbox.vue'
8
+
9
+ Vue.use(Vuetify)
10
+
11
+ describe('Dropbox', () => {
12
+ test('Dropbox is a Vue instance', () => {
13
+ const wrapper = shallowMount(Dropbox, {
14
+ vuetify: new Vuetify(),
15
+ propsData: {
16
+ organizationIntegration: {
17
+ id: '00000000-0000-0000-0000-000000000000',
18
+ },
19
+ },
20
+ mocks: defaultMocks,
21
+ })
22
+ expect(wrapper.vm).toBeTruthy()
23
+ })
24
+ })
@@ -0,0 +1,24 @@
1
+ import { shallowMount } from '@vue/test-utils'
2
+
3
+ import Vue from 'vue'
4
+ import Vuetify from 'vuetify'
5
+ import { defaultMocks } from '@/test/mocks'
6
+
7
+ import GoogleDrive from '@/components/FileImport/GoogleDrive.vue'
8
+
9
+ Vue.use(Vuetify)
10
+
11
+ describe('GoogleDrive', () => {
12
+ test('GoogleDrive is a Vue instance', () => {
13
+ const wrapper = shallowMount(GoogleDrive, {
14
+ vuetify: new Vuetify(),
15
+ propsData: {
16
+ organizationIntegration: {
17
+ id: '00000000-0000-0000-0000-000000000000',
18
+ },
19
+ },
20
+ mocks: defaultMocks,
21
+ })
22
+ expect(wrapper.vm).toBeTruthy()
23
+ })
24
+ })
@@ -0,0 +1,24 @@
1
+ import { shallowMount } from '@vue/test-utils'
2
+
3
+ import Vue from 'vue'
4
+ import Vuetify from 'vuetify'
5
+ import { defaultMocks } from '@/test/mocks'
6
+
7
+ import Resourcespace from '@/components/FileImport/Resourcespace.vue'
8
+
9
+ Vue.use(Vuetify)
10
+
11
+ describe('Resourcespace', () => {
12
+ test('Resourcespace is a Vue instance', () => {
13
+ const wrapper = shallowMount(Resourcespace, {
14
+ vuetify: new Vuetify(),
15
+ propsData: {
16
+ organizationIntegration: {
17
+ id: '00000000-0000-0000-0000-000000000000',
18
+ },
19
+ },
20
+ mocks: defaultMocks,
21
+ })
22
+ expect(wrapper.vm).toBeTruthy()
23
+ })
24
+ })
@@ -0,0 +1,22 @@
1
+ import { shallowMount } from '@vue/test-utils'
2
+
3
+ import Vue from 'vue'
4
+ import Vuetify from 'vuetify'
5
+ import { defaultMocks } from '@/test/mocks'
6
+
7
+ import ManageAtutor from '@/components/Integration/Driver/ManageAtutor.vue'
8
+
9
+ Vue.use(Vuetify)
10
+
11
+ describe('ManageAtutor', () => {
12
+ test('ManageAtutor is a Vue instance', () => {
13
+ const wrapper = shallowMount(ManageAtutor, {
14
+ vuetify: new Vuetify(),
15
+ mocks: defaultMocks,
16
+ propsData: {
17
+ vendor: {},
18
+ },
19
+ })
20
+ expect(wrapper.vm).toBeTruthy()
21
+ })
22
+ })
@@ -0,0 +1,22 @@
1
+ import { shallowMount } from '@vue/test-utils'
2
+
3
+ import Vue from 'vue'
4
+ import Vuetify from 'vuetify'
5
+ import { defaultMocks } from '@/test/mocks'
6
+
7
+ import ManageResourcespace from '@/components/Integration/Driver/ManageResourcespace.vue'
8
+
9
+ Vue.use(Vuetify)
10
+
11
+ describe('ManageResourcespace', () => {
12
+ test('ManageResourcespace is a Vue instance', () => {
13
+ const wrapper = shallowMount(ManageResourcespace, {
14
+ vuetify: new Vuetify(),
15
+ mocks: defaultMocks,
16
+ propsData: {
17
+ vendor: {},
18
+ },
19
+ })
20
+ expect(wrapper.vm).toBeTruthy()
21
+ })
22
+ })
@@ -0,0 +1,22 @@
1
+ import { shallowMount } from '@vue/test-utils'
2
+
3
+ import Vue from 'vue'
4
+ import Vuetify from 'vuetify'
5
+ import { defaultMocks } from '@/test/mocks'
6
+
7
+ import JobLog from '@/components/Integration/JobLog.vue'
8
+
9
+ Vue.use(Vuetify)
10
+
11
+ describe('JobLog', () => {
12
+ test('JobLog is a Vue instance', () => {
13
+ const wrapper = shallowMount(JobLog, {
14
+ vuetify: new Vuetify(),
15
+ propsData: {
16
+ id: '',
17
+ },
18
+ mocks: defaultMocks,
19
+ })
20
+ expect(wrapper.vm).toBeTruthy()
21
+ })
22
+ })
@@ -0,0 +1,23 @@
1
+ import { shallowMount } from '@vue/test-utils'
2
+
3
+ import Vue from 'vue'
4
+ import Vuetify from 'vuetify'
5
+ import { defaultMocks } from '@/test/mocks'
6
+
7
+ import JobTable from '@/components/Integration/JobTable.vue'
8
+
9
+ Vue.use(Vuetify)
10
+
11
+ describe('JobTable', () => {
12
+ test('JobTable is a Vue instance', () => {
13
+ const wrapper = shallowMount(JobTable, {
14
+ vuetify: new Vuetify(),
15
+ propsData: {
16
+ channel: '',
17
+ event: '',
18
+ },
19
+ mocks: defaultMocks,
20
+ })
21
+ expect(wrapper.vm).toBeTruthy()
22
+ })
23
+ })
@@ -10,3 +10,27 @@ jest.mock(
10
10
  },
11
11
  { virtual: true }
12
12
  )
13
+
14
+ jest.mock(
15
+ '~/components/Breadcrumbs.vue',
16
+ () => {
17
+ return {
18
+ data() {
19
+ return { validation: {} }
20
+ },
21
+ }
22
+ },
23
+ { virtual: true }
24
+ )
25
+
26
+ jest.mock(
27
+ '~/components/SearchField.vue',
28
+ () => {
29
+ return {
30
+ props: {},
31
+ computed: {},
32
+ methods: {},
33
+ }
34
+ },
35
+ { virtual: true }
36
+ )
@@ -30,6 +30,7 @@ const mockModels = [
30
30
  resource: 'remote-organizations',
31
31
  },
32
32
  { path: '../../models/Vendor', resource: 'vendors' },
33
+ { path: '../../models/RemoteFile', resource: 'remote-files' },
33
34
  ]
34
35
 
35
36
  // DO NOT ALTER THE BELOW CODE
package/test/mocks.js CHANGED
@@ -14,6 +14,18 @@ mocks.$Integration = {
14
14
  resolve([])
15
15
  })
16
16
  },
17
+ getSocket() {
18
+ return {
19
+ leave: jest.fn(),
20
+ public: () => {
21
+ return { listen: jest.fn() }
22
+ },
23
+ private: () => {
24
+ return { listen: jest.fn() }
25
+ },
26
+ connector: { pusher: { connection: { bind: jest.fn() } } },
27
+ }
28
+ },
17
29
  }
18
30
  mocks.$PermissionService = { userHasAccessTo: () => true }
19
31