Skip to content

Commit e8050b0

Browse files
Merge pull request #2102 from ucfopen/dev/32-pigeonite
Dev/32 - Pigeonite
2 parents 5693d59 + a785647 commit e8050b0

File tree

134 files changed

+8311
-3466
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+8311
-3466
lines changed

.github/workflows/tests.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jobs:
55
runs-on: ubuntu-latest
66
strategy:
77
matrix:
8-
node-version: [14.x]
8+
node-version: [18.x]
99
steps:
1010
- name: Checkout code
1111
uses: actions/checkout@v2
@@ -19,10 +19,10 @@ jobs:
1919
# should help to speed up yarn install and be safe
2020
# across changes to the repo and platforms
2121
- name: Cache Yarn Deps
22-
uses: c-hive/gha-yarn-cache@v1
22+
uses: c-hive/gha-yarn-cache@v1
2323

2424
- run: echo "github.ref = ${{ github.ref }}"
25-
25+
2626
# frozen lockfile should make the cache more effective
2727
# and our tests more predictable
2828
- run: yarn install --frozen-lockfile
@@ -35,7 +35,7 @@ jobs:
3535
# will fail the PRs that need prettier run on them
3636
- name: Does Prettier Need to Be Run
3737
run: git --no-pager diff --exit-code -- .
38-
38+
3939
- run: yarn test:ci
4040

4141
build_docker_images:
@@ -83,7 +83,7 @@ jobs:
8383
- name: NPM - Test, Build, Deploy
8484
uses: actions/setup-node@v1
8585
with:
86-
node-version: 14
86+
node-version: 18
8787
registry-url: https://registry.npmjs.org/
8888

8989
- name: Cache Yarn Deps

docker/dockerfiles/obojobo-node-debian.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# =====================================================================================================
22
# Base stage used for build and final stages
33
# =====================================================================================================
4-
FROM node:14.16.0-alpine AS base_stage
4+
FROM node:18.16.0-alpine AS base_stage
55

66
# ======== PUT NEW NODE BIN DIR IN PATH
77
RUN npm config set prefix '/home/node/.npm-global'

