Skip to content

Commit 4985e57

Browse files
Merge branch 'release-5.20.0'
2 parents 853ddf0 + 1aab80f commit 4985e57

463 files changed

Lines changed: 1700 additions & 63349 deletions

File tree

Some content is hidden

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

angular.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@
5656
"extractCss": true,
5757
"assets": [
5858
"src/main/webapp/site/src/assets",
59-
"src/main/webapp/site/src/favicon.ico"
59+
"src/main/webapp/site/src/favicon.ico",
60+
{ "glob": "**/*", "input": "node_modules/tinymce", "output": "/tinymce/" }
6061
],
6162
"styles": [
6263
{

custom-webpack.config.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ module.exports = {
55
plugins: [
66
new MomentLocalesPlugin({
77
localesToKeep: ['zh-cn', 'zh-tw']
8-
}),
9-
new webpack.IgnorePlugin(/^codemirror$/),
8+
})
109
]
1110
};

gulpfile.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ const newer = require('gulp-newer');
1919
const postcss = require('gulp-postcss');
2020
const print = require('gulp-print').default;
2121
const sass = require('gulp-sass');
22+
const rename = require("gulp-rename");
23+
const replace = require('gulp-replace');
2224
//const rtlscss = require('rtlcss');
2325

2426
// -----------------------------------------------------------------------------
@@ -163,6 +165,15 @@ gulp.task('update-i18n', gulp.series(function() {
163165
done();
164166
}));
165167

168+
gulp.task('rename-styles-bundle', (done) => {
169+
const statsJSON = JSON.parse(fs.readFileSync('./src/main/webapp/site/dist/stats.json'));
170+
const siteStylesPath = statsJSON.assetsByChunkName.siteStyles[0];
171+
gulp.src('./src/main/webapp/site/dist/*.js')
172+
.pipe(replace('siteStyles.css', siteStylesPath))
173+
.pipe(gulp.dest('./src/main/webapp/site/dist'));
174+
done();
175+
});
176+
166177

167178
// -----------------------------------------------------------------------------
168179
// Default task

package-lock.json

