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

chore: make english default language for Leav #395

Merged
merged 2 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions apps/core/config/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ module.exports = {
},
lang: {
available: process.env.LANG_AVAILABLE || ['fr', 'en'],
default: process.env.LANG_DEFAULT || 'fr'
default: process.env.LANG_DEFAULT || 'en'
},
logs: {
level: process.env.LOG_LEVEL || 'info',
Expand Down Expand Up @@ -139,7 +139,7 @@ module.exports = {
endpoint: process.env.IMPORT_ENDPOINT || 'imports',
sizeLimit: process.env.IMPORT_SIZE_LIMIT || 10, // megabytes
groupData: process.env.IMPORT_GROUP_DATA || 50, // number of elements processed at the same time,
maxStackedElements: process.env.IMPORT_MAX_STACKED_ELEMENTS || 10000, // We clear the parser value stack based on the number of elements present
maxStackedElements: process.env.IMPORT_MAX_STACKED_ELEMENTS || 10000 // We clear the parser value stack based on the number of elements present
},
preview: {
directory: process.env.PREVIEWS_DIRECTORY || '/results'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe('Applications', () => {
const res = await makeGraphQlCall(`mutation {
saveApplication(application: {
id: "test_app",
label: {fr: "Test app"},
label: {en: "Test app"},
endpoint: "my-app",
module: "data-studio"
}) {
Expand Down Expand Up @@ -49,7 +49,6 @@ describe('Applications', () => {

test('Get applications list', async () => {
const res = await makeGraphQlCall('{ applications { list { id } } }');

expect(res.status).toBe(200);
expect(res.data.data.applications.list.length).toBeGreaterThanOrEqual(1);
expect(res.data.errors).toBeUndefined();
Expand Down
14 changes: 7 additions & 7 deletions apps/core/src/__tests__/e2e/api/e2eUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export async function gqlSaveLibrary(id: string, label: string, additionalAttrib
`mutation {
saveLibrary(library: {
id: "${id}",
label: {fr: "${label}"},
label: {en: "${label}"},
attributes: [${libAttributes.map(a => `"${a}"`).join(', ')}]
}) { id }
}`,
Expand All @@ -89,7 +89,7 @@ export async function gqlSaveApplication(id: string, label: string, endpoint: st
`mutation {
saveApplication(application: {
id: "${id}",
label: {fr: "${label}"},
label: {en: "${label}"},
endpoint: "${endpoint}",
module: "data-studio"
}) { id }
Expand Down Expand Up @@ -136,7 +136,7 @@ export async function gqlSaveAttribute(params: {
{
id: "${field.id}",
format: ${field.format ?? 'null'},
label: {fr: "${field.id}"},
label: {en: "${field.id}"},
validation_regex: ${field.validation_regex ? `"${field.validation_regex}"` : 'null'},
embedded_fields: ${
field.embedded_fields ? `[${field.embedded_fields.map(_convertEmbeddedFields).join(', ')}]` : 'null'
Expand Down Expand Up @@ -174,8 +174,8 @@ export async function gqlSaveAttribute(params: {
id: "${id}",
type: ${type},
format: ${format},
label: {fr: "${label}"},
description: {fr: "${description ? `"${description}"` : 'null'}"},
label: {en: "${label}"},
description: {en: "${description ? `"${description}"` : 'null'}"},
linked_library: ${linkedLibrary ? `"${linkedLibrary}"` : 'null'},
reverse_link: ${reverseLink ? `"${reverseLink}"` : 'null'},
linked_tree: ${linkedTree ? `"${linkedTree}"` : 'null'},
Expand Down Expand Up @@ -206,7 +206,7 @@ export async function gqlSaveTree(id: string, label: string, libraries: string[]
saveTree(
tree: {
id: "${id}",
label: {fr: "${label}"},
label: {en: "${label}"},
libraries: [${libraries
.map(
l =>
Expand Down Expand Up @@ -304,7 +304,7 @@ export async function gqlSaveVersionProfile(profileId: string, label: string, tr
`mutation {
saveVersionProfile(versionProfile: {
id: "${profileId}",
label: {fr: "label"},
label: {en: "label"},
trees: [${trees.map(a => `"${a}"`).join(', ')}]
}) {
id
Expand Down
18 changes: 9 additions & 9 deletions apps/core/src/__tests__/e2e/api/forms/forms.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ describe('Forms', () => {
await makeGraphQlCall(`mutation {
l1: saveLibrary(library: {
id: "${libraryId}",
label: {fr: "Test lib"}
label: {en: "Test lib"}
}) { id },
l2: saveLibrary(library: {
id: "${libraryId2}",
label: {fr: "Test lib"}
label: {en: "Test lib"}
}) { id },
a: saveAttribute(
attribute: {
id: "${fieldAttributeId}",
type: simple,
format: text,
label: {fr: "Test attr simple"}
label: {en: "Test attr simple"}
}
) {
id
Expand All @@ -44,7 +44,7 @@ describe('Forms', () => {
form: {
id: "${formName}"
library: "${libraryId}"
label: { fr: "Formulaire édition" }
label: { en: "Formulaire édition" }
elements: [
{
elements: [
Expand Down Expand Up @@ -96,7 +96,7 @@ describe('Forms', () => {
form: {
id: "${formName}"
library: "${libraryId}"
label: { fr: "Formulaire édition" }
label: { en: "Formulaire édition" }
elements: [
{
elements: [
Expand Down Expand Up @@ -146,7 +146,7 @@ describe('Forms', () => {
form: {
id: "${formName}"
library: "${libraryId2}"
label: { fr: "Formulaire édition" }
label: { en: "Formulaire édition" }
}
) {
id
Expand Down Expand Up @@ -203,7 +203,7 @@ describe('Forms', () => {
form: {
id: "${formName2}"
library: "${libraryId}"
label: { fr: "Formulaire édition" }
label: { en: "Formulaire édition" }
elements: [
{
elements: [
Expand All @@ -230,7 +230,7 @@ describe('Forms', () => {
form: {
id: "${formName2}"
library: "${libraryId}"
label: { fr: "Formulaire édition modifié" }
label: { en: "Formulaire édition modifié" }
}
) {
id
Expand Down Expand Up @@ -273,7 +273,7 @@ describe('Forms', () => {
form: {
id: "${formName}_for_record_form"
library: "${libraryId}"
label: { fr: "Formulaire édition" }
label: { en: "Formulaire édition" }
elements: [
{
elements: [
Expand Down
4 changes: 2 additions & 2 deletions apps/core/src/__tests__/e2e/api/libraries/libraries.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe('Libraries', () => {

test('Create library', async () => {
const res = await makeGraphQlCall(`mutation {
saveLibrary(library: {id: "libraries_test", label: {fr: "Test lib"}}) {
saveLibrary(library: {id: "libraries_test", label: {en: "Test lib"}}) {
id
attributes {id type}
fullTextAttributes { id }
Expand Down Expand Up @@ -42,7 +42,7 @@ describe('Libraries', () => {

test('Create files library', async () => {
const res = await makeGraphQlCall(`mutation {
saveLibrary(library: {id: "libraries_files_test", label: {fr: "Test lib"}, behavior: files}) {
saveLibrary(library: {id: "libraries_files_test", label: {en: "Test lib"}, behavior: files}) {
id
attributes {
id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ describe('Permissions', () => {
id: "${testPermAttrId}",
type: simple,
format: text,
label: {fr: "Permissions Test Attribute"},
label: {en: "Permissions Test Attribute"},
permissions_conf: {permissionTreeAttributes: ["${testLibAttrId}"], relation: and}
}) {
permissions_conf {
Expand Down Expand Up @@ -348,8 +348,8 @@ describe('Permissions', () => {
beforeAll(async () => {
// Create new test libs
await makeGraphQlCall(`mutation {
l1: saveLibrary(library: {id: "${inheritTestLibName}", label: {fr: "Test lib"}}) { id },
l2: saveLibrary(library: {id: "${inheritTestTreeElemLibName}", label: {fr: "Test lib"}}) { id }
l1: saveLibrary(library: {id: "${inheritTestLibName}", label: {en: "Test lib"}}) { id },
l2: saveLibrary(library: {id: "${inheritTestTreeElemLibName}", label: {en: "Test lib"}}) { id }
}`);

// Create test tree
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ describe('TreeNodePermissions', () => {
saveTree(
tree: {
id: "${elementsTreeId}",
label: {fr: "${elementsTreeId}"},
label: {en: "${elementsTreeId}"},
libraries: [{
library: "${elementsTreeLibId}",
settings: {allowMultiplePositions: false, allowedAtRoot: true, allowedChildren: ["__all__"]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ describe('Record identity', () => {
`mutation {
saveLibrary(library: {
id: "${testLinkedLibraryId}",
label: {fr: "Test Lib"},
label: {en: "Test Lib"},
attributes: ["${testLabelAttributeId}", "${testColorAttributeId}"]
recordIdentityConf: {
label: "${testLabelAttributeId}",
Expand All @@ -84,7 +84,7 @@ describe('Record identity', () => {
`mutation {
saveLibrary(library: {
id: "${testTreeRecordLibraryId}",
label: {fr: "Test Lib"},
label: {en: "Test Lib"},
attributes: ["${testLabelAttributeId}", "${testColorAttributeId}"]
recordIdentityConf: {
label: "${testLabelAttributeId}",
Expand All @@ -99,7 +99,7 @@ describe('Record identity', () => {
`mutation {
saveLibrary(library: {
id: "${testLinkedIdentityLibraryId}",
label: {fr: "Test Lib"},
label: {en: "Test Lib"},
attributes: ["${testLinkAttributeId}"]
recordIdentityConf: {
label: "${testLinkAttributeId}",
Expand All @@ -124,7 +124,7 @@ describe('Record identity', () => {
`mutation {
saveLibrary(library: {
id: "${testTreeIdentityLibraryId}",
label: {fr: "Test Lib"},
label: {en: "Test Lib"},
attributes: ["${testTreeAttributeId}"],
recordIdentityConf: {
label: "${testTreeAttributeId}",
Expand Down
2 changes: 1 addition & 1 deletion apps/core/src/__tests__/e2e/api/trees/trees.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe('Trees', () => {
saveTree(
tree: {
id: "${testTreeName}",
label: {fr: "Test tree"},
label: {en: "Test tree"},
libraries: [{
library: "users",
settings: {allowMultiplePositions: true, allowedAtRoot: true, allowedChildren: ["__all__"]}
Expand Down
20 changes: 10 additions & 10 deletions apps/core/src/__tests__/e2e/api/values/values.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe('Values', () => {
type: simple,
format: text,
unique: true,
label: {fr: "Test attr simple"},
label: {en: "Test attr simple"},
actions_list: {
saveValue: [
{id: "validateFormat",},
Expand All @@ -56,7 +56,7 @@ describe('Values', () => {
id: "${attrSimpleExtendedName}",
type: simple,
format: extended,
label: {fr: "Test attr simple étendu"},
label: {en: "Test attr simple étendu"},
embedded_fields: [
{
format: text,
Expand Down Expand Up @@ -90,7 +90,7 @@ describe('Values', () => {
id: "${attrAdvancedName}",
type: advanced,
format: text,
label: {fr: "Test attr advanced"}
label: {en: "Test attr advanced"}
}
) { id }
}`);
Expand All @@ -102,7 +102,7 @@ describe('Values', () => {
type: simple_link,
format: text,
linked_library: "${testLibName}",
label: {fr: "Test attr simple link"}
label: {en: "Test attr simple link"}
}
) { id }
}`);
Expand All @@ -114,7 +114,7 @@ describe('Values', () => {
type: advanced_link,
format: text,
linked_library: "${testLibName}",
label: {fr: "Test attr advanced link"}
label: {en: "Test attr advanced link"}
}
) { id }
}`);
Expand All @@ -126,7 +126,7 @@ describe('Values', () => {
type: advanced_link,
format: text,
linked_library: "${testLibName}",
label: {fr: "Test attr advanced link"},
label: {en: "Test attr advanced link"},
reverse_link: "${attrAdvancedLinkName}"
}
) { id }
Expand All @@ -139,7 +139,7 @@ describe('Values', () => {
type: advanced_link,
format: text,
linked_library: "${testLibName}",
label: {fr: "Test attr advanced link"},
label: {en: "Test attr advanced link"},
reverse_link: "${attrSimpleLinkName}"
}
) { id }
Expand All @@ -154,7 +154,7 @@ describe('Values', () => {

// Create library to use in tree
await makeGraphQlCall(`mutation {
saveLibrary(library: {id: "${treeLibName}", label: {fr: "Test tree lib"}}) { id }
saveLibrary(library: {id: "${treeLibName}", label: {en: "Test tree lib"}}) { id }
}`);

// create tree
Expand All @@ -167,7 +167,7 @@ describe('Values', () => {
id: "${attrTreeName}",
type: tree,
linked_tree: "${treeName}",
label: {fr: "Test tree attr"}
label: {en: "Test tree attr"}
}
) { id }
}`);
Expand All @@ -176,7 +176,7 @@ describe('Values', () => {
await makeGraphQlCall(`mutation {
saveLibrary(library: {
id: "${testLibName}",
label: {fr: "Test lib"},
label: {en: "Test lib"},
attributes: [
"id",
"modified_by",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ describe('VersionProfiles', () => {
const resSaveProfile = await makeGraphQlCall(`mutation {
saveVersionProfile(versionProfile: {
id: "${profileId}",
label: {fr: "test_profile"},
description: {fr: "Best profile ever!"},
label: {en: "test_profile"},
description: {en: "Best profile ever!"},
trees: ["${testTreeName}"],
}) {
id
Expand Down Expand Up @@ -54,7 +54,7 @@ describe('VersionProfiles', () => {
const resUpdateProfile = await makeGraphQlCall(`mutation {
saveVersionProfile(versionProfile: {
id: "${profileId}",
label: {fr: "test_profile modified"},
label: {en: "test_profile modified"},
}) {
id
label
Expand All @@ -64,7 +64,7 @@ describe('VersionProfiles', () => {

expect(resUpdateProfile.status).toBe(200);
expect(resUpdateProfile.data.errors).toBeUndefined();
expect(resUpdateProfile.data.data.saveVersionProfile.label.fr).toBe('test_profile modified');
expect(resUpdateProfile.data.data.saveVersionProfile.label.en).toBe('test_profile modified');

// Delete view
const resDeleteProfile = await makeGraphQlCall(`mutation {
Expand Down
Loading
Loading