Skip to content

Commit dc73a46

Browse files
author
billy clark
committed
Merge branch 'develop'
2 parents 96fc4bf + c92fca0 commit dc73a46

35 files changed

+466
-947
lines changed

Makefile

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,24 @@ dev: start
1212
.PHONY: playwright-tests-ci
1313
playwright-tests-ci:
1414
npm ci
15-
$(MAKE) playwright-tests
15+
$(MAKE) playwright-app
16+
npx playwright install chromium && npx playwright test
1617

1718
.PHONY: playwright-tests
1819
playwright-tests:
1920
npm install
21+
$(MAKE) playwright-app
22+
docker compose up -d ui-builder
23+
npx playwright install chromium && npx playwright test $(params)
2024

21-
# stop any containers that are running
22-
docker compose down
23-
25+
.PHONY: playwright-app
26+
playwright-app:
2427
# delete any cached session storage state files if the service isn't running
2528
docker compose ps app-for-playwright > /dev/null 2>&1 || rm -f *-storageState.json
26-
2729
docker compose up -d app-for-playwright
28-
2930
# wait until the app-for-playwright service is serving up HTTP before continuing
3031
until curl localhost:3238 > /dev/null 2>&1; do sleep 1; done
3132

32-
npx playwright install chromium && npx playwright test $(params)
33-
3433
.PHONY: e2e-tests
3534
e2e-tests:
3635
docker compose build app-for-e2e test-e2e

docker-compose.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,10 @@ services:
325325
volumes:
326326
- ./test/e2e/utils/TestControl.php:/var/www/src/Api/Service/TestControl.php
327327
- ./test/e2e/shared-files:/tmp/e2e-shared-files
328+
- lf-ui-dist:/var/www/html/dist
329+
330+
# needed this volume mapping so changes to partials would be reflected in running app (e.g. HTML)
331+
- ./src/angular-app:/var/www/src/angular-app
328332

329333
test-php:
330334
build:

