From 8aace158db991ef5daa76d16870165f344c80538 Mon Sep 17 00:00:00 2001 From: Kiril Kartunov Date: Thu, 6 Nov 2025 16:24:32 +0200 Subject: [PATCH 1/6] Update tc-auth-lib dependency to use master branch --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 21a134470..360cf93aa 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "dependencies": { "@hapi/joi": "^16.1.4", "@optimizely/react-sdk": "^2.5.0", - "@topcoder-platform/tc-auth-lib": "topcoder-platform/tc-auth-lib#1.0.4", + "@topcoder-platform/tc-auth-lib": "topcoder-platform/tc-auth-lib#master", "aos": "^2.3.4", "atob": "^2.1.1", "babel-register": "^6.26.0", From 1701e0fe9d35a837bf8a4bba3408bd53aadf7ab8 Mon Sep 17 00:00:00 2001 From: Justin Gasper Date: Mon, 17 Nov 2025 11:55:39 +1100 Subject: [PATCH 2/6] auth0_updates --- .../components/__snapshots__/Content.jsx.snap | 27 ++++++++----------- __tests__/shared/reducers/challenge.js | 1 - src/shared/components/Content/index.jsx | 9 ++----- src/shared/utils/tc.js | 3 ++- 4 files changed, 15 insertions(+), 25 deletions(-) diff --git a/__tests__/shared/components/__snapshots__/Content.jsx.snap b/__tests__/shared/components/__snapshots__/Content.jsx.snap index 659f2ce57..b40694e90 100644 --- a/__tests__/shared/components/__snapshots__/Content.jsx.snap +++ b/__tests__/shared/components/__snapshots__/Content.jsx.snap @@ -81,22 +81,17 @@ exports[`Matches shallow shapshot 1`] = ` topcoder-react-lib/src/services/api.js - ), with support of TC authentication (look for auth tokens either in - - store.auth - - - of Redux store, or in - - v3jwt - - - and - - tcjwt - - - cookies of the front-end requests to the server); + ), with support of TC authentication (look for auth tokens either in + + store.auth + + + of Redux store, or in the + + tcjwt + + + cookie of the front-end requests to the server);
  • Stylefmt; diff --git a/__tests__/shared/reducers/challenge.js b/__tests__/shared/reducers/challenge.js index 2d4e112a9..7ca4ef13f 100644 --- a/__tests__/shared/reducers/challenge.js +++ b/__tests__/shared/reducers/challenge.js @@ -315,7 +315,6 @@ describe('Factory with server-side rendering', () => { reducers.factory({ cookies: { tcjwt: 'TcAuthTokenV2', - v3jwt: 'TcAuthTokenV3', }, url: '/challenges/12345/my-submissions', }).then((res) => { diff --git a/src/shared/components/Content/index.jsx b/src/shared/components/Content/index.jsx index a1c9139df..a2e2d4681 100644 --- a/src/shared/components/Content/index.jsx +++ b/src/shared/components/Content/index.jsx @@ -102,17 +102,12 @@ export default function Content() { {' '} of Redux store, or - in - - v3jwt - - {' '} - and + in the tcjwt {' '} - cookies of the front-end + cookie of the front-end requests to the server);
  • diff --git a/src/shared/utils/tc.js b/src/shared/utils/tc.js index 37cf139e4..0b1f3f3d7 100644 --- a/src/shared/utils/tc.js +++ b/src/shared/utils/tc.js @@ -200,7 +200,8 @@ export function getUnSelectedColors(rating) { export function getAuthTokens(req = {}) { const cookies = req.cookies || {}; let tokenV2 = cookies.tcjwt; - let tokenV3 = cookies.v3jwt; + let tokenV3 = cookies.tcjwt; + if (!tokenV2 || isTokenExpired(tokenV2, config.AUTH_DROP_TIME)) { tokenV2 = ''; } From cca4bf274827b5ef305697c9f63196dcdd2053f5 Mon Sep 17 00:00:00 2001 From: Justin Gasper Date: Mon, 17 Nov 2025 18:35:53 +1100 Subject: [PATCH 3/6] Let's try this --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index be92a2ada..7962f2e8e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1469,8 +1469,8 @@ "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==" }, "@topcoder-platform/tc-auth-lib": { - "version": "github:topcoder-platform/tc-auth-lib#68fdc22464810c51b703a33e529cdbd6d09437de", - "from": "github:topcoder-platform/tc-auth-lib#1.0.4", + "version": "github:topcoder-platform/tc-auth-lib#1c9be61eb32583beeb74f596fe58bb3ada97462d", + "from": "github:topcoder-platform/tc-auth-lib#master", "requires": { "lodash": "^4.17.19" } @@ -25686,7 +25686,7 @@ "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==" }, "topcoder-react-lib": { - "version": "github:topcoder-platform/topcoder-react-lib#2a61cecad3917f084797af010a93f7f544840174", + "version": "github:topcoder-platform/topcoder-react-lib#0145b54636dcdfee4185baafa95194535f280b37", "from": "github:topcoder-platform/topcoder-react-lib#v6", "requires": { "@topcoder-platform/tc-auth-lib": "git+https://github.com/topcoder-platform/tc-auth-lib.git#1.0.4", diff --git a/package.json b/package.json index 360cf93aa..0a002f8c8 100644 --- a/package.json +++ b/package.json @@ -164,7 +164,7 @@ "supertest": "^3.1.0", "tc-core-library-js": "github:appirio-tech/tc-core-library-js#v2.6.3.1", "tc-ui": "^1.0.12", - "topcoder-react-lib": "github:topcoder-platform/topcoder-react-lib#v6", + "topcoder-react-lib": "github:topcoder-platform/topcoder-react-lib#auth0", "topcoder-react-ui-kit": "2.0.1", "topcoder-react-utils": "github:topcoder-platform/topcoder-react-utils#v6", "turndown": "^4.0.2", From aec4a7e1c9e264035aa4bc79eca708de701372fb Mon Sep 17 00:00:00 2001 From: Justin Gasper Date: Mon, 17 Nov 2025 20:55:22 +1100 Subject: [PATCH 4/6] Another test build fix --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0a002f8c8..b61a5d540 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "dependencies": { "@hapi/joi": "^16.1.4", "@optimizely/react-sdk": "^2.5.0", - "@topcoder-platform/tc-auth-lib": "topcoder-platform/tc-auth-lib#master", + "@topcoder-platform/tc-auth-lib": "topcoder-platform/tc-auth-lib#v2.0", "aos": "^2.3.4", "atob": "^2.1.1", "babel-register": "^6.26.0", From 320134b97d7b222d71e78316c08321da35fce1d6 Mon Sep 17 00:00:00 2001 From: Justin Gasper Date: Thu, 20 Nov 2025 08:59:42 +1100 Subject: [PATCH 5/6] CORE-2300 fixes --- package-lock.json | 270 ++++++++++++++---- .../MySubmissions/SubmissionsList/index.jsx | 24 +- .../containers/challenge-detail/index.jsx | 51 ++-- 3 files changed, 276 insertions(+), 69 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7962f2e8e..d7229823c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1426,9 +1426,9 @@ } }, "@paralleldrive/cuid2": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/@paralleldrive/cuid2/-/cuid2-2.2.2.tgz", - "integrity": "sha512-ZOBkgDwEdoYVlSeRbYYXs0S9MejQofiVYoTbKzy/6GQa39/q5tQU2IX46+shYnUkpEl3wc+J6wRlar7r2EK2xA==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@paralleldrive/cuid2/-/cuid2-2.3.1.tgz", + "integrity": "sha512-XO7cAxhnTZl0Yggq6jOgjiOHhbgcO4NqFqwSmQpjK3b6TEE6Uj/jfSk6wzYyemh3+I0sHirKSetjQwn5cZktFw==", "requires": { "@noble/hashes": "^1.1.5" } @@ -1469,8 +1469,8 @@ "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==" }, "@topcoder-platform/tc-auth-lib": { - "version": "github:topcoder-platform/tc-auth-lib#1c9be61eb32583beeb74f596fe58bb3ada97462d", - "from": "github:topcoder-platform/tc-auth-lib#master", + "version": "github:topcoder-platform/tc-auth-lib#56996006ee5918b3e77fc5a8ab005ae738b4de12", + "from": "github:topcoder-platform/tc-auth-lib#v2.0", "requires": { "lodash": "^4.17.19" } @@ -4491,6 +4491,49 @@ } } }, + "call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "requires": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "dependencies": { + "function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==" + }, + "get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "requires": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + } + }, + "gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==" + }, + "has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==" + } + } + }, "call-me-maybe": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.2.tgz", @@ -23119,6 +23162,123 @@ "object-inspect": "^1.9.0" } }, + "side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "requires": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, + "dependencies": { + "object-inspect": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==" + } + } + }, + "side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "requires": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "dependencies": { + "function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==" + }, + "get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "requires": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + } + }, + "gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==" + }, + "has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==" + }, + "object-inspect": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==" + } + } + }, + "side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "requires": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "dependencies": { + "function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==" + }, + "get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "requires": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + } + }, + "gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==" + }, + "has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==" + }, + "object-inspect": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==" + } + } + }, "sigmund": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz", @@ -25686,10 +25846,10 @@ "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==" }, "topcoder-react-lib": { - "version": "github:topcoder-platform/topcoder-react-lib#0145b54636dcdfee4185baafa95194535f280b37", - "from": "github:topcoder-platform/topcoder-react-lib#v6", + "version": "github:topcoder-platform/topcoder-react-lib#4f8468736883ac51649b5fe0b66ad37cb16a6a89", + "from": "github:topcoder-platform/topcoder-react-lib#auth0", "requires": { - "@topcoder-platform/tc-auth-lib": "git+https://github.com/topcoder-platform/tc-auth-lib.git#1.0.4", + "@topcoder-platform/tc-auth-lib": "git+https://github.com/topcoder-platform/tc-auth-lib.git#v2.0", "auth0-js": "^6.8.4", "config": "^3.2.0", "isomorphic-fetch": "^2.2.1", @@ -25710,8 +25870,8 @@ }, "dependencies": { "@topcoder-platform/tc-auth-lib": { - "version": "git+https://github.com/topcoder-platform/tc-auth-lib.git#68fdc22464810c51b703a33e529cdbd6d09437de", - "from": "git+https://github.com/topcoder-platform/tc-auth-lib.git#1.0.4", + "version": "git+https://github.com/topcoder-platform/tc-auth-lib.git#56996006ee5918b3e77fc5a8ab005ae738b4de12", + "from": "git+https://github.com/topcoder-platform/tc-auth-lib.git#v2.0", "requires": { "lodash": "^4.17.19" } @@ -25745,6 +25905,11 @@ "follow-redirects": "0.0.7" } }, + "component-emitter": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.1.tgz", + "integrity": "sha512-T0+barUSQRTUQASh8bx02dl+DhF54GtIDY13Y3m9oWTklKbb3Wv974meRpeZ3lp1JpLVECWWNHC4vaG2XHXouQ==" + }, "config": { "version": "3.3.12", "resolved": "https://registry.npmjs.org/config/-/config-3.3.12.tgz", @@ -25754,9 +25919,9 @@ } }, "debug": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz", - "integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==", + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", "requires": { "ms": "^2.1.3" } @@ -25797,9 +25962,9 @@ } }, "form-data": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.3.tgz", - "integrity": "sha512-qsITQPfmvMOSAdeyZ+12I1c+CKSstAFAwu+97zrnWAbIr5u8wfsExUzCesVLC8NgHuRUqNN4Zy6UPWUTRGslcA==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.5.tgz", + "integrity": "sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==", "requires": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", @@ -25809,14 +25974,13 @@ } }, "formidable": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/formidable/-/formidable-2.1.5.tgz", - "integrity": "sha512-Oz5Hwvwak/DCaXVVUtPn4oLMLLy1CdclLKO1LFgU7XzDpVMUU5UjlSLpGMocyQNNk8F6IJW9M/YdooSn2MRI+Q==", + "version": "3.5.4", + "resolved": "https://registry.npmjs.org/formidable/-/formidable-3.5.4.tgz", + "integrity": "sha512-YikH+7CUTOtP44ZTnUhR7Ic2UASBPOqmaRkRKxRbywPTe5VxF7RRCck4af9wutiZ/QKM5nME9Bie2fFaPz5Gug==", "requires": { "@paralleldrive/cuid2": "^2.2.2", "dezalgo": "^1.0.4", - "once": "^1.4.0", - "qs": "^6.11.0" + "once": "^1.4.0" } }, "function-bind": { @@ -25874,6 +26038,11 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" }, + "object-inspect": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==" + }, "object-keys": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-0.4.0.tgz", @@ -25892,37 +26061,42 @@ "react-is": "^16.8.2" } }, - "readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "side-channel": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" } }, - "semver": { - "version": "7.7.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", - "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==" - }, "superagent": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/superagent/-/superagent-7.1.6.tgz", - "integrity": "sha512-gZkVCQR1gy/oUXr+kxJMLDjla434KmSOKbx5iGD30Ql+AkJQ/YlPKECJy2nhqOsHLjGHzoDTXNSjhnvWhzKk7g==", + "version": "10.2.3", + "resolved": "https://registry.npmjs.org/superagent/-/superagent-10.2.3.tgz", + "integrity": "sha512-y/hkYGeXAj7wUMjxRbB21g/l6aAEituGXM9Rwl4o20+SX3e8YOSV6BxFXl+dL3Uk0mjSL3kCbNkwURm8/gEDig==", "requires": { - "component-emitter": "^1.3.0", - "cookiejar": "^2.1.3", - "debug": "^4.3.4", + "component-emitter": "^1.3.1", + "cookiejar": "^2.1.4", + "debug": "^4.3.7", "fast-safe-stringify": "^2.1.1", - "form-data": "^4.0.0", - "formidable": "^2.0.1", + "form-data": "^4.0.4", + "formidable": "^3.5.4", "methods": "^1.1.2", "mime": "2.6.0", - "qs": "^6.10.3", - "readable-stream": "^3.6.0", - "semver": "^7.3.7" + "qs": "^6.11.2" + }, + "dependencies": { + "qs": { + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.0.tgz", + "integrity": "sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w==", + "requires": { + "side-channel": "^1.1.0" + } + } } }, "tc-core-library-js": { @@ -25941,16 +26115,16 @@ }, "dependencies": { "auth0-js": { - "version": "9.28.0", - "resolved": "https://registry.npmjs.org/auth0-js/-/auth0-js-9.28.0.tgz", - "integrity": "sha512-2xIfQIGM0vX3IdPR91ztLO2+Ar2I5+3iFKcjuZO+LV9vRh4Wje+Ka1hnHjMU9dH892Lm3ZxBAHxRo68YToUhfg==", + "version": "9.29.0", + "resolved": "https://registry.npmjs.org/auth0-js/-/auth0-js-9.29.0.tgz", + "integrity": "sha512-e9xMyKrcWvDLjCbztv3jC/TX/wdz2WynLiXHjPQ07H3zN3NdqCXD37zd9ogETYLRKtNN1t9c9pZu30qMbfbDkg==", "requires": { "base64-js": "^1.5.1", "idtoken-verifier": "^2.2.4", "js-cookie": "^2.2.0", "minimist": "^1.2.5", "qs": "^6.10.1", - "superagent": "^7.1.5", + "superagent": "^10.2.3", "url-join": "^4.0.1", "winchan": "^0.2.2" } diff --git a/src/shared/components/challenge-detail/MySubmissions/SubmissionsList/index.jsx b/src/shared/components/challenge-detail/MySubmissions/SubmissionsList/index.jsx index 3a86b2554..a17e8b913 100644 --- a/src/shared/components/challenge-detail/MySubmissions/SubmissionsList/index.jsx +++ b/src/shared/components/challenge-detail/MySubmissions/SubmissionsList/index.jsx @@ -63,6 +63,16 @@ const getDisplaySubmissionId = (submission) => { return ''; }; +const getSubmissionCreatedTime = (submission) => { + if (!submission) return undefined; + return ( + submission.created + || submission.createdAt + || submission.submissionTime + || submission.updated + || submission.updatedAt + ); +}; class SubmissionsListView extends React.Component { constructor(props) { @@ -73,7 +83,7 @@ class SubmissionsListView extends React.Component { statusClicked: false, finalClicked: false, provisionClicked: false, - timeClicked: false, + timeClicked: true, openModal: false, selectedSubmission: {}, }; @@ -106,7 +116,7 @@ class SubmissionsListView extends React.Component { } = this.props; let { field, sort } = submissionsSort; if (!field) { - field = 'Submission ID'; + field = 'Time'; } if (!sort) { @@ -172,8 +182,8 @@ class SubmissionsListView extends React.Component { break; } case 'Time': { - valueA = new Date(a.submissionTime); - valueB = new Date(b.submissionTime); + valueA = new Date(getSubmissionCreatedTime(a)); + valueB = new Date(getSubmissionCreatedTime(b)); break; } default: @@ -444,6 +454,10 @@ class SubmissionsListView extends React.Component { const statusStyleName = isAccepted ? 'accepted' : 'queue'; const statusLabel = isAccepted ? 'Accepted' : 'In Queue'; const displaySubmissionId = getDisplaySubmissionId(mySubmission); + const submissionCreatedTime = getSubmissionCreatedTime(mySubmission); + const submissionTimeDisplay = submissionCreatedTime + ? moment(submissionCreatedTime).format('MMM DD, YYYY HH:mm:ss') + : 'N/A'; return (
    Time
    - {moment(mySubmission.submissionTime).format('MMM DD, YYYY HH:mm:ss')} + {submissionTimeDisplay}
    { !isTopCrowdChallenge diff --git a/src/shared/containers/challenge-detail/index.jsx b/src/shared/containers/challenge-detail/index.jsx index 8ff11dc0a..e62c19ac8 100644 --- a/src/shared/containers/challenge-detail/index.jsx +++ b/src/shared/containers/challenge-detail/index.jsx @@ -179,8 +179,8 @@ class ChallengeDetailPageContainer extends React.Component { sort: '', }, mySubmissionsSort: { - field: '', - sort: '', + field: 'Time', + sort: 'desc', }, notFoundCountryFlagUrl: {}, viewAsTable: false, @@ -849,11 +849,40 @@ ChallengeDetailPageContainer.propTypes = { getSubmissionArtifacts: PT.func, }; +function extractArrayFromStateSlice(slice, challengeId) { + if (Array.isArray(slice)) { + return slice; + } + if (slice && Array.isArray(slice.data)) { + return slice.data; + } + const key = challengeId ? String(challengeId) : null; + if (key && slice && slice[key]) { + const scoped = slice[key]; + if (Array.isArray(scoped)) { + return scoped; + } + if (scoped && Array.isArray(scoped.data)) { + return scoped.data; + } + } + return []; +} + function mapStateToProps(state, props) { + const challengeId = String(props.match.params.challengeId); const cl = state.challengeListing; const { lookup: { allCountries, reviewTypes } } = state; - let { challenge: { mmSubmissions } } = state; + const reviewSummations = extractArrayFromStateSlice(state.challenge.reviewSummations, challengeId); + let mmSubmissions = extractArrayFromStateSlice(state.challenge.mmSubmissions, challengeId); + if (!mmSubmissions.length && reviewSummations.length) { + mmSubmissions = buildMmSubmissionData(reviewSummations); + } const { auth } = state; + let statisticsData = extractArrayFromStateSlice(state.challenge.statisticsData, challengeId); + if ((!Array.isArray(statisticsData) || !statisticsData.length) && reviewSummations.length) { + statisticsData = buildStatisticsData(reviewSummations); + } const challenge = state.challenge.details || {}; let mySubmissions = []; if (challenge.registrants) { @@ -1087,7 +1116,7 @@ function mapStateToProps(state, props) { // recommendedChallenges: cl.recommendedChallenges, // loadingRecommendedChallengesUUID: cl.loadingRecommendedChallengesUUID, expandedTags: cl.expandedTags, - challengeId: String(props.match.params.challengeId), + challengeId, challengesUrl: props.challengesUrl, challengeTypesMap: state.challengeListing.challengeTypesMap, checkpointResults: checkpoints.checkpointResults, @@ -1099,7 +1128,7 @@ function mapStateToProps(state, props) { isLoadingChallenge: Boolean(state.challenge.loadingDetailsForChallengeId), isLoadingTerms: _.isEqual(state.terms.loadingTermsForEntity, { type: 'challenge', - id: props.match.params.challengeId, + id: challengeId, }), loadingCheckpointResults: state.challenge.loadingCheckpoints, loadingResultsForChallengeId: state.challenge.loadingResultsForChallengeId, @@ -1124,7 +1153,7 @@ function mapStateToProps(state, props) { mySubmissions, reviewTypes, openForRegistrationChallenges: state.challengeListing.openForRegistrationChallenges, - statisticsData: state.challenge.statisticsData, + statisticsData, }; } @@ -1132,10 +1161,6 @@ const mapDispatchToProps = (dispatch) => { const ca = communityActions.tcCommunity; const lookupActions = actions.lookup; const challengeActions = actions.challenge || {}; - const hasReviewSummationsActions = ( - typeof challengeActions.getReviewSummationsInit === 'function' - && typeof challengeActions.getReviewSummationsDone === 'function' - ); const dispatchReviewSummations = (challengeId, tokenV3) => { const challengeIdStr = _.toString(challengeId); @@ -1143,12 +1168,6 @@ const mapDispatchToProps = (dispatch) => { return; } - if (hasReviewSummationsActions) { - dispatch(challengeActions.getReviewSummationsInit(challengeIdStr)); - dispatch(challengeActions.getReviewSummationsDone(challengeIdStr, tokenV3)); - return; - } - dispatch({ type: 'CHALLENGE/GET_REVIEW_SUMMATIONS_INIT', payload: challengeIdStr, From 8b184d69c02390956efce7de91c0c93572e34d9c Mon Sep 17 00:00:00 2001 From: Justin Gasper Date: Thu, 20 Nov 2025 09:46:39 +1100 Subject: [PATCH 6/6] Lint --- src/shared/containers/challenge-detail/index.jsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/shared/containers/challenge-detail/index.jsx b/src/shared/containers/challenge-detail/index.jsx index e62c19ac8..752f14302 100644 --- a/src/shared/containers/challenge-detail/index.jsx +++ b/src/shared/containers/challenge-detail/index.jsx @@ -873,7 +873,10 @@ function mapStateToProps(state, props) { const challengeId = String(props.match.params.challengeId); const cl = state.challengeListing; const { lookup: { allCountries, reviewTypes } } = state; - const reviewSummations = extractArrayFromStateSlice(state.challenge.reviewSummations, challengeId); + const reviewSummations = extractArrayFromStateSlice( + state.challenge.reviewSummations, + challengeId, + ); let mmSubmissions = extractArrayFromStateSlice(state.challenge.mmSubmissions, challengeId); if (!mmSubmissions.length && reviewSummations.length) { mmSubmissions = buildMmSubmissionData(reviewSummations); @@ -1160,7 +1163,6 @@ function mapStateToProps(state, props) { const mapDispatchToProps = (dispatch) => { const ca = communityActions.tcCommunity; const lookupActions = actions.lookup; - const challengeActions = actions.challenge || {}; const dispatchReviewSummations = (challengeId, tokenV3) => { const challengeIdStr = _.toString(challengeId);