Skip to content

Commit 7ef37cb

Browse files
authored
Merge pull request #1830 from moodlehq/integration
Integration
2 parents c6d5338 + 3c1163b commit 7ef37cb

File tree

419 files changed

+15028
-4548
lines changed

Some content is hidden

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

419 files changed

+15028
-4548
lines changed

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
Dockerfile

.gitattributes

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# This file has been retrieved from angular repository.
2+
3+
# Auto detect text files and perform LF normalization
4+
* text=auto
5+
6+
# JS and TS files must always use LF for tools to work
7+
*.js eol=lf
8+
*.ts eol=lf

.travis.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
11
sudo: required
2-
dist: trusty
2+
dist: xenial
33
group: edge
44

55
language: node_js
6-
node_js:
7-
- '8.10'
6+
node_js: stable
7+
8+
before_cache:
9+
- rm -rf $HOME/.cache/electron-builder/wine
10+
11+
cache:
12+
directories:
13+
- node_modules
14+
- $HOME/.cache/electron
15+
- $HOME/.cache/electron-builder
816

917
before_script:
1018
- npm install -g @angular/cli
1119
- npm i npm@latest -g
1220
- gulp
13-
- rm -Rf node_modules/electron-builder-squirrel-windows node_modules/electron-windows-notifications #Avoid electron fail
1421

1522
script:
1623
- npm run build

Dockerfile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# This image is based on the fat node 11 image.
2+
# We require fat images as neither alpine, or slim, include git binaries.
3+
FROM node:11
4+
5+
# Port 8100 for ionic dev server.
6+
EXPOSE 8100
7+
8+
# Port 35729 is the live-reload server.
9+
EXPOSE 35729
10+
11+
# Port 53703 is the Chrome dev logger port.
12+
EXPOSE 53703
13+
14+
# MoodleMobile uses Cordova, Ionic, and Gulp.
15+
RUN npm install -g cordova ionic gulp && rm -rf /root/.npm
16+
17+
WORKDIR /app
18+
19+
COPY . /app
20+
21+
# The setup script will handle npm installation, cordova setup, and gulp setup.
22+
RUN npm run setup && rm -rf /root/.npm
23+
24+
# Provide a Healthcheck command for easier use in CI.
25+
HEALTHCHECK --interval=10s --timeout=3s --start-period=30s CMD curl -f http://localhost:8100 || exit 1
26+
27+
CMD ["ionic", "serve", "-b"]

GoogleService-Info.plist

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>AD_UNIT_ID_FOR_BANNER_TEST</key>
6+
<string>ca-app-pub-3940256099942544/2934735716</string>
7+
<key>AD_UNIT_ID_FOR_INTERSTITIAL_TEST</key>
8+
<string>ca-app-pub-3940256099942544/4411468910</string>
9+
<key>CLIENT_ID</key>
10+
<string>694767596569-c2cjrca92k99f6nkp3363lsb7ljhdgdr.apps.googleusercontent.com</string>
11+
<key>REVERSED_CLIENT_ID</key>
12+
<string>com.googleusercontent.apps.694767596569-c2cjrca92k99f6nkp3363lsb7ljhdgdr</string>
13+
<key>API_KEY</key>
14+
<string>AIzaSyA-77ZjkxII6GV97CC9rdUl83rzdEXu_rM</string>
15+
<key>GCM_SENDER_ID</key>
16+
<string>694767596569</string>
17+
<key>PLIST_VERSION</key>
18+
<string>1</string>
19+
<key>BUNDLE_ID</key>
20+
<string>com.moodle.moodlemobile</string>
21+
<key>PROJECT_ID</key>
22+
<string>moodlemobile-push</string>
23+
<key>STORAGE_BUCKET</key>
24+
<string>moodlemobile-push.appspot.com</string>
25+
<key>IS_ADS_ENABLED</key>
26+
<true></true>
27+
<key>IS_ANALYTICS_ENABLED</key>
28+
<false></false>
29+
<key>IS_APPINVITE_ENABLED</key>
30+
<true></true>
31+
<key>IS_GCM_ENABLED</key>
32+
<true></true>
33+
<key>IS_SIGNIN_ENABLED</key>
34+
<true></true>
35+
<key>GOOGLE_APP_ID</key>
36+
<string>1:694767596569:ios:a4cdad4d168c9d1a</string>
37+
<key>DATABASE_URL</key>
38+
<string>https://moodlemobile-push.firebaseio.com</string>
39+
</dict>
40+
</plist>

