@windward/integrations 0.2.1 → 0.3.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.
@@ -154,7 +154,7 @@ import BaseContentBlock from '~/components/Content/Blocks/BaseContentBlock'
154
154
  import Course from '~/models/Course'
155
155
  import Organization from '~/models/Organization'
156
156
  import Enrollment from '~/models/Enrollment'
157
- import DialogBox from '~/components/DialogBox.vue'
157
+ import DialogBox from '~/components/Core/DialogBox.vue'
158
158
 
159
159
  export default {
160
160
  name: 'ContentBlockExternalIntegrationLti1p1Consumer',
@@ -321,7 +321,8 @@ export default {
321
321
  },
322
322
  onBeforeSave() {
323
323
  // Set a generic body since we don't use this field
324
- this.block.body = 'lti-' + this.consumer.version + '-consumer'
324
+ this.block.body =
325
+ 'lti-' + _.get(this.consumer, 'version', '0.0') + '-consumer'
325
326
  },
326
327
  },
327
328
  }
@@ -154,7 +154,7 @@ import LtiConsumer from '../../../../models/ExternalIntegration/LtiConsumer'
154
154
  import Organization from '~/models/Organization'
155
155
  import Course from '~/models/Course'
156
156
  import TextEditor from '~/components/Text/TextEditor.vue'
157
- import FormVue from '~/components/Form'
157
+ import FormVue from '~/components/Core/Form'
158
158
 