Lines changed: 156 additions & 42 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "wise",
3-
"version": "5.19.0",
3+
"version": "5.20.0",
44
"description": "Web-based Inquiry Science Environment",
55
"main": "app.js",
66
"browserslist": [
@@ -17,13 +17,13 @@
1717
"@angular/core": "^10.1.2",
1818
"@angular/flex-layout": "^10.0.0-beta.32",
1919
"@angular/forms": "^10.1.2",
20-
"@angular/localize": "~9.1.3",
2120
"@angular/material": "^10.2.1",
2221
"@angular/platform-browser": "^10.1.2",
2322
"@angular/platform-browser-dynamic": "^10.1.2",
2423
"@angular/router": "^10.1.2",
2524
"@angular/upgrade": "^10.1.2",
2625
"@stomp/stompjs": "^5.4.4",
26+
"@tinymce/tinymce-angular": "^4.2.0",
2727
"angular": "1.7.9",
2828
"angular-animate": "1.7.8",
2929
"angular-aria": "1.7.8",
@@ -34,14 +34,12 @@
3434
"angular-mocks": "1.7.8",
3535
"angular-moment": "^1.0.0-beta.6",
3636
"angular-sanitize": "1.7.8",
37-
"angular-summernote": "0.8.1",
3837
"angular-toarrayfilter": "^1.0.3",
3938
"angular-translate": "^2.18.2",
4039
"angular-translate-loader-partial": "^2.18.2",
4140
"angular-ui-router": "^1.0.25",
4241
"angular-ui-scrollpoint": "^2.1.1",
4342
"angularx-social-login": "^2.3.1",
44-
"bootstrap": "^3.1.1",
4543
"canvg": "^2.0.0",
4644
"codemirror": "5.48.2",
4745
"compute-covariance": "^1.0.1",
@@ -64,9 +62,9 @@
6462
"oclazyload": "^1.0.9",
6563
"rxjs": "^6.5.5",
6664
"sockjs-client": "^1.4.0",
67-
"summernote": "0.8.2",
6865
"svg.draggable.js": "2.2.0",
6966
"svg.js": "2.3.2",
67+
"tinymce": "^5.5.1",
7068
"tslib": "^2.0.0",
7169
"webfontloader": "^1.6.20",
7270
"xmldom": "^0.1.31",
@@ -78,6 +76,7 @@
7876
"@angular/cli": "^10.1.1",
7977
"@angular/compiler-cli": "^10.1.2",
8078
"@angular/language-service": "^10.1.2",
79+
"@angular/localize": "^10.1.2",
8180
"@babel/cli": "^7.8.4",
8281
"@babel/core": "^7.9.0",
8382
"@babel/preset-env": "^7.9.5",
@@ -101,6 +100,8 @@
101100
"gulp-newer": "^1.3.0",
102101
"gulp-postcss": "^8.0.0",
103102
"gulp-print": "^5.0.2",
103+
"gulp-rename": "^2.0.0",
104+
"gulp-replace": "^1.0.0",
104105
"gulp-sass": "^4.1.0",
105106
"gulp-sourcemaps": "^2.6.5",
106107
"html-webpack-plugin": "^3.2.0",
@@ -133,12 +134,12 @@
133134
},
134135
"scripts": {
135136
"build-dev": "node node_modules/concurrently/bin/concurrently.js \"ng build wise --watch\" \"ng test --source-map=false --karma-config src/main/webapp/site/karma.conf.js --browsers ChromeHeadlessNoSandbox\"",
136-
"build-prod": "node --max_old_space_size=4096 ./node_modules/@angular/cli/bin/ng build wise --configuration=production",
137-
"build-prod-es": "node --max_old_space_size=4096 ./node_modules/@angular/cli/bin/ng build wise --configuration=production-es",
138-
"build-prod-pt": "node --max_old_space_size=4096 ./node_modules/@angular/cli/bin/ng build wise --configuration=production-pt",
139-
"build-prod-tr": "node --max_old_space_size=4096 ./node_modules/@angular/cli/bin/ng build wise --configuration=production-tr",
140-
"build-prod-hans": "node --max_old_space_size=4096 ./node_modules/@angular/cli/bin/ng build wise --configuration=production-zh-Hans",
141-
"build-prod-hant": "node --max_old_space_size=4096 ./node_modules/@angular/cli/bin/ng build wise --configuration=production-zh-Hant",
137+
"build-prod": "node --max_old_space_size=4096 ./node_modules/@angular/cli/bin/ng build wise --configuration=production; gulp rename-styles-bundle",
138+
"build-prod-es": "node --max_old_space_size=4096 ./node_modules/@angular/cli/bin/ng build wise --configuration=production-es; gulp rename-styles-bundle",
139+
"build-prod-pt": "node --max_old_space_size=4096 ./node_modules/@angular/cli/bin/ng build wise --configuration=production-pt; gulp rename-styles-bundle",
140+
"build-prod-tr": "node --max_old_space_size=4096 ./node_modules/@angular/cli/bin/ng build wise --configuration=production-tr; gulp rename-styles-bundle",
141+
"build-prod-hans": "node --max_old_space_size=4096 ./node_modules/@angular/cli/bin/ng build wise --configuration=production-zh-Hans; gulp rename-styles-bundle",
142+
"build-prod-hant": "node --max_old_space_size=4096 ./node_modules/@angular/cli/bin/ng build wise --configuration=production-zh-Hant; gulp rename-styles-bundle",
142143
"bundle-report": "node ./node_modules/webpack-bundle-analyzer/lib/bin/analyzer.js src/main/webapp/site/dist/stats.json",
143144
"watch-all-wise5": "node node_modules/concurrently/bin/concurrently.js \"node ./node_modules/gulp/bin/gulp.js\" \"npm run test-wise5-watch\"",
144145
"watch-sass": "npm rebuild node-sass && node ./node_modules/gulp/bin/gulp.js",

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
<artifactId>wise</artifactId>
3535
<packaging>war</packaging>
3636
<name>Web-based Inquiry Science Environment</name>
37-
<version>5.19.0</version>
37+
<version>5.20.0</version>
3838
<url>http://wise5.org</url>
3939
<licenses>
4040
<license>

src/main/java/org/wise/portal/spring/impl/WebConfig.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ public void addResourceHandlers(final ResourceHandlerRegistry registry) {
8383
registry.addResourceHandler("/portal/translate/**").addResourceLocations("/portal/translate/");
8484
registry.addResourceHandler("/vle/**").addResourceLocations("/vle/");
8585
registry.addResourceHandler("/wise5/**").addResourceLocations("/wise5/");
86+
registry.addResourceHandler("/tinymce/**").addResourceLocations("/site/dist/tinymce/");
8687
registry.addResourceHandler("/site/**").addResourceLocations("/site/");
8788
registry.addResourceHandler("/curriculum/**").addResourceLocations("/curriculum/");
8889
registry.addResourceHandler("/studentuploads/**").addResourceLocations("/studentuploads/");

src/main/resources/version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5.19.0
1+
5.20.0

src/main/webapp/site/src/app/common-hybrid-angular.module.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,10 @@ import { MatCheckboxModule } from '@angular/material/checkbox';
4949
import { MatSelectModule } from '@angular/material/select';
5050
import { HelpIconComponent } from '../../../wise5/themes/default/themeComponents/helpIcon/help-icon.component';
5151
import { NodeStatusIcon } from '../../../wise5/themes/default/themeComponents/nodeStatusIcon/node-status-icon.component';
52+
import { MatProgressBarModule } from '@angular/material/progress-bar';
5253
import { MomentModule } from 'ngx-moment';
54+
import { EditorModule, TINYMCE_SCRIPT_SRC } from '@tinymce/tinymce-angular';
55+
import { WiseTinymceEditorComponent } from '../../../wise5/directives/wise-tinymce-editor/wise-tinymce-editor.component';
5356

5457
@Component({template: ``})
5558
export class EmptyComponent {}
@@ -59,11 +62,13 @@ export class EmptyComponent {}
5962
EmptyComponent,
6063
HelpIconComponent,
6164
NodeIconComponent,
62-
NodeStatusIcon
65+
NodeStatusIcon,
66+
WiseTinymceEditorComponent
6367
],
6468
imports: [
6569
UpgradeModule,
6670
CommonModule,
71+
EditorModule,
6772
FlexLayoutModule,
6873
FormsModule,
6974
MatButtonModule,
@@ -74,6 +79,7 @@ export class EmptyComponent {}
7479
MatIconModule,
7580
MatInputModule,
7681
MatListModule,
82+
MatProgressBarModule,
7783
MatSelectModule,
7884
MatTooltipModule,
7985
MomentModule,
@@ -112,11 +118,13 @@ export class EmptyComponent {}
112118
SummaryService,
113119
TableService,
114120
TagService,
121+
{ provide: TINYMCE_SCRIPT_SRC, useValue: 'tinymce/tinymce.min.js' },
115122
UtilService,
116123
VLEProjectService
117124
],
118125
exports: [
119126
CommonModule,
127+
EditorModule,
120128
FlexLayoutModule,
121129
FormsModule,
122130
MatButtonModule,
@@ -127,10 +135,12 @@ export class EmptyComponent {}
127135
MatIconModule,
128136
MatInputModule,
129137
MatListModule,
138+
MatProgressBarModule,
130139
MatSelectModule,
131140
MatTooltipModule,
132141
MomentModule,
133142
NodeIconComponent,
143+
NodeStatusIcon,
134144
ReactiveFormsModule
135145
]
136146
})