config.xml

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version='1.0' encoding='utf-8'?>
2-
<widget id="com.moodle.moodlemobile" version="3.6.0" xmlns="http://www.w3.org/ns/widgets" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:cdv="http://cordova.apache.org/ns/1.0">
2+
<widget id="com.moodle.moodlemobile" version="3.6.1" xmlns="http://www.w3.org/ns/widgets" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:cdv="http://cordova.apache.org/ns/1.0">
33
<name>Moodle</name>
44
<description>Moodle official app</description>
55
<author email="[email protected]" href="http://moodle.com">Moodle Mobile team</author>
@@ -41,6 +41,7 @@
4141
<param name="ios-package" onload="true" value="CDVStatusBar" />
4242
</feature>
4343
<platform name="android">
44+
<resource-file src="google-services.json" target="app/google-services.json" />
4445
<splash qualifier="land-ldpi" src="resources/android/splash/drawable-land-ldpi-screen.png" />
4546
<splash qualifier="land-mdpi" src="resources/android/splash/drawable-land-mdpi-screen.png" />
4647
<splash qualifier="land-hdpi" src="resources/android/splash/drawable-land-hdpi-screen.png" />
@@ -59,8 +60,25 @@
5960
<icon density="xhdpi" src="resources/android/icon/drawable-xhdpi-icon.png" />
6061
<icon density="xxhdpi" src="resources/android/icon/drawable-xxhdpi-icon.png" />
6162
<icon density="xxxhdpi" src="resources/android/icon/drawable-xxxhdpi-icon.png" />
63+
<resource-file src="resources/android/icon/drawable-ldpi-smallicon.png" target="app/src/main/res/mipmap-ldpi/smallicon.png" />
64+
<resource-file src="resources/android/icon/drawable-mdpi-smallicon.png" target="app/src/main/res/mipmap-mdpi/smallicon.png" />
65+
<resource-file src="resources/android/icon/drawable-hdpi-smallicon.png" target="app/src/main/res/mipmap-hdpi/smallicon.png" />
66+
<resource-file src="resources/android/icon/drawable-xhdpi-smallicon.png" target="app/src/main/res/mipmap-xhdpi/smallicon.png" />
67+
<resource-file src="resources/android/splash/drawable-land-hdpi-screen.png" target="app/src/main/res/drawable-land-hdpi/screen.png" />
68+
<resource-file src="resources/android/splash/drawable-land-ldpi-screen.png" target="app/src/main/res/drawable-land-ldpi/screen.png" />
69+
<resource-file src="resources/android/splash/drawable-land-mdpi-screen.png" target="app/src/main/res/drawable-land-mdpi/screen.png" />
70+
<resource-file src="resources/android/splash/drawable-land-xhdpi-screen.png" target="app/src/main/res/drawable-land-xhdpi/screen.png" />
71+
<resource-file src="resources/android/splash/drawable-land-xxhdpi-screen.png" target="app/src/main/res/drawable-land-xxhdpi/screen.png" />
72+
<resource-file src="resources/android/splash/drawable-land-xxxhdpi-screen.png" target="app/src/main/res/drawable-land-xxxhdpi/screen.png" />
73+
<resource-file src="resources/android/splash/drawable-port-hdpi-screen.png" target="app/src/main/res/drawable-port-hdpi/screen.png" />
74+
<resource-file src="resources/android/splash/drawable-port-ldpi-screen.png" target="app/src/main/res/drawable-port-ldpi/screen.png" />
75+
<resource-file src="resources/android/splash/drawable-port-mdpi-screen.png" target="app/src/main/res/drawable-port-mdpi/screen.png" />
76+
<resource-file src="resources/android/splash/drawable-port-xhdpi-screen.png" target="app/src/main/res/drawable-port-xhdpi/screen.png" />
77+
<resource-file src="resources/android/splash/drawable-port-xxhdpi-screen.png" target="app/src/main/res/drawable-port-xxhdpi/screen.png" />
78+
<resource-file src="resources/android/splash/drawable-port-xxxhdpi-screen.png" target="app/src/main/res/drawable-port-xxxhdpi/screen.png" />
6279
</platform>
6380
<platform name="ios">
81+
<resource-file src="GoogleService-Info.plist" />
6482
<icon height="57" src="resources/ios/icon/icon.png" width="57" />
6583
<icon height="114" src="resources/ios/icon/[email protected]" width="114" />
6684
<icon height="40" src="resources/ios/icon/icon-40.png" width="40" />
@@ -94,7 +112,7 @@
94112
<icon height="1024" src="resources/ios/icon/icon-1024.png" width="1024" />
95113
<splash height="2732" src="resources/ios/splash/Default@2x~universal~anyany.png" width="2732" />
96114
</platform>
97-
<plugin name="com-darryncampbell-cordova-plugin-intent" spec="1.1.1" />
115+
<plugin name="com-darryncampbell-cordova-plugin-intent" spec="1.1.5" />
98116
<plugin name="cordova-android-support-gradle-release" spec="2.0.1">
99117
<variable name="ANDROID_SUPPORT_VERSION" value="27.1.0" />
100118
</plugin>
@@ -111,7 +129,7 @@
111129
<plugin name="cordova-plugin-globalization" spec="1.11.0" />
112130
<plugin name="cordova-plugin-inappbrowser" spec="3.0.0" />
113131
<plugin name="cordova-plugin-ionic-keyboard" spec="2.1.3" />
114-
<plugin name="cordova-plugin-local-notifications-mm" spec="1.0.13" />
132+
<plugin name="cordova-plugin-local-notification" spec="0.9.0-beta.3" />
115133
<plugin name="cordova-plugin-media-capture" spec="3.0.2" />
116134
<plugin name="cordova-plugin-network-information" spec="2.0.1" />
117135
<plugin name="cordova-plugin-screen-orientation" spec="3.0.1" />
@@ -121,8 +139,9 @@
121139
<plugin name="cordova-plugin-zip" spec="3.1.0" />
122140
<plugin name="cordova-sqlite-storage" spec="2.6.0" />
123141
<plugin name="nl.kingsquare.cordova.background-audio" spec="1.0.1" />
124-
<plugin name="phonegap-plugin-push" spec="https://github.com/moodlemobile/phonegap-plugin-push.git#moodle">
125-
<variable name="SENDER_ID" value="694767596569" />
142+
<plugin name="phonegap-plugin-push" spec="https://github.com/moodlemobile/phonegap-plugin-push.git#moodle-v2">
143+
<variable name="ANDROID_SUPPORT_V13_VERSION" value="27.+" />
144+
<variable name="FCM_VERSION" value="17.0.+" />
126145
</plugin>
127146
<edit-config file="AndroidManifest.xml" mode="merge" target="/manifest/application/activity[@android:name='MainActivity']">
128147
<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|screenLayout|smallestScreenSize" android:debuggable="true" />