159
159
  export default {
160
160
  name: 'ManageLti1p1ConsumerDriver',
@@ -101,8 +101,8 @@ import LtiConsumer from '../../../../models/ExternalIntegration/LtiConsumer'
101
101
  import ManageConsumer from './ManageConsumer.vue'
102
102
  import Course from '~/models/Course'
103
103
  import Organization from '~/models/Organization'
104
- import DialogBox from '~/components/DialogBox.vue'
105
- import SpeedDial from '~/components/SpeedDial.vue'
104
+ import DialogBox from '~/components/Core/DialogBox.vue'
105
+ import SpeedDial from '~/components/Core/SpeedDial.vue'
106
106
 
107
107
  export default {
108
108
  name: 'ManageLti1p1ConsumersDriver',
@@ -256,7 +256,7 @@ import _ from 'lodash'
256
256
  import { mapGetters } from 'vuex'
257
257
  import ProviderTargetPicker from '../../ProviderTargetPicker.vue'
258
258
  import LtiProvider from '../../../../models/ExternalIntegration/LtiProvider'
259
- import FormVue from '~/components/Form.vue'
259
+ import FormVue from '~/components/Core/Form.vue'
260
260
  import Role from '~/models/Role'
261
261
  import Organization from '~/models/Organization'
262
262
  import Course from '~/models/Course'
@@ -124,10 +124,10 @@ import LtiProvider from '../../../../models/ExternalIntegration/LtiProvider'
124
124
  import SecretField from '../../../SecretField.vue'
125
125
  import ProviderTargetViewer from '../../ProviderTargetViewer.vue'
126
126
  import ManageProvider from './ManageProvider.vue'
127
- import DialogBox from '~/components/DialogBox.vue'
127
+ import DialogBox from '~/components/Core/DialogBox.vue'
128
128
  import Organization from '~/models/Organization'
129
129
  import Course from '~/models/Course'
130
- import SpeedDial from '~/components/SpeedDial.vue'
130
+ import SpeedDial from '~/components/Core/SpeedDial.vue'
131
131
 
132
132
  export default {
133
133
  name: 'ManageLti1p1ProvidersDriver',
@@ -145,7 +145,7 @@ import LtiConsumer from '../../../../models/ExternalIntegration/LtiConsumer'
145
145
  import Organization from '~/models/Organization'
146
146
  import Course from '~/models/Course'
147
147
  import TextEditor from '~/components/Text/TextEditor.vue'
148
- import FormVue from '~/components/Form'
148
+ import FormVue from '~/components/Core/Form'
149
149
 
150
150
  export default {
151
151
  name: 'ManageLti1p3ConsumerDriver',
@@ -128,8 +128,8 @@ import ManageConsumer from './ManageConsumer.vue'
128
128
  import ViewConsumer from './ViewConsumer.vue'
129
129
  import Course from '~/models/Course'
130
130
  import Organization from '~/models/Organization'
131
- import DialogBox from '~/components/DialogBox.vue'
132
- import SpeedDial from '~/components/SpeedDial.vue'
131
+ import DialogBox from '~/components/Core/DialogBox.vue'
132
+ import SpeedDial from '~/components/Core/SpeedDial.vue'
133
133
 
134
134
  export default {
135
135
  name: 'ManageLti1p1ConsumersDriver',
@@ -356,7 +356,7 @@ import { mapGetters } from 'vuex'
356
356
  import ProviderTargetPicker from '../../ProviderTargetPicker.vue'
357
357
  import LtiProvider from '../../../../models/ExternalIntegration/LtiProvider'
358
358
 
359
- import FormVue from '~/components/Form.vue'
359
+ import FormVue from '~/components/Core/Form.vue'
360
360
  import Role from '~/models/Role'
361
361
  import Organization from '~/models/Organization'
362
362
  import Course from '~/models/Course'
@@ -126,10 +126,10 @@ import LtiProvider from '../../../../models/ExternalIntegration/LtiProvider'
126
126
  import SecretField from '../../../SecretField.vue'
127
127
  import ProviderTargetViewer from '../../ProviderTargetViewer.vue'
128
128
  import ManageProvider from './ManageProvider.vue'
129
- import DialogBox from '~/components/DialogBox.vue'
129
+ import DialogBox from '~/components/Core/DialogBox.vue'
130
130
  import Organization from '~/models/Organization'
131
131
  import Course from '~/models/Course'
132
- import SpeedDial from '~/components/SpeedDial.vue'
132
+ import SpeedDial from '~/components/Core/SpeedDial.vue'
133
133
 
134
134
  export default {
135
135
  name: 'ManageLti1p1ProvidersDriver',
@@ -112,7 +112,7 @@ import LtiConsumer from '../../../../models/ExternalIntegration/LtiConsumer'
112
112
  import SecretField from '../../../SecretField.vue'
113
113
  import Organization from '~/models/Organization'
114
114
  import Course from '~/models/Course'
115
- import FormVue from '~/components/Form'
115
+ import FormVue from '~/components/Core/Form'
116
116
  export default {
117
117
  name: 'ViewLti1p3Consumer',
118
118
  components: { SecretField },
@@ -39,7 +39,7 @@
39
39
  import _ from 'lodash'
40
40
  import { mapGetters } from 'vuex'
41
41
  import Organization from '../../models/Organization'
42
- import DialogBox from '~/components/DialogBox.vue'
42
+ import DialogBox from '~/components/Core/DialogBox.vue'
43
43
 
44
44
  export default {
45
45
  name: 'FileImportMenu',
@@ -61,7 +61,7 @@ import { mapGetters } from 'vuex'
61
61
  import OrganizationIntegration from '../../models/OrganizationIntegration'
62
62
  import RemoteFile from '../../models/RemoteFile'
63
63
  import Course from '~/models/Course'
64
- import SearchField from '~/components/SearchField.vue'
64
+ import SearchField from '~/components/Core/SearchField.vue'
65
65
 
66
66
  export default {
67
67
  name: 'FileImportResourcespace',
@@ -3,7 +3,7 @@ import { mapGetters } from 'vuex'
3
3
  import Organization from '../../../models/Organization'
4
4
  import OrganizationIntegration from '../../../models/OrganizationIntegration'
5
5
  import Vendor from '../../../models/Vendor'
6
- import FormVue from '~/components/Form'
6
+ import FormVue from '~/components/Core/Form'
7
7
 
8
8
  export default {
9
9
  name: 'ManageBase',
@@ -187,8 +187,8 @@
187
187
  <script>
188
188
  import _ from 'lodash'
189
189
  import { mapGetters } from 'vuex'
190
- import SearchField from '~/components/SearchField.vue'
191
190
  import Organization from '../../models/Organization'
191
+ import SearchField from '~/components/Core/SearchField.vue'
192
192
 
193
193
  export default {
194
194
  name: 'IntegrationJobLog',
@@ -156,13 +156,14 @@
156
156
  import Confetti from 'canvas-confetti'
157
157
  import _ from 'lodash'
158
158
  import { mapGetters } from 'vuex'
159
+ import DialogBox from '~/components/Core/DialogBox.vue'
159
160
  import Vendor from '../../models/Vendor'
160
161
  import Organization from '../../models/Organization'
161
162
  import JobLog from './JobLog.vue'
162
163
 
163
164
  export default {
164
165
  name: 'IntegrationJobs',
165
- components: { JobLog },
166
+ components: { DialogBox, JobLog },
166
167
  props: {
167
168
  channel: { type: String, required: true },
168
169
  event: { type: String, required: true },
@@ -20,11 +20,12 @@
20
20
  <script>
21
21
  import _ from 'lodash'
22
22
  import { mapGetters } from 'vuex'
23
+ import DialogBox from '~/components/Core/DialogBox.vue'
23
24
  import JobLog from '../../Integration/JobLog.vue'
24
25
 
25
26
  export default {
26
27
  name: 'NavigationItemCourseJobLog',
27
- components: { JobLog },
28
+ components: { DialogBox, JobLog },
28
29
  props: {
29
30
  config: { type: Object, required: true },
30
31
  },
@@ -10,6 +10,7 @@
10
10
  'windward.integrations.components.settings.external_integration.lti_consumer.title'
11
11
  )
12
12
  "
13
+ :disabled="render"
13
14
  ></v-text-field>
14
15
  <v-textarea
15
16
  v-model="block.metadata.config.instructions"
@@ -21,6 +22,7 @@
21
22
  'windward.integrations.components.settings.external_integration.lti_consumer.instructions'
22
23
  )
23
24
  "
25
+ :disabled="render"
24
26
  ></v-textarea>
25
27
  <br />
26
28
  <v-divider class="primary"></v-divider>
@@ -35,6 +37,7 @@
35
37
  :items="launchTypes"
36
38
  item-text="name"
37
39
  item-value="value"
40
+ :disabled="render"
38
41
  ></v-select>
39
42
  {{
40
43
  $t(
@@ -50,8 +53,8 @@
50
53
  v-for="consumer in consumers"
51
54
  :key="consumer.id"
52
55
  two-line
53
- :disabled="!consumer.enabled"
54
56
  :value="consumer.id"
57
+ :disabled="render || !consumer.enabled"
55
58
  >
56
59
  <v-list-item-avatar
57
60
  :color="!consumer.enabled ? 'error' : ''"
@@ -88,7 +91,7 @@
88
91
  <script>
89
92
  import { mapGetters } from 'vuex'
90
93
  import LtiConsumer from '../../../models/ExternalIntegration/LtiConsumer'
91
- import BaseContentSettings from '~/components/Content/Tool/BaseContentSettings.js'
94
+ import BaseContentSettings from '~/components/Content/Settings/BaseContentSettings.js'
92
95
  import Course from '~/models/Course'
93
96
  import Organization from '~/models/Organization'
94
97
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@windward/integrations",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "description": "Windward UI Plugin Integrations for 3rd Party Systems",
5
5
  "main": "plugin.js",
6
6
  "scripts": {
@@ -21,7 +21,7 @@
21
21
  "license": "MIT",
22
22
  "homepage": "https://bitbucket.org/mindedge/windward-ui-plugin-integrations#readme",
23
23
  "dependencies": {
24
- "@windward/core": "^0.0.2",
24
+ "@windward/core": "^0.3.0",
25
25
  "canvas-confetti": "^1.6.0",
26
26
  "eslint": "^8.11.0",
27
27
  "laravel-echo": "^1.15.0",
@@ -153,8 +153,8 @@ import _ from 'lodash'
153
153
  import { mapGetters } from 'vuex'
154
154
  import Organization from '../../models/Organization'
155
155
  import IntegrationJobTable from '../../components/Integration/JobTable.vue'
156
- import Breadcrumbs from '~/components/Breadcrumbs.vue'
157
- import DialogBox from '~/components/DialogBox.vue'
156
+ import Breadcrumbs from '~/components/Core/Breadcrumbs.vue'
157
+ import DialogBox from '~/components/Core/DialogBox.vue'
158
158
 
159
159
  export default {
160
160
  name: 'PluginIntegrationsAdminVendorsPage',
@@ -1,48 +1 @@
1
- // TODO find better way for jest to recognize utils imports
2
- jest.mock(
3
- '~/components/Form.vue',
4
- () => {
5
- return {
6
- data() {
7
- return { validation: {} }
8
- },
9
- }
10
- },
11
- { virtual: true }
12
- )
13
-
14
- jest.mock(
15
- '~/components/Form',
16
- () => {
17
- return {
18
- data() {
19
- return { validation: {} }
20
- },
21
- }
22
- },
23
- { virtual: true }
24
- )
25
-
26
- jest.mock(
27
- '~/components/Breadcrumbs.vue',
28
- () => {
29
- return {
30
- data() {
31
- return { validation: {} }
32
- },
33
- }
34
- },
35
- { virtual: true }
36
- )
37
-
38
- jest.mock(
39
- '~/components/SearchField.vue',
40
- () => {
41
- return {
42
- props: {},
43
- computed: {},
44
- methods: {},
45
- }
46
- },
47
- { virtual: true }
48
- )
1
+ // Mock components from other repos
@@ -1,105 +1,22 @@
1
- import { Model as mockModel } from 'vue-api-query'
1
+ import { registerModels } from '@windward/core/test/__mocks__/modelMock.js'
2
2
 
3
- import axios from 'axios'
4
- jest.mock('axios')
5
- mockModel.$http = axios
6
-
7
- jest.mock('axios')
8
-
9
- // Define any new model mocks here. The imports / mocks will be auto-generated below
10
- const mockVirtualModels = [
11
- { path: '~/models/Role', resource: 'roles' },
12
- { path: '~/models/Organization', resource: 'organizations' },
13
- ]
14
-
15
- const mockModels = [
16
- { path: '../../models/Organization', resource: 'organizations' },
3
+ registerModels([
4
+ { path: '@/models/Organization', resource: 'organizations' },
17
5
  {
18
- path: '../../models/OrganizationIntegration',
6
+ path: '@/models/OrganizationIntegration',
19
7
  resource: 'organization-integrations',
20
8
  },
21
9
  {
22
- path: '../../models/CourseSectionIntegration',
10
+ path: '@/models/CourseSectionIntegration',
23
11
  resource: 'section-integrations',
24
12
  },
25
- { path: '../../models/IntegrationJob', resource: 'integration-jobs' },
26
- { path: '../../models/RemoteContent', resource: 'remote-content' },
27
- { path: '../../models/RemoteCourse', resource: 'remote-courses' },
13
+ { path: '@/models/IntegrationJob', resource: 'integration-jobs' },
14
+ { path: '@/models/RemoteContent', resource: 'remote-content' },
15
+ { path: '@/models/RemoteCourse', resource: 'remote-courses' },
28
16
  {
29
- path: '../../models/RemoteOrganization',
17
+ path: '@/models/RemoteOrganization',
30
18
  resource: 'remote-organizations',
31
19
  },
32
- { path: '../../models/Vendor', resource: 'vendors' },
33
- { path: '../../models/RemoteFile', resource: 'remote-files' },
34
- ]
35
-
36
- // DO NOT ALTER THE BELOW CODE
37
- jest.mock('', () => {
38
- return {
39
- __esModule: true,
40
- default: class Model {},
41
- }
42
- })
43
- class mockBaseModel extends mockModel {
44
- baseURL() {
45
- return 'http://windwardapi.local'
46
- }
47
-
48
- request(_config) {
49
- return new Promise((resolve) => {
50
- resolve({ data: {} })
51
- })
52
- }
53
- }
54
-
55
- jest.mock(
56
- '~/models/Model',
57
- () => {
58
- return {
59
- __esModule: true,
60
- default: class Model extends mockBaseModel {},
61
- }
62
- },
63
- { virtual: true }
64
- )
65
-
66
- for (let mockI = 0; mockI < mockVirtualModels.length; mockI++) {
67
- jest.mock(
68
- mockVirtualModels[mockI].path,
69
- () => {
70
- return {
71
- __esModule: true,
72
- default: class Model extends mockBaseModel {
73
- resource() {
74
- return (
75
- mockVirtualModels[mockI].resource ||
76
- this.constructor.name
77
- )
78
- }
79
- },
80
- }
81
- },
82
- { virtual: true }
83
- )
84
- }
85
-
86
- for (let mockJ = 0; mockJ < mockModels.length; mockJ++) {
87
- jest.mock(mockModels[mockJ].path, () => {
88
- return {
89
- __esModule: true,
90
- default: class Model extends mockBaseModel {
91
- resource() {
92
- return mockModels[mockJ].resource || this.constructor.name
93
- }
94
-
95
- integrations() {
96
- return this
97
- }
98
-
99
- get() {
100
- return []
101
- }
102
- },
103
- }
104
- })
105
- }
20
+ { path: '@/models/Vendor', resource: 'vendors' },
21
+ { path: '@/models/RemoteFile', resource: 'remote-files' },
22
+ ])