Skip to content

Commit 36b3c36

Browse files
leangseu-edxRodra
andauthored
feat: whole course translations (#1330)
* feat: add language selection chore: update tests so we have less error message test: update test * test: update tests * chore: remove duplicate translation * chore: lint for console * chore: remove comments * chore: make sure the affect url frame refresh after the language selection change * chore: add whole_course_translation and language to courseware meta (#1305) * feat: Add feedback widget UI mock Add unit tests Fix snapshot Clean Sequence component logEvent calls Clean unit test Put feedback widget behind whole course translation flag Fix useFeedbackWidget test * chore: add src and dest translation * feat: first iteration of plugin translation chore: update plugin instruction * feat: Connect FeedbackWidget with backend services (#1325) Connect FeedbackWidget with backend services Move feedback widget to unit translation plugin * feat: Add authentication to WCT feedback endpoints (#1329) * chore: add fetch config and move feedback widget for the plugin chore: rewrite and test the api request chore: rebase chore: update translation feedback chore: test chore: add more tests * chore: rebase * chore: update requested change * chore: update package * chore: upgrade frontend-lib-special-exams and frontend-lib-learning-assistant * chore: update tests * chore: remove unneeded package * chore: update example config * chore: add source-map-loader * fix: feedback widget render error after submit feedback (#1335) * fix: feedback widget render error after submit feedback * fix: widget logic --------- Co-authored-by: Rodrigo Martin <[email protected]>
1 parent 3917262 commit 36b3c36

File tree

91 files changed

+12927
-12644
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+12927
-12644
lines changed

.env

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
NODE_ENV='production'
55

66
ACCESS_TOKEN_COOKIE_NAME=''
7+
AI_TRANSLATIONS_URL=''
78
BASE_URL=''
89
CONTACT_URL=''
910
CREDENTIALS_BASE_URL=''

.env.development

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
NODE_ENV='development'
55

66
ACCESS_TOKEN_COOKIE_NAME='edx-jwt-cookie-header-payload'
7+
AI_TRANSLATIONS_URL='http://localhost:18760'
78
BASE_URL='http://localhost:2000'
89
CONTACT_URL='http://localhost:18000/contact'
910
CREDENTIALS_BASE_URL='http://localhost:18150'

.env.test

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
NODE_ENV='test'
55

66
ACCESS_TOKEN_COOKIE_NAME='edx-jwt-cookie-header-payload'
7+
AI_TRANSLATIONS_URL='http://localhost:18760'
78
BASE_URL='http://localhost:2000'
89
CONTACT_URL='http://localhost:18000/contact'
910
CREDENTIALS_BASE_URL='http://localhost:18150'

.eslintrc.js

+7
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ const config = createConfig('eslint', {
1212
'react/no-unknown-property': 'off',
1313
'func-names': 'off',
1414
},
15+
settings: {
16+
'import/resolver': {
17+
webpack: {
18+
config: 'webpack.prod.config.js',
19+
},
20+
},
21+
},
1522
});
1623

1724
module.exports = config;

.gitignore

+4-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
node_modules
77
npm-debug.log
88
coverage
9+
env.config.*
910

1011
dist/
1112
src/i18n/transifex_input.json
@@ -26,4 +27,6 @@ module.config.js
2627
# Local environment overrides
2728
.env.private
2829

29-
src/i18n/messages/
30+
src/i18n/messages/
31+
32+
env.config.jsx

example.env.config.jsx

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import UnitTranslationPlugin from '@plugins/UnitTranslationPlugin';
2+
import { PLUGIN_OPERATIONS, DIRECT_PLUGIN } from '@openedx/frontend-plugin-framework';
3+
4+
// Load environment variables from .env file
5+
const config = {
6+
...process.env,
7+
pluginSlots: {
8+
unit_title_plugin: {
9+
plugins: [
10+
{
11+
op: PLUGIN_OPERATIONS.Insert,
12+
widget: {
13+
id: 'unit_title_plugin',
14+
type: DIRECT_PLUGIN,
15+
priority: 1,
16+
RenderWidget: UnitTranslationPlugin,
17+
},
18+
},
19+
],
20+
},
21+
},
22+
};
23+
24+
export default config;

jest.config.js

+25-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const { createConfig } = require('@openedx/frontend-build');
22

3-
module.exports = createConfig('jest', {
3+
const config = createConfig('jest', {
44
setupFilesAfterEnv: [
55
'<rootDir>/src/setupTest.js',
66
],
@@ -14,8 +14,31 @@ module.exports = createConfig('jest', {
1414
"^axios$": "axios/dist/axios.js",
1515
// See https://stackoverflow.com/questions/72382316/jest-encountered-an-unexpected-token-react-markdown
1616
'react-markdown': '<rootDir>/node_modules/react-markdown/react-markdown.min.js',
17+
'@src/(.*)': '<rootDir>/src/$1',
18+
'@plugins/(.*)': '<rootDir>/plugins/$1',
1719
},
1820
testTimeout: 30000,
21+
globalSetup: "./global-setup.js",
22+
verbose: true,
1923
testEnvironment: 'jsdom',
20-
globalSetup: "./global-setup.js"
2124
});
25+
26+
// delete config.testURL;
27+
28+
config.reporters = [...(config.reporters || []), ["jest-console-group-reporter", {
29+
// change this setting if need to see less details for each test
30+
// reportType: "summary" | "details",
31+
// enable: true | false,
32+
afterEachTest: {
33+
enable: true,
34+
filePaths: false,
35+
reportType: "details",
36+
},
37+
afterAllTests: {
38+
reportType: "summary",
39+
enable: true,
40+
filePaths: true,
41+
},
42+
}]];
43+
44+
module.exports = config;

0 commit comments

Comments
 (0)