From 2a2ce4d8e446cf081e4a41845b3d12bd6fa1f345 Mon Sep 17 00:00:00 2001 From: Steven Wade <99294987+StevenWadeOddball@users.noreply.github.com> Date: Mon, 11 Mar 2024 10:23:57 -0700 Subject: [PATCH 1/3] NOREF: Notification Preferences Fix (#997) * chore: update where clause for notification preference update to more specifically check that a user updates their own record * chore: clarify error checking, the resolver ensures that the preference is only updateted by the current user. --- pkg/graph/resolvers/user_notification_preferences.go | 1 + pkg/sqlqueries/SQL/user_notification_preferences/update.sql | 2 +- pkg/storage/user_notification_preferencesStore.go | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/graph/resolvers/user_notification_preferences.go b/pkg/graph/resolvers/user_notification_preferences.go index 7ac1c32d6f..0ab4b00c07 100644 --- a/pkg/graph/resolvers/user_notification_preferences.go +++ b/pkg/graph/resolvers/user_notification_preferences.go @@ -18,6 +18,7 @@ func UserNotificationPreferencesGetByUserID(ctx context.Context, userID uuid.UUI } // UserNotificationPreferencesUpdate updates a user notification preferences object for a user +// Notice: The specific UserNotificationPreference is inferred from the principal object. It will only update the notification preference for the current user. func UserNotificationPreferencesUpdate(ctx context.Context, logger *zap.Logger, principal authentication.Principal, store *storage.Store, changes map[string]interface{}) (*models.UserNotificationPreferences, error) { existingPreferences, err := UserNotificationPreferencesGetByUserID(ctx, principal.Account().ID) if err != nil { diff --git a/pkg/sqlqueries/SQL/user_notification_preferences/update.sql b/pkg/sqlqueries/SQL/user_notification_preferences/update.sql index ed8229f9ca..ba5a880887 100644 --- a/pkg/sqlqueries/SQL/user_notification_preferences/update.sql +++ b/pkg/sqlqueries/SQL/user_notification_preferences/update.sql @@ -9,7 +9,7 @@ SET modified_by = :modified_by, modified_dts = CURRENT_TIMESTAMP WHERE - id = :id AND created_by = :modified_by + id = :id RETURNING id, user_id, diff --git a/pkg/storage/user_notification_preferencesStore.go b/pkg/storage/user_notification_preferencesStore.go index 7523a42866..dcb76f1182 100644 --- a/pkg/storage/user_notification_preferencesStore.go +++ b/pkg/storage/user_notification_preferencesStore.go @@ -53,7 +53,6 @@ func UserNotificationPreferencesGetByUserIDLoader(np sqlutils.NamedPreparer, par // UserNotificationPreferencesUpdate updates a new UserNotificationPreferences in the database func UserNotificationPreferencesUpdate(np sqlutils.NamedPreparer, userNotificationPreferences *models.UserNotificationPreferences) (*models.UserNotificationPreferences, error) { - retUserNotificationPref, procErr := sqlutils.GetProcedure[models.UserNotificationPreferences](np, sqlqueries.UserNotificationPreferences.Update, userNotificationPreferences) if procErr != nil { return nil, fmt.Errorf("issue updating UserNotificationPreferences object: %w", procErr) From 57f4369ae08568f475d5a09bc9b0add54ec7a90c Mon Sep 17 00:00:00 2001 From: Gary Zhao Date: Mon, 11 Mar 2024 16:19:46 -0400 Subject: [PATCH 2/3] [NOREF] change the link to send to read only discussion view (#998) change the link to send to read only discussion view --- .../Notifications/Home/_components/IndividualNotification.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/Notifications/Home/_components/IndividualNotification.tsx b/src/views/Notifications/Home/_components/IndividualNotification.tsx index 40f6451a4a..fadb606f23 100644 --- a/src/views/Notifications/Home/_components/IndividualNotification.tsx +++ b/src/views/Notifications/Home/_components/IndividualNotification.tsx @@ -54,7 +54,7 @@ const IndividualNotification = ({ }).then(response => { if (!response?.errors) { history.push( - `/models/${modelPlanID}/task-list?discussionID=${discussionID}` + `/models/${modelPlanID}/read-only/discussions?discussionID=${discussionID}` ); } }); From 64efdfdf6ab37e3ae36f2c5b5e2c9fa19e1514b1 Mon Sep 17 00:00:00 2001 From: Gary Zhao Date: Tue, 12 Mar 2024 10:41:52 -0400 Subject: [PATCH 3/3] [EASI-4076] Updating dependencies (#994) * updated luxon to 3.4.4 and types/luxon to 3.4.2 * updated vite to 4.5.2 * updated axios to 1.6.7 --- package.json | 8 ++++---- yarn.lock | 50 ++++++++++++++++++++++++++++++++++---------------- 2 files changed, 38 insertions(+), 20 deletions(-) diff --git a/package.json b/package.json index fdca0f0839..310f8836ea 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "@types/enzyme": "^3.10.3", "@types/jest": "26.0.23", "@types/lodash": "^4.14.202", - "@types/luxon": "^1.26.5", + "@types/luxon": "^3.4.2", "@types/no-scroll": "^2.1.2", "@types/node": "15.12.5", "@types/react": "17.0.11", @@ -46,7 +46,7 @@ "@uswds/uswds": "^3.4.1", "apollo": "^2.34", "apollo-upload-client": "^17.0.0", - "axios": "^0.21.3", + "axios": "^1.6.7", "classnames": "^2.5.1", "cross-fetch": "^3.1.5", "cypress-file-upload": "^5.0.8", @@ -59,7 +59,7 @@ "istanbul-lib-coverage": "^3.0.0", "launchdarkly-react-client-sdk": "^3.0.10", "lodash": "^4.17.21", - "luxon": "^1.22.0", + "luxon": "^3.4.4", "no-scroll": "^2.1.1", "nyc": "^15.0.0", "react": "^17.0.2", @@ -184,7 +184,7 @@ "storybook-addon-apollo-client": "^5.0.0", "text-encoding": "^0.7.0", "ts-loader": "^7.0.5", - "vite": "^4.4.12", + "vite": "^4.5.2", "vite-plugin-svgr": "^3.2.0", "vite-tsconfig-paths": "^4.2.0", "vitest": "^0.34.1", diff --git a/yarn.lock b/yarn.lock index 4f0c4416ab..c4c555b30d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6454,10 +6454,10 @@ resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.202.tgz#f09dbd2fb082d507178b2f2a5c7e74bd72ff98f8" integrity sha512-OvlIYQK9tNneDlS0VN54LLd5uiPCBOp7gS5Z0f1mjoJYBrtStzgmJBxONW3U6OZqdtNzZPmn9BS/7WI7BFFcFQ== -"@types/luxon@^1.26.5": - version "1.27.0" - resolved "https://registry.yarnpkg.com/@types/luxon/-/luxon-1.27.0.tgz#1e3b5a7f8ca6944349c43498b4442b742c71ab0b" - integrity sha512-rr2lNXsErnA/ARtgFn46NtQjUa66cuwZYeo/2K7oqqxhJErhXgHBPyNKCo+pfOC3L7HFwtao8ebViiU9h4iAxA== +"@types/luxon@^3.4.2": + version "3.4.2" + resolved "https://registry.yarnpkg.com/@types/luxon/-/luxon-3.4.2.tgz#e4fc7214a420173cea47739c33cdf10874694db7" + integrity sha512-TifLZlFudklWlMBfhubvgqTXRzLDI5pCbGa4P8a3wPyUQSW+1xQ5eDsreP9DWHX3tjq1ke96uYG/nwundroWcA== "@types/mdx@^2.0.0": version "2.0.7" @@ -8077,12 +8077,14 @@ axios@0.21.1, axios@^0.19.2, axios@^1.6.1: dependencies: follow-redirects "^1.10.0" -axios@^0.21.3: - version "0.21.3" - resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.3.tgz#f85d9b747f9b66d59ca463605cedf1844872b82e" - integrity sha512-JtoZ3Ndke/+Iwt5n+BgSli/3idTvpt5OjKyoCmz4LX5+lPiY5l7C1colYezhlxThjNa/NhngCUWZSZFypIFuaA== +axios@^1.6.7: + version "1.6.7" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.7.tgz#7b48c2e27c96f9c68a2f8f31e2ab19f59b06b0a7" + integrity sha512-/hDJGff6/c7u0hDkvkGxR/oy6CbCs8ziCsC7SqmhjfozqiJGc8Z11wrv9z9lYfY4K8l+H9TpjcMDX0xOZmx+RA== dependencies: - follow-redirects "^1.14.0" + follow-redirects "^1.15.4" + form-data "^4.0.0" + proxy-from-env "^1.1.0" axobject-query@^3.1.1: version "3.1.1" @@ -10891,11 +10893,16 @@ flow-parser@0.*: resolved "https://registry.yarnpkg.com/flow-parser/-/flow-parser-0.219.5.tgz#bff08036bd8f2aa7ebfd54a580dc418e37bc9c0e" integrity sha512-lHx/cl2XjopBx/ma9RYhG7FGj2JLKacoBwtI3leOp8AwRDPGwu6bzJoaCMfIl/sq14KdtY5MGzd5q6nKfGzcuQ== -follow-redirects@^1.10.0, follow-redirects@^1.14.0: +follow-redirects@^1.10.0: version "1.15.4" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.4.tgz#cdc7d308bf6493126b17ea2191ea0ccf3e535adf" integrity sha512-Cr4D/5wlrb0z9dgERpUL3LrmPKVDsETIJhaCMeDfuFYcqa5bldGV6wBsAN6X/vxlXQtFBMrXdXxdL8CbDTGniw== +follow-redirects@^1.15.4: + version "1.15.5" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.5.tgz#54d4d6d062c0fa7d9d17feb008461550e3ba8020" + integrity sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw== + font-awesome@^4.7.0: version "4.7.0" resolved "https://registry.yarnpkg.com/font-awesome/-/font-awesome-4.7.0.tgz#8fa8cf0411a1a31afd07b06d2902bb9fc815a133" @@ -13381,10 +13388,10 @@ lru-cache@^6.0.0: resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.0.1.tgz#0a3be479df549cca0e5d693ac402ff19537a6b7a" integrity sha512-IJ4uwUTi2qCccrioU6g9g/5rvvVl13bsdczUUcqbciD9iLr095yj8DQKdObriEvuNSx325N1rV1O0sJFszx75g== -luxon@^1.22.0: - version "1.24.1" - resolved "https://registry.yarnpkg.com/luxon/-/luxon-1.24.1.tgz#a8383266131ed4eaed4b5f430f96f3695403a52a" - integrity sha512-CgnIMKAWT0ghcuWFfCWBnWGOddM0zu6c4wZAWmD0NN7MZTnro0+833DF6tJep+xlxRPg4KtsYEHYLfTMBQKwYg== +luxon@^3.4.4: + version "3.4.4" + resolved "https://registry.yarnpkg.com/luxon/-/luxon-3.4.4.tgz#cf20dc27dc532ba41a169c43fdcc0063601577af" + integrity sha512-zobTr7akeGHnv7eBOXcRgMeCP6+uyYsczwmeRCauvpvaAltgNyTbLH/+VaEAPUeWBT+1GuNmz4wC/6jtQzbbVA== lz-string@^1.4.4: version "1.4.4" @@ -15044,7 +15051,7 @@ proxy-from-env@1.0.0: resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.0.0.tgz#33c50398f70ea7eb96d21f7b817630a55791c7ee" integrity sha512-F2JHgJQ1iqwnHDcQjVBsq3n/uoaFL+iPW/eAeL7kVxy/2RrWaN4WroKjjvbsoRtv0ftelNyC01bjRhn/bhcf4A== -proxy-from-env@^1.0.0: +proxy-from-env@^1.0.0, proxy-from-env@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== @@ -17837,7 +17844,7 @@ vite-tsconfig-paths@^4.2.0: globrex "^0.1.2" tsconfck "^2.1.0" -"vite@^3.0.0 || ^4.0.0", "vite@^3.1.0 || ^4.0.0 || ^5.0.0-0", vite@^4.4.12: +"vite@^3.0.0 || ^4.0.0", "vite@^3.1.0 || ^4.0.0 || ^5.0.0-0": version "4.4.12" resolved "https://registry.yarnpkg.com/vite/-/vite-4.4.12.tgz#e9c355d5a0d8a47afa46cb4bad10820da333da5c" integrity sha512-KtPlUbWfxzGVul8Nut8Gw2Qe8sBzWY+8QVc5SL8iRFnpnrcoCaNlzO40c1R6hPmcdTwIPEDkq0Y9+27a5tVbdQ== @@ -17848,6 +17855,17 @@ vite-tsconfig-paths@^4.2.0: optionalDependencies: fsevents "~2.3.2" +vite@^4.5.2: + version "4.5.2" + resolved "https://registry.yarnpkg.com/vite/-/vite-4.5.2.tgz#d6ea8610e099851dad8c7371599969e0f8b97e82" + integrity sha512-tBCZBNSBbHQkaGyhGCDUGqeo2ph8Fstyp6FMSvTtsXeZSPpSMGlviAOav2hxVTqFcx8Hj/twtWKsMJXNY0xI8w== + dependencies: + esbuild "^0.18.10" + postcss "^8.4.27" + rollup "^3.27.1" + optionalDependencies: + fsevents "~2.3.2" + vitest@^0.34.1: version "0.34.4" resolved "https://registry.yarnpkg.com/vitest/-/vitest-0.34.4.tgz#c7f40cf7ca3b590bb333b3272a98f49e85f7b958"