docker/obojobo-pm2-server-src/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "obojobo-pm2-server-app",
3-
"version": "16.0.1",
3+
"version": "17.0.0",
44
"description": "Reference project for deploying and customizing an Obojobo Next server",
55
"main": "./index.js",
66
"private": true,

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"packages": [
33
"packages/**/*"
44
],
5-
"version": "16.0.1",
5+
"version": "17.0.0",
66
"command": {
77
"command": {
88
"run": {

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"private": true,
33
"name": "obojobo-next",
4-
"version": "16.0.1",
4+
"version": "17.0.0",
55
"repository": "https://github.com/ucfopen/Obojobo.git",
66
"homepage": "https://ucfopen.github.io/Obojobo-Docs/",
77
"license": "AGPL-3.0-only",
@@ -103,6 +103,6 @@
103103
],
104104
"engines": {
105105
"yarn": "^1.15.2",
106-
"node": "^14.16.0"
106+
"node": "^18.16.0"
107107
}
108108
}

packages/app/obojobo-document-engine/__tests__/Viewer/util/editor-api.test.js

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,33 @@ describe('EditorAPI', () => {
115115
expect(res).toBe(mockJsonResult)
116116
})
117117

118-
test('copyDraft fetches with the correct args', async () => {
118+
test('copyDraft fetches with the correct args - allow default readOnly', async () => {
119119
const res = await EditorAPI.copyDraft('draft-id', 'new-title')
120120

121-
expect(post).toHaveBeenCalledWith('/api/drafts/draft-id/copy', { title: 'new-title' })
121+
expect(post).toHaveBeenCalledWith('/api/drafts/draft-id/copy', {
122+
title: 'new-title',
123+
readOnly: false
124+
})
125+
expect(res).toBe(mockJsonResult)
126+
})
127+
128+
test('copyDraft fetches with the correct args - readOnly true', async () => {
129+
const res = await EditorAPI.copyDraft('draft-id', 'new-title', true)
130+
131+
expect(post).toHaveBeenCalledWith('/api/drafts/draft-id/copy', {
132+
title: 'new-title',
133+
readOnly: true
134+
})
135+
expect(res).toBe(mockJsonResult)
136+
})
137+
138+
test('copyDraft fetches with the correct args - readOnly false', async () => {
139+
const res = await EditorAPI.copyDraft('draft-id', 'new-title', false)
140+
141+
expect(post).toHaveBeenCalledWith('/api/drafts/draft-id/copy', {
142+
title: 'new-title',
143+
readOnly: false
144+
})
122145
expect(res).toBe(mockJsonResult)
123146
})
124147

@@ -147,7 +170,10 @@ describe('EditorAPI', () => {
147170
expect.hasAssertions()
148171

149172
return EditorAPI.copyDraft('mock-draft-id', 'new title').then(result => {
150-
expect(post).toHaveBeenCalledWith('/api/drafts/mock-draft-id/copy', { title: 'new title' })
173+
expect(post).toHaveBeenCalledWith('/api/drafts/mock-draft-id/copy', {
174+
title: 'new title',
175+
readOnly: false
176+
})
151177
expect(result).toEqual(mockJsonResult)
152178
})
153179
})

packages/app/obojobo-document-engine/__tests__/oboeditor/components/toolbars/__snapshots__/file-menu.test.js.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
exports[`File Menu File Menu node 1`] = `
44
"<div class=\\"visual-editor--drop-down-menu\\"><div class=\\"dropdown is-not-open\\" tabindex=\\"-1\\"><button class=\\"menu-title\\">File</button><div class=\\"menu-items\\"><button>Save Module<span>
5-
CTRL+S</span></button><button>New</button><button>Make a copy...</button><div class=\\"dropdown is-not-open\\" tabindex=\\"-1\\"><button class=\\"menu-title\\">Download</button><div class=\\"menu-items\\"><button>XML Document (.xml)</button><button>JSON Document (.json)</button></div></div><button>Import from file...</button><button disabled=\\"\\">Delete Module...</button><button>Copy LTI Link</button></div></div></div>"
5+
CTRL+S</span></button><button>New</button><button>Make a copy...</button><button>Make a read-only copy...</button><div class=\\"dropdown is-not-open\\" tabindex=\\"-1\\"><button class=\\"menu-title\\">Download</button><div class=\\"menu-items\\"><button>XML Document (.xml)</button><button>JSON Document (.json)</button></div></div><button>Import from file...</button><button disabled=\\"\\">Delete Module...</button><button>Copy LTI Link</button></div></div></div>"
66
`;

packages/app/obojobo-document-engine/__tests__/oboeditor/components/toolbars/file-menu.test.js

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,20 @@ describe('File Menu', () => {
119119
expect(ModalUtil.show).toHaveBeenCalled()
120120
})
121121

122+
test('FileMenu calls Copy (Read-Only)', () => {
123+
const model = {
124+
title: 'mockTitle'
125+
}
126+
127+
const component = mount(<FileMenu draftId="mockDraft" model={model} />)
128+
129+
component
130+
.findWhere(n => n.type() === 'button' && n.html().includes('Make a read-only copy...'))
131+
.simulate('click')
132+
133+
expect(ModalUtil.show).toHaveBeenCalled()
134+
})
135+
122136
test('FileMenu calls Download', done => {
123137
// setup
124138
const model = {
@@ -243,7 +257,49 @@ describe('File Menu', () => {
243257
.instance()
244258
.copyModule('new title')
245259
.then(() => {
246-
expect(EditorAPI.copyDraft).toHaveBeenCalledWith('mockDraftId', 'new title')
260+
expect(EditorAPI.copyDraft).toHaveBeenCalledWith('mockDraftId', 'new title', false)
261+
})
262+
})
263+
264+
test('copyModuleReadOnly calls copyDraft api', () => {
265+
expect.hasAssertions()
266+
const model = {
267+
flatJSON: () => ({ children: [] }),
268+
children: [
269+
{
270+
get: () => CONTENT_NODE,
271+
flatJSON: () => ({ children: [] }),
272+
children: { models: [{ get: () => 'mockValue' }] }
273+
},
274+
{
275+
get: () => ASSESSMENT_NODE
276+
}
277+
]
278+
}
279+
280+
const exportToJSON = jest.fn()
281+
282+
const component = mount(
283+
<FileMenu
284+
draftId="mockDraftId"
285+
model={model}
286+
exportToJSON={exportToJSON}
287+
onSave={jest.fn()}
288+
/>
289+
)
290+
291+
EditorAPI.copyDraft.mockResolvedValueOnce({
292+
status: 'ok',
293+
value: {
294+
draftId: 'new-copy-draft-id'
295+
}
296+
})
297+
298+
return component
299+
.instance()
300+
.copyModuleReadOnly('new title')
301+
.then(() => {
302+
expect(EditorAPI.copyDraft).toHaveBeenCalledWith('mockDraftId', 'new title', true)
247303
})
248304
})
249305

packages/app/obojobo-document-engine/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"name": "obojobo-document-engine",
3-
"version": "16.0.1",
3+
"version": "17.0.0",
44
"license": "AGPL-3.0-only",
55
"description": "",
66
"engines": {
7-
"node": "^14.16.0"
7+
"node": "^18.16.0"
88
},
99
"main": "index.js",
1010
"scripts": {

packages/app/obojobo-document-engine/src/scripts/oboeditor/components/editor-app.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
margin-bottom: 10rem;
55

66
span::selection {
7-
background-color: highlight; /* stylelint-disable-line sh-waqar/declaration-use-variable */
8-
color: inherit; /* stylelint-disable-line sh-waqar/declaration-use-variable */
7+
background-color: highlight; /* stylelint-disable-line scale-unlimited/declaration-strict-value */
8+
color: inherit; /* stylelint-disable-line scale-unlimited/declaration-strict-value */
99
}
1010

1111
.draft-toolbars {

0 commit comments

Comments
 (0)