playwright.config.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,17 @@ const config: PlaywrightTestConfig = {
2626
/* Global setup for things like logging in users and saving login cookies */
2727
globalSetup: require.resolve('./test/e2e/utils/globalSetup'),
2828
/* Retry on CI only */
29-
retries: process.env.CI ? 2 : 0,
29+
retries: process.env.CI ? 1 : 0,
3030
/* Opt out of parallel tests on CI. */
3131
workers: process.env.CI ? 1 : 1,
3232
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
3333
outputDir: 'test-results', // referenced in pull-request.yml
34-
reporter: process.env.CI ? [['github'], ['list']] : [['html', {outputFolder: 'test-results/_html-report'}]],
34+
reporter: process.env.CI
35+
? [['github'], ['list']]
36+
// Putting the HTML report in a subdirectory of the main output directory results in a warning log
37+
// stating that it will "lead to artifact loss" but the warning in this case is not accurate
38+
// npx playwright show-report test-results/_html-report
39+
: [['html', {outputFolder: 'test-results/_html-report', open: 'never'}]],
3540
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
3641
use: {
3742
/* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */
@@ -101,7 +106,7 @@ const config: PlaywrightTestConfig = {
101106

102107
/* Run your local dev server before starting the tests */
103108
webServer: {
104-
command: 'docker compose up app-for-playwright',
109+
command: 'make playwright-app',
105110
port: 3238,
106111
timeout: 15 * 1000,
107112
reuseExistingServer: true,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public static function uploadAudioFile($projectId, $mediaType, $tmpFilePath)
9898

9999
$extensionlessFileName = substr($fileName, 0, strrpos($fileName, strtolower($fileExt)));
100100
$fileName = "$extensionlessFileName.webm"; //$fileName ->> the converted file
101-
`ffmpeg -i $tmpFilePath -acodec opus $fileName 2> /dev/null`; //original file is at the tmpFilePath. convert that file and save it to be $fileName
101+
`ffmpeg -i $tmpFilePath -c:a libopus $fileName 2> /dev/null`; //original file is at the tmpFilePath. convert that file and save it to be $fileName
102102
$filePath = self::mediaFilePath($folderPath, $fileNamePrefix, $fileName);
103103
$moveOk = copy($fileName, $filePath);
104104

src/angular-app/languageforge/lexicon/settings/configuration/configuration-fields.component.html

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -106,26 +106,22 @@
106106
</tr>
107107
<tr style="background-color: initial">
108108
<td></td>
109-
<th class="text-left align-middle">
110-
<button type="button" class="btn btn-std" data-ng-click="$ctrl.fccAddInputSystem()"
111-
id="add-input-system-btn" title="Add an Input System">
112-
<i class="fa fa-plus"></i>
113-
</button>
114-
</th>
115-
<td colspan="6"></td>
116-
<!--suppress JSUnusedLocalSymbols -->
117-
<td data-ng-repeat="group in $ctrl.unifiedViewModel.inputSystems.selectAllColumns.groups"></td>
118-
<td></td>
119-
</tr>
120-
<tr style="background-color: initial; height: 2rem">
121-
<td></td>
122-
<th></th>
123109
<td colspan="6"></td>
124110
<!--suppress JSUnusedLocalSymbols -->
125111
<td data-ng-repeat="group in $ctrl.unifiedViewModel.inputSystems.selectAllColumns.groups"></td>
126112
<td></td>
127113
</tr>
128114
</tbody>
115+
<tr style="background-color: initial; height: 4rem">
116+
<td></td>
117+
<th class="text-left align-top">
118+
<small>To add input systems, please use FieldWorks (FLEx).</small>
119+
</th>
120+
<td colspan="6"></td>
121+
<!--suppress JSUnusedLocalSymbols -->
122+
<td data-ng-repeat="group in $ctrl.unifiedViewModel.entryFields.selectAllColumns.groups"></td>
123+
<td></td>
124+
</tr>
129125
<tbody drag-to-reorder-bind="$ctrl.unifiedViewModel.entryFields.settings">
130126
<tr class="table-secondary" id="entry-header">
131127
<th class="text-center align-top"></th>

src/angular-app/languageforge/lexicon/settings/configuration/configuration-input-systems.component.html

Lines changed: 20 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
1+
<div style="padding: 10px">
2+
<small>To add input systems, please use FieldWorks (FLEx).</small>
3+
</div>
14
<div class="row">
25
<!-- Left column: input system list -->
36
<div class="col-md-3">
4-
<!-- control buttons -->
5-
<div class="form-group">
6-
<button class="btn btn-sm btn-primary" id="configuration-new-btn" data-ng-click="$ctrl.openNewLanguageModal($ctrl.suggestedLanguageCodes)">
7-
<i class="fa fa-plus iconPadding"></i>New</button>
8-
</div>
9-
107
<!-- picklist -->
118
<dl class="picklists" style="height: 300px; overflow: auto;">
129
<dt>Language Names</dt>
@@ -25,30 +22,6 @@
2522

2623
<!-- Right column: input system setup -->
2724
<div class="col-md-9 settings-panel">
28-
<!-- control buttons -->
29-
<div uib-dropdown class="dropdown form-group btn-group">
30-
<button uib-dropdown-toggle class="btn btn-sm btn-std pui-no-caret" id="configuration-dropdown-btn"><i class="fa fa-ellipsis-v"></i></button>
31-
<div class="dropdown-menu" uib-dropdown-menu>
32-
<a href class="dropdown-item" id="configuration-add-ipa-btn" tabindex="-1" data-ng-class="{disabled: $ctrl.newExists($ctrl.selects.special.optionsOrder[1])}"
33-
data-ng-click="$ctrl.addInputSystem($ctrl.iscInputSystemViewModels[$ctrl.selectedInputSystemId].language, $ctrl.iscInputSystemViewModels[$ctrl.selectedInputSystemId].inputSystem.languageName, $ctrl.selects.special.optionsOrder[1])">
34-
<i class="fa fa-plus"></i> Add IPA for
35-
<span class="notranslate">{{$ctrl.iscInputSystemViewModels[$ctrl.selectedInputSystemId].inputSystem.languageName}}</span></a>
36-
<a href class="dropdown-item" id="configuration-add-voice-btn" tabindex="-1" data-ng-class="{disabled: $ctrl.newExists($ctrl.selects.special.optionsOrder[2])}"
37-
data-ng-click="$ctrl.addInputSystem($ctrl.iscInputSystemViewModels[$ctrl.selectedInputSystemId].language, $ctrl.iscInputSystemViewModels[$ctrl.selectedInputSystemId].inputSystem.languageName, $ctrl.selects.special.optionsOrder[2])">
38-
<i class="fa fa-plus"></i> Add Voice for
39-
<span class="notranslate">{{$ctrl.iscInputSystemViewModels[$ctrl.selectedInputSystemId].inputSystem.languageName}}</span></a>
40-
<a href class="dropdown-item" id="configuration-add-variant-btn" tabindex="-1"
41-
data-ng-click="$ctrl.addInputSystem($ctrl.iscInputSystemViewModels[$ctrl.selectedInputSystemId].language, $ctrl.iscInputSystemViewModels[$ctrl.selectedInputSystemId].inputSystem.languageName, $ctrl.selects.special.optionsOrder[3])">
42-
<i class="fa fa-plus"></i> Add a variant of
43-
<span class="notranslate">{{$ctrl.iscInputSystemViewModels[$ctrl.selectedInputSystemId].inputSystem.languageName}}</span></a>
44-
<div class="dropdown-divider" data-ng-show="! $ctrl.isInputSystemInUse()"></div>
45-
<a href class="dropdown-item" id="configuration-remove-btn" data-ng-show="! $ctrl.isInputSystemInUse()" tabindex="-1"
46-
data-ng-click="$ctrl.removeInputSystem($ctrl.selectedInputSystemId)">
47-
<i class="fa fa-trash"></i> Remove
48-
<span class="notranslate">{{$ctrl.iscInputSystemViewModels[$ctrl.selectedInputSystemId].languageDisplayName()}}</span></a>
49-
</div>
50-
</div>
51-
5225
<!-- settings -->
5326
<div class="card card-body bg-light" data-ng-show="$ctrl.iscInputSystemViewModels[$ctrl.selectedInputSystemId]">
5427
<label class="col-form-label float-right">{{$ctrl.iscInputSystemViewModels[$ctrl.selectedInputSystemId].inputSystem.tag}}</label>
@@ -57,7 +30,7 @@ <h3 data-ng-show="!$ctrl.isUnlistedLanguage($ctrl.iscInputSystemViewModels[$ctrl
5730
{{$ctrl.iscInputSystemViewModels[$ctrl.selectedInputSystemId].languageDisplayName()}}</h3>
5831
<!-- unlisted language name -->
5932
<!--suppress HtmlFormInputWithoutLabel -->
60-
<input type="text" id="languageName" style="font-size: 1.35em; color: black; font-weight: 700; border: 0; height: 32px; width: 365px"
33+
<input type="text" id="languageName" style="font-size: 1.35em; color: black; font-weight: 700; height: 32px; width: 365px"
6134
data-ng-model="$ctrl.iscInputSystemViewModels[$ctrl.selectedInputSystemId].inputSystem.languageName"
6235
data-ng-show="$ctrl.isUnlistedLanguage($ctrl.iscInputSystemViewModels[$ctrl.selectedInputSystemId].language)">
6336
<div class="form-group">
@@ -80,16 +53,16 @@ <h3 data-ng-show="!$ctrl.isUnlistedLanguage($ctrl.iscInputSystemViewModels[$ctrl
8053
</div>
8154
<br>
8255
<p class="text-warning" data-ng-show="$ctrl.isInputSystemInUse()">
83-
<small>Some settings are disabled because the Input System may already be in use.</small>
56+
<small>Some settings are disabled. Please edit these in Fieldworks (FLEx).</small>
8457
</p>
8558
<div class="form-group">
8659
<label class="col-form-label" for="special">Special</label>
8760
<div class="controls">
88-
<select class="form-control custom-select" id="special"
61+
<input type="text" class="form-control" id="special"
8962
data-ng-model="$ctrl.iscInputSystemViewModels[$ctrl.selectedInputSystemId].special"
90-
data-ng-disabled="$ctrl.isInputSystemInUse()"
9163
data-ng-change="$ctrl.specialChanged($ctrl.iscInputSystemViewModels[$ctrl.selectedInputSystemId].special)"
92-
data-ng-options="$ctrl.selects.special.options[key] for key in $ctrl.selects.special.optionsOrder"></select>
64+
disabled>
65+
</input>
9366
</div>
9467
</div>
9568

@@ -98,18 +71,17 @@ <h3 data-ng-show="!$ctrl.isUnlistedLanguage($ctrl.iscInputSystemViewModels[$ctrl
9871
<div class="form-group" data-ng-show="$ctrl.iscInputSystemViewModels[$ctrl.selectedInputSystemId].special == $ctrl.selects.special.optionsOrder[1]">
9972
<label class="col-form-label" for="purpose">Purpose</label>
10073
<div class="controls">
101-
<select class="form-control custom-select" id="purpose"
74+
<input type="text" class="form-control" id="purpose"
10275
data-ng-model="$ctrl.iscInputSystemViewModels[$ctrl.selectedInputSystemId].purpose"
103-
data-ng-disabled="$ctrl.isInputSystemInUse()"
104-
data-ng-options="$ctrl.selects.purpose.options[key] for key in $ctrl.selects.purpose.optionsOrder">
105-
<option value="">unspecified</option></select>
76+
disabled>
77+
</input>
10678
</div>
10779
<label class="col-form-label" for="ipaVariant">Variant (limited to letters or numbers, no spaces)</label>
10880
<div class="controls">
10981
<input type="text" class="form-control" id="ipaVariant" size="25"
11082
model-transform-limit="35" model-transform-no-space data-ng-trim="false"
11183
data-ng-model="$ctrl.iscInputSystemViewModels[$ctrl.selectedInputSystemId].variantString"
112-
data-ng-disabled="$ctrl.isInputSystemInUse()">
84+
disabled>
11385
</div>
11486
</div>
11587
<!-- Voice -->
@@ -119,33 +91,31 @@ <h3 data-ng-show="!$ctrl.isUnlistedLanguage($ctrl.iscInputSystemViewModels[$ctrl
11991
<input type="text" class="form-control" id="voiceVariant" size="25"
12092
model-transform-limit="35" model-transform-no-space data-ng-trim="false"
12193
data-ng-model="$ctrl.iscInputSystemViewModels[$ctrl.selectedInputSystemId].variantString"
122-
data-ng-disabled="$ctrl.isInputSystemInUse()">
94+
disabled>
12395
</div>
12496
</div>
12597
<!-- Script / Region / Variant -->
12698
<div class="form-group" data-ng-show="$ctrl.iscInputSystemViewModels[$ctrl.selectedInputSystemId].special == $ctrl.selects.special.optionsOrder[3]">
12799
<label class="col-form-label" for="script">Script</label>
128100
<div class="controls">
129-
<select class="form-control custom-select" id="script"
101+
<input type="text" class="form-control" id="script"
130102
data-ng-model="$ctrl.iscInputSystemViewModels[$ctrl.selectedInputSystemId].script"
131-
data-ng-disabled="$ctrl.isInputSystemInUse()"
132-
data-ng-options="key as option.join(', ') for (key, option) in $ctrl.selects.script.options">
133-
<option value="">-- select a script --</option></select>
103+
disabled>
104+
</input>
134105
</div>
135106
<label class="col-form-label" for="region">Region</label>
136107
<div class="controls">
137-
<select class="form-control custom-select" id="region"
108+
<input type="text" class="form-control" id="region"
138109
data-ng-model="$ctrl.iscInputSystemViewModels[$ctrl.selectedInputSystemId].region"
139-
data-ng-disabled="$ctrl.isInputSystemInUse()"
140-
data-ng-options="key as option for (key, option) in $ctrl.selects.region.options">
141-
<option value="">-- select a region --</option></select>
110+
disabled>
111+
</input>
142112
</div>
143113
<label class="col-form-label" for="variant">Variant (limited to letters or numbers, no spaces)</label>
144114
<div class="controls">
145115
<input type="text" class="form-control" id="variant" size="25"
146116
model-transform-limit="35" model-transform-no-space data-ng-trim="false"
147117
data-ng-model="$ctrl.iscInputSystemViewModels[$ctrl.selectedInputSystemId].variantString"
148-
data-ng-disabled="$ctrl.isInputSystemInUse()">
118+
disabled>
149119
</div>
150120
</div>
151121
</div>

src/angular-app/languageforge/lexicon/settings/configuration/configuration-input-systems.component.ts

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,6 @@ export class InputSystemsConfigurationController implements angular.IController
6464
) {
6565
this.selectInputSystem(this.iscInputSystemsList[0].uuid);
6666
}
67-
68-
const addInputSystemChange = changes.iscAddInputSystem as angular.IChangesObject<boolean>;
69-
if (addInputSystemChange != null && addInputSystemChange.currentValue) {
70-
this.openNewLanguageModal(this.suggestedLanguageCodes);
71-
this.iscOnUpdate({ $event: {
72-
addInputSystem: false
73-
} });
74-
}
7567
}
7668

7769
isInputSystemInUse(): boolean {
@@ -176,34 +168,6 @@ export class InputSystemsConfigurationController implements angular.IController
176168
return (code === 'qaa');
177169
}
178170

179-
openNewLanguageModal(suggestedLanguageCodes: any): void {
180-
const modalInstance = this.$modal.open({
181-
templateUrl: '/angular-app/languageforge/lexicon/shared/select-new-language.modal.html',
182-
windowTopClass: 'modal-select-language',
183-
controller: ['$scope', '$uibModalInstance',
184-
(scope: any, $modalInstance: angular.ui.bootstrap.IModalInstanceService) => {
185-
scope.selected = {
186-
code: '',
187-
language: {}
188-
};
189-
scope.add = () => {
190-
$modalInstance.close(scope.selected);
191-
};
192-
193-
scope.close = $modalInstance.dismiss;
194-
195-
scope.suggestedLanguageCodes = suggestedLanguageCodes;
196-
}
197-
]
198-
});
199-
200-
modalInstance.result.then((selected: any) => {
201-
this.addInputSystem(selected.code, selected.language.name,
202-
this.selects.special.optionsOrder[0]);
203-
}, () => { });
204-
205-
}
206-
207171
}
208172

209173
export const InputSystemsConfigurationComponent: angular.IComponentOptions = {

src/angular-app/languageforge/lexicon/settings/project-settings.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
</div>
2828
<div class="form-group row">
2929
<label class="col-form-label col-12">Project Owner</label>
30-
<div id="e2e-test-project-owner" class="controls col-12 notranslate">
30+
<div data-testid="e2e-test-project-owner" class="controls col-12 notranslate">
3131
{{$ctrl.project.ownerRef.username}}
3232
</div>
3333
</div>

test/app/languageforge/lexicon-traversal.e2e-spec.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@ describe('Lexicon E2E Page Traversal', () => {
2424
await configurationPage.tabs.unified.click();
2525
await configurationPage.unifiedPane.inputSystem.addGroupButton.click();
2626
await browser.$('body').sendKeys(protractor.Key.ESCAPE);
27-
await browser.wait(
28-
ExpectedConditions.elementToBeClickable(configurationPage.unifiedPane.inputSystem.addInputSystemButton),
29-
constants.conditionTimeout);
30-
await configurationPage.unifiedPane.inputSystem.addInputSystemButton.click();
3127
await browser.$('body').sendKeys(protractor.Key.ESCAPE);
3228
await browser.wait(ExpectedConditions.elementToBeClickable(configurationPage.tabs.unified), constants.conditionTimeout);
3329
await configurationPage.tabs.unified.click();

test/app/languageforge/lexicon/settings/config-fields.e2e-spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ describe('Lexicon E2E Configuration Fields', () => {
4545
expect<any>(await configPage.applyButton.isDisplayed()).toBe(true);
4646
expect<any>(await configPage.applyButton.isEnabled()).toBe(false);
4747
await configPage.tabs.unified.click();
48-
expect<any>(await configPage.unifiedPane.inputSystem.addInputSystemButton.isDisplayed()).toBe(true);
4948
});
5049

5150
it('check Apply button is enabled on changes', async () => {

0 commit comments

Comments
 (0)