Conversation
…s input in challenge & engagement forms
Engagements v2 changes
…kills PM-3786 ai assisted skills suggestions
…kills PM-3786 #time 30min build & lint fixes
| defaults: &defaults | ||
| docker: | ||
| - image: cimg/python:3.11.11-browsers | ||
| - image: cimg/python:3.12.12-browsers |
There was a problem hiding this comment.
[❗❗ correctness]
Upgrading the Python image from 3.11.11 to 3.12.12 may 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.
| // require.resolve('webpack/hot/dev-server'), | ||
| isEnvDevelopment && | ||
| require.resolve('react-dev-utils/webpackHotDevClient'), | ||
| path.resolve(__dirname, 'webpackHotDevClient'), |
There was a problem hiding this comment.
[❗❗ correctness]
The change from require.resolve('react-dev-utils/webpackHotDevClient') to path.resolve(__dirname, 'webpackHotDevClient') could lead to potential issues if the webpackHotDevClient file is not present in the expected directory. Ensure that this file is correctly located and that any differences in behavior between the resolved module and the local file are intentional.
dist/976489525ddbc1ce.ttf
Outdated
| @@ -0,0 +1 @@ | |||
| module.exports = __webpack_public_path__ + "static/media/roboto-blackitalic.9fce9ccc.ttf"; No newline at end of file | |||
There was a problem hiding this comment.
[maintainability]
Consider using path.join from the Node.js path module to construct file paths. This approach can improve cross-platform compatibility by ensuring the correct path separators are used.
dist/9ff19a4f2cee2a22.eot
Outdated
| @@ -0,0 +1 @@ | |||
| module.exports = __webpack_public_path__ + "static/media/roboto-bolditalic.aa10b644.eot"; No newline at end of file | |||
There was a problem hiding this comment.
[💡 style]
The lack of a newline at the end of the file can cause issues with some tools that process files line by line. Consider adding a newline to improve compatibility and maintainability.
dist/a103d3afb23be6d5.woff
Outdated
| @@ -0,0 +1 @@ | |||
| module.exports = __webpack_public_path__ + "static/media/roboto-thin.391f6caa.woff"; No newline at end of file | |||
There was a problem hiding this comment.
[💡 style]
Consider adding a newline at the end of the file. While this is not a correctness issue, it is a common convention that can help prevent issues with some tools and version control systems.
dist/abe50b9e8f8dd1b9.ttf
Outdated
| @@ -0,0 +1 @@ | |||
| module.exports = __webpack_public_path__ + "static/media/roboto-mediumitalic.3eef81d5.ttf"; No newline at end of file | |||
There was a problem hiding this comment.
[correctness]
The use of __webpack_public_path__ assumes that it is correctly set at runtime. Ensure that this variable is properly configured in all environments where this code will run to avoid potential path resolution issues.
dist/ad4d04a37af8ada3.svg
Outdated
| @@ -0,0 +1 @@ | |||
| module.exports = __webpack_public_path__ + "static/media/roboto-lightitalic.baa43a84.svg"; No newline at end of file | |||
There was a problem hiding this comment.
[❗❗ correctness]
The use of __webpack_public_path__ assumes that it is correctly set up and available in the environment where this module is used. Ensure that this variable is properly configured to avoid runtime errors related to incorrect asset paths.
dist/bf79b0288d0b9cb9.ttf
Outdated
| @@ -0,0 +1 @@ | |||
| module.exports = __webpack_public_path__ + "static/media/roboto-bold.a452a6e8.ttf"; No newline at end of file | |||
There was a problem hiding this comment.
[💡 style]
Consider adding a newline at the end of the file. While this is not a correctness issue, it is a common convention that can help avoid potential issues with some tools and version control systems.
dist/c984e46df0e90c1f.eot
Outdated
| @@ -0,0 +1 @@ | |||
| module.exports = __webpack_public_path__ + "static/media/roboto-light.82fabc8a.eot"; No newline at end of file | |||
There was a problem hiding this comment.
[correctness]
The use of __webpack_public_path__ assumes that it is correctly set up in the webpack configuration. Ensure that this variable is properly defined and managed to avoid potential issues with asset loading paths in different environments.
dist/c984e46df0e90c1f.eot
Outdated
| @@ -0,0 +1 @@ | |||
| module.exports = __webpack_public_path__ + "static/media/roboto-light.82fabc8a.eot"; No newline at end of file | |||
There was a problem hiding this comment.
[💡 style]
Consider adding a newline at the end of the file. While this is a minor issue, it can help avoid unnecessary diffs in version control systems and is a common convention.
dist/d2276a84aff4ac30.svg
Outdated
| @@ -0,0 +1 @@ | |||
| module.exports = __webpack_public_path__ + "static/media/roboto-bold.aff20cb4.svg"; No newline at end of file | |||
There was a problem hiding this comment.
[❗❗ correctness]
The use of __webpack_public_path__ can be risky if not properly configured, as it relies on the global state of the webpack runtime. Ensure that __webpack_public_path__ is set correctly in all environments to avoid loading assets from incorrect paths.
dist/d2276a84aff4ac30.svg
Outdated
| @@ -0,0 +1 @@ | |||
| module.exports = __webpack_public_path__ + "static/media/roboto-bold.aff20cb4.svg"; No newline at end of file | |||
There was a problem hiding this comment.
[💡 style]
Consider adding a newline at the end of the file to comply with POSIX standards, which can help prevent issues with some tools and version control systems.
dist/d44f7fb00f260066.ttf
Outdated
| @@ -0,0 +1 @@ | |||
| module.exports = __webpack_public_path__ + "static/media/roboto-medium.9f855913.ttf"; No newline at end of file | |||
There was a problem hiding this comment.
[💡 style]
Consider adding a newline at the end of the file. While this is not a correctness issue, it is a common convention that can help prevent potential issues with certain tools or when concatenating files.
dist/e86e56fec2935cb2.svg
Outdated
| @@ -0,0 +1 @@ | |||
| module.exports = __webpack_public_path__ + "static/media/roboto-black.7e09c6e9.svg"; No newline at end of file | |||
There was a problem hiding this comment.
[💡 style]
Consider adding a newline at the end of the file. While this is not a correctness issue, it is a common convention that can help avoid potential issues with certain tools or when concatenating files.
dist/eba69177dc437c4f.svg
Outdated
| @@ -0,0 +1 @@ | |||
| module.exports = __webpack_public_path__ + "static/media/roboto-thinitalic.a96ddaaf.svg"; No newline at end of file | |||
There was a problem hiding this comment.
[💡 style]
Consider adding a newline at the end of the file. While not technically incorrect, having a newline at the end of files is a convention that can prevent potential issues with some tools and version control systems.
dist/f196a91cced815e5.svg
Outdated
| @@ -0,0 +1 @@ | |||
| module.exports = __webpack_public_path__ + "static/media/roboto-bolditalic.fd7a4235.svg"; No newline at end of file | |||
There was a problem hiding this comment.
[💡 style]
Consider adding a newline at the end of the file. While not technically incorrect, having a newline at the end of files is a common convention that can prevent potential issues with certain tools and version control systems.
dist/f598273ad7e765f0.woff
Outdated
| @@ -0,0 +1 @@ | |||
| module.exports = __webpack_public_path__ + "static/media/roboto-medium.8b88b4ee.woff"; No newline at end of file | |||
There was a problem hiding this comment.
[💡 style]
Consider adding a newline at the end of the file. While this is not technically incorrect, it is a common convention that can prevent issues with certain tools or when concatenating files.
dist/index.html
Outdated
| /> | ||
| <meta name="theme-color" content="#000000" /> | ||
| <title>Work Manager - Topcoder</title> | ||
| <script defer src="/static/js/runtime~main.js"></script><script defer src="/static/js/vendors-node_modules_pnpm_fortawesome_free-solid-svg-icons_5_15_4_node_modules_fortawesome_fr-d89314.js"></script><script defer src="/static/js/main.js"></script></head> |
There was a problem hiding this comment.
[💡 readability]
Consider splitting the <script> tags onto separate lines for improved readability and maintainability. This will make it easier to manage and update individual scripts in the future.
| if (uncachedProjectIds.length) { | ||
| const projectNameEntries = await Promise.all( | ||
| uncachedProjectIds.map(async (projectId) => { | ||
| try { |
There was a problem hiding this comment.
[maintainability]
Consider adding logging or handling for the error case in fetchProjectById. Currently, if an error occurs, it silently returns null, which might make debugging difficult.
| const projectNameEntries = await Promise.all( | ||
| uncachedProjectIds.map(async (projectId) => { | ||
| try { | ||
| const project = await fetchProjectById(projectId) |
There was a problem hiding this comment.
[❗❗ correctness]
Ensure that fetchProjectById handles network errors and returns a consistent response. If it throws an error, it might cause the hydrateEngagementProjectNames function to fail unexpectedly.
| }) | ||
| ) | ||
|
|
||
| projectNameEntries.forEach(([projectId, projectName]) => { |
There was a problem hiding this comment.
[performance]
The projectNameCache is a global object that could grow indefinitely if the application runs for a long time or processes many projects. Consider implementing a cache eviction strategy to prevent potential memory issues.
| @@ -61,6 +65,52 @@ const DateInput = forwardRef(({ | |||
| return valueAsDate.getTime() < minAsDate.getTime() ? minAsDate : valueAsDate | |||
| } | |||
|
|
|||
| const adjustPopoverToViewport = () => { | |||
There was a problem hiding this comment.
[❗❗ correctness]
The adjustPopoverToViewport function relies on window and document objects, which are not available in server-side rendering environments. Consider adding checks or guards to ensure this function is only called in client-side environments.
| @@ -83,6 +133,7 @@ const DateInput = forwardRef(({ | |||
| } | |||
| onChange(newValue) | |||
| }} | |||
| onFocus={adjustPopoverToViewport} | |||
There was a problem hiding this comment.
[performance]
Attaching adjustPopoverToViewport to the onFocus event might lead to performance issues if the function is computationally expensive or if focus events are triggered frequently. Consider evaluating the performance impact and optimizing if necessary.
| @@ -164,7 +168,7 @@ | |||
|
|
|||
| .filters { | |||
| display: grid; | |||
| grid-template-columns: minmax(240px, 2fr) repeat(3, minmax(160px, 1fr)); | |||
| grid-template-columns: minmax(240px, 2fr) repeat(2, minmax(160px, 1fr)); | |||
There was a problem hiding this comment.
[design]
The change from repeat(3, minmax(160px, 1fr)) to repeat(2, minmax(160px, 1fr)) reduces the number of columns in the grid layout. Ensure that this change aligns with the intended design and that it does not negatively impact the layout on different screen sizes.
| return fallbackProjectId | ||
| } | ||
|
|
||
| const getEngagementProjectName = (engagement, fallbackProjectName = null) => { |
There was a problem hiding this comment.
[💡 maintainability]
The function getEngagementProjectName could be optimized by checking for engagement once at the beginning, reducing redundancy in the checks for engagement.projectName and engagement.project.name.
| const [statusFilter, setStatusFilter] = useState(DEFAULT_STATUS_OPTION) | ||
| const [sortBy, setSortBy] = useState(SORT_OPTIONS[0]) | ||
| const [sortOrder, setSortOrder] = useState(SORT_ORDER_OPTIONS[0]) | ||
| const [searchProjectName, setSearchProjectName] = useState('') |
There was a problem hiding this comment.
[💡 readability]
Consider renaming searchProjectName to projectNameFilter for consistency with other filter state variables like statusFilter and visibilityFilter.
| @@ -353,59 +265,55 @@ const EngagementsList = ({ | |||
|
|
|||
| return ( | |||
| <tr key={engagement.id || engagement.title}> | |||
There was a problem hiding this comment.
[correctness]
Using engagement.id || engagement.title as the key for the table rows could lead to duplicate keys if engagement.id is null and multiple engagements have the same title. Consider using a more unique identifier.
| if (!projectId) { | ||
| return 0 | ||
| } | ||
| if (pathname.includes(`/projects/${projectId}/engagements`)) { | ||
| return 2 | ||
| return canViewEngagements ? 2 : 0 |
There was a problem hiding this comment.
[❗❗ correctness]
The change here introduces a conditional return value based on canViewEngagements. Ensure that the logic for determining canViewEngagements is correctly implemented and tested, as this impacts the tab navigation logic.
| if (projectId) { | ||
| if (tab === 3 && !canViewAssets) { | ||
| if ((tab === 2 && !canViewEngagements) || (tab === 3 && !canViewAssets)) { |
There was a problem hiding this comment.
[❗❗ correctness]
The condition now checks both tab === 2 && !canViewEngagements and tab === 3 && !canViewAssets. Ensure that these conditions are correctly aligned with the intended tab access logic, as incorrect conditions could prevent users from accessing the correct tabs.
| return | ||
| } | ||
| if (tab === 1) { | ||
| history.push(`/projects/${projectId}/challenges`) | ||
| this.setState({ currentTab: 1 }) | ||
| } else if (tab === 2) { | ||
| } else if (tab === 2 && canViewEngagements) { |
There was a problem hiding this comment.
[security]
The added condition && canViewEngagements ensures that navigation to the engagements tab only occurs if the user has the appropriate permissions. Verify that this logic is consistent with the application's permission model.
| @@ -124,7 +124,7 @@ class Routes extends React.Component { | |||
| const isReadOnly = checkReadOnlyRoles(this.props.token) | |||
| const isCopilot = checkCopilot(this.props.token) | |||
| const isAdmin = checkAdmin(this.props.token) | |||
| const canManageEngagements = checkAdminOrPmOrTaskManager(this.props.token, null) | |||
| const canAccessEngagements = checkAdminOrTalentManager(this.props.token) | |||
|
|
|||
There was a problem hiding this comment.
[maintainability]
The variable canAccessEngagements is used multiple times to control access to routes. Consider extracting this logic into a separate function or utility to improve maintainability and reduce repetition.
| {!canManageEngagements && ( | ||
| <Route exact path='/projects/:projectId/engagements/new' | ||
| {canAccessEngagements && ( | ||
| <Route exact path='/projects/:projectId/engagements/:engagementId/applications' |
There was a problem hiding this comment.
[design]
The route for /projects/:projectId/engagements/:engagementId/applications is nested under canAccessEngagements, which seems to imply that only users with access can view applications. Ensure this is the intended behavior, as it might restrict access more than necessary.
| {!canManageEngagements && ( | ||
| <Route path='/projects/:projectId/engagements/:engagementId' | ||
| {!canAccessEngagements && ( | ||
| <Route path='/projects/:projectId/engagements' |
There was a problem hiding this comment.
[❗❗ security]
The warning message for users without access to engagements has been updated to 'You need Admin or Talent Manager role to view engagements'. Ensure that this change aligns with the intended access control policy, as it might affect user roles and permissions.
fix(PM-3485): fixed columns and data mismatch in resources tab
| test-automation/test-results No newline at end of file | ||
| test-automation/test-results | ||
|
|
||
| dist No newline at end of file |
There was a problem hiding this comment.
[💡 maintainability]
The entry dist is already included in the .gitignore under the # production section at line 15. This duplication is unnecessary and could lead to confusion. Consider removing the duplicate entry.
No description provided.