Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update field names to be consistent with FLEx #1731

Merged
merged 8 commits into from
Feb 24, 2023
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Api/Model/Languageforge/Lexicon/Config/LexConfig.php
Original file line number Diff line number Diff line change
@@ -127,14 +127,14 @@ 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",
"location" => "Location",
"usage-type" => "Usages",
"reversal-type" => "Reversal Entries",
"sense-type" => "Type",
"sense-type" => "Sense Type",
megahirt marked this conversation as resolved.
Show resolved Hide resolved
"anthro-code" => "Anthropology Categories",
"do-not-publish-in" => "Publish In",
"status" => "Status",
@@ -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",
Original file line number Diff line number Diff line change
@@ -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();
2 changes: 1 addition & 1 deletion src/Api/Model/Languageforge/Lexicon/Import/LiftDecoder.php
Original file line number Diff line number Diff line change
@@ -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":
2 changes: 1 addition & 1 deletion src/Api/Model/Languageforge/Lexicon/Import/LiftImport.php
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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;
26 changes: 13 additions & 13 deletions test/e2e/tests/editor/editor.audio.spec.ts
Original file line number Diff line number Diff line change
@@ -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.
37 changes: 18 additions & 19 deletions test/e2e/tests/editor/editor.comments.spec.ts
Original file line number Diff line number Diff line change
@@ -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,14 +32,13 @@ 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();
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();
@@ -51,8 +50,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,10 +67,10 @@ 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();
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');
@@ -81,7 +80,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 +103,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,27 +125,27 @@ 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
await editorPage.toggleAllComments();
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);
});
});
Loading