Skip to content

Commit 699c82c

Browse files
author
billy clark
committed
Merge branch 'develop'
2 parents d5d32ad + 8a13be3 commit 699c82c

27 files changed

+855
-142
lines changed

docker/deployment/db-deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ spec:
4949
spec:
5050
containers:
5151
- name: db
52-
image: mongo:4.0
52+
image: mongo:4.2
5353
# https://kubernetes.io/docs/concepts/configuration/manage-resources-containers
5454
resources:
5555
requests:

docker/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ services:
193193
command: sh -c "postconf -e 'default_transport = retry:no outbound email allowed' && /run.sh"
194194

195195
db:
196-
image: mongo:4.0
196+
image: mongo:4.2
197197
container_name: lf-db
198198
ports:
199199
# exposed this to host for admin tools

docker/ssl/Caddyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# https://caddyserver.com/docs/caddyfile
22
{
33
#debug
4-
#auto_https disable_redirects
4+
auto_https disable_redirects
55
}
66

77
localhost {

docs/DEVELOPER.md

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Welcome! We're glad that you are interested in helping develop Language Forge.
66
- [Supported Development Environments](#supported-development-environments)
77
- [Project Setup](#project-setup)
88
- [Running the App Locally](#running-the-app-locally)
9+
- [Mobile Device Testing on a Branch](#mobile-device-testing-on-a-branch)
910
- [Tests](#tests)
1011
- [Running Playwright E2E Tests](#running-playwright-e2e-tests)
1112
- [Running Protractor E2E Tests](#running-protractor-e2e-tests)
@@ -53,19 +54,36 @@ On Windows, the project should be opened with the [Remote - WSL](https://marketp
5354
1. You should see a landing page, click "Login"
5455
1. Use `admin` and `password` to login
5556

56-
> Sometimes there may be a need to hit the locally running app from a device other than the machine the app is running on. In order to do that, you'll need to do the following:
57-
> 1. Figure out your local ip address
58-
> 1. Access the app via http at that address
59-
>
60-
> On a Mac for example:
61-
> ```
62-
> ifconfig | grep broadcast
63-
> inet 192.168.161.99 netmask 0xfffffc00 broadcast 192.168.163.255
64-
> ```
65-
>
66-
> then hit `http://192.168.161.99` from your phone or other device on the same network.
67-
>
68-
> NOTE: disabling cache on your device may not be trivial, you'll either need to wipe the site settings on your device's browser or you'll need to do it via USB debugging.
57+
Note: The application is accessible via HTTP or HTTPS. HTTPS is required for service-worker functionality.
58+
59+
### Mobile device testing on a branch ###
60+
61+
Sometimes there may be a need to hit the locally running app from a device other than the machine the app is running on. In order to do that, you'll need to do the following:
62+
### If your machine's firewall is already configured for external access e.g. you use Docker Desktop ###
63+
64+
1. Figure out your local ip address
65+
1. Access the app via http at that address
66+
67+
On a Mac for example:
68+
```
69+
ifconfig | grep broadcast
70+
inet 192.168.161.99 netmask 0xfffffc00 broadcast 192.168.163.255
71+
```
72+
73+
then hit `http://192.168.161.99` from your phone or other device on the same network.
74+
75+
NOTE: disabling cache on your device may not be trivial, you'll either need to wipe the site settings on your device's browser or you'll need to do it via USB debugging.
76+
77+
### If your machine's firewall is not configured for external port 80/443 access, you can use ngrok ###
78+
79+
[Here](https://gist.github.com/SalahHamza/799cac56b8c2cd20e6bfeb8886f18455) are instructions for installing ngrok on WSL (Linux Subsystem for Windows).
80+
[Here](https://ngrok.com/download) are instructions for installing ngrok on Windows, Mac OS, Linux, or Docker.
81+
82+
Once ngrok is installed, run:
83+
`./ngrok http http://localhost`
84+
in a bash terminal. The same command with https://localhost may not work, so be careful to try http://localhost in particular.
85+
86+
ngrok will return two URLs, one http and one https, that contain what is being served in localhost. Test on another device using one or both of these URLs.
6987

7088
## Tests
7189

src/Api/Model/Languageforge/Lexicon/Command/LexUploadCommands.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ public static function uploadAudioFile($projectId, $mediaType, $tmpFilePath)
117117
$filePath = self::mediaFilePath($folderPath, $fileNamePrefix, $fileName);
118118
$moveOk = copy($fileName, $filePath);
119119

120+
120121
//unlink the converted file from its temporary location
121122
@unlink($fileName);
122123

@@ -130,6 +131,7 @@ public static function uploadAudioFile($projectId, $mediaType, $tmpFilePath)
130131
$data = new MediaResult();
131132
$data->path = $project->getAudioFolderPath($project->getAssetsRelativePath());
132133
$data->fileName = $fileNamePrefix . '_' . $fileName; //if the file has been converted, $fileName = converted file
134+
$data->fileSize = filesize($filePath);
133135
$response->result = true;
134136

135137
//If this audio upload is replacing old audio, the previous file(s) for the entry are deleted from the assets
@@ -226,6 +228,7 @@ public static function uploadImageFile($projectId, $mediaType, $tmpFilePath)
226228
$data = new MediaResult();
227229
$data->path = $project->getImageFolderPath($project->getAssetsRelativePath());
228230
$data->fileName = $fileNamePrefix . '_' . $fileName;
231+
$data->fileSize = filesize($filePath);
229232
$response->result = true;
230233
} else {
231234
$data = new ErrorResult();

src/angular-app/bellows/shared/sound-player.component.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,13 @@ export class SoundController implements angular.IController {
1616

1717
$onInit(): void {
1818

19-
2019
this.slider = this.$element.find('.seek-slider').get(0) as HTMLInputElement;
2120

21+
//So that duration appears immediately once it is available
22+
this.audioElement.addEventListener('durationchange', () => {
23+
this.$scope.$apply();
24+
});
25+
2226
this.audioElement.addEventListener('ended', () => {
2327
this.$scope.$apply(() => {
2428
if (this.playing) {

src/angular-app/languageforge/lexicon/editor/field/dc-audio.component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ export class FieldAudioController implements angular.IController {
115115
this.dcFilename = response.data.data.fileName;
116116
this.showAudioUpload = false;
117117
this.notice.push(this.notice.SUCCESS, 'File uploaded successfully.');
118+
if(response.data.data.fileSize > 1000000){ //1 MB file size limit 2022-10
119+
this.notice.push(this.notice.WARN, 'WARNING: Because the audio file - ' + response.data.data.fileName + ' - is larger than 1 MB, it will not be synced with FLEx.');
120+
}
118121
} else {
119122
this.notice.push(this.notice.ERROR, response.data.data.errorMessage);
120123
}

src/angular-app/languageforge/lexicon/editor/field/dc-picture.component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ export class FieldPictureController implements angular.IController {
113113
if (isUploadSuccess) {
114114
this.upload.progress = 100.0;
115115
this.addPicture(response.data.data.fileName);
116+
if(response.data.data.fileSize > 1000000){ //1 MB file size limit 2022-10
117+
this.notice.push(this.notice.WARN, 'WARNING: Because the image file - ' + response.data.data.fileName + ' - is larger than 1 MB, it will not be synced with FLEx.');
118+
}
116119
this.upload.showAddPicture = false;
117120
} else {
118121
this.upload.progress = 0;

test/e2e/change-password.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ test.describe('E2E Change Password app', () => {
5858
const loginPage = new LoginPage(page);
5959
await loginPage.loginAs(member.username, newPassword);
6060
const pageHeader = new PageHeader(page);
61-
await expect (pageHeader.myProjects.button).toBeVisible();
61+
await expect(pageHeader.myProjects.button).toBeVisible(); // TODO: is flaky, fix it
6262
});
6363

6464
});

0 commit comments

Comments
 (0)