Skip to content

Commit

Permalink
Prod Release 2023-11-21 - Take 1 (#2143)
Browse files Browse the repository at this point in the history
  • Loading branch information
as1729 authored and adele-usdr committed Nov 28, 2023
1 parent 96dcb90 commit cba1c77
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 4 deletions.
3 changes: 1 addition & 2 deletions packages/client/src/components/Layout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@
<b-dropdown-item-button href="#" @click="trainingGuide">Training Guide</b-dropdown-item-button>
<b-dropdown-item-button href="#" @click="logout">Sign Out</b-dropdown-item-button>
</b-nav-item-dropdown>

<b-nav-text v-if="!myProfileEnabled">
<b-nav-text>
<b-badge>{{selectedTeam ? selectedTeam.name : ''}}</b-badge>
</b-nav-text>

Expand Down
45 changes: 45 additions & 0 deletions packages/client/src/views/MyProfile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,27 @@ export default {
],
};
},
data() {
return {
prefs: [
{
name: 'New Grant Digest',
key: 'GRANT_DIGEST',
description: 'Send me a daily email if new grants match my saved search(es).',
},
{
name: 'Grants Assignment',
key: 'GRANT_ASSIGNMENT',
description: 'Send me notifications if a grant has been assigned to my USDR Grants team.',
},
{
name: 'Occasional Updates',
key: 'GRANT_FINDER_UPDATES',
description: 'Send me occasional emails about feature releases, surveys, and other updates.',
},
],
};
},
computed: {
...mapGetters({
loggedInUser: 'users/loggedInUser',
Expand All @@ -82,6 +103,30 @@ export default {
emailPreferences() {
return this.loggedInUser.emailPreferences;
},
emailPreferences() {
return this.loggedInUser.emailPreferences;
},
},
methods: {
...mapActions({
updateEmailSubscriptionPreferences: 'users/updateEmailSubscriptionPreferences',
}),
onUpdateEmailPreference(pref) {
const updatedPreferences = {
...this.emailPreferences,
[pref.key]: pref.checked ? 'SUBSCRIBED' : 'UNSUBSCRIBED',
};
this.updateEmailSubscriptionPreferences({
userId: this.loggedInUser.id,
preferences: updatedPreferences,
});
},
},
beforeMount() {
this.prefs.forEach((pref) => {
// eslint-disable-next-line no-param-reassign
pref.checked = this.emailPreferences[pref.key] === 'SUBSCRIBED';
});
},
methods: {
...mapActions({
Expand Down
2 changes: 1 addition & 1 deletion packages/server/src/routes/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ router.patch('/:userId', requireUser, async (req, res) => {
return;
}

const allowedFields = new Set(['name', 'avatar_color']);
const allowedFields = new Set(['name']);
for (const key of Object.keys(req.body)) {
if (!allowedFields.has(key)) {
res.status(400).json({ message: `Request body contains unsupported field: ${key}` });
Expand Down
2 changes: 1 addition & 1 deletion terraform/modules/gost_website/waf.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ locals {

module "waf" {
source = "cloudposse/waf/aws"
version = "0.3.0"
version = "0.4.0"
scope = "CLOUDFRONT"
default_action = "allow"

Expand Down

0 comments on commit cba1c77

Please sign in to comment.