From 85532f32b44f0338e5a593e2d9e2a4fa685f761f Mon Sep 17 00:00:00 2001 From: laineyhm <56163492+laineyhm@users.noreply.github.com> Date: Tue, 4 Oct 2022 01:51:06 +0700 Subject: [PATCH 1/6] removes red circle from tab after stopping recorder (#1501) --- .../shared/audio-recorder/audio-recorder.component.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/angular-app/bellows/shared/audio-recorder/audio-recorder.component.ts b/src/angular-app/bellows/shared/audio-recorder/audio-recorder.component.ts index ac268dab40..6979288214 100644 --- a/src/angular-app/bellows/shared/audio-recorder/audio-recorder.component.ts +++ b/src/angular-app/bellows/shared/audio-recorder/audio-recorder.component.ts @@ -55,6 +55,16 @@ export class AudioRecorderController implements angular.IController { } ); + //Stopping the media stream tracks releases the red recording indicator from browser tabs + this.mediaRecorder.addEventListener("stop", + () => { + stream.getTracks().forEach(function(track) { + track.stop(); + }); + } + ); + + this.recordingStartTime = new Date(); this.interval = this.$interval(() => { From f3e271fc3d4ecd1b2bbd88338c5c1dbb0723aced Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Oct 2022 15:17:14 -0400 Subject: [PATCH 2/6] Bump twig/twig from 2.14.11 to 2.15.3 in /src (#1498) Bumps [twig/twig](https://github.com/twigphp/Twig) from 2.14.11 to 2.15.3. - [Release notes](https://github.com/twigphp/Twig/releases) - [Changelog](https://github.com/twigphp/Twig/blob/v2.15.3/CHANGELOG) - [Commits](https://github.com/twigphp/Twig/compare/v2.14.11...v2.15.3) --- updated-dependencies: - dependency-name: twig/twig dependency-type: direct:production ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: billy clark --- src/composer.lock | 187 +++++----------------------------------------- 1 file changed, 19 insertions(+), 168 deletions(-) diff --git a/src/composer.lock b/src/composer.lock index a7c3593f9e..9c3179cca4 100644 --- a/src/composer.lock +++ b/src/composer.lock @@ -4,65 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "52725ec675f45fb8446057c9c73d3054", + "content-hash": "6edb83437f5571b479ab692fc1bb5b0c", "packages": [ - { - "name": "aptoma/twig-markdown", - "version": "3.2.0", - "source": { - "type": "git", - "url": "https://github.com/aptoma/twig-markdown.git", - "reference": "496ec52657ead7c7e816a8702da26c3cc2e0990c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/aptoma/twig-markdown/zipball/496ec52657ead7c7e816a8702da26c3cc2e0990c", - "reference": "496ec52657ead7c7e816a8702da26c3cc2e0990c", - "shasum": "" - }, - "require": { - "php": "^7.0", - "twig/twig": "^2.7.0" - }, - "require-dev": { - "codeclimate/php-test-reporter": "dev-master", - "erusev/parsedown": "^1.6", - "knplabs/github-api": "~1.4", - "league/commonmark": "~0.5", - "michelf/php-markdown": "~1", - "phpunit/phpunit": "~6.0||~5.0" - }, - "suggest": { - "knplabs/github-api": "Needed for using GitHub's Markdown engine provided through their API.", - "michelf/php-markdown": "Original Markdown engine with MarkdownExtra." - }, - "type": "library", - "autoload": { - "psr-0": { - "Aptoma": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Joris Berthelot", - "email": "joris@berthelot.tel" - }, - { - "name": "Gunnar Lium", - "email": "gunnar@aptoma.com" - } - ], - "description": "Twig extension to work with Markdown content", - "keywords": [ - "markdown", - "twig" - ], - "time": "2019-05-24T07:47:05+00:00" - }, { "name": "firebase/php-jwt", "version": "v5.2.1", @@ -422,52 +365,6 @@ ], "time": "2022-06-20T21:43:03+00:00" }, - { - "name": "ircmaxell/password-compat", - "version": "v1.0.4", - "source": { - "type": "git", - "url": "https://github.com/ircmaxell/password_compat.git", - "reference": "5c5cde8822a69545767f7c7f3058cb15ff84614c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ircmaxell/password_compat/zipball/5c5cde8822a69545767f7c7f3058cb15ff84614c", - "reference": "5c5cde8822a69545767f7c7f3058cb15ff84614c", - "shasum": "" - }, - "require-dev": { - "phpunit/phpunit": "4.*" - }, - "type": "library", - "autoload": { - "files": [ - "lib/password.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Anthony Ferrara", - "email": "ircmaxell@php.net", - "homepage": "http://blog.ircmaxell.com" - } - ], - "description": "A compatibility library for the proposed simplified password hashing algorithm: https://wiki.php.net/rfc/password_hash", - "homepage": "https://github.com/ircmaxell/password_compat", - "keywords": [ - "hashing", - "password" - ], - "support": { - "issues": "https://github.com/ircmaxell/password_compat/issues", - "source": "https://github.com/ircmaxell/password_compat/tree/v1.0" - }, - "time": "2014-11-20T16:49:30+00:00" - }, { "name": "league/oauth2-client", "version": "2.4.1", @@ -682,52 +579,6 @@ ], "time": "2016-06-06T21:45:43+00:00" }, - { - "name": "michelf/php-markdown", - "version": "1.8.0", - "source": { - "type": "git", - "url": "https://github.com/michelf/php-markdown.git", - "reference": "01ab082b355bf188d907b9929cd99b2923053495" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/michelf/php-markdown/zipball/01ab082b355bf188d907b9929cd99b2923053495", - "reference": "01ab082b355bf188d907b9929cd99b2923053495", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Michelf\\": "Michelf/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Michel Fortin", - "email": "michel.fortin@michelf.ca", - "homepage": "https://michelf.ca/", - "role": "Developer" - }, - { - "name": "John Gruber", - "homepage": "https://daringfireball.net/" - } - ], - "description": "PHP Markdown", - "homepage": "https://michelf.ca/projects/php-markdown/", - "keywords": [ - "markdown" - ], - "time": "2018-01-15T00:49:33+00:00" - }, { "name": "mongodb/mongodb", "version": "1.4.3", @@ -1621,16 +1472,16 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.24.0", + "version": "v1.26.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "30885182c981ab175d4d034db0f6f469898070ab" + "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/30885182c981ab175d4d034db0f6f469898070ab", - "reference": "30885182c981ab175d4d034db0f6f469898070ab", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4", + "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4", "shasum": "" }, "require": { @@ -1645,7 +1496,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.26-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1653,12 +1504,12 @@ } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - }, "files": [ "bootstrap.php" - ] + ], + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1683,7 +1534,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.24.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.26.0" }, "funding": [ { @@ -1699,7 +1550,7 @@ "type": "tidelift" } ], - "time": "2021-10-20T20:35:02+00:00" + "time": "2022-05-24T11:49:31+00:00" }, { "name": "symfony/polyfill-intl-idn", @@ -2765,16 +2616,16 @@ }, { "name": "twig/twig", - "version": "v2.14.11", + "version": "v2.15.3", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "66baa66f29ee30e487e05f1679903e36eb01d727" + "reference": "ab402673db8746cb3a4c46f3869d6253699f614a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/66baa66f29ee30e487e05f1679903e36eb01d727", - "reference": "66baa66f29ee30e487e05f1679903e36eb01d727", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/ab402673db8746cb3a4c46f3869d6253699f614a", + "reference": "ab402673db8746cb3a4c46f3869d6253699f614a", "shasum": "" }, "require": { @@ -2790,7 +2641,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.14-dev" + "dev-master": "2.15-dev" } }, "autoload": { @@ -2829,7 +2680,7 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v2.14.11" + "source": "https://github.com/twigphp/Twig/tree/v2.15.3" }, "funding": [ { @@ -2841,7 +2692,7 @@ "type": "tidelift" } ], - "time": "2022-02-04T06:57:25+00:00" + "time": "2022-09-28T08:40:08+00:00" }, { "name": "twilio/sdk", From 157bd750f740c607c7960dcd7fbf1cab5421de98 Mon Sep 17 00:00:00 2001 From: laineyhm <56163492+laineyhm@users.noreply.github.com> Date: Tue, 4 Oct 2022 15:16:01 +0700 Subject: [PATCH 3/6] removed other custom field dialog and related tests (#1503) We no longer need tests to exercise the 'add custom fields' dialogs. --- .../settings/config-fields.e2e-spec.ts | 65 ------------------- .../lexicon/shared/lex-modals.util.ts | 9 --- 2 files changed, 74 deletions(-) diff --git a/test/app/languageforge/lexicon/settings/config-fields.e2e-spec.ts b/test/app/languageforge/lexicon/settings/config-fields.e2e-spec.ts index f46b0d1b90..9af854c437 100644 --- a/test/app/languageforge/lexicon/settings/config-fields.e2e-spec.ts +++ b/test/app/languageforge/lexicon/settings/config-fields.e2e-spec.ts @@ -713,71 +713,6 @@ describe('Lexicon E2E Configuration Fields', () => { await configPage.unifiedPane.entry.rows().count().then(count => rowNumber = count); }); - it('can open the custom field modal for an entry', async () => { - await browser.wait(configPage.modal.customField.displayNameInput.isDisplayed(), 500); - expect(await configPage.modal.customField.displayNameInput.isDisplayed()).toBe(true); - expect(await configPage.modal.customField.typeDropdown.isDisplayed()).toBe(true); - expect(await configPage.modal.customField.listCodeDropdown.isPresent()).toBe(false); - }); - - it('can enter a field name', async () => { - expect(await configPage.modal.customField.fieldCodeExists.isPresent()).toBe(true); - expect(await configPage.modal.customField.fieldCodeExists.isDisplayed()).toBe(false); - await configPage.modal.customField.displayNameInput.sendKeys(customDisplayName + protractor.Key.ENTER); - expect(await configPage.modal.customField.fieldCodeExists.isDisplayed()).toBe(false); - }); - - it('can enter a field type', async () => { - Utils.clickDropdownByValue(await configPage.modal.customField.typeDropdown, 'Multi-input-system Text'); - expect(await configPage.modal.customField.fieldCodeExists.isDisplayed()).toBe(false); - }); - - it('can add custom field', async () => { - expect(await configPage.modal.customField.displayNameInput.isPresent()).toBe(false); - expect(await configPage.unifiedPane.entry.rows().count()).toEqual(rowNumber + 1); - expect(await configPage.unifiedPane.entry.rowLabelCustomInput(rowNumber).getAttribute('value')) - .toEqual(customDisplayName); - expect(await configPage.applyButton.isEnabled()).toBe(true); - }); - - it('cannot add a duplicate field name', async () => { - expect(await configPage.modal.customField.fieldCodeExists.isDisplayed()).toBe(false); - await configPage.modal.customField.displayNameInput.sendKeys(customDisplayName + protractor.Key.ENTER); - expect(await configPage.modal.customField.fieldCodeExists.isDisplayed()).toBe(true); - }); - - it('can cancel custom entry field modal', async () => { - await configPage.modal.customField.displayNameInput.sendKeys(protractor.Key.ESCAPE); - expect(await configPage.modal.customField.displayNameInput.isPresent()).toBe(false); - expect(await configPage.applyButton.isEnabled()).toBe(true); - }); - - it('can add a duplicate field name for a sense', async () => { - expect(await configPage.modal.customField.displayNameInput.getAttribute('value')).toEqual(''); - await configPage.modal.customField.displayNameInput.sendKeys(customDisplayName + protractor.Key.ENTER); - expect(await configPage.modal.customField.fieldCodeExists.isDisplayed()).toBe(false); - }); - - it('list code only shows when a list type is selected', async () => { - await Utils.clickDropdownByValue(configPage.modal.customField.typeDropdown, - 'Multi-input-system Text'); - expect(await configPage.modal.customField.listCodeDropdown.isPresent()).toBe(false); - await Utils.clickDropdownByValue(configPage.modal.customField.typeDropdown, 'Multi-option List'); - expect(await configPage.modal.customField.listCodeDropdown.isDisplayed()).toBe(true); - await Utils.clickDropdownByValue(configPage.modal.customField.typeDropdown, 'Option List'); - expect(await configPage.modal.customField.listCodeDropdown.isDisplayed()).toBe(true); - }); - - it('can enter a list code', async () => { - await Utils.clickDropdownByValue(configPage.modal.customField.listCodeDropdown, 'Part of Speech'); - }); - - it('can cancel custom sense field modal', async () => { - await configPage.modal.customField.displayNameInput.sendKeys(protractor.Key.ESCAPE); - expect(await configPage.modal.customField.displayNameInput.isPresent()).toBe(false); - expect(await configPage.applyButton.isEnabled()).toBe(true); - }); - }); }); diff --git a/test/app/languageforge/lexicon/shared/lex-modals.util.ts b/test/app/languageforge/lexicon/shared/lex-modals.util.ts index 8c07c3d756..51caf04796 100644 --- a/test/app/languageforge/lexicon/shared/lex-modals.util.ts +++ b/test/app/languageforge/lexicon/shared/lex-modals.util.ts @@ -15,13 +15,4 @@ export class LexModals { clearSearchButton: this.modalBodyDiv.element(by.className('clear-search-button')), addButton: this.modalFooterDiv.element(by.id('select-language-add-btn')) }; - - // custom field modal - customField = { - displayNameInput: element(by.id('name')), - fieldCodeExists: element(by.id('fieldCodeExists')), - levelDropdown: element(by.id('level')), - typeDropdown: element(by.id('type')), - listCodeDropdown: element(by.id('optionListCode')) - }; } From c580ba6b75172f61da52cbcf74b7af47fc154ac9 Mon Sep 17 00:00:00 2001 From: laineyhm <56163492+laineyhm@users.noreply.github.com> Date: Tue, 4 Oct 2022 16:20:57 +0700 Subject: [PATCH 4/6] On delete, remove all stored versions of the target media file (#1504) --- .../Lexicon/Command/LexUploadCommands.php | 29 +++++++++++++++---- 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/src/Api/Model/Languageforge/Lexicon/Command/LexUploadCommands.php b/src/Api/Model/Languageforge/Lexicon/Command/LexUploadCommands.php index 1ecd05ec43..5f26a83e6a 100644 --- a/src/Api/Model/Languageforge/Lexicon/Command/LexUploadCommands.php +++ b/src/Api/Model/Languageforge/Lexicon/Command/LexUploadCommands.php @@ -132,11 +132,11 @@ public static function uploadAudioFile($projectId, $mediaType, $tmpFilePath) $data->fileName = $fileNamePrefix . '_' . $fileName; //if the file has been converted, $fileName = converted file $response->result = true; - //Uncomment to ensure that only one format for each audio file is stored in the assets. We want to keep up to two formats right now (09-2022): the original and if needed, a FLEx-compatible one - // if (array_key_exists('previousFilename', $_POST)) { - // $previousFilename = $_POST['previousFilename']; - // self::deleteMediaFile($projectId, $mediaType, $previousFilename); - // } + //If this audio upload is replacing old audio, the previous file(s) for the entry are deleted from the assets + if (array_key_exists('previousFilename', $_POST)) { + $previousFilename = $_POST['previousFilename']; + self::deleteMediaFile($projectId, $mediaType, $previousFilename); + } } else { $data = new ErrorResult(); $data->errorType = 'UserMessage'; @@ -279,8 +279,16 @@ public static function deleteMediaFile($projectId, $mediaType, $fileName) { $data->errorMessage = $errorMsg; return $response; } - $filePath = $folderPath . '/' . $fileName; + + //Path to the specific file the entry points to + $filePath = "$folderPath/$fileName"; + //Put any other stored versions of the file (e.g. the same file saved in other formats) in an array + $fileNameWithoutExt = preg_replace('/\\.[^.\\s]{3,4}$/', '', $fileName); + $versionsOfTheSameFile = glob("$folderPath/$fileNameWithoutExt.*"); + if (file_exists($filePath) and ! is_dir($filePath)) { + + //Delete the file the entry points to and create the server response if (unlink($filePath)) { $data = new MediaResult(); $data->path = $folderPath; @@ -291,8 +299,17 @@ public static function deleteMediaFile($projectId, $mediaType, $fileName) { $data->errorType = 'UserMessage'; $data->errorMessage = "$fileName could not be deleted. Contact your Site Administrator."; } + + //Delete any other stored versions of the file + foreach ($versionsOfTheSameFile as $aVersionOfThisFile){ + if($aVersionOfThisFile != $filePath){ //because $filePath, the one the entry points to, was already deleted above + unlink($aVersionOfThisFile); + } + } + return $response; } + $data = new ErrorResult(); $data->errorType = 'UserMessage'; $data->errorMessage = "$fileName does not exist in this project. Contact your Site Administrator."; From f374a87e2328690c926d01920561c3f0b123549a Mon Sep 17 00:00:00 2001 From: Tim Haasdyk Date: Tue, 4 Oct 2022 13:18:21 +0200 Subject: [PATCH 5/6] Tell VS Code makefile extension where makefile is (#1510) --- .vscode/settings.json | 1 + 1 file changed, 1 insertion(+) diff --git a/.vscode/settings.json b/.vscode/settings.json index 050d2822fa..63782b0d32 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -6,4 +6,5 @@ "phpcs.composerJsonPath": "src", "php.suggest.basic": false, "git.ignoreLimitWarning": true, + "makefile.makeDirectory": "docker", } From 262bd5a8399916fb90c0a69a9399113bd8d1e559 Mon Sep 17 00:00:00 2001 From: laineyhm <56163492+laineyhm@users.noreply.github.com> Date: Wed, 5 Oct 2022 00:38:18 +0700 Subject: [PATCH 6/6] Style page-header-detail for small viewports (#1509) --- .../languageforge/theme/default/sass/_global.scss | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Site/views/languageforge/theme/default/sass/_global.scss b/src/Site/views/languageforge/theme/default/sass/_global.scss index 0924148c17..ea16605448 100644 --- a/src/Site/views/languageforge/theme/default/sass/_global.scss +++ b/src/Site/views/languageforge/theme/default/sass/_global.scss @@ -65,13 +65,17 @@ } } -// for very small devices such as iPhone 5 -@media (max-width: 350px) { +// for small and extra small devices +@include media-breakpoint-down(sm) { .btn span { display: none; } #shareBtn, #settingsBtn { padding-right: 0; + + span { + display: none; + } } } @@ -200,11 +204,15 @@ font-size: 25px; line-height: 25px; font-weight: bold; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; @include media-breakpoint-down(sm) { font-size: 18px; line-height: 18px; } } + overflow: hidden; } } .breadcrumbs {