-
Notifications
You must be signed in to change notification settings - Fork 51
[PROD RELEASE] - AI & V2 engagements & Fixes #1728
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
Changes from all commits
52363ce
7655a19
d44d9ba
4105e35
2618327
70fa065
cc50fab
9263eb6
bcbcc8e
4638c97
ca3b234
2989706
5aa2478
7d1d959
3d337d5
281a998
9613ac3
928a24d
ee9a63b
198c4dd
3a051ff
fd0ecba
6feee77
c091375
052e0d5
c3a74f4
500e9b1
aa60cbf
cddfaf1
015a292
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,6 +12,7 @@ node_modules | |
|
|
||
| # production | ||
| /build | ||
| /dist | ||
|
|
||
| # misc | ||
| .DS_Store | ||
|
|
@@ -32,4 +33,6 @@ yarn-error.log* | |
|
|
||
| # e2e test case | ||
| test-automation/temp | ||
| test-automation/test-results | ||
| test-automation/test-results | ||
|
|
||
| dist | ||
|
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. [💡 |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,7 +37,6 @@ module.exports = function (webpackEnv) { | |
| const isEnvDevelopment = webpackEnv === 'development' | ||
| const isEnvProduction = webpackEnv === 'production' | ||
| const WM_DEBUG = /^(1|true|on|yes)$/i.test(String(process.env.WM_DEBUG || '')) | ||
| const reactDevUtilsContextRegExp = /[\\/]react-dev-utils[\\/]/ | ||
|
|
||
| // Webpack uses `publicPath` to determine where the app is being served from. | ||
| // It requires a trailing slash, or the file assets will get an incorrect path. | ||
|
|
@@ -150,7 +149,7 @@ module.exports = function (webpackEnv) { | |
| // require.resolve('webpack-dev-server/client') + '?/', | ||
| // require.resolve('webpack/hot/dev-server'), | ||
| isEnvDevelopment && | ||
| require.resolve('react-dev-utils/webpackHotDevClient'), | ||
| path.resolve(__dirname, 'webpackHotDevClient'), | ||
|
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. [❗❗ |
||
| // Finally, this is your app's code: | ||
| paths.appIndexJs | ||
| // We include the app code last so that if there is a runtime error during | ||
|
|
@@ -485,13 +484,6 @@ module.exports = function (webpackEnv) { | |
| // This gives some necessary context to module not found errors, such as | ||
| // the requesting resource. | ||
| new ModuleNotFoundPlugin(paths.appPath), | ||
| // Ensure the dev client tolerates webpack 5 warning/error objects. | ||
| isEnvDevelopment && | ||
| new webpack.NormalModuleReplacementPlugin(/\.\/formatWebpackMessages$/, (resource) => { | ||
| if (reactDevUtilsContextRegExp.test(resource.context || '')) { | ||
| resource.request = path.resolve(__dirname, 'formatWebpackMessages') | ||
| } | ||
| }), | ||
| // (DefinePlugin already added above with merged env) | ||
| // This is necessary to emit hot updates (currently CSS only): | ||
| isEnvDevelopment && new webpack.HotModuleReplacementPlugin(), | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| 'use strict' | ||
|
|
||
| var patchedFormatWebpackMessages = require('./formatWebpackMessages') | ||
|
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. [💡 |
||
| var originalFormatWebpackMessages = require('react-dev-utils/formatWebpackMessages') | ||
|
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. [💡 |
||
|
|
||
| // webpackHotDevClient requires react-dev-utils/formatWebpackMessages internally. | ||
| // Replace that cached module export before loading the hot client so warnings | ||
| // and errors can be normalized for webpack 5 object payloads. | ||
| if (typeof __webpack_require__ === 'function' && __webpack_require__.c) { | ||
| Object.keys(__webpack_require__.c).forEach(function(id) { | ||
| var cachedModule = __webpack_require__.c[id] | ||
|
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. [💡 |
||
| if (cachedModule && cachedModule.exports === originalFormatWebpackMessages) { | ||
| cachedModule.exports = patchedFormatWebpackMessages | ||
| } | ||
| }) | ||
| } | ||
|
|
||
| require('react-dev-utils/webpackHotDevClient') | ||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,6 +7,7 @@ import { | |
| patchEngagement, | ||
| deleteEngagement as deleteEngagementAPI | ||
| } from '../services/engagements' | ||
| import { fetchProjectById } from '../services/projects' | ||
| import { fetchSkillsByIds } from '../services/skills' | ||
| import { | ||
| normalizeEngagement, | ||
|
|
@@ -33,6 +34,8 @@ import { | |
| DELETE_ENGAGEMENT_FAILURE | ||
| } from '../config/constants' | ||
|
|
||
| const projectNameCache = {} | ||
|
|
||
| const getSkillId = (skill) => { | ||
| if (!skill) { | ||
| return null | ||
|
|
@@ -93,6 +96,70 @@ const withSkillDetails = (engagement, skillsMap) => { | |
| } | ||
| } | ||
|
|
||
| const getProjectId = (engagement) => { | ||
| if (!engagement || !engagement.projectId) { | ||
| return null | ||
| } | ||
| return String(engagement.projectId) | ||
| } | ||
|
|
||
| const getProjectName = (project) => { | ||
| if (!project || typeof project !== 'object') { | ||
| return null | ||
| } | ||
| if (typeof project.name === 'string' && project.name.trim()) { | ||
| return project.name | ||
| } | ||
| if (typeof project.projectName === 'string' && project.projectName.trim()) { | ||
| return project.projectName | ||
| } | ||
| return null | ||
| } | ||
|
|
||
| const hydrateEngagementProjectNames = async (engagements = []) => { | ||
| if (!Array.isArray(engagements) || !engagements.length) { | ||
| return [] | ||
| } | ||
|
|
||
| const projectIds = Array.from(new Set( | ||
| engagements | ||
| .map(getProjectId) | ||
| .filter(Boolean) | ||
| )) | ||
|
|
||
| if (!projectIds.length) { | ||
| return engagements | ||
| } | ||
|
|
||
| const uncachedProjectIds = projectIds.filter((projectId) => !projectNameCache[projectId]) | ||
| if (uncachedProjectIds.length) { | ||
| const projectNameEntries = await Promise.all( | ||
| uncachedProjectIds.map(async (projectId) => { | ||
| try { | ||
|
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. [ |
||
| const project = await fetchProjectById(projectId) | ||
|
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. [❗❗ |
||
| return [projectId, getProjectName(project)] | ||
| } catch (error) { | ||
| return [projectId, null] | ||
| } | ||
| }) | ||
| ) | ||
|
|
||
| projectNameEntries.forEach(([projectId, projectName]) => { | ||
|
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. [ |
||
| if (projectName) { | ||
| projectNameCache[projectId] = projectName | ||
| } | ||
| }) | ||
| } | ||
|
|
||
| return engagements.map((engagement) => { | ||
| const projectId = getProjectId(engagement) | ||
| return { | ||
| ...engagement, | ||
| projectName: (projectId && projectNameCache[projectId]) || engagement.projectName || null | ||
| } | ||
| }) | ||
| } | ||
|
|
||
| const hydrateEngagementSkills = async (engagements = []) => { | ||
| if (!Array.isArray(engagements) || !engagements.length) { | ||
| return [] | ||
|
|
@@ -206,7 +273,8 @@ export function loadEngagements (projectId, status = 'all', filterName = '', inc | |
| } while (!totalPages || page <= totalPages) | ||
|
|
||
| const hydratedEngagements = await hydrateEngagementSkills(engagements) | ||
| const normalizedEngagements = normalizeEngagements(hydratedEngagements) | ||
| const engagementsWithProjectNames = await hydrateEngagementProjectNames(hydratedEngagements) | ||
| const normalizedEngagements = normalizeEngagements(engagementsWithProjectNames) | ||
| dispatch({ | ||
| type: LOAD_ENGAGEMENTS_SUCCESS, | ||
| engagements: normalizedEngagements | ||
|
|
||
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.
[❗❗
correctness]Upgrading the Python image from
3.11.11to3.12.12may introduce compatibility issues with existing code or dependencies. Ensure that all dependencies and code are compatible with Python 3.12.12 and that thorough testing is conducted to verify this change.