config/copy.config.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// New copy task for font files
1+
// New copy task for font files and config.json.
22
module.exports = {
33
// Override Ionic copyFonts task to exclude Roboto and Noto fonts.
44
copyFonts: {
@@ -8,5 +8,9 @@ module.exports = {
88
copyFontAwesome: {
99
src: ['{{ROOT}}/node_modules/font-awesome/fonts/**/*'],
1010
dest: '{{WWW}}/assets/fonts'
11+
},
12+
copyConfig: {
13+
src: ['{{ROOT}}/src/config.json'],
14+
dest: '{{WWW}}/'
1115
}
1216
};

desktop/assets/windows/AppXManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<Identity Name="3312ADB7.MoodleDesktop"
77
ProcessorArchitecture="x64"
88
Publisher="CN=33CDCDF6-1EB5-4827-9897-ED25C91A32F6"
9-
Version="3.6.0.0" />
9+
Version="3.6.1.0" />
1010
<Properties>
1111
<DisplayName>Moodle Desktop</DisplayName>
1212
<PublisherDisplayName>Moodle Pty Ltd.</PublisherDisplayName>

desktop/electron.js

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,26 @@ function createWindow() {
7070
mainWindow.webContents.setUserAgent(mainWindow.webContents.getUserAgent() + ' ' + userAgent);
7171
}
7272

73+
// Make sure that only a single instance of the app is running.
74+
// For some reason, gotTheLock is always false in signed Mac apps so we should ingore it.
75+
// See https://github.com/electron/electron/issues/15958
76+
var gotTheLock = app.requestSingleInstanceLock();
77+
78+
if (!gotTheLock && os.platform().indexOf('darwin') == -1) {
79+
// It's not the main instance of the app, kill it.
80+
app.exit();
81+
return;
82+
}
83+
84+
app.on('second-instance', (event, commandLine, workingDirectory) => {
85+
// Another instance was launched. If it was launched with a URL, it should be in the second param.
86+
if (commandLine && commandLine[1]) {
87+
appLaunched(commandLine[1]);
88+
} else {
89+
focusApp();
90+
}
91+
});
92+
7393
// This method will be called when Electron has finished initialization and is ready to create browser windows.
7494
// Some APIs can only be used after this event occurs.
7595
app.on('ready', function() {
@@ -122,23 +142,6 @@ fs.readFile(path.join(__dirname, 'config.json'), 'utf8', (err, data) => {
122142
}
123143
});
124144

125-
// Make sure that only a single instance of the app is running.
126-
var shouldQuit = app.makeSingleInstance((argv, workingDirectory) => {
127-
// Another instance was launched. If it was launched with a URL, it should be in the second param.
128-
if (argv && argv[1]) {
129-
appLaunched(argv[1]);
130-
} else {
131-
focusApp();
132-
}
133-
});
134-
135-
// For some reason, shouldQuit is always true in signed Mac apps so we should ingore it.
136-
if (shouldQuit && os.platform().indexOf('darwin') == -1) {
137-
// It's not the main instance of the app, kill it.
138-
app.exit();
139-
return;
140-
}
141-
142145
// Listen for open-url events (Mac OS only).
143146
app.on('open-url', (event, url) => {
144147
event.preventDefault();

google-services.json

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"project_info": {
3+
"project_number": "694767596569",
4+
"firebase_url": "https://moodlemobile-push.firebaseio.com",
5+
"project_id": "moodlemobile-push",
6+
"storage_bucket": "moodlemobile-push.appspot.com"
7+
},
8+
"client": [
9+
{
10+
"client_info": {
11+
"mobilesdk_app_id": "1:694767596569:android:a4cdad4d168c9d1a",
12+
"android_client_info": {
13+
"package_name": "com.moodle.moodlemobile"
14+
}
15+
},
16+
"oauth_client": [
17+
{
18+
"client_id": "694767596569-icveqqa2n56oh44l6ev1dr2oh67nh8il.apps.googleusercontent.com",
19+
"client_type": 3
20+
}
21+
],
22+
"api_key": [
23+
{
24+
"current_key": "AIzaSyCb2zogu0P_aZ2LNgdwzshWExITPKTXJyk"
25+
},
26+
{
27+
"current_key": "AIzaSyDRT1HwT0gSsTty0whOVtoNKAh8SPrJXLE"
28+
}
29+
],
30+
"services": {
31+
"analytics_service": {
32+
"status": 1
33+
},
34+
"appinvite_service": {
35+
"status": 1,
36+
"other_platform_oauth_client": []
37+
},
38+
"ads_service": {
39+
"status": 2
40+
}
41+
}
42+
}
43+
],
44+
"configuration_version": "1"
45+
}

0 commit comments

Comments
 (0)