src/main/webapp/site/src/app/services/projectAssetService.spec.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { TestBed, fakeAsync } from '@angular/core/testing';
1+
import { TestBed, fakeAsync, tick } from '@angular/core/testing';
22
import { ConfigService } from '../../../../wise5/services/configService';
33
import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing';
44
import { ProjectService } from '../../../../wise5/services/projectService';
@@ -50,6 +50,7 @@ describe('ProjectAssetService', () => {
5050
calculateUsedFiles();
5151
getFileNameFromURL();
5252
getTextFiles();
53+
injectFileTypeValues();
5354
});
5455

5556
function retrieveProjectAssets() {
@@ -100,6 +101,7 @@ function deleteAssetItem() {
100101
totalFileSize: 1
101102
};
102103
request.flush(response);
104+
tick();
103105
expect(service.getProjectAssets().getValue()).toEqual(response);
104106
}));
105107
}
@@ -291,3 +293,17 @@ function getTextFiles() {
291293
request2.flush(result2);
292294
}));
293295
}
296+
297+
function injectFileTypeValues() {
298+
it('should inject file type values', () => {
299+
const files: any = [
300+
{ fileName: 'spongebob.png' },
301+
{ fileName: 'squidward.mp4' },
302+
{ fileName: 'plankton.pdf' }
303+
];
304+
service.injectFileTypeValues(files);
305+
expect(files[0].fileType).toEqual('image');
306+
expect(files[1].fileType).toEqual('video');
307+
expect(files[2].fileType).toEqual('other');
308+
})
309+
}

0 commit comments

Comments
 (0)