adapt-authoring-adaptframework 1.9.1 → 1.9.3

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.
@@ -1,29 +1,15 @@
1
- name: Add to main project
1
+ # Calls the org-level reusable workflow to add PRs to the TODO Board
2
+
3
+ name: Add PR to Project
2
4
 
3
5
  on:
4
- issues:
5
- types:
6
- - opened
7
6
  pull_request:
8
7
  types:
9
8
  - opened
9
+ - reopened
10
10
 
11
11
  jobs:
12
12
  add-to-project:
13
- name: Add to main project
14
- runs-on: ubuntu-latest
15
- steps:
16
- - uses: actions/add-to-project@v0.1.0
17
- with:
18
- project-url: https://github.com/orgs/adapt-security/projects/5
19
- github-token: ${{ secrets.PROJECTS_SECRET }}
20
-
21
- handle_precommit_pr:
22
- if: contains(github.event.pull_request.title, '[pre-commit.ci]')
23
- runs-on: ubuntu-latest
24
-
25
- steps:
26
- - name: Label pull request with "_bot"
27
- run: gh pr edit ${{ github.event.pull_request.number }} -R ${{ github.repository }} --add-label "_bot"
28
- env:
29
- GH_TOKEN: ${{ secrets.PROJECTS_SECRET }}
13
+ uses: adapt-security/.github/.github/workflows/new.yml@main
14
+ secrets:
15
+ PROJECTS_SECRET: ${{ secrets.PROJECTS_SECRET }}
@@ -60,9 +60,6 @@ class AdaptFrameworkModule extends AbstractModule {
60
60
  const content = await this.app.waitForModule('content')
61
61
  content.accessCheckHook.tap(this.checkContentAccess.bind(this))
62
62
 
63
- this.postInstallHook.tap(this.installFrameworkModules.bind(this))
64
- this.postUpdateHook.tap(this.installFrameworkModules.bind(this))
65
-
66
63
  await this.installFramework()
67
64
 
68
65
  if (this.app.args['update-framework'] === true) {
@@ -90,20 +87,6 @@ class AdaptFrameworkModule extends AbstractModule {
90
87
  return this._version
91
88
  }
92
89
 
93
- /**
94
- * Run npm install on framework directory to install/update any dependencies
95
- * @type {Promise}
96
- */
97
- async installFrameworkModules () {
98
- this.log('verbose', 'INSTALL_NPM_MODULES')
99
- try {
100
- await FWUtils.spawnPromise('npm install')
101
- } catch (e) {
102
- this.log('error', `failed to run npm install, ${e.message}`)
103
- throw this.app.errors.FW_INSTALL_FAILED
104
- }
105
- }
106
-
107
90
  /**
108
91
  * Installs a local copy of the Adapt framework
109
92
  * @return {Promise}
@@ -113,14 +96,14 @@ class AdaptFrameworkModule extends AbstractModule {
113
96
  try {
114
97
  try {
115
98
  await fs.readFile(path.resolve(this.path, 'package.json'))
116
- if (!force) {
117
- this.log('verbose', 'INSTALL no action, force !== true')
118
- return
99
+ if (force) {
100
+ this.log('verbose', 'INSTALL forcing new framework install')
101
+ } else {
102
+ return this.log('verbose', 'INSTALL no action, force !== true')
119
103
  }
120
- this.log('verbose', 'INSTALL forcing new framework install')
121
104
  await fs.rm(this.path, { recursive: true })
122
105
  } catch (e) {
123
- // if src and node_modules are missing, install required
106
+ // package is missing, an install is required
124
107
  }
125
108
  await this.runCliCommand('installFramework', { version })
126
109
  } catch (e) {
@@ -219,7 +202,7 @@ class AdaptFrameworkModule extends AbstractModule {
219
202
  }
220
203
  const shareWithUsers = course?._shareWithUsers.map(id => id.toString()) ?? []
221
204
  const userId = req.auth.user._id.toString()
222
- return course._isShared || shareWithUsers.includes(userId)
205
+ return course.createdBy.toString() === userId || course._isShared || shareWithUsers.includes(userId)
223
206
  }
224
207
 
225
208
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adapt-authoring-adaptframework",
3
- "version": "1.9.1",
3
+ "version": "1.9.3",
4
4
  "description": "Adapt framework integration for the Adapt authoring tool",
5
5
  "homepage": "https://github.com/adapt-security/adapt-authoring-adaptframework",
6
6
  "license": "GPL-3.0",
@@ -1,16 +0,0 @@
1
- name: Add labelled PRs to project
2
-
3
- on:
4
- pull_request:
5
- types: [ labeled ]
6
-
7
- jobs:
8
- add-to-project:
9
- if: ${{ github.event.label.name == 'dependencies' }}
10
- name: Add to main project
11
- runs-on: ubuntu-latest
12
- steps:
13
- - uses: actions/add-to-project@v0.1.0
14
- with:
15
- project-url: https://github.com/orgs/adapt-security/projects/5
16
- github-token: ${{ secrets.PROJECTS_SECRET }}