From c63d206d7b7df246502cf4e9700654aec9fd7689 Mon Sep 17 00:00:00 2001 From: billy clark Date: Thu, 16 Feb 2023 14:53:46 -0500 Subject: [PATCH 1/7] change labels to "Lexeme" and "Sense" --- .../Languageforge/Lexicon/Config/LexConfiguration.php | 4 ++-- .../Languageforge/Lexicon/LexCommentFieldReference.php | 10 ++++------ .../apps/activity/activity-container.component.ts | 4 ++-- .../lexicon/editor/field/dc-entry.component.html | 8 ++++---- .../lexicon/editor/field/dc-entry.component.ts | 4 ++-- .../lexicon/editor/field/dc-sense.component.html | 2 +- .../lexicon/editor/field/dc-sense.component.ts | 4 ++-- .../configuration/configuration-fields.component.html | 2 +- 8 files changed, 18 insertions(+), 20 deletions(-) diff --git a/src/Api/Model/Languageforge/Lexicon/Config/LexConfiguration.php b/src/Api/Model/Languageforge/Lexicon/Config/LexConfiguration.php index 9f008a94e4..21d176062b 100644 --- a/src/Api/Model/Languageforge/Lexicon/Config/LexConfiguration.php +++ b/src/Api/Model/Languageforge/Lexicon/Config/LexConfiguration.php @@ -89,11 +89,11 @@ public function __construct() $this->entry->fieldOrder[] = LexConfig::SENSES_LIST; $this->entry->fields[LexConfig::LEXEME] = new LexConfigMultiText(); - $this->entry->fields[LexConfig::LEXEME]->label = "Word"; + $this->entry->fields[LexConfig::LEXEME]->label = "Lexeme"; $this->entry->fields[LexConfig::LEXEME]->inputSystems[] = "th"; $this->entry->fields[LexConfig::SENSES_LIST] = new LexConfigFieldList(); - $this->entry->fields[LexConfig::SENSES_LIST]->label = "Meaning"; + $this->entry->fields[LexConfig::SENSES_LIST]->label = "Sense"; $this->entry->fields[LexConfig::SENSES_LIST]->fieldOrder[] = LexConfig::GLOSS; $this->entry->fields[LexConfig::SENSES_LIST]->fieldOrder[] = LexConfig::DEFINITION; $this->entry->fields[LexConfig::SENSES_LIST]->fieldOrder[] = LexConfig::PICTURES; diff --git a/src/Api/Model/Languageforge/Lexicon/LexCommentFieldReference.php b/src/Api/Model/Languageforge/Lexicon/LexCommentFieldReference.php index ab8f062cad..ec0b63c8ea 100644 --- a/src/Api/Model/Languageforge/Lexicon/LexCommentFieldReference.php +++ b/src/Api/Model/Languageforge/Lexicon/LexCommentFieldReference.php @@ -6,10 +6,10 @@ class LexCommentFieldReference extends ObjectForEncoding { - /** @var string - the field name e.g. "lexeme" */ + /** @var string */ public $field; - /** @var string - the field name for display e.g. "Word" */ + /** @var string */ public $fieldNameForDisplay; /** @var string */ @@ -21,11 +21,9 @@ class LexCommentFieldReference extends ObjectForEncoding /** @var string */ public $inputSystemAbbreviation; - // The EntryContext and SenseContext are strings storing the value of the effective "word" (the entry context) and "meaning" (the sense context) at the time the comment was made - - /** @var string - the "Word" value of the entry at comment time */ + /** @var string */ public $word; - /** @var string - the "Meaning" value of the entry at comment time */ + /** @var string */ public $meaning; } diff --git a/src/angular-app/bellows/apps/activity/activity-container.component.ts b/src/angular-app/bellows/apps/activity/activity-container.component.ts index 0722873bbe..4b46f8af92 100644 --- a/src/angular-app/bellows/apps/activity/activity-container.component.ts +++ b/src/angular-app/bellows/apps/activity/activity-container.component.ts @@ -93,7 +93,7 @@ class Activity { if (index.includes('#examples')) { label = 'Example - ' + label; } else if (index.indexOf('#examples')) { - label = 'Meaning - ' + label; + label = 'Sense - ' + label; } return label; } @@ -109,7 +109,7 @@ class Activity { label = 'Example ' + fieldLabel.example + (label !== 'examples' ? ' ' + label : ''); } if (fieldLabel.sense) { - label = 'Meaning ' + fieldLabel.sense + (label !== 'senses' ? ' ' + label : ''); + label = 'Sense ' + fieldLabel.sense + (label !== 'senses' ? ' ' + label : ''); } return label; } diff --git a/src/angular-app/languageforge/lexicon/editor/field/dc-entry.component.html b/src/angular-app/languageforge/lexicon/editor/field/dc-entry.component.html index 832a52cef0..280e41887a 100644 --- a/src/angular-app/languageforge/lexicon/editor/field/dc-entry.component.html +++ b/src/angular-app/languageforge/lexicon/editor/field/dc-entry.component.html @@ -17,9 +17,9 @@ - -
- Add Meaning + +
@@ -30,6 +30,6 @@
- Add Meaning + Add Sense
diff --git a/src/angular-app/languageforge/lexicon/editor/field/dc-entry.component.ts b/src/angular-app/languageforge/lexicon/editor/field/dc-entry.component.ts index bdcf299bcc..2a5420975e 100644 --- a/src/angular-app/languageforge/lexicon/editor/field/dc-entry.component.ts +++ b/src/angular-app/languageforge/lexicon/editor/field/dc-entry.component.ts @@ -52,10 +52,10 @@ export class FieldEntryController implements angular.IController { } deleteSense = (index: number): void => { - const deletemsg = 'Are you sure you want to delete the meaning \'' + + const deletemsg = 'Are you sure you want to delete the sense \'' + LexiconUtilityService.getMeaning(this.control.config, this.config.fields.senses as LexConfigFieldList, this.model.senses[index]) + '\'?'; - this.modal.showModalSimple('Delete Meaning', deletemsg, 'Cancel', 'Delete Meaning') + this.modal.showModalSimple('Delete Sense', deletemsg, 'Cancel', 'Delete Sense') .then(() => { // Adding or removing senses makes for a non-delta update, so save a possible delta update first this.control.saveCurrentEntry(false, () => { diff --git a/src/angular-app/languageforge/lexicon/editor/field/dc-sense.component.html b/src/angular-app/languageforge/lexicon/editor/field/dc-sense.component.html index 7201e10671..5f0672a076 100644 --- a/src/angular-app/languageforge/lexicon/editor/field/dc-sense.component.html +++ b/src/angular-app/languageforge/lexicon/editor/field/dc-sense.component.html @@ -1,7 +1,7 @@
- Meaning {{$ctrl.index+1}} + Sense {{$ctrl.index+1}} diff --git a/src/angular-app/languageforge/lexicon/editor/field/dc-sense.component.ts b/src/angular-app/languageforge/lexicon/editor/field/dc-sense.component.ts index 028c577379..2ac433e7af 100644 --- a/src/angular-app/languageforge/lexicon/editor/field/dc-sense.component.ts +++ b/src/angular-app/languageforge/lexicon/editor/field/dc-sense.component.ts @@ -30,10 +30,10 @@ export class FieldSenseController implements angular.IController { const field = this.config.fields[fieldName]; if (field.senseLabel == null) { field.senseLabel = []; - field.senseLabel[-1] = 'Meaning'; + field.senseLabel[-1] = 'Sense'; } - field.senseLabel[this.index] = 'Meaning ' + (this.index + 1); + field.senseLabel[this.index] = 'Sense ' + (this.index + 1); } } } diff --git a/src/angular-app/languageforge/lexicon/settings/configuration/configuration-fields.component.html b/src/angular-app/languageforge/lexicon/settings/configuration/configuration-fields.component.html index fcaae2d4ca..bb61da8eab 100644 --- a/src/angular-app/languageforge/lexicon/settings/configuration/configuration-fields.component.html +++ b/src/angular-app/languageforge/lexicon/settings/configuration/configuration-fields.component.html @@ -305,7 +305,7 @@ - Meaning Fields + Sense Fields Select All From 3fa60ffe2d8e49929849d13549075b730c289b34 Mon Sep 17 00:00:00 2001 From: billy clark Date: Thu, 16 Feb 2023 14:54:03 -0500 Subject: [PATCH 2/7] fix unit tests --- .../lexicon/command/LexEntryCommandsTest.php | 44 +++++++++---------- .../command/LexProjectCommandsTest.php | 2 +- .../lexicon/dto/LexBaseViewDtoTest.php | 4 +- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/test/php/model/languageforge/lexicon/command/LexEntryCommandsTest.php b/test/php/model/languageforge/lexicon/command/LexEntryCommandsTest.php index 38ddb3022b..395dfa0990 100644 --- a/test/php/model/languageforge/lexicon/command/LexEntryCommandsTest.php +++ b/test/php/model/languageforge/lexicon/command/LexEntryCommandsTest.php @@ -207,7 +207,7 @@ public function testUpdateEntry_UpdateTwice_DifferencesAreCorrect() $this->assertEquals(["oldValue.lexeme.th" => "apple", "newValue.lexeme.th" => "first edit"], $differences); $withLabels = LexEntryCommands::addFieldLabelsToDifferences($project->config, $differences); $this->assertEquals( - ["oldValue.lexeme.th" => "apple", "newValue.lexeme.th" => "first edit", "fieldLabel.lexeme.th" => "Word"], + ["oldValue.lexeme.th" => "apple", "newValue.lexeme.th" => "first edit", "fieldLabel.lexeme.th" => "Lexeme"], $withLabels ); @@ -225,7 +225,7 @@ public function testUpdateEntry_UpdateTwice_DifferencesAreCorrect() [ "oldValue.lexeme.th" => "first edit", "newValue.lexeme.th" => "second edit", - "fieldLabel.lexeme.th" => "Word", + "fieldLabel.lexeme.th" => "Lexeme", ], $withLabels ); @@ -252,7 +252,7 @@ public function testUpdateEntry_UpdateWithNull_DifferencesHasEmptyStringInsteadO $this->assertEquals(["oldValue.lexeme.th" => "apple", "newValue.lexeme.th" => ""], $differences); $withLabels = LexEntryCommands::addFieldLabelsToDifferences($project->config, $differences); $this->assertEquals( - ["oldValue.lexeme.th" => "apple", "newValue.lexeme.th" => "", "fieldLabel.lexeme.th" => "Word"], + ["oldValue.lexeme.th" => "apple", "newValue.lexeme.th" => "", "fieldLabel.lexeme.th" => "Lexeme"], $withLabels ); } @@ -292,7 +292,7 @@ public function testUpdateEntry_DeleteSense_ProducesDifferencesForTheSenseAndAll "deleted.senses@0#" . $sense->guid => "apple", "oldValue.senses@0#" . $sense->guid . ".definition.en" => "apple", "newValue.senses@0#" . $sense->guid . ".definition.en" => "", - "fieldLabel.senses@0#" . $sense->guid => "Meaning", + "fieldLabel.senses@0#" . $sense->guid => "Sense", "fieldLabel.senses@0#" . $sense->guid . ".definition.en" => "Definition", ], $withLabels @@ -340,12 +340,12 @@ public function testUpdateEntry_DeleteTwoSensesOutOfTwoTotal_ProducesTwoDeletedD "deleted.senses@0#" . $sense1->guid => "apple", "oldValue.senses@0#" . $sense1->guid . ".definition.en" => "apple", "newValue.senses@0#" . $sense1->guid . ".definition.en" => "", - "fieldLabel.senses@0#" . $sense1->guid => "Meaning", + "fieldLabel.senses@0#" . $sense1->guid => "Sense", "fieldLabel.senses@0#" . $sense1->guid . ".definition.en" => "Definition", "deleted.senses@1#" . $sense2->guid => "also an apple", "oldValue.senses@1#" . $sense2->guid . ".definition.en" => "also an apple", "newValue.senses@1#" . $sense2->guid . ".definition.en" => "", - "fieldLabel.senses@1#" . $sense2->guid => "Meaning", + "fieldLabel.senses@1#" . $sense2->guid => "Sense", "fieldLabel.senses@1#" . $sense2->guid . ".definition.en" => "Definition", ], $withLabels @@ -389,8 +389,8 @@ public function testUpdateEntry_RearrangeTwoSensesOutOfTwoTotal_ProducesTwoMoved [ "moved.senses@0#" . $sense1->guid => "1", "moved.senses@1#" . $sense2->guid => "0", - "fieldLabel.senses@0#" . $sense1->guid => "Meaning", - "fieldLabel.senses@1#" . $sense2->guid => "Meaning", + "fieldLabel.senses@0#" . $sense1->guid => "Sense", + "fieldLabel.senses@1#" . $sense2->guid => "Sense", ], $withLabels ); @@ -435,10 +435,10 @@ public function testUpdateEntry_DeleteFirstSenseOfTwo_ProducesBothDeletedAndMove "deleted.senses@0#" . $sense1->guid => "apple", "oldValue.senses@0#" . $sense1->guid . ".definition.en" => "apple", "newValue.senses@0#" . $sense1->guid . ".definition.en" => "", - "fieldLabel.senses@0#" . $sense1->guid => "Meaning", + "fieldLabel.senses@0#" . $sense1->guid => "Sense", "fieldLabel.senses@0#" . $sense1->guid . ".definition.en" => "Definition", "moved.senses@1#" . $sense2->guid => 0, - "fieldLabel.senses@1#" . $sense2->guid => "Meaning", + "fieldLabel.senses@1#" . $sense2->guid => "Sense", ], $withLabels ); @@ -482,7 +482,7 @@ public function testUpdateEntry_DeleteSecondSenseOfTwo_ProducesDeleteDifferences "deleted.senses@1#" . $sense2->guid => "also an apple", "oldValue.senses@1#" . $sense2->guid . ".definition.en" => "also an apple", "newValue.senses@1#" . $sense2->guid . ".definition.en" => "", - "fieldLabel.senses@1#" . $sense2->guid => "Meaning", + "fieldLabel.senses@1#" . $sense2->guid => "Sense", "fieldLabel.senses@1#" . $sense2->guid . ".definition.en" => "Definition", ], $withLabels @@ -541,7 +541,7 @@ public function testUpdateEntry_AddSecondSense_ProducesNewValuesForSenseFields() "newValue.senses@1#" . $sense2Guid . ".definition.fr" => "une pomme", "oldValue.senses@1#" . $sense2Guid . ".generalNote.en" => "", "newValue.senses@1#" . $sense2Guid . ".generalNote.en" => "note about the apple", - "fieldLabel.senses@1#" . $sense2Guid => "Meaning", + "fieldLabel.senses@1#" . $sense2Guid => "Sense", "fieldLabel.senses@1#" . $sense2Guid . ".definition.en" => "Definition", "fieldLabel.senses@1#" . $sense2Guid . ".definition.fr" => "Definition", "fieldLabel.senses@1#" . $sense2Guid . ".generalNote.en" => "General Note", @@ -598,7 +598,7 @@ public function testUpdateEntry_AddSenseInFirstPosition_ProducesAddedDifferenceA $this->assertEquals( [ "moved.senses@0#" . $sense2->guid => 1, - "fieldLabel.senses@0#" . $sense2->guid => "Meaning", + "fieldLabel.senses@0#" . $sense2->guid => "Sense", "added.senses@0#" . $newSenseGuid => "also an apple", "oldValue.senses@0#" . $newSenseGuid . ".definition.en" => "", "newValue.senses@0#" . $newSenseGuid . ".definition.en" => "also an apple", @@ -606,7 +606,7 @@ public function testUpdateEntry_AddSenseInFirstPosition_ProducesAddedDifferenceA "newValue.senses@0#" . $newSenseGuid . ".definition.fr" => "une pomme", "oldValue.senses@0#" . $newSenseGuid . ".generalNote.en" => "", "newValue.senses@0#" . $newSenseGuid . ".generalNote.en" => "note about the apple", - "fieldLabel.senses@0#" . $newSenseGuid => "Meaning", + "fieldLabel.senses@0#" . $newSenseGuid => "Sense", "fieldLabel.senses@0#" . $newSenseGuid . ".definition.en" => "Definition", "fieldLabel.senses@0#" . $newSenseGuid . ".definition.fr" => "Definition", "fieldLabel.senses@0#" . $newSenseGuid . ".generalNote.en" => "General Note", @@ -691,12 +691,12 @@ public function testUpdateEntry_AddOneSenseDeleteOneSenseUpdateOneSenseAndRearra "newValue.senses@1#" . $senseB->guid . ".definition.en" => "", "oldValue.senses@2#" . $senseC->guid . ".definition.en" => "C", "newValue.senses@2#" . $senseC->guid . ".definition.en" => "C2", - "fieldLabel.senses@0#" . $senseA->guid => "Meaning", - "fieldLabel.senses@1#" . $senseB->guid => "Meaning", + "fieldLabel.senses@0#" . $senseA->guid => "Sense", + "fieldLabel.senses@1#" . $senseB->guid => "Sense", "fieldLabel.senses@1#" . $senseB->guid . ".definition.en" => "Definition", - "fieldLabel.senses@2#" . $senseC->guid => "Meaning", + "fieldLabel.senses@2#" . $senseC->guid => "Sense", "fieldLabel.senses@2#" . $senseC->guid . ".definition.en" => "Definition", - "fieldLabel.senses@0#" . $newSenseGuid => "Meaning", + "fieldLabel.senses@0#" . $newSenseGuid => "Sense", "fieldLabel.senses@0#" . $newSenseGuid . ".definition.en" => "Definition", ], $withLabels @@ -1026,10 +1026,10 @@ public function testUpdateEntry_AddDeleteAndRearrangeBothSensesAndExamples_Every "newValue.senses@1#" . $senseD->guid . ".examples@0#" . $exampleD1->guid . ".sentence.en" => "D1", // All added, deleted, moved, oldValue and newValue entries also have corresponding fieldLabel entries - "fieldLabel.senses@0#" . $senseA->guid => "Meaning", - "fieldLabel.senses@1#" . $senseB->guid => "Meaning", - "fieldLabel.senses@2#" . $senseC->guid => "Meaning", - "fieldLabel.senses@1#" . $senseD->guid => "Meaning", + "fieldLabel.senses@0#" . $senseA->guid => "Sense", + "fieldLabel.senses@1#" . $senseB->guid => "Sense", + "fieldLabel.senses@2#" . $senseC->guid => "Sense", + "fieldLabel.senses@1#" . $senseD->guid => "Sense", "fieldLabel.senses@1#" . $senseB->guid . ".definition.en" => "Definition", "fieldLabel.senses@2#" . $senseC->guid . ".definition.en" => "Definition", diff --git a/test/php/model/languageforge/lexicon/command/LexProjectCommandsTest.php b/test/php/model/languageforge/lexicon/command/LexProjectCommandsTest.php index fcb8c462e1..852ede2569 100644 --- a/test/php/model/languageforge/lexicon/command/LexProjectCommandsTest.php +++ b/test/php/model/languageforge/lexicon/command/LexProjectCommandsTest.php @@ -53,7 +53,7 @@ public function testUpdateConfig_TasksEntryRoleViews_ConfigPersists() // test for a few default values $this->assertEquals("en", $project2->inputSystems["en"]->tag); $this->assertTrue($project2->config->tasks["dbe"]->visible); - $this->assertEquals("Word", $project2->config->entry->fields["lexeme"]->label); + $this->assertEquals("Lexeme", $project2->config->entry->fields["lexeme"]->label); $this->assertCount(0, $project2->config->roleViews["observer"]->fields["lexeme"]->inputSystems); $this->assertCount(0, $project2->config->roleViews["observer_with_comment"]->fields["lexeme"]->inputSystems); diff --git a/test/php/model/languageforge/lexicon/dto/LexBaseViewDtoTest.php b/test/php/model/languageforge/lexicon/dto/LexBaseViewDtoTest.php index 4bf58eb3d8..ded68c49c7 100644 --- a/test/php/model/languageforge/lexicon/dto/LexBaseViewDtoTest.php +++ b/test/php/model/languageforge/lexicon/dto/LexBaseViewDtoTest.php @@ -32,8 +32,8 @@ public function testEncode_Project_DtoCorrect() $this->assertEquals("en", $dto["config"]["inputSystems"]["en"]["tag"]); $this->assertTrue($dto["config"]["tasks"]["dbe"]["visible"]); $this->assertEquals("fields", $dto["config"]["entry"]["type"], "dto config is not valid"); - $this->assertEquals("Word", $dto["config"]["entry"]["fields"]["lexeme"]["label"]); - $this->assertEquals("Word", $dto["config"]["entry"]["fields"]["lexeme"]["label"]); + $this->assertEquals("Lexeme", $dto["config"]["entry"]["fields"]["lexeme"]["label"]); + $this->assertEquals("Lexeme", $dto["config"]["entry"]["fields"]["lexeme"]["label"]); $this->assertEquals( "Part of Speech", $dto["config"]["entry"]["fields"]["senses"]["fields"]["partOfSpeech"]["label"] From a9d5a21cde62d06d5a67cdd2b4348b94e4827fee Mon Sep 17 00:00:00 2001 From: billy clark Date: Thu, 16 Feb 2023 15:07:45 -0500 Subject: [PATCH 3/7] update label --- src/angular-app/bellows/core/offline/editor-data.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/angular-app/bellows/core/offline/editor-data.service.ts b/src/angular-app/bellows/core/offline/editor-data.service.ts index d1f60d38bc..42c13cead4 100644 --- a/src/angular-app/bellows/core/offline/editor-data.service.ts +++ b/src/angular-app/bellows/core/offline/editor-data.service.ts @@ -56,7 +56,7 @@ class EntryListModifiers { filterText = () => this.filterBy && this.filterBy.text || ''; filterByLabel = () => this.filterBy && this.filterBy.option && this.filterBy.option.label || ''; filterActive = () => !!(this.filterText() || this.filterBy && this.filterBy.option); - sortOptionLabel = (s: string) => s === 'Default' ? `Default (${this.filterText() ? 'Relevance' : 'Word'})` : s; + sortOptionLabel = (s: string) => s === 'Default' ? `Default (${this.filterText() ? 'Relevance' : 'Lexeme'})` : s; } const entriesIncrement = 50; From 436c008b04e754aa91fcda1765ceee9f432136fa Mon Sep 17 00:00:00 2001 From: billy clark Date: Thu, 16 Feb 2023 15:13:15 -0500 Subject: [PATCH 4/7] fix e2e tests --- test/e2e/tests/editor/editor.audio.spec.ts | 32 ++++---- test/e2e/tests/editor/editor.comments.spec.ts | 32 ++++---- .../tests/editor/editor.configuration.spec.ts | 76 +++++++++---------- test/e2e/tests/editor/editor.entries.spec.ts | 24 +++--- test/e2e/tests/editor/editor.pictures.spec.ts | 14 ++-- test/e2e/tests/entry-list.spec.ts | 2 +- test/e2e/tests/lexicon-new-project.spec.ts | 2 +- 7 files changed, 90 insertions(+), 92 deletions(-) diff --git a/test/e2e/tests/editor/editor.audio.spec.ts b/test/e2e/tests/editor/editor.audio.spec.ts index ef3e6d99e0..17b4f6a496 100644 --- a/test/e2e/tests/editor/editor.audio.spec.ts +++ b/test/e2e/tests/editor/editor.audio.spec.ts @@ -10,9 +10,9 @@ test.describe('Editor audio', () => { test.beforeAll(async ({ managerTab }) => { const configurationPage = await new ConfigurationPageFieldsTab(managerTab, project()).goto(); - await configurationPage.toggleFieldExpanded('Entry Fields', 'Word'); - await (await configurationPage.getFieldCheckbox('Entry Fields', 'Word', 'ภาษาไทย (IPA)')).check(); - await (await configurationPage.getFieldCheckbox('Entry Fields', 'Word', 'ภาษาไทย (Voice)')).check(); + await configurationPage.toggleFieldExpanded('Entry Fields', 'Lexeme'); + await (await configurationPage.getFieldCheckbox('Entry Fields', 'Lexeme', 'ภาษาไทย (IPA)')).check(); + await (await configurationPage.getFieldCheckbox('Entry Fields', 'Lexeme', 'ภาษาไทย (Voice)')).check(); await configurationPage.applyButton.click(); }); @@ -25,7 +25,7 @@ test.describe('Editor audio', () => { test('Audio input system is present, playable and has "more" control (member)', async () => { await editorPageMember.goto(); - const audio = editorPageMember.getAudioPlayer('Word', 'taud'); + const audio = editorPageMember.getAudioPlayer('Lexeme', 'taud'); await expect(audio.playIcon).toBeVisible(); await expect(audio.togglePlaybackAnchor).toBeEnabled(); @@ -36,9 +36,9 @@ test.describe('Editor audio', () => { await expect(audio.downloadButton).not.toBeVisible(); }); - test('Word 2 (without audio): audio input system is not playable but has "upload" button (member)', async () => { + test('Lexeme 2 (without audio): audio input system is not playable but has "upload" button (member)', async () => { await editorPageMember.goto({ entryId: entryIds()[1] }); - const audio = editorPageMember.getAudioPlayer('Word', 'taud'); + const audio = editorPageMember.getAudioPlayer('Lexeme', 'taud'); await expect(audio.togglePlaybackAnchor).not.toBeVisible(); await expect(audio.dropdownToggle).toBeEnabled(); await expect(audio.uploadButton).toBeVisible(); @@ -56,7 +56,7 @@ test.describe('Editor audio', () => { test('Audio Input System is playable but does not have "more" control (observer)', async () => { await editorPageObserver.goto(); - const audio = editorPageObserver.getAudioPlayer('Word', 'taud'); + const audio = editorPageObserver.getAudioPlayer('Lexeme', 'taud'); await expect(audio.playIcon).toBeVisible(); await expect(audio.togglePlaybackAnchor).toBeVisible(); await expect(audio.togglePlaybackAnchor).toBeEnabled(); @@ -65,9 +65,9 @@ test.describe('Editor audio', () => { await expect(audio.downloadButton).toBeVisible(); }); - test('Word 2 (without audio): audio input system is not playable and does not have "upload" button (observer)', async () => { + test('Lexeme 2 (without audio): audio input system is not playable and does not have "upload" button (observer)', async () => { await editorPageObserver.goto({ entryId: entryIds()[1] }); - const audio = editorPageObserver.getAudioPlayer('Word', 'taud'); + const audio = editorPageObserver.getAudioPlayer('Lexeme', 'taud'); await expect(audio.togglePlaybackAnchor).not.toBeVisible(); await expect(audio.dropdownToggle).not.toBeVisible(); await expect(audio.uploadButton).not.toBeVisible(); @@ -85,7 +85,7 @@ test.describe('Editor audio', () => { test('Audio input system is present, playable and has "more" control (manager)', async () => { await editorPageManager.goto(); - const audio = editorPageManager.getAudioPlayer('Word', 'taud'); + const audio = editorPageManager.getAudioPlayer('Lexeme', 'taud'); await expect(audio.playIcon).toBeVisible(); await expect(audio.togglePlaybackAnchor).toBeEnabled(); await expect(audio.dropdownToggle).toBeVisible(); @@ -97,7 +97,7 @@ test.describe('Editor audio', () => { test('Slider is present and updates with seeking', async () => { await editorPageManager.goto(); - const audio = editorPageManager.getAudioPlayer('Word', 'taud'); + const audio = editorPageManager.getAudioPlayer('Lexeme', 'taud'); await expect(audio.slider).toBeVisible(); const bounds = await audio.slider.boundingBox(); const yMiddle = bounds.y + bounds.height / 2; @@ -113,7 +113,7 @@ test.describe('Editor audio', () => { const cancelAddingAudio = editorPageManager.getCancelDropboxButton(editorPageManager.entryCard, 'Audio'); await expect(cancelAddingAudio).not.toBeVisible(); - const audio = editorPageManager.getAudioPlayer('Word', 'taud'); + const audio = editorPageManager.getAudioPlayer('Lexeme', 'taud'); await audio.dropdownToggle.click(); await audio.dropdownMenu.uploadReplacementButton.click(); await expect(audio.dropdownToggle).not.toBeVisible(); @@ -126,9 +126,9 @@ test.describe('Editor audio', () => { await expect(cancelAddingAudio).not.toBeVisible(); }); - test('Word 2 (without audio): audio input system is not playable but has "upload" button (manager)', async () => { + test('Lexeme 2 (without audio): audio input system is not playable but has "upload" button (manager)', async () => { await editorPageManager.goto({ entryId: entryIds()[1] }); - const audio = editorPageManager.getAudioPlayer('Word', 'taud'); + const audio = editorPageManager.getAudioPlayer('Lexeme', 'taud'); await expect(audio.playIcon).not.toBeVisible(); await expect(audio.dropdownToggle).not.toBeVisible(); @@ -139,7 +139,7 @@ test.describe('Editor audio', () => { test('Can delete audio input system (manager)', async () => { await editorPageManager.goto(); - const audio = editorPageManager.getAudioPlayer('Word', 'taud'); + const audio = editorPageManager.getAudioPlayer('Lexeme', 'taud'); await audio.dropdownToggle.click(); await audio.dropdownMenu.deleteAudioButton.click(); const confirmModal = new ConfirmModal(editorPageManager.page); @@ -154,7 +154,7 @@ test.describe('Editor audio', () => { await expect(noticeElement.notices).toHaveCount(0); // Can't upload a non-audio file - const audio = editorPageManager.getAudioPlayer('Word', 'taud'); + const audio = editorPageManager.getAudioPlayer('Lexeme', 'taud'); await audio.uploadButton.click(); // Note that Promise.all prevents a race condition between clicking and waiting for the file chooser. diff --git a/test/e2e/tests/editor/editor.comments.spec.ts b/test/e2e/tests/editor/editor.comments.spec.ts index c616f36af6..a1c87d8dac 100644 --- a/test/e2e/tests/editor/editor.comments.spec.ts +++ b/test/e2e/tests/editor/editor.comments.spec.ts @@ -11,17 +11,16 @@ test.describe('Lexicon Editor Comments', () => { await test.step('And input systems and entries', async () => { const configurationPage = await new ConfigurationPageFieldsTab(managerTab, project()).goto(); - await configurationPage.toggleFieldExpanded('Entry Fields', 'Word'); - await (await configurationPage.getFieldCheckbox('Entry Fields', 'Word', 'English')).check(); - await (await configurationPage.getFieldCheckbox('Entry Fields', 'Word', 'ภาษาไทย (Voice)')).check(); + await configurationPage.toggleFieldExpanded('Entry Fields', 'Lexeme'); + await (await configurationPage.getFieldCheckbox('Entry Fields', 'Lexeme', 'English')).check(); + await (await configurationPage.getFieldCheckbox('Entry Fields', 'Lexeme', 'ภาษาไทย (Voice)')).check(); await configurationPage.applyButton.click(); }); const editorPage = await test.step('Create comments and replies', async () => { const editorPage = await new EditorPage(managerTab, project()).goto(); - // Create comments on "Word" "th" - await editorPage.commentBubble('Word', 'th').click(); + await editorPage.commentBubble('Lexeme', 'th').click(); const comment1 = await editorPage.postComment('Test comment 1'); await comment1.toggleReplies(); @@ -33,8 +32,7 @@ test.describe('Lexicon Editor Comments', () => { await comment2.postReply('Test reply 2.1'); await comment2.postReply('Test reply 2.2'); - // Create comments on "Word" "en" - await editorPage.commentBubble('Word', 'en').click(); + await editorPage.commentBubble('Lexeme', 'en').click(); const comment3 = await editorPage.postComment('Test comment 3'); await comment3.toggleReplies(); @@ -53,8 +51,8 @@ test.describe('Lexicon Editor Comments', () => { await test.step('Verify comments and replies', async () => { await editorPage.reload(); - await expect(editorPage.commentCount('Word', 'th')).toHaveText('2'); - await editorPage.commentBubble('Word', 'th').click(); + await expect(editorPage.commentCount('Lexeme', 'th')).toHaveText('2'); + await editorPage.commentBubble('Lexeme', 'th').click(); await expect(editorPage.comments).toHaveCount(2); const comment1 = editorPage.getComment(1); await expect(comment1.content).toContainText('Test comment 1'); @@ -70,7 +68,7 @@ test.describe('Lexicon Editor Comments', () => { await expect(comment2.getReply(1).content).toContainText('Test reply 2.1'); await expect(comment2.getReply(2).content).toContainText('Test reply 2.2'); - await expect(editorPage.commentCount('Word', 'en')).toHaveText('1'); + await expect(editorPage.commentCount('Lexeme', 'en')).toHaveText('1'); await expect(editorPage.commentCount('Part of Speech')).toHaveText('1'); await editorPage.commentBubble('Part of Speech').click(); @@ -83,7 +81,7 @@ test.describe('Lexicon Editor Comments', () => { }); await test.step('Like and change state', async () => { - await editorPage.commentBubble('Word', 'th').click(); + await editorPage.commentBubble('Lexeme', 'th').click(); let comment2 = editorPage.getComment(2); // Likes @@ -106,7 +104,7 @@ test.describe('Lexicon Editor Comments', () => { // Verify it stuck await editorPage.reload(); - await editorPage.commentBubble('Word', 'th').click(); + await editorPage.commentBubble('Lexeme', 'th').click(); comment2 = editorPage.getComment(2); await expect(comment2.likes).toContainText('1 Like'); await expect(comment2.stateButton.markToDo).not.toBeVisible(); @@ -128,7 +126,7 @@ test.describe('Lexicon Editor Comments', () => { await expect(editorPage.comments).toHaveCount(4); // open for field - await editorPage.toggleComments('Word', 'th'); + await editorPage.toggleComments('Lexeme', 'th'); await expect(editorPage.comments).toHaveCount(2); // open all @@ -136,19 +134,19 @@ test.describe('Lexicon Editor Comments', () => { await expect(editorPage.comments).toHaveCount(4); // open for field - await editorPage.toggleComments('Word', 'th'); + await editorPage.toggleComments('Lexeme', 'th'); await expect(editorPage.comments).toHaveCount(2); // close field - await editorPage.toggleComments('Word', 'th'); + await editorPage.toggleComments('Lexeme', 'th'); await expect(editorPage.comments).toHaveCount(0); // open for field - await editorPage.toggleComments('Word', 'en'); + await editorPage.toggleComments('Lexeme', 'en'); await expect(editorPage.comments).toHaveCount(1); // open for different field - await editorPage.toggleComments('Word', 'th'); + await editorPage.toggleComments('Lexeme', 'th'); await expect(editorPage.comments).toHaveCount(2); }); }); diff --git a/test/e2e/tests/editor/editor.configuration.spec.ts b/test/e2e/tests/editor/editor.configuration.spec.ts index a55f041876..4a66f9fc91 100644 --- a/test/e2e/tests/editor/editor.configuration.spec.ts +++ b/test/e2e/tests/editor/editor.configuration.spec.ts @@ -9,9 +9,9 @@ test.describe('Editor configuration', async () => { test.beforeAll(async ({ managerTab }) => { const configurationPage = new ConfigurationPageFieldsTab(managerTab, project()); await configurationPage.goto(); - await configurationPage.toggleFieldExpanded('Entry Fields', 'Word'); - await (await configurationPage.getFieldCheckbox('Entry Fields', 'Word', 'ภาษาไทย (IPA)')).check(); - await (await configurationPage.getFieldCheckbox('Entry Fields', 'Word', 'ภาษาไทย (Voice)')).check(); + await configurationPage.toggleFieldExpanded('Entry Fields', 'Lexeme'); + await (await configurationPage.getFieldCheckbox('Entry Fields', 'Lexeme', 'ภาษาไทย (IPA)')).check(); + await (await configurationPage.getFieldCheckbox('Entry Fields', 'Lexeme', 'ภาษาไทย (Voice)')).check(); await configurationPage.applyButton.click(); }); @@ -24,42 +24,42 @@ test.describe('Editor configuration', async () => { test('Can change configuration to make a writing system visible or invisible', async ({ managerTab }) => { await editorPageManager.goto(); // word has only "th", "tipa" and "taud" visible - await expect(editorPageManager.label('Word', editorPageManager.entryCard)).toHaveCount(3); - await expect(editorPageManager.label('Word', editorPageManager.entryCard)).toHaveCount(3); - await expect(editorPageManager.getTextarea(editorPageManager.entryCard, 'Word', 'th')).toBeVisible(); - await expect(editorPageManager.getTextarea(editorPageManager.entryCard, 'Word', 'tipa')).toBeVisible(); - await expect(editorPageManager.audioPlayer('Word', 'taud')).toBeVisible(); + await expect(editorPageManager.label('Lexeme', editorPageManager.entryCard)).toHaveCount(3); + await expect(editorPageManager.label('Lexeme', editorPageManager.entryCard)).toHaveCount(3); + await expect(editorPageManager.getTextarea(editorPageManager.entryCard, 'Lexeme', 'th')).toBeVisible(); + await expect(editorPageManager.getTextarea(editorPageManager.entryCard, 'Lexeme', 'tipa')).toBeVisible(); + await expect(editorPageManager.audioPlayer('Lexeme', 'taud')).toBeVisible(); - // make "en" input system visible for "Word" field + // make "en" input system visible for "Lexeme" field const configurationPage = await new ConfigurationPageFieldsTab(managerTab, project()).goto(); - await configurationPage.toggleFieldExpanded('Entry Fields', 'Word'); - await (await configurationPage.getFieldCheckbox('Entry Fields', 'Word', 'English')).check(); + await configurationPage.toggleFieldExpanded('Entry Fields', 'Lexeme'); + await (await configurationPage.getFieldCheckbox('Entry Fields', 'Lexeme', 'English')).check(); await configurationPage.applyButton.click(); // check if "en" is visible await editorPageManager.goto(); - await expect(editorPageManager.label('Word', editorPageManager.entryCard)).toHaveCount(4); - await expect(editorPageManager.getTextarea(editorPageManager.entryCard, 'Word', 'en')).toBeVisible(); + await expect(editorPageManager.label('Lexeme', editorPageManager.entryCard)).toHaveCount(4); + await expect(editorPageManager.getTextarea(editorPageManager.entryCard, 'Lexeme', 'en')).toBeVisible(); - // make "en" input system invisible for "Word" field + // make "en" input system invisible for "Lexeme" field await configurationPage.goto(); - await configurationPage.toggleFieldExpanded('Entry Fields', 'Word'); - await (await configurationPage.getFieldCheckbox('Entry Fields', 'Word', 'English')).uncheck(); + await configurationPage.toggleFieldExpanded('Entry Fields', 'Lexeme'); + await (await configurationPage.getFieldCheckbox('Entry Fields', 'Lexeme', 'English')).uncheck(); await configurationPage.applyButton.click(); // check if "en" is invisible await editorPageManager.goto(); - await expect(editorPageManager.label('Word', editorPageManager.entryCard)).toHaveCount(3); - await expect(editorPageManager.getTextarea(editorPageManager.entryCard, 'Word', 'en')).not.toBeVisible(); + await expect(editorPageManager.label('Lexeme', editorPageManager.entryCard)).toHaveCount(3); + await expect(editorPageManager.getTextarea(editorPageManager.entryCard, 'Lexeme', 'en')).not.toBeVisible(); }); - test('Make "taud" input system invisible for "Word" field and "tipa" invisible for manager role, then ensure it worked and change it back', async ({ managerTab, memberTab }) => { + test('Make "taud" input system invisible for "Lexeme" field and "tipa" invisible for manager role, then ensure it worked and change it back', async ({ managerTab, memberTab }) => { test.slow(); const configurationPage = await new ConfigurationPageFieldsTab(managerTab, project()).goto(); - await configurationPage.toggleFieldExpanded('Entry Fields', 'Word'); - // Make "taud" input system invisible for "Word" field.... - await (await configurationPage.getFieldCheckbox('Entry Fields', 'Word', '(Voice)')).uncheck(); + await configurationPage.toggleFieldExpanded('Entry Fields', 'Lexeme'); + // Make "taud" input system invisible for "Lexeme" field.... + await (await configurationPage.getFieldCheckbox('Entry Fields', 'Lexeme', '(Voice)')).uncheck(); // ....and "tipa" invisible for manager role await (await configurationPage.getCheckbox('Input Systems', 'IPA', 'Manager')).uncheck(); await configurationPage.applyButton.click(); @@ -67,36 +67,36 @@ test.describe('Editor configuration', async () => { // verify that contributor can still see "tipa" const editorPageMember = new EditorPage(memberTab, project()); await editorPageMember.goto(); - await expect(editorPageMember.label('Word', editorPageMember.entryCard)).toHaveCount(2); - await expect(editorPageMember.getTextarea(editorPageMember.entryCard, 'Word', 'th')).toBeVisible(); - await expect(editorPageMember.getTextarea(editorPageMember.entryCard, 'Word', 'tipa')).toBeVisible(); + await expect(editorPageMember.label('Lexeme', editorPageMember.entryCard)).toHaveCount(2); + await expect(editorPageMember.getTextarea(editorPageMember.entryCard, 'Lexeme', 'th')).toBeVisible(); + await expect(editorPageMember.getTextarea(editorPageMember.entryCard, 'Lexeme', 'tipa')).toBeVisible(); - // Word then only has "th" visible for manager role + // Lexeme then only has "th" visible for manager role await editorPageManager.goto(); - await expect(editorPageManager.label('Word', editorPageManager.entryCard)).toHaveCount(1); - await expect(editorPageManager.getTextarea(editorPageManager.entryCard, 'Word', 'th')).toBeVisible(); + await expect(editorPageManager.label('Lexeme', editorPageManager.entryCard)).toHaveCount(1); + await expect(editorPageManager.getTextarea(editorPageManager.entryCard, 'Lexeme', 'th')).toBeVisible(); - // restore visibility of "taud" for "Word" field + // restore visibility of "taud" for "Lexeme" field await configurationPage.goto(); - await configurationPage.toggleFieldExpanded('Entry Fields', 'Word'); - await (await configurationPage.getFieldCheckbox('Entry Fields', 'Word', '(Voice)')).check(); + await configurationPage.toggleFieldExpanded('Entry Fields', 'Lexeme'); + await (await configurationPage.getFieldCheckbox('Entry Fields', 'Lexeme', '(Voice)')).check(); await configurationPage.applyButton.click(); - // Word has only "th" and "taud" visible for manager role + // Lexeme has only "th" and "taud" visible for manager role await editorPageManager.goto(); - await expect(editorPageManager.label('Word', editorPageManager.entryCard)).toHaveCount(2); - await expect(editorPageManager.getTextarea(editorPageManager.entryCard, 'Word', 'th')).toBeVisible(); - await expect(editorPageManager.audioPlayer('Word', 'taud')).toBeVisible(); + await expect(editorPageManager.label('Lexeme', editorPageManager.entryCard)).toHaveCount(2); + await expect(editorPageManager.getTextarea(editorPageManager.entryCard, 'Lexeme', 'th')).toBeVisible(); + await expect(editorPageManager.audioPlayer('Lexeme', 'taud')).toBeVisible(); // restore visibility of "tipa" input system for manager role await configurationPage.goto(); await (await configurationPage.getCheckbox('Input Systems', 'IPA', 'Manager')).check(); await configurationPage.applyButton.click(); - // Word has "th", "tipa" and "taud" visible again for manager role + // Lexeme has "th", "tipa" and "taud" visible again for manager role await editorPageManager.goto(); - await expect(editorPageManager.label('Word', editorPageManager.entryCard)).toHaveCount(3); - await expect(editorPageManager.getTextarea(editorPageManager.entryCard, 'Word', 'tipa')).toBeVisible(); + await expect(editorPageManager.label('Lexeme', editorPageManager.entryCard)).toHaveCount(3); + await expect(editorPageManager.getTextarea(editorPageManager.entryCard, 'Lexeme', 'tipa')).toBeVisible(); }); }); diff --git a/test/e2e/tests/editor/editor.entries.spec.ts b/test/e2e/tests/editor/editor.entries.spec.ts index c734703f26..f181e143e4 100644 --- a/test/e2e/tests/editor/editor.entries.spec.ts +++ b/test/e2e/tests/editor/editor.entries.spec.ts @@ -61,8 +61,8 @@ test.describe('Editor entries', () => { test('Citation form field overrides lexeme form in dictionary citation view', async ({ managerTab }) => { const configurationPage = await new ConfigurationPageFieldsTab(managerTab, project()).goto(); - await configurationPage.toggleFieldExpanded('Entry Fields', 'Word'); - await (await configurationPage.getFieldCheckbox('Entry Fields', 'Word', 'ภาษาไทย (IPA)')).check(); + await configurationPage.toggleFieldExpanded('Entry Fields', 'Lexeme'); + await (await configurationPage.getFieldCheckbox('Entry Fields', 'Lexeme', 'ภาษาไทย (IPA)')).check(); await configurationPage.applyButton.click(); await editorPageManager.goto(); @@ -96,7 +96,7 @@ test.describe('Editor entries', () => { editorPageManager.senseCard.first(), 'Definition', 'en')).toHaveValue(entries.multipleMeaningEntry.senses[0].definition.en.value); }); - test('Word 2: edit page has correct definition, part of speech', async () => { + test('Lexeme 2: edit page has correct definition, part of speech', async () => { await editorPageManager.goto({ entryId: entryIds()[1] }); await expect(editorPageManager.getTextarea( editorPageManager.senseCard, 'Definition', 'en')) @@ -119,7 +119,7 @@ test.describe('Editor entries', () => { await expect(editorPageManager.renderedDivs).toContainText([entries.multipleMeaningEntry.senses[1].examples[1].translation.en.value, entries.multipleMeaningEntry.senses[1].examples[1].translation.en.value]); }); - test('Word with multiple definitions: edit page has correct definitions, parts of speech', async () => { + test('Lexeme with multiple definitions: edit page has correct definitions, parts of speech', async () => { await editorPageManager.goto({ entryId: entryIds()[2] }); await expect(editorPageManager.getTextarea( editorPageManager.senseCard.first(), 'Definition', 'en')) @@ -134,7 +134,7 @@ test.describe('Editor entries', () => { .toEqual(entries.multipleMeaningEntry.senses[1].partOfSpeech.displayName); }); - test('Word with multiple meanings: edit page has correct example sentences, translations', async () => { + test('Lexeme with multiple meanings: edit page has correct example sentences, translations', async () => { await editorPageManager.goto({ entryId: entryIds()[2] }); await expect(editorPageManager.getTextarea( @@ -176,7 +176,7 @@ test.describe('Editor entries', () => { editorPageManager.senseCard.nth(0), 'General Note', 'en')).toBeVisible(); }); - test('Word with multiple meanings: edit page has correct general notes, sources', async () => { + test('Lexeme with multiple meanings: edit page has correct general notes, sources', async () => { await editorPageManager.goto({ entryId: entryIds()[2] }); await expect(editorPageManager.getTextarea( editorPageManager.senseCard.nth(0), 'General Note', 'en')) @@ -215,7 +215,7 @@ test.describe('Editor entries', () => { await expect(editorPageManager.compactEntryListItem).toHaveCount(newEntryCount); // go back to editor - await (editorPageManager.getTextarea(editorPageManager.entryCard, 'Word', 'th')) + await (editorPageManager.getTextarea(editorPageManager.entryCard, 'Lexeme', 'th')) .fill(entries.entry3.lexeme.th.value); await (editorPageManager.getTextarea(editorPageManager.senseCard, 'Definition', 'en')) .fill(entries.entry3.senses[0].definition.en.value); @@ -229,14 +229,14 @@ test.describe('Editor entries', () => { await expect(partOfSpeedDropdown).toHaveSelectedOption({ label: 'Noun (n)' }); - const alreadyThere: string = await editorPageManager.getTextarea(editorPageManager.entryCard, 'Word', 'th').inputValue(); - await (editorPageManager.getTextarea(editorPageManager.entryCard, 'Word', 'th')) + const alreadyThere: string = await editorPageManager.getTextarea(editorPageManager.entryCard, 'Lexeme', 'th').inputValue(); + await (editorPageManager.getTextarea(editorPageManager.entryCard, 'Lexeme', 'th')) .fill(alreadyThere + 'a'); await editorPageManager.page.reload(); await expect((editorPageManager.getTextarea( - editorPageManager.entryCard, 'Word', 'th'))) + editorPageManager.entryCard, 'Lexeme', 'th'))) .toHaveValue(entries.entry3.lexeme.th.value + 'a'); - await (editorPageManager.getTextarea(editorPageManager.entryCard, 'Word', 'th')) + await (editorPageManager.getTextarea(editorPageManager.entryCard, 'Lexeme', 'th')) .fill(entries.entry3.lexeme.th.value); // New word is visible in list @@ -253,7 +253,7 @@ test.describe('Editor entries', () => { // previous entry is selected after delete await expect(editorPageManager.getTextarea( - editorPageManager.entryCard, 'Word', 'th')) + editorPageManager.entryCard, 'Lexeme', 'th')) .toHaveValue(entries.entry1.lexeme.th.value); }); }); diff --git a/test/e2e/tests/editor/editor.pictures.spec.ts b/test/e2e/tests/editor/editor.pictures.spec.ts index a8cae945d1..fdd1a1dc39 100644 --- a/test/e2e/tests/editor/editor.pictures.spec.ts +++ b/test/e2e/tests/editor/editor.pictures.spec.ts @@ -58,8 +58,8 @@ test.describe('Editor pictures', () => { await test.step('Hide empty captions', async () => { await configurationPage.goto(); await configurationPage.tabLinks.fields.click(); - await configurationPage.toggleFieldExpanded('Meaning Fields', 'Pictures'); - await (await configurationPage.getFieldCheckbox('Meaning Fields', 'Pictures', 'Hide Caption If Empty')).check(); + await configurationPage.toggleFieldExpanded('Sense Fields', 'Pictures'); + await (await configurationPage.getFieldCheckbox('Sense Fields', 'Pictures', 'Hide Caption If Empty')).check(); await configurationPage.applyButton.click(); }); @@ -83,8 +83,8 @@ test.describe('Editor pictures', () => { await test.step('Show empty captions', async () => { await configurationPage.goto(); await configurationPage.tabLinks.fields.click(); - await configurationPage.toggleFieldExpanded('Meaning Fields', 'Pictures'); - await (await configurationPage.getFieldCheckbox('Meaning Fields', 'Pictures', 'Hide Caption If Empty')).uncheck(); + await configurationPage.toggleFieldExpanded('Sense Fields', 'Pictures'); + await (await configurationPage.getFieldCheckbox('Sense Fields', 'Pictures', 'Hide Caption If Empty')).uncheck(); await configurationPage.applyButton.click(); }); @@ -113,9 +113,9 @@ test.describe('Editor pictures', () => { const configurationPage = await new ConfigurationPageFieldsTab(editorPageManager.page, testProject).goto(); await configurationPage.tabLinks.fields.click(); - await (await configurationPage.getCheckbox('Meaning Fields', 'Pictures', 'Hidden if Empty')).check(); - await configurationPage.toggleFieldExpanded('Meaning Fields', 'Pictures'); - await (await configurationPage.getFieldCheckbox('Meaning Fields', 'Pictures', 'Hide Caption If Empty')).uncheck(); + await (await configurationPage.getCheckbox('Sense Fields', 'Pictures', 'Hidden if Empty')).check(); + await configurationPage.toggleFieldExpanded('Sense Fields', 'Pictures'); + await (await configurationPage.getFieldCheckbox('Sense Fields', 'Pictures', 'Hide Caption If Empty')).uncheck(); await configurationPage.applyButton.click(); // can change config to hide pictures and hide captions diff --git a/test/e2e/tests/entry-list.spec.ts b/test/e2e/tests/entry-list.spec.ts index 2a437f9988..585e394040 100644 --- a/test/e2e/tests/entry-list.spec.ts +++ b/test/e2e/tests/entry-list.spec.ts @@ -35,7 +35,7 @@ test.describe('Entries List', () => { entryListPageManager.entry(entries.entry1.lexeme.th.value).click(), new EditorPage(entryListPageManager.page, project()).waitFor(), ]) - await expect(editorPageManager.getTextarea(editorPageManager.entryCard, 'Word', 'th')).toHaveValue(entries.entry1.lexeme.th.value); + await expect(editorPageManager.getTextarea(editorPageManager.entryCard, 'Lexeme', 'th')).toHaveValue(entries.entry1.lexeme.th.value); }); test('Add word buttons works and redirects to editor', async () => { diff --git a/test/e2e/tests/lexicon-new-project.spec.ts b/test/e2e/tests/lexicon-new-project.spec.ts index b0a6ed28df..d1eb5f57a3 100644 --- a/test/e2e/tests/lexicon-new-project.spec.ts +++ b/test/e2e/tests/lexicon-new-project.spec.ts @@ -502,7 +502,7 @@ test.describe('New Project wizard', () => { await expect(editorPage.noEntries).toBeVisible(); await editorPage.entryList.createNewWordButton.click(); await editorPage.entryList.expectTotalNumberOfEntries(1); - await expect(editorPage.field('Word', 'es')).toBeVisible(); + await expect(editorPage.field('Lexeme', 'es')).toBeVisible(); }); }); }); From 0d254dc7530780bb627d3bae43822ce29e33f8db Mon Sep 17 00:00:00 2001 From: billy clark Date: Thu, 23 Feb 2023 14:50:03 -0500 Subject: [PATCH 5/7] updated field to "Lexeme Form" --- .../Lexicon/Config/LexConfiguration.php | 2 +- .../core/offline/editor-data.service.ts | 2 +- test/e2e/tests/editor/editor.audio.spec.ts | 26 ++++---- test/e2e/tests/editor/editor.comments.spec.ts | 30 +++++----- .../tests/editor/editor.configuration.spec.ts | 60 +++++++++---------- test/e2e/tests/editor/editor.entries.spec.ts | 16 ++--- test/e2e/tests/entry-list.spec.ts | 2 +- test/e2e/tests/lexicon-new-project.spec.ts | 2 +- .../lexicon/command/LexEntryCommandsTest.php | 10 +++- .../command/LexProjectCommandsTest.php | 2 +- .../lexicon/dto/LexBaseViewDtoTest.php | 4 +- 11 files changed, 80 insertions(+), 76 deletions(-) diff --git a/src/Api/Model/Languageforge/Lexicon/Config/LexConfiguration.php b/src/Api/Model/Languageforge/Lexicon/Config/LexConfiguration.php index 21d176062b..a7cfdf133f 100644 --- a/src/Api/Model/Languageforge/Lexicon/Config/LexConfiguration.php +++ b/src/Api/Model/Languageforge/Lexicon/Config/LexConfiguration.php @@ -89,7 +89,7 @@ public function __construct() $this->entry->fieldOrder[] = LexConfig::SENSES_LIST; $this->entry->fields[LexConfig::LEXEME] = new LexConfigMultiText(); - $this->entry->fields[LexConfig::LEXEME]->label = "Lexeme"; + $this->entry->fields[LexConfig::LEXEME]->label = "Lexeme Form"; $this->entry->fields[LexConfig::LEXEME]->inputSystems[] = "th"; $this->entry->fields[LexConfig::SENSES_LIST] = new LexConfigFieldList(); diff --git a/src/angular-app/bellows/core/offline/editor-data.service.ts b/src/angular-app/bellows/core/offline/editor-data.service.ts index 42c13cead4..2c9ecb1830 100644 --- a/src/angular-app/bellows/core/offline/editor-data.service.ts +++ b/src/angular-app/bellows/core/offline/editor-data.service.ts @@ -56,7 +56,7 @@ class EntryListModifiers { filterText = () => this.filterBy && this.filterBy.text || ''; filterByLabel = () => this.filterBy && this.filterBy.option && this.filterBy.option.label || ''; filterActive = () => !!(this.filterText() || this.filterBy && this.filterBy.option); - sortOptionLabel = (s: string) => s === 'Default' ? `Default (${this.filterText() ? 'Relevance' : 'Lexeme'})` : s; + sortOptionLabel = (s: string) => s === 'Default' ? `Default (${this.filterText() ? 'Relevance' : 'Lexeme Form'})` : s; } const entriesIncrement = 50; diff --git a/test/e2e/tests/editor/editor.audio.spec.ts b/test/e2e/tests/editor/editor.audio.spec.ts index 17b4f6a496..dcc756ad07 100644 --- a/test/e2e/tests/editor/editor.audio.spec.ts +++ b/test/e2e/tests/editor/editor.audio.spec.ts @@ -10,9 +10,9 @@ test.describe('Editor audio', () => { test.beforeAll(async ({ managerTab }) => { const configurationPage = await new ConfigurationPageFieldsTab(managerTab, project()).goto(); - await configurationPage.toggleFieldExpanded('Entry Fields', 'Lexeme'); - await (await configurationPage.getFieldCheckbox('Entry Fields', 'Lexeme', 'ภาษาไทย (IPA)')).check(); - await (await configurationPage.getFieldCheckbox('Entry Fields', 'Lexeme', 'ภาษาไทย (Voice)')).check(); + await configurationPage.toggleFieldExpanded('Entry Fields', 'Lexeme Form'); + await (await configurationPage.getFieldCheckbox('Entry Fields', 'Lexeme Form', 'ภาษาไทย (IPA)')).check(); + await (await configurationPage.getFieldCheckbox('Entry Fields', 'Lexeme Form', 'ภาษาไทย (Voice)')).check(); await configurationPage.applyButton.click(); }); @@ -25,7 +25,7 @@ test.describe('Editor audio', () => { test('Audio input system is present, playable and has "more" control (member)', async () => { await editorPageMember.goto(); - const audio = editorPageMember.getAudioPlayer('Lexeme', 'taud'); + const audio = editorPageMember.getAudioPlayer('Lexeme Form', 'taud'); await expect(audio.playIcon).toBeVisible(); await expect(audio.togglePlaybackAnchor).toBeEnabled(); @@ -38,7 +38,7 @@ test.describe('Editor audio', () => { test('Lexeme 2 (without audio): audio input system is not playable but has "upload" button (member)', async () => { await editorPageMember.goto({ entryId: entryIds()[1] }); - const audio = editorPageMember.getAudioPlayer('Lexeme', 'taud'); + const audio = editorPageMember.getAudioPlayer('Lexeme Form', 'taud'); await expect(audio.togglePlaybackAnchor).not.toBeVisible(); await expect(audio.dropdownToggle).toBeEnabled(); await expect(audio.uploadButton).toBeVisible(); @@ -56,7 +56,7 @@ test.describe('Editor audio', () => { test('Audio Input System is playable but does not have "more" control (observer)', async () => { await editorPageObserver.goto(); - const audio = editorPageObserver.getAudioPlayer('Lexeme', 'taud'); + const audio = editorPageObserver.getAudioPlayer('Lexeme Form', 'taud'); await expect(audio.playIcon).toBeVisible(); await expect(audio.togglePlaybackAnchor).toBeVisible(); await expect(audio.togglePlaybackAnchor).toBeEnabled(); @@ -67,7 +67,7 @@ test.describe('Editor audio', () => { test('Lexeme 2 (without audio): audio input system is not playable and does not have "upload" button (observer)', async () => { await editorPageObserver.goto({ entryId: entryIds()[1] }); - const audio = editorPageObserver.getAudioPlayer('Lexeme', 'taud'); + const audio = editorPageObserver.getAudioPlayer('Lexeme Form', 'taud'); await expect(audio.togglePlaybackAnchor).not.toBeVisible(); await expect(audio.dropdownToggle).not.toBeVisible(); await expect(audio.uploadButton).not.toBeVisible(); @@ -85,7 +85,7 @@ test.describe('Editor audio', () => { test('Audio input system is present, playable and has "more" control (manager)', async () => { await editorPageManager.goto(); - const audio = editorPageManager.getAudioPlayer('Lexeme', 'taud'); + const audio = editorPageManager.getAudioPlayer('Lexeme Form', 'taud'); await expect(audio.playIcon).toBeVisible(); await expect(audio.togglePlaybackAnchor).toBeEnabled(); await expect(audio.dropdownToggle).toBeVisible(); @@ -97,7 +97,7 @@ test.describe('Editor audio', () => { test('Slider is present and updates with seeking', async () => { await editorPageManager.goto(); - const audio = editorPageManager.getAudioPlayer('Lexeme', 'taud'); + const audio = editorPageManager.getAudioPlayer('Lexeme Form', 'taud'); await expect(audio.slider).toBeVisible(); const bounds = await audio.slider.boundingBox(); const yMiddle = bounds.y + bounds.height / 2; @@ -113,7 +113,7 @@ test.describe('Editor audio', () => { const cancelAddingAudio = editorPageManager.getCancelDropboxButton(editorPageManager.entryCard, 'Audio'); await expect(cancelAddingAudio).not.toBeVisible(); - const audio = editorPageManager.getAudioPlayer('Lexeme', 'taud'); + const audio = editorPageManager.getAudioPlayer('Lexeme Form', 'taud'); await audio.dropdownToggle.click(); await audio.dropdownMenu.uploadReplacementButton.click(); await expect(audio.dropdownToggle).not.toBeVisible(); @@ -128,7 +128,7 @@ test.describe('Editor audio', () => { test('Lexeme 2 (without audio): audio input system is not playable but has "upload" button (manager)', async () => { await editorPageManager.goto({ entryId: entryIds()[1] }); - const audio = editorPageManager.getAudioPlayer('Lexeme', 'taud'); + const audio = editorPageManager.getAudioPlayer('Lexeme Form', 'taud'); await expect(audio.playIcon).not.toBeVisible(); await expect(audio.dropdownToggle).not.toBeVisible(); @@ -139,7 +139,7 @@ test.describe('Editor audio', () => { test('Can delete audio input system (manager)', async () => { await editorPageManager.goto(); - const audio = editorPageManager.getAudioPlayer('Lexeme', 'taud'); + const audio = editorPageManager.getAudioPlayer('Lexeme Form', 'taud'); await audio.dropdownToggle.click(); await audio.dropdownMenu.deleteAudioButton.click(); const confirmModal = new ConfirmModal(editorPageManager.page); @@ -154,7 +154,7 @@ test.describe('Editor audio', () => { await expect(noticeElement.notices).toHaveCount(0); // Can't upload a non-audio file - const audio = editorPageManager.getAudioPlayer('Lexeme', 'taud'); + const audio = editorPageManager.getAudioPlayer('Lexeme Form', 'taud'); await audio.uploadButton.click(); // Note that Promise.all prevents a race condition between clicking and waiting for the file chooser. diff --git a/test/e2e/tests/editor/editor.comments.spec.ts b/test/e2e/tests/editor/editor.comments.spec.ts index a1c87d8dac..21d8619d0d 100644 --- a/test/e2e/tests/editor/editor.comments.spec.ts +++ b/test/e2e/tests/editor/editor.comments.spec.ts @@ -11,16 +11,16 @@ test.describe('Lexicon Editor Comments', () => { await test.step('And input systems and entries', async () => { const configurationPage = await new ConfigurationPageFieldsTab(managerTab, project()).goto(); - await configurationPage.toggleFieldExpanded('Entry Fields', 'Lexeme'); - await (await configurationPage.getFieldCheckbox('Entry Fields', 'Lexeme', 'English')).check(); - await (await configurationPage.getFieldCheckbox('Entry Fields', 'Lexeme', 'ภาษาไทย (Voice)')).check(); + await configurationPage.toggleFieldExpanded('Entry Fields', 'Lexeme Form'); + await (await configurationPage.getFieldCheckbox('Entry Fields', 'Lexeme Form', 'English')).check(); + await (await configurationPage.getFieldCheckbox('Entry Fields', 'Lexeme Form', 'ภาษาไทย (Voice)')).check(); await configurationPage.applyButton.click(); }); const editorPage = await test.step('Create comments and replies', async () => { const editorPage = await new EditorPage(managerTab, project()).goto(); - await editorPage.commentBubble('Lexeme', 'th').click(); + await editorPage.commentBubble('Lexeme Form', 'th').click(); const comment1 = await editorPage.postComment('Test comment 1'); await comment1.toggleReplies(); @@ -32,7 +32,7 @@ test.describe('Lexicon Editor Comments', () => { await comment2.postReply('Test reply 2.1'); await comment2.postReply('Test reply 2.2'); - await editorPage.commentBubble('Lexeme', 'en').click(); + await editorPage.commentBubble('Lexeme Form', 'en').click(); const comment3 = await editorPage.postComment('Test comment 3'); await comment3.toggleReplies(); @@ -51,8 +51,8 @@ test.describe('Lexicon Editor Comments', () => { await test.step('Verify comments and replies', async () => { await editorPage.reload(); - await expect(editorPage.commentCount('Lexeme', 'th')).toHaveText('2'); - await editorPage.commentBubble('Lexeme', 'th').click(); + await expect(editorPage.commentCount('Lexeme Form', 'th')).toHaveText('2'); + await editorPage.commentBubble('Lexeme Form', 'th').click(); await expect(editorPage.comments).toHaveCount(2); const comment1 = editorPage.getComment(1); await expect(comment1.content).toContainText('Test comment 1'); @@ -68,7 +68,7 @@ test.describe('Lexicon Editor Comments', () => { await expect(comment2.getReply(1).content).toContainText('Test reply 2.1'); await expect(comment2.getReply(2).content).toContainText('Test reply 2.2'); - await expect(editorPage.commentCount('Lexeme', 'en')).toHaveText('1'); + await expect(editorPage.commentCount('Lexeme Form', 'en')).toHaveText('1'); await expect(editorPage.commentCount('Part of Speech')).toHaveText('1'); await editorPage.commentBubble('Part of Speech').click(); @@ -81,7 +81,7 @@ test.describe('Lexicon Editor Comments', () => { }); await test.step('Like and change state', async () => { - await editorPage.commentBubble('Lexeme', 'th').click(); + await editorPage.commentBubble('Lexeme Form', 'th').click(); let comment2 = editorPage.getComment(2); // Likes @@ -104,7 +104,7 @@ test.describe('Lexicon Editor Comments', () => { // Verify it stuck await editorPage.reload(); - await editorPage.commentBubble('Lexeme', 'th').click(); + await editorPage.commentBubble('Lexeme Form', 'th').click(); comment2 = editorPage.getComment(2); await expect(comment2.likes).toContainText('1 Like'); await expect(comment2.stateButton.markToDo).not.toBeVisible(); @@ -126,7 +126,7 @@ test.describe('Lexicon Editor Comments', () => { await expect(editorPage.comments).toHaveCount(4); // open for field - await editorPage.toggleComments('Lexeme', 'th'); + await editorPage.toggleComments('Lexeme Form', 'th'); await expect(editorPage.comments).toHaveCount(2); // open all @@ -134,19 +134,19 @@ test.describe('Lexicon Editor Comments', () => { await expect(editorPage.comments).toHaveCount(4); // open for field - await editorPage.toggleComments('Lexeme', 'th'); + await editorPage.toggleComments('Lexeme Form', 'th'); await expect(editorPage.comments).toHaveCount(2); // close field - await editorPage.toggleComments('Lexeme', 'th'); + await editorPage.toggleComments('Lexeme Form', 'th'); await expect(editorPage.comments).toHaveCount(0); // open for field - await editorPage.toggleComments('Lexeme', 'en'); + await editorPage.toggleComments('Lexeme Form', 'en'); await expect(editorPage.comments).toHaveCount(1); // open for different field - await editorPage.toggleComments('Lexeme', 'th'); + await editorPage.toggleComments('Lexeme Form', 'th'); await expect(editorPage.comments).toHaveCount(2); }); }); diff --git a/test/e2e/tests/editor/editor.configuration.spec.ts b/test/e2e/tests/editor/editor.configuration.spec.ts index 4a66f9fc91..0aa45d9f29 100644 --- a/test/e2e/tests/editor/editor.configuration.spec.ts +++ b/test/e2e/tests/editor/editor.configuration.spec.ts @@ -9,9 +9,9 @@ test.describe('Editor configuration', async () => { test.beforeAll(async ({ managerTab }) => { const configurationPage = new ConfigurationPageFieldsTab(managerTab, project()); await configurationPage.goto(); - await configurationPage.toggleFieldExpanded('Entry Fields', 'Lexeme'); - await (await configurationPage.getFieldCheckbox('Entry Fields', 'Lexeme', 'ภาษาไทย (IPA)')).check(); - await (await configurationPage.getFieldCheckbox('Entry Fields', 'Lexeme', 'ภาษาไทย (Voice)')).check(); + await configurationPage.toggleFieldExpanded('Entry Fields', 'Lexeme Form'); + await (await configurationPage.getFieldCheckbox('Entry Fields', 'Lexeme Form', 'ภาษาไทย (IPA)')).check(); + await (await configurationPage.getFieldCheckbox('Entry Fields', 'Lexeme Form', 'ภาษาไทย (Voice)')).check(); await configurationPage.applyButton.click(); }); @@ -24,42 +24,42 @@ test.describe('Editor configuration', async () => { test('Can change configuration to make a writing system visible or invisible', async ({ managerTab }) => { await editorPageManager.goto(); // word has only "th", "tipa" and "taud" visible - await expect(editorPageManager.label('Lexeme', editorPageManager.entryCard)).toHaveCount(3); - await expect(editorPageManager.label('Lexeme', editorPageManager.entryCard)).toHaveCount(3); - await expect(editorPageManager.getTextarea(editorPageManager.entryCard, 'Lexeme', 'th')).toBeVisible(); - await expect(editorPageManager.getTextarea(editorPageManager.entryCard, 'Lexeme', 'tipa')).toBeVisible(); - await expect(editorPageManager.audioPlayer('Lexeme', 'taud')).toBeVisible(); + await expect(editorPageManager.label('Lexeme Form', editorPageManager.entryCard)).toHaveCount(3); + await expect(editorPageManager.label('Lexeme Form', editorPageManager.entryCard)).toHaveCount(3); + await expect(editorPageManager.getTextarea(editorPageManager.entryCard, 'Lexeme Form', 'th')).toBeVisible(); + await expect(editorPageManager.getTextarea(editorPageManager.entryCard, 'Lexeme Form', 'tipa')).toBeVisible(); + await expect(editorPageManager.audioPlayer('Lexeme Form', 'taud')).toBeVisible(); // make "en" input system visible for "Lexeme" field const configurationPage = await new ConfigurationPageFieldsTab(managerTab, project()).goto(); - await configurationPage.toggleFieldExpanded('Entry Fields', 'Lexeme'); - await (await configurationPage.getFieldCheckbox('Entry Fields', 'Lexeme', 'English')).check(); + await configurationPage.toggleFieldExpanded('Entry Fields', 'Lexeme Form'); + await (await configurationPage.getFieldCheckbox('Entry Fields', 'Lexeme Form', 'English')).check(); await configurationPage.applyButton.click(); // check if "en" is visible await editorPageManager.goto(); - await expect(editorPageManager.label('Lexeme', editorPageManager.entryCard)).toHaveCount(4); - await expect(editorPageManager.getTextarea(editorPageManager.entryCard, 'Lexeme', 'en')).toBeVisible(); + await expect(editorPageManager.label('Lexeme Form', editorPageManager.entryCard)).toHaveCount(4); + await expect(editorPageManager.getTextarea(editorPageManager.entryCard, 'Lexeme Form', 'en')).toBeVisible(); // make "en" input system invisible for "Lexeme" field await configurationPage.goto(); - await configurationPage.toggleFieldExpanded('Entry Fields', 'Lexeme'); - await (await configurationPage.getFieldCheckbox('Entry Fields', 'Lexeme', 'English')).uncheck(); + await configurationPage.toggleFieldExpanded('Entry Fields', 'Lexeme Form'); + await (await configurationPage.getFieldCheckbox('Entry Fields', 'Lexeme Form', 'English')).uncheck(); await configurationPage.applyButton.click(); // check if "en" is invisible await editorPageManager.goto(); - await expect(editorPageManager.label('Lexeme', editorPageManager.entryCard)).toHaveCount(3); - await expect(editorPageManager.getTextarea(editorPageManager.entryCard, 'Lexeme', 'en')).not.toBeVisible(); + await expect(editorPageManager.label('Lexeme Form', editorPageManager.entryCard)).toHaveCount(3); + await expect(editorPageManager.getTextarea(editorPageManager.entryCard, 'Lexeme Form', 'en')).not.toBeVisible(); }); test('Make "taud" input system invisible for "Lexeme" field and "tipa" invisible for manager role, then ensure it worked and change it back', async ({ managerTab, memberTab }) => { test.slow(); const configurationPage = await new ConfigurationPageFieldsTab(managerTab, project()).goto(); - await configurationPage.toggleFieldExpanded('Entry Fields', 'Lexeme'); + await configurationPage.toggleFieldExpanded('Entry Fields', 'Lexeme Form'); // Make "taud" input system invisible for "Lexeme" field.... - await (await configurationPage.getFieldCheckbox('Entry Fields', 'Lexeme', '(Voice)')).uncheck(); + await (await configurationPage.getFieldCheckbox('Entry Fields', 'Lexeme Form', '(Voice)')).uncheck(); // ....and "tipa" invisible for manager role await (await configurationPage.getCheckbox('Input Systems', 'IPA', 'Manager')).uncheck(); await configurationPage.applyButton.click(); @@ -67,26 +67,26 @@ test.describe('Editor configuration', async () => { // verify that contributor can still see "tipa" const editorPageMember = new EditorPage(memberTab, project()); await editorPageMember.goto(); - await expect(editorPageMember.label('Lexeme', editorPageMember.entryCard)).toHaveCount(2); - await expect(editorPageMember.getTextarea(editorPageMember.entryCard, 'Lexeme', 'th')).toBeVisible(); - await expect(editorPageMember.getTextarea(editorPageMember.entryCard, 'Lexeme', 'tipa')).toBeVisible(); + await expect(editorPageMember.label('Lexeme Form', editorPageMember.entryCard)).toHaveCount(2); + await expect(editorPageMember.getTextarea(editorPageMember.entryCard, 'Lexeme Form', 'th')).toBeVisible(); + await expect(editorPageMember.getTextarea(editorPageMember.entryCard, 'Lexeme Form', 'tipa')).toBeVisible(); // Lexeme then only has "th" visible for manager role await editorPageManager.goto(); - await expect(editorPageManager.label('Lexeme', editorPageManager.entryCard)).toHaveCount(1); - await expect(editorPageManager.getTextarea(editorPageManager.entryCard, 'Lexeme', 'th')).toBeVisible(); + await expect(editorPageManager.label('Lexeme Form', editorPageManager.entryCard)).toHaveCount(1); + await expect(editorPageManager.getTextarea(editorPageManager.entryCard, 'Lexeme Form', 'th')).toBeVisible(); // restore visibility of "taud" for "Lexeme" field await configurationPage.goto(); - await configurationPage.toggleFieldExpanded('Entry Fields', 'Lexeme'); - await (await configurationPage.getFieldCheckbox('Entry Fields', 'Lexeme', '(Voice)')).check(); + await configurationPage.toggleFieldExpanded('Entry Fields', 'Lexeme Form'); + await (await configurationPage.getFieldCheckbox('Entry Fields', 'Lexeme Form', '(Voice)')).check(); await configurationPage.applyButton.click(); // Lexeme has only "th" and "taud" visible for manager role await editorPageManager.goto(); - await expect(editorPageManager.label('Lexeme', editorPageManager.entryCard)).toHaveCount(2); - await expect(editorPageManager.getTextarea(editorPageManager.entryCard, 'Lexeme', 'th')).toBeVisible(); - await expect(editorPageManager.audioPlayer('Lexeme', 'taud')).toBeVisible(); + await expect(editorPageManager.label('Lexeme Form', editorPageManager.entryCard)).toHaveCount(2); + await expect(editorPageManager.getTextarea(editorPageManager.entryCard, 'Lexeme Form', 'th')).toBeVisible(); + await expect(editorPageManager.audioPlayer('Lexeme Form', 'taud')).toBeVisible(); // restore visibility of "tipa" input system for manager role await configurationPage.goto(); @@ -95,8 +95,8 @@ test.describe('Editor configuration', async () => { // Lexeme has "th", "tipa" and "taud" visible again for manager role await editorPageManager.goto(); - await expect(editorPageManager.label('Lexeme', editorPageManager.entryCard)).toHaveCount(3); - await expect(editorPageManager.getTextarea(editorPageManager.entryCard, 'Lexeme', 'tipa')).toBeVisible(); + await expect(editorPageManager.label('Lexeme Form', editorPageManager.entryCard)).toHaveCount(3); + await expect(editorPageManager.getTextarea(editorPageManager.entryCard, 'Lexeme Form', 'tipa')).toBeVisible(); }); }); diff --git a/test/e2e/tests/editor/editor.entries.spec.ts b/test/e2e/tests/editor/editor.entries.spec.ts index f181e143e4..f09fd5c56c 100644 --- a/test/e2e/tests/editor/editor.entries.spec.ts +++ b/test/e2e/tests/editor/editor.entries.spec.ts @@ -61,8 +61,8 @@ test.describe('Editor entries', () => { test('Citation form field overrides lexeme form in dictionary citation view', async ({ managerTab }) => { const configurationPage = await new ConfigurationPageFieldsTab(managerTab, project()).goto(); - await configurationPage.toggleFieldExpanded('Entry Fields', 'Lexeme'); - await (await configurationPage.getFieldCheckbox('Entry Fields', 'Lexeme', 'ภาษาไทย (IPA)')).check(); + await configurationPage.toggleFieldExpanded('Entry Fields', 'Lexeme Form'); + await (await configurationPage.getFieldCheckbox('Entry Fields', 'Lexeme Form', 'ภาษาไทย (IPA)')).check(); await configurationPage.applyButton.click(); await editorPageManager.goto(); @@ -215,7 +215,7 @@ test.describe('Editor entries', () => { await expect(editorPageManager.compactEntryListItem).toHaveCount(newEntryCount); // go back to editor - await (editorPageManager.getTextarea(editorPageManager.entryCard, 'Lexeme', 'th')) + await (editorPageManager.getTextarea(editorPageManager.entryCard, 'Lexeme Form', 'th')) .fill(entries.entry3.lexeme.th.value); await (editorPageManager.getTextarea(editorPageManager.senseCard, 'Definition', 'en')) .fill(entries.entry3.senses[0].definition.en.value); @@ -229,14 +229,14 @@ test.describe('Editor entries', () => { await expect(partOfSpeedDropdown).toHaveSelectedOption({ label: 'Noun (n)' }); - const alreadyThere: string = await editorPageManager.getTextarea(editorPageManager.entryCard, 'Lexeme', 'th').inputValue(); - await (editorPageManager.getTextarea(editorPageManager.entryCard, 'Lexeme', 'th')) + const alreadyThere: string = await editorPageManager.getTextarea(editorPageManager.entryCard, 'Lexeme Form', 'th').inputValue(); + await (editorPageManager.getTextarea(editorPageManager.entryCard, 'Lexeme Form', 'th')) .fill(alreadyThere + 'a'); await editorPageManager.page.reload(); await expect((editorPageManager.getTextarea( - editorPageManager.entryCard, 'Lexeme', 'th'))) + editorPageManager.entryCard, 'Lexeme Form', 'th'))) .toHaveValue(entries.entry3.lexeme.th.value + 'a'); - await (editorPageManager.getTextarea(editorPageManager.entryCard, 'Lexeme', 'th')) + await (editorPageManager.getTextarea(editorPageManager.entryCard, 'Lexeme Form', 'th')) .fill(entries.entry3.lexeme.th.value); // New word is visible in list @@ -253,7 +253,7 @@ test.describe('Editor entries', () => { // previous entry is selected after delete await expect(editorPageManager.getTextarea( - editorPageManager.entryCard, 'Lexeme', 'th')) + editorPageManager.entryCard, 'Lexeme Form', 'th')) .toHaveValue(entries.entry1.lexeme.th.value); }); }); diff --git a/test/e2e/tests/entry-list.spec.ts b/test/e2e/tests/entry-list.spec.ts index 585e394040..5b9095d6e1 100644 --- a/test/e2e/tests/entry-list.spec.ts +++ b/test/e2e/tests/entry-list.spec.ts @@ -35,7 +35,7 @@ test.describe('Entries List', () => { entryListPageManager.entry(entries.entry1.lexeme.th.value).click(), new EditorPage(entryListPageManager.page, project()).waitFor(), ]) - await expect(editorPageManager.getTextarea(editorPageManager.entryCard, 'Lexeme', 'th')).toHaveValue(entries.entry1.lexeme.th.value); + await expect(editorPageManager.getTextarea(editorPageManager.entryCard, 'Lexeme Form', 'th')).toHaveValue(entries.entry1.lexeme.th.value); }); test('Add word buttons works and redirects to editor', async () => { diff --git a/test/e2e/tests/lexicon-new-project.spec.ts b/test/e2e/tests/lexicon-new-project.spec.ts index d1eb5f57a3..2971bcdcab 100644 --- a/test/e2e/tests/lexicon-new-project.spec.ts +++ b/test/e2e/tests/lexicon-new-project.spec.ts @@ -502,7 +502,7 @@ test.describe('New Project wizard', () => { await expect(editorPage.noEntries).toBeVisible(); await editorPage.entryList.createNewWordButton.click(); await editorPage.entryList.expectTotalNumberOfEntries(1); - await expect(editorPage.field('Lexeme', 'es')).toBeVisible(); + await expect(editorPage.field('Lexeme Form', 'es')).toBeVisible(); }); }); }); diff --git a/test/php/model/languageforge/lexicon/command/LexEntryCommandsTest.php b/test/php/model/languageforge/lexicon/command/LexEntryCommandsTest.php index 395dfa0990..beeca717a2 100644 --- a/test/php/model/languageforge/lexicon/command/LexEntryCommandsTest.php +++ b/test/php/model/languageforge/lexicon/command/LexEntryCommandsTest.php @@ -207,7 +207,11 @@ public function testUpdateEntry_UpdateTwice_DifferencesAreCorrect() $this->assertEquals(["oldValue.lexeme.th" => "apple", "newValue.lexeme.th" => "first edit"], $differences); $withLabels = LexEntryCommands::addFieldLabelsToDifferences($project->config, $differences); $this->assertEquals( - ["oldValue.lexeme.th" => "apple", "newValue.lexeme.th" => "first edit", "fieldLabel.lexeme.th" => "Lexeme"], + [ + "oldValue.lexeme.th" => "apple", + "newValue.lexeme.th" => "first edit", + "fieldLabel.lexeme.th" => "Lexeme Form", + ], $withLabels ); @@ -225,7 +229,7 @@ public function testUpdateEntry_UpdateTwice_DifferencesAreCorrect() [ "oldValue.lexeme.th" => "first edit", "newValue.lexeme.th" => "second edit", - "fieldLabel.lexeme.th" => "Lexeme", + "fieldLabel.lexeme.th" => "Lexeme Form", ], $withLabels ); @@ -252,7 +256,7 @@ public function testUpdateEntry_UpdateWithNull_DifferencesHasEmptyStringInsteadO $this->assertEquals(["oldValue.lexeme.th" => "apple", "newValue.lexeme.th" => ""], $differences); $withLabels = LexEntryCommands::addFieldLabelsToDifferences($project->config, $differences); $this->assertEquals( - ["oldValue.lexeme.th" => "apple", "newValue.lexeme.th" => "", "fieldLabel.lexeme.th" => "Lexeme"], + ["oldValue.lexeme.th" => "apple", "newValue.lexeme.th" => "", "fieldLabel.lexeme.th" => "Lexeme Form"], $withLabels ); } diff --git a/test/php/model/languageforge/lexicon/command/LexProjectCommandsTest.php b/test/php/model/languageforge/lexicon/command/LexProjectCommandsTest.php index 852ede2569..3ef27b9f1c 100644 --- a/test/php/model/languageforge/lexicon/command/LexProjectCommandsTest.php +++ b/test/php/model/languageforge/lexicon/command/LexProjectCommandsTest.php @@ -53,7 +53,7 @@ public function testUpdateConfig_TasksEntryRoleViews_ConfigPersists() // test for a few default values $this->assertEquals("en", $project2->inputSystems["en"]->tag); $this->assertTrue($project2->config->tasks["dbe"]->visible); - $this->assertEquals("Lexeme", $project2->config->entry->fields["lexeme"]->label); + $this->assertEquals("Lexeme Form", $project2->config->entry->fields["lexeme"]->label); $this->assertCount(0, $project2->config->roleViews["observer"]->fields["lexeme"]->inputSystems); $this->assertCount(0, $project2->config->roleViews["observer_with_comment"]->fields["lexeme"]->inputSystems); diff --git a/test/php/model/languageforge/lexicon/dto/LexBaseViewDtoTest.php b/test/php/model/languageforge/lexicon/dto/LexBaseViewDtoTest.php index ded68c49c7..1f6f908dae 100644 --- a/test/php/model/languageforge/lexicon/dto/LexBaseViewDtoTest.php +++ b/test/php/model/languageforge/lexicon/dto/LexBaseViewDtoTest.php @@ -32,8 +32,8 @@ public function testEncode_Project_DtoCorrect() $this->assertEquals("en", $dto["config"]["inputSystems"]["en"]["tag"]); $this->assertTrue($dto["config"]["tasks"]["dbe"]["visible"]); $this->assertEquals("fields", $dto["config"]["entry"]["type"], "dto config is not valid"); - $this->assertEquals("Lexeme", $dto["config"]["entry"]["fields"]["lexeme"]["label"]); - $this->assertEquals("Lexeme", $dto["config"]["entry"]["fields"]["lexeme"]["label"]); + $this->assertEquals("Lexeme Form", $dto["config"]["entry"]["fields"]["lexeme"]["label"]); + $this->assertEquals("Lexeme Form", $dto["config"]["entry"]["fields"]["lexeme"]["label"]); $this->assertEquals( "Part of Speech", $dto["config"]["entry"]["fields"]["senses"]["fields"]["partOfSpeech"]["label"] From b4ec14a8ea8a42db6f7725db373bb01518c009a2 Mon Sep 17 00:00:00 2001 From: billy clark Date: Thu, 23 Feb 2023 14:55:13 -0500 Subject: [PATCH 6/7] updated "Part of Speech" field to "Grammatical Category" --- .../Languageforge/Lexicon/Config/LexConfig.php | 4 ++-- .../Languageforge/Lexicon/Import/LiftDecoder.php | 2 +- .../Languageforge/Lexicon/Import/LiftImport.php | 2 +- test/e2e/tests/editor/editor.comments.spec.ts | 7 +++---- test/e2e/tests/editor/editor.entries.spec.ts | 14 +++++++------- .../lexicon/command/LexOptionListCommandsTest.php | 4 ++-- .../lexicon/dto/LexBaseViewDtoTest.php | 2 +- 7 files changed, 17 insertions(+), 18 deletions(-) diff --git a/src/Api/Model/Languageforge/Lexicon/Config/LexConfig.php b/src/Api/Model/Languageforge/Lexicon/Config/LexConfig.php index 875ec77543..c074309cc2 100644 --- a/src/Api/Model/Languageforge/Lexicon/Config/LexConfig.php +++ b/src/Api/Model/Languageforge/Lexicon/Config/LexConfig.php @@ -127,7 +127,7 @@ public static function flexOptionlistCode($fieldName) * @var array */ private static $flexOptionlistNames = [ - "grammatical-info" => "Part of Speech", + "grammatical-info" => "Grammatical Category", "semantic-domain-ddp4" => "Semantic Domain", "domain-type" => "Academic Domains", self::ENVIRONMENTS => "Environments", @@ -145,7 +145,7 @@ public static function flexOptionlistCode($fieldName) "paradigm" => "Paradigm", "users" => "Users", "translation-type" => "Translation Type", - "from-part-of-speech" => "From Part of Speech", + "from-part-of-speech" => "From Grammatical Category", "morph-type" => "Morph Type", "noun-slot" => "Noun Slot", "verb-slot" => "Verb Slot", diff --git a/src/Api/Model/Languageforge/Lexicon/Import/LiftDecoder.php b/src/Api/Model/Languageforge/Lexicon/Import/LiftDecoder.php index 5747c9ad1c..7851dc426f 100644 --- a/src/Api/Model/Languageforge/Lexicon/Import/LiftDecoder.php +++ b/src/Api/Model/Languageforge/Lexicon/Import/LiftDecoder.php @@ -264,7 +264,7 @@ public function readSense($sxeNode, $sense) ); break; case "grammatical-info": - // Part Of Speech + // Grammatical Category $sense->partOfSpeech->value = \Normalizer::normalize((string) $element["value"]); break; case "illustration": diff --git a/src/Api/Model/Languageforge/Lexicon/Import/LiftImport.php b/src/Api/Model/Languageforge/Lexicon/Import/LiftImport.php index c9ea369e6f..d68ade1ebc 100644 --- a/src/Api/Model/Languageforge/Lexicon/Import/LiftImport.php +++ b/src/Api/Model/Languageforge/Lexicon/Import/LiftImport.php @@ -279,7 +279,7 @@ public function getReport() /** * Convert a LIFT range to an option list of the right code - * Usage example: rangeToOptionList($projectModel, 'grammatical-info', 'Part of Speech', $liftRanges['grammatical-info']) + * Usage example: rangeToOptionList($projectModel, 'grammatical-info', 'Grammatical Category', $liftRanges['grammatical-info']) * @param LexProjectModel $projectModel * @param string $optionListCode * @param string $optionListName diff --git a/test/e2e/tests/editor/editor.comments.spec.ts b/test/e2e/tests/editor/editor.comments.spec.ts index 21d8619d0d..ea0c27f894 100644 --- a/test/e2e/tests/editor/editor.comments.spec.ts +++ b/test/e2e/tests/editor/editor.comments.spec.ts @@ -38,8 +38,7 @@ test.describe('Lexicon Editor Comments', () => { await comment3.toggleReplies(); await comment3.postReply('Test reply 3.1'); - // Create comments on "Part of Speech" - await editorPage.commentBubble('Part of Speech').click(); + await editorPage.commentBubble('Grammatical Category').click(); const comment4 = await editorPage.postComment('Test comment 4'); await comment4.toggleReplies(); @@ -70,8 +69,8 @@ test.describe('Lexicon Editor Comments', () => { await expect(editorPage.commentCount('Lexeme Form', 'en')).toHaveText('1'); - await expect(editorPage.commentCount('Part of Speech')).toHaveText('1'); - await editorPage.commentBubble('Part of Speech').click(); + await expect(editorPage.commentCount('Grammatical Category')).toHaveText('1'); + await editorPage.commentBubble('Grammatical Category').click(); await expect(editorPage.comments).toHaveCount(1); const comment4 = editorPage.getComment(1); await expect(comment4.content).toContainText('Test comment 4'); diff --git a/test/e2e/tests/editor/editor.entries.spec.ts b/test/e2e/tests/editor/editor.entries.spec.ts index f09fd5c56c..baa3026cba 100644 --- a/test/e2e/tests/editor/editor.entries.spec.ts +++ b/test/e2e/tests/editor/editor.entries.spec.ts @@ -41,12 +41,12 @@ test.describe('Editor entries', () => { expect(editorPageManager.page.url()).not.toContain(entryIds()[0]); }); - test('Entry 1: edit page has correct definition, part of speech', async () => { + test('Entry 1: edit page has correct definition, grammatical category', async () => { await editorPageManager.goto(); await expect(editorPageManager.getTextarea( editorPageManager.senseCard, 'Definition', 'en')) .toHaveValue(entries.entry1.senses[0].definition.en.value); - expect(await editorPageManager.getSelectedValueFromSelectDropdown(editorPageManager.senseCard, 'Part of Speech')) + expect(await editorPageManager.getSelectedValueFromSelectDropdown(editorPageManager.senseCard, 'Grammatical Category')) .toEqual(entries.entry1.senses[0].partOfSpeech.displayName); }); @@ -96,13 +96,13 @@ test.describe('Editor entries', () => { editorPageManager.senseCard.first(), 'Definition', 'en')).toHaveValue(entries.multipleMeaningEntry.senses[0].definition.en.value); }); - test('Lexeme 2: edit page has correct definition, part of speech', async () => { + test('Lexeme 2: edit page has correct definition, grammatical category', async () => { await editorPageManager.goto({ entryId: entryIds()[1] }); await expect(editorPageManager.getTextarea( editorPageManager.senseCard, 'Definition', 'en')) .toHaveValue(entries.entry2.senses[0].definition.en.value); - expect(await editorPageManager.getSelectedValueFromSelectDropdown(editorPageManager.senseCard, 'Part of Speech')) + expect(await editorPageManager.getSelectedValueFromSelectDropdown(editorPageManager.senseCard, 'Grammatical Category')) .toEqual(entries.entry2.senses[0].partOfSpeech.displayName); }); @@ -128,9 +128,9 @@ test.describe('Editor entries', () => { editorPageManager.senseCard.nth(1), 'Definition', 'en')) .toHaveValue(entries.multipleMeaningEntry.senses[1].definition.en.value); - expect(await editorPageManager.getSelectedValueFromSelectDropdown(editorPageManager.senseCard.nth(0), 'Part of Speech')) + expect(await editorPageManager.getSelectedValueFromSelectDropdown(editorPageManager.senseCard.nth(0), 'Grammatical Category')) .toEqual(entries.multipleMeaningEntry.senses[0].partOfSpeech.displayName); - expect(await editorPageManager.getSelectedValueFromSelectDropdown(editorPageManager.senseCard.nth(1), 'Part of Speech')) + expect(await editorPageManager.getSelectedValueFromSelectDropdown(editorPageManager.senseCard.nth(1), 'Grammatical Category')) .toEqual(entries.multipleMeaningEntry.senses[1].partOfSpeech.displayName); }); @@ -220,7 +220,7 @@ test.describe('Editor entries', () => { await (editorPageManager.getTextarea(editorPageManager.senseCard, 'Definition', 'en')) .fill(entries.entry3.senses[0].definition.en.value); - const partOfSpeedDropdown = editorPageManager.getDropdown(editorPageManager.senseCard, 'Part of Speech'); + const partOfSpeedDropdown = editorPageManager.getDropdown(editorPageManager.senseCard, 'Grammatical Category'); partOfSpeedDropdown.selectOption({ label: 'Noun (n)' }); // Autosaves changes diff --git a/test/php/model/languageforge/lexicon/command/LexOptionListCommandsTest.php b/test/php/model/languageforge/lexicon/command/LexOptionListCommandsTest.php index af58fbc7c6..f28242876f 100644 --- a/test/php/model/languageforge/lexicon/command/LexOptionListCommandsTest.php +++ b/test/php/model/languageforge/lexicon/command/LexOptionListCommandsTest.php @@ -18,7 +18,7 @@ public function testUpdateList_newList_createsOK() // Initial project has no optionlists populated $this->assertEquals(0, $optionLists->count); - // Initialized project has part of speech optionlist defined + // Initialized project has grammatical category optionlist defined $project->initializeNewProject(); $optionLists->read(); $this->assertEquals(1, $optionLists->count); @@ -36,7 +36,7 @@ public function testUpdateList_newList_createsOK() $newValue = $optionLists->entries[0]["items"][0]["value"]; $this->assertEquals("Verb (v)", $newValue); - // Create part of speech list for fruits + // Create grammatical category list for fruits $fruits = [ ["key" => "a", "value" => "apple"], ["key" => "b", "value" => "berry"], diff --git a/test/php/model/languageforge/lexicon/dto/LexBaseViewDtoTest.php b/test/php/model/languageforge/lexicon/dto/LexBaseViewDtoTest.php index 1f6f908dae..5e6a05d196 100644 --- a/test/php/model/languageforge/lexicon/dto/LexBaseViewDtoTest.php +++ b/test/php/model/languageforge/lexicon/dto/LexBaseViewDtoTest.php @@ -35,7 +35,7 @@ public function testEncode_Project_DtoCorrect() $this->assertEquals("Lexeme Form", $dto["config"]["entry"]["fields"]["lexeme"]["label"]); $this->assertEquals("Lexeme Form", $dto["config"]["entry"]["fields"]["lexeme"]["label"]); $this->assertEquals( - "Part of Speech", + "Grammatical Category", $dto["config"]["entry"]["fields"]["senses"]["fields"]["partOfSpeech"]["label"] ); $this->assertTrue($dto["config"]["roleViews"]["contributor"]["fields"]["lexeme"]["show"]); From ea7fa0ee71d385a94cb33673a0acbbca9ffe1ba1 Mon Sep 17 00:00:00 2001 From: billy clark Date: Thu, 23 Feb 2023 14:58:19 -0500 Subject: [PATCH 7/7] updated "Type" field to "Sense Type" --- src/Api/Model/Languageforge/Lexicon/Config/LexConfig.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Api/Model/Languageforge/Lexicon/Config/LexConfig.php b/src/Api/Model/Languageforge/Lexicon/Config/LexConfig.php index c074309cc2..7d29aec751 100644 --- a/src/Api/Model/Languageforge/Lexicon/Config/LexConfig.php +++ b/src/Api/Model/Languageforge/Lexicon/Config/LexConfig.php @@ -134,7 +134,7 @@ public static function flexOptionlistCode($fieldName) "location" => "Location", "usage-type" => "Usages", "reversal-type" => "Reversal Entries", - "sense-type" => "Type", + "sense-type" => "Sense Type", "anthro-code" => "Anthropology Categories", "do-not-publish-in" => "Publish In", "status" => "Status",