-
Notifications
You must be signed in to change notification settings - Fork 894
feat: [UEPR-57] migrate to react v18 #9311
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
Merged
Merged
Changes from 8 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
a739682
feat: [UEPR-57] migrate to react v18
MiroslavDionisiev dce8c99
feat: [UEPR-57] update tests to use react testing library and remove …
MiroslavDionisiev d0d00ed
Merge remote-tracking branch 'origin/develop' into react-18-update
MiroslavDionisiev 45de5f5
fix: [UEPR-57] fix failing spec after change of banner text
MiroslavDionisiev 5ca5c20
fix: [UEPR-57] add generate locals to ci-cd workflow
MiroslavDionisiev a383ed8
fix: [UEPR-57] change import of act
MiroslavDionisiev 01dd173
fix: [UEPR-57] change import of act and change the node env we run te…
MiroslavDionisiev 6dc8bcc
chore: [UEPR-57] run tests in development mode
MiroslavDionisiev 8ce58e4
Merge remote-tracking branch 'upstream/develop' into react-18-update
KManolov3 c65391b
Merge remote-tracking branch 'upstream/develop' into react-18-update
KManolov3 1112aa4
feat: extract NODE_ENV=development to package.json
KManolov3 575c827
fix: update tests according to PR comments
KManolov3 8413829
fix: address comments
KManolov3 dc9d677
fix: pass ref to containers where useOnClickOutside is used
KManolov3 9c86bac
chore: upgrade to newest gui prerelease version
KManolov3 26d646e
Merge remote-tracking branch 'upstream/develop' into react-18-update
KManolov3 e0d67eb
fix: add cross-env library
KManolov3 59c64bd
fix: set NODE_ENV on jest commands themselves
KManolov3 6625f1e
Merge remote-tracking branch 'upstream/develop' into HEAD
KManolov3 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,7 @@ ENV | |
|
||
# Test | ||
/test/results/* | ||
/test/generated/generated-locales.js | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Props for remembering to add this line! |
||
/.nyc_output | ||
/coverage | ||
/bin/lib/localized-urls.json | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
const routes = require('../src/routes.json'); | ||
const path = require('path'); | ||
const fs = require('fs'); | ||
const merge = require('lodash.merge'); | ||
|
||
const globalTemplateFile = path.resolve(__dirname, '../src/l10n.json'); | ||
const generatedLocales = { | ||
en: JSON.parse(fs.readFileSync(globalTemplateFile, 'utf8')) | ||
}; | ||
const defaultLocales = {}; | ||
const views = []; | ||
|
||
for (const route in routes) { | ||
if (typeof routes[route].redirect !== 'undefined') { | ||
continue; | ||
} | ||
|
||
views.push(routes[route].name); | ||
try { | ||
const subdir = routes[route].view.split('/'); | ||
subdir.pop(); | ||
const l10n = path.resolve( | ||
__dirname, | ||
`../src/views/${subdir.join('/')}/l10n.json` | ||
); | ||
const viewIds = JSON.parse(fs.readFileSync(l10n, 'utf8')); | ||
defaultLocales[routes[route].name] = viewIds; | ||
} catch (err) { | ||
if (err.code !== 'ENOENT') { | ||
throw err; | ||
} | ||
} | ||
} | ||
|
||
views | ||
.map(view => defaultLocales[view]) | ||
.reduce((acc, curr) => merge(acc, curr), generatedLocales.en); | ||
|
||
const dirPath = './test/generated'; | ||
const filePath = './test/generated/generated-locales.js'; | ||
const variableName = 'generatedLocales'; | ||
const variableValue = JSON.stringify(generatedLocales, null, 2); | ||
const content = `const ${variableName} = ${variableValue}; | ||
export {${variableName}}; | ||
`; | ||
|
||
fs.mkdirSync(dirPath, {recursive: true}); | ||
fs.writeFileSync(filePath, content, 'utf8'); |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If
test:unit:jest:unit
doesn't work outside of dev mode, would it make sense to move theNODE_ENV=development
part intopackage.json
? Something like: