From 7eee3d803deb389af8d304cd9a1c639da92bdc04 Mon Sep 17 00:00:00 2001 From: Spicer Matthews Date: Tue, 28 Nov 2023 12:23:30 -0800 Subject: [PATCH 1/7] Killed black friday promos --- src/pages/index.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/pages/index.js b/src/pages/index.js index 9b27ab34..f4e04621 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -108,8 +108,6 @@ import FrontpageShortcutListContainer from 'src/components/FrontpageShortcutList import Modal from '@material-ui/core/Modal' import { Box } from '@material-ui/core' -import November2023ShopUser from 'src/components/promos/November2023ShopUser' - const getNotifDismissKey = (code) => `${NOTIF_DISMISS_PREFIX}.${code}` const useStyles = makeStyles((theme) => ({ @@ -1121,7 +1119,7 @@ const Index = ({ data: fallbackData, userAgent }) => { {/* {user.userId && notif && } */} {/* November Shop User 2023 Promo */} - {user.userId && } + {/* user.userId && */} Date: Tue, 28 Nov 2023 13:10:12 -0800 Subject: [PATCH 2/7] Fix spacing issue with our search bar. --- src/pages/index.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/pages/index.js b/src/pages/index.js index f4e04621..b39afc71 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -238,7 +238,7 @@ const useStyles = makeStyles((theme) => ({ background: grey['300'], }, centerContainer: { - // height: '100%', + height: '100%', width: '100%', display: 'flex', justifyContent: 'center', @@ -251,7 +251,6 @@ const useStyles = makeStyles((theme) => ({ justifyContent: 'center', minWidth: 500, maxWidth: 800, - marginTop: '60px', }, searchBar: { position: 'relative', From 8f8ffb4d1da9d2e736f50425baf2e9533ad01a18 Mon Sep 17 00:00:00 2001 From: Spicer Matthews Date: Thu, 7 Dec 2023 23:12:07 -0800 Subject: [PATCH 3/7] Launched shop on leaderboard --- src/__tests__/pages/index.test.js | 3 ++ .../groupImpactComponents/GroupImpact.js | 13 ++++- .../GroupImpactContainer.js | 1 + .../GroupImpactSidebar.js | 47 +++++++++++++++---- .../GroupImpactSidebar.stories.jsx | 7 +++ .../__tests__/GroupImpact.test.js | 8 ++++ .../__tests__/GroupImpactSidebar.test.js | 28 +++++++++-- src/schema/schema.graphql | 5 ++ 8 files changed, 97 insertions(+), 15 deletions(-) diff --git a/src/__tests__/pages/index.test.js b/src/__tests__/pages/index.test.js index e16f9ea2..abd13256 100644 --- a/src/__tests__/pages/index.test.js +++ b/src/__tests__/pages/index.test.js @@ -1651,6 +1651,7 @@ describe('index.js: hardcoded notifications', () => { id: 'abcd', dollarProgress: 28e5, dollarProgressFromSearch: 14e5, + dollarProgressFromShop: 0, dollarGoal: 5e6, impactMetric: { impactTitle: @@ -1689,6 +1690,7 @@ describe('index.js: hardcoded notifications', () => { id: 'abcd', dollarProgress: 28e5, dollarProgressFromSearch: 14e5, + dollarProgressFromShop: 0, dollarGoal: 5e6, impactMetric: { impactTitle: @@ -1737,6 +1739,7 @@ describe('index.js: hardcoded notifications', () => { id: 'abcd', dollarProgress: 28e5, dollarProgressFromSearch: 14e5, + dollarProgressFromShop: 0, dollarGoal: 5e6, impactMetric: { impactTitle: diff --git a/src/components/groupImpactComponents/GroupImpact.js b/src/components/groupImpactComponents/GroupImpact.js index de291171..f10b8939 100644 --- a/src/components/groupImpactComponents/GroupImpact.js +++ b/src/components/groupImpactComponents/GroupImpact.js @@ -58,8 +58,13 @@ const GroupImpact = ({ user }) => { GROUP_IMPACT_SIDEBAR_STATE.NORMAL ) const [sidebarOpen, setSidebarOpen] = useState(false) - const { id, dollarGoal, dollarProgressFromSearch, impactMetric } = - groupImpactMetric + const { + id, + dollarGoal, + dollarProgressFromSearch, + dollarProgressFromShop, + impactMetric, + } = groupImpactMetric const { impactTitle, impactCountPerMetric, whyValuableDescription } = impactMetric @@ -87,6 +92,7 @@ const GroupImpact = ({ user }) => { id, dollarProgress: dollarGoal, dollarProgressFromSearch, + dollarProgressFromShop, dollarGoal, impactMetric: { impactTitle, @@ -104,6 +110,7 @@ const GroupImpact = ({ user }) => { id, dollarGoal, dollarProgressFromSearch, + dollarProgressFromShop, impactTitle, whyValuableDescription, ]) @@ -209,6 +216,7 @@ GroupImpact.propTypes = { id: PropTypes.string.isRequired, dollarProgress: PropTypes.number.isRequired, dollarProgressFromSearch: PropTypes.number.isRequired, + dollarProgressFromShop: PropTypes.number.isRequired, dollarGoal: PropTypes.number.isRequired, impactMetric: PropTypes.shape({ impactTitle: PropTypes.string.isRequired, @@ -254,6 +262,7 @@ GroupImpactWrapper.propTypes = { id: PropTypes.string.isRequired, dollarProgress: PropTypes.number.isRequired, dollarProgressFromSearch: PropTypes.number.isRequired, + dollarProgressFromShop: PropTypes.number.isRequired, dollarGoal: PropTypes.number.isRequired, impactMetric: PropTypes.shape({ impactTitle: PropTypes.string.isRequired, diff --git a/src/components/groupImpactComponents/GroupImpactContainer.js b/src/components/groupImpactComponents/GroupImpactContainer.js index a3df758b..483fff40 100644 --- a/src/components/groupImpactComponents/GroupImpactContainer.js +++ b/src/components/groupImpactComponents/GroupImpactContainer.js @@ -10,6 +10,7 @@ export default createFragmentContainer(GroupImpact, { id dollarProgress dollarProgressFromSearch + dollarProgressFromShop dollarGoal impactMetric { impactTitle diff --git a/src/components/groupImpactComponents/GroupImpactSidebar.js b/src/components/groupImpactComponents/GroupImpactSidebar.js index 10473400..729ec736 100644 --- a/src/components/groupImpactComponents/GroupImpactSidebar.js +++ b/src/components/groupImpactComponents/GroupImpactSidebar.js @@ -26,6 +26,7 @@ import { windowOpenTop } from 'src/utils/navigation' import { lighten } from '@material-ui/core' import Handlebars from 'handlebars' import defaultTheme from 'src/utils/theme' +import ShoppingCartIcon from '@mui/icons-material/ShoppingCart' import SearchIcon from '@material-ui/icons/Search' import TabIcon from '@material-ui/icons/Tab' import ToggleButton from '@material-ui/lab/ToggleButton' @@ -253,17 +254,29 @@ const GroupImpactSidebar = ({ setSelectedMode(newValue) event.stopPropagation() } - const { dollarProgress, dollarGoal, dollarProgressFromSearch, impactMetric } = - displayingOldGoal ? lastGroupImpactMetric : groupImpactMetric + const { + dollarProgress, + dollarGoal, + dollarProgressFromSearch, + dollarProgressFromShop, + impactMetric, + } = displayingOldGoal ? lastGroupImpactMetric : groupImpactMetric const { impactTitle, whyValuableDescription, impactCountPerMetric } = impactMetric const classes = useStyles() + const searchDollarProgress = dollarProgressFromSearch && Math.max( Math.min(Math.floor(100 * (dollarProgressFromSearch / dollarGoal)), 100), 1 ) + const shopDollarProgress = + dollarProgressFromShop && + Math.max( + Math.min(Math.floor(100 * (dollarProgressFromShop / dollarGoal)), 100), + 1 + ) const searchDisplayProgress = dollarProgressFromSearch && Math.min( @@ -276,9 +289,18 @@ const GroupImpactSidebar = ({ ), 92 ) + const shopDisplayProgress = + dollarProgressFromShop && + Math.min( + Math.max( + Math.min(Math.floor(100 * (dollarProgressFromShop / dollarGoal)), 100), + 8 + ), + 92 + ) const totalDisplayProgress = Math.max( Math.min(Math.floor(100 * (dollarProgress / dollarGoal)), 100), - (searchDisplayProgress || 0) + 8 + (searchDisplayProgress || 0) + (shopDisplayProgress || 0) + 8 ) const totalProgress = Math.max( Math.min(Math.floor(100 * (dollarProgress / dollarGoal)), 100), @@ -377,8 +399,12 @@ const GroupImpactSidebar = ({
, ] + searchDisplayProgress || shopDisplayProgress + ? [, , ] : [] } tooltips={[ `${ - totalProgress - searchDollarProgress + totalProgress - searchDollarProgress - shopDollarProgress }% of funds raised by tabs opened through Tab for a Cause`, `${searchDollarProgress}% of funds raised by searches through Search for a Cause`, + `${shopDollarProgress}% of funds raised by shopping through Shop for a Cause`, ]} />
@@ -578,12 +606,13 @@ const GroupImpactSidebar = ({ ({ id: 'abcd', dollarProgress: 250, dollarProgressFromSearch: 125, + dollarProgressFromShop: 0, dollarGoal: 600, impactMetric: { impactTitle: 'impact-title', @@ -76,6 +77,7 @@ describe('GroupImpact component', () => { id: 'bcde', dollarProgress: 28e5, dollarProgressFromSearch: 125, + dollarProgressFromShop: 0, dollarGoal: 5e6, impactMetric: { impactTitle: 'Provide 1 home visit from a community health worker', @@ -99,6 +101,7 @@ describe('GroupImpact component', () => { id: 'bcde', dollarProgress: 28e5, dollarProgressFromSearch: 125, + dollarProgressFromShop: 0, dollarGoal: 5e6, impactMetric: { impactTitle: 'Provide 1 home visit from a community health worker', @@ -122,6 +125,7 @@ describe('GroupImpact component', () => { id: 'abcd', dollarProgress: 28e5, dollarProgressFromSearch: 125, + dollarProgressFromShop: 0, dollarGoal: 5e6, impactMetric: { impactTitle: 'Provide 1 home visit from a community health worker', @@ -144,6 +148,7 @@ describe('GroupImpact component', () => { id: 'bcde', dollarProgress: 28e5, dollarProgressFromSearch: 125, + dollarProgressFromShop: 0, dollarGoal: 5e6, impactMetric: { impactTitle: 'Provide 1 home visit from a community health worker', @@ -177,6 +182,7 @@ describe('GroupImpact component', () => { id: 'bcde', dollarProgress: 28e5, dollarProgressFromSearch: 125, + dollarProgressFromShop: 0, dollarGoal: 5e6, impactMetric: { impactTitle: 'Provide 1 home visit from a community health worker', @@ -285,6 +291,7 @@ describe('GroupImpact component', () => { id: 'bcde', dollarProgress: 28e5, dollarProgressFromSearch: 125, + dollarProgressFromShop: 0, dollarGoal: 5e6, impactMetric: { impactTitle: 'Provide 1 home visit from a community health worker', @@ -322,6 +329,7 @@ describe('GroupImpact component', () => { id: 'bcde', dollarProgress: 28e5, dollarProgressFromSearch: 125, + dollarProgressFromShop: 0, dollarGoal: 5e6, impactMetric: { impactTitle: 'Provide 1 home visit from a community health worker', diff --git a/src/components/groupImpactComponents/__tests__/GroupImpactSidebar.test.js b/src/components/groupImpactComponents/__tests__/GroupImpactSidebar.test.js index dde86e22..efbdde91 100644 --- a/src/components/groupImpactComponents/__tests__/GroupImpactSidebar.test.js +++ b/src/components/groupImpactComponents/__tests__/GroupImpactSidebar.test.js @@ -12,6 +12,7 @@ import { shopLandingURL } from 'src/utils/urls' import { windowOpenTop } from 'src/utils/navigation' import SearchIcon from '@material-ui/icons/Search' import TabIcon from '@material-ui/icons/Tab' +import ShoppingCartIcon from '@mui/icons-material/ShoppingCart' import GroupImpactLeaderboard from '../GroupImpactLeaderboard' jest.mock('ga-gtag') @@ -119,6 +120,7 @@ describe('GroupImpactSidebar component', () => { groupImpactMetric: { dollarProgress: 250, dollarProgressFromSearch: 100, + dollarProgressFromShop: 0, dollarGoal: 600, impactMetric: { impactTitle: 'impact-title', @@ -147,16 +149,23 @@ describe('GroupImpactSidebar component', () => { (mockProps.groupImpactMetric.dollarProgressFromSearch / mockProps.groupImpactMetric.dollarGoal) ), + Math.floor( + 100 * + (mockProps.groupImpactMetric.dollarProgressFromShop / + mockProps.groupImpactMetric.dollarGoal) + ), ]) expect(wrapper.find(VerticalLinearProgress).first().prop('icons')).toEqual([ , , + , ]) expect( wrapper.find(VerticalLinearProgress).first().prop('tooltips') ).toEqual([ `25% of funds raised by tabs opened through Tab for a Cause`, `16% of funds raised by searches through Search for a Cause`, + `0% of funds raised by shopping through Shop for a Cause`, ]) expect(wrapper.find(VerticalLinearProgress).at(1).prop('progress')).toEqual( [ @@ -170,6 +179,7 @@ describe('GroupImpactSidebar component', () => { (mockProps.groupImpactMetric.dollarProgressFromSearch / mockProps.groupImpactMetric.dollarGoal) ), + 0, ] ) }) @@ -182,6 +192,7 @@ describe('GroupImpactSidebar component', () => { groupImpactMetric: { dollarProgress: 650, dollarProgressFromSearch: 100, + dollarProgressFromShop: 0, dollarGoal: 600, impactMetric: { impactTitle: 'impact-title', @@ -193,19 +204,21 @@ describe('GroupImpactSidebar component', () => { expect(wrapper.find(Typography).at(2).text()).toEqual('108%') expect( wrapper.find(VerticalLinearProgress).first().prop('progress') - ).toEqual([100, 16]) + ).toEqual([100, 16, 0]) expect(wrapper.find(VerticalLinearProgress).first().prop('icons')).toEqual([ , , + , ]) expect( wrapper.find(VerticalLinearProgress).first().prop('tooltips') ).toEqual([ `84% of funds raised by tabs opened through Tab for a Cause`, `16% of funds raised by searches through Search for a Cause`, + `0% of funds raised by shopping through Shop for a Cause`, ]) expect(wrapper.find(VerticalLinearProgress).at(1).prop('progress')).toEqual( - [100, 16] + [100, 16, 0] ) }) @@ -217,6 +230,7 @@ describe('GroupImpactSidebar component', () => { groupImpactMetric: { dollarProgress: 20, dollarProgressFromSearch: 6, + dollarProgressFromShop: 0, dollarGoal: 600, impactMetric: { impactTitle: 'impact-title', @@ -234,19 +248,21 @@ describe('GroupImpactSidebar component', () => { ) expect( wrapper.find(VerticalLinearProgress).first().prop('progress') - ).toEqual([16, 8]) + ).toEqual([16, 8, 0]) expect(wrapper.find(VerticalLinearProgress).first().prop('icons')).toEqual([ , , + , ]) expect( wrapper.find(VerticalLinearProgress).first().prop('tooltips') ).toEqual([ `2% of funds raised by tabs opened through Tab for a Cause`, `1% of funds raised by searches through Search for a Cause`, + `0% of funds raised by shopping through Shop for a Cause`, ]) expect(wrapper.find(VerticalLinearProgress).at(1).prop('progress')).toEqual( - [3, 1] + [3, 1, 0] ) }) @@ -412,6 +428,7 @@ describe('GroupImpactSidebar component', () => { ...getMockProps(), groupImpactMetric: { dollarProgressFromSearch: 125, + dollarProgressFromShop: 0, dollarProgress: 250, dollarGoal: 600, impactMetric: { @@ -439,6 +456,7 @@ describe('GroupImpactSidebar component', () => { ...getMockProps(), groupImpactMetric: { dollarProgressFromSearch: 125, + dollarProgressFromShop: 0, dollarProgress: 250, dollarGoal: 600, impactMetric: { @@ -466,6 +484,7 @@ describe('GroupImpactSidebar component', () => { ...getMockProps(), groupImpactMetric: { dollarProgressFromSearch: 125, + dollarProgressFromShop: 0, dollarProgress: 250, dollarGoal: 600, impactMetric: { @@ -487,6 +506,7 @@ describe('GroupImpactSidebar component', () => { ...getMockProps(), groupImpactMetric: { dollarProgressFromSearch: 125, + dollarProgressFromShop: 0, dollarProgress: 250, dollarGoal: 600, impactMetric: { diff --git a/src/schema/schema.graphql b/src/schema/schema.graphql index 89ed2733..006905c2 100644 --- a/src/schema/schema.graphql +++ b/src/schema/schema.graphql @@ -498,6 +498,11 @@ type GroupImpactMetric implements Node { """ dollarProgressFromSearch: Int! + """ + The micro USD amount raised for this instance of GroupImpactMetric so far from shop + """ + dollarProgressFromShop: Int! + """ISO datetime string of when this GroupImpactMetric will expire""" dateExpires: String } From 737deec13a539bc3309ea37487e33029126632f3 Mon Sep 17 00:00:00 2001 From: Spicer Matthews Date: Wed, 13 Dec 2023 10:53:51 -0800 Subject: [PATCH 4/7] Launched dec 2023 survey --- src/pages/index.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/pages/index.js b/src/pages/index.js index b39afc71..f880e93d 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -757,7 +757,7 @@ const Index = ({ data: fallbackData, userAgent }) => { // Our survey notification const surveyNotif = notificationsToShow.find( - (res) => res.code === 'user-survey-august-2023' + (res) => res.code === 'user-survey-december-2023' ) // Don't load the page until there is data. Data won't exist @@ -1015,26 +1015,26 @@ const Index = ({ data: fallbackData, userAgent }) => { gutterBottom className={classes.notificationTitle} > - We want to hear from you! + Time for the 2023 Survey! - We'd love your feedback via this quick (<2 min) survey - to help improve Tab for a Cause! + Help decide what is next for Tab for a Cause by providing + your feedback. Thanks for Tabbing!
- + {/* Thanks for your help! - + */} } buttons={
- +
} From 24a8c861ffb6b19e929650d4269abdf2578246b9 Mon Sep 17 00:00:00 2001 From: Spicer Matthews Date: Fri, 15 Dec 2023 16:47:22 -0800 Subject: [PATCH 5/7] Removed dec 2023 user survey --- src/pages/index.js | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/pages/index.js b/src/pages/index.js index f880e93d..ecf14e02 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -39,7 +39,8 @@ import Typography from '@material-ui/core/Typography' import IconButton from '@material-ui/core/IconButton' import SettingsIcon from '@material-ui/icons/Settings' import Chip from '@material-ui/core/Chip' -import Button from '@material-ui/core/Button' + +// import Button from '@material-ui/core/Button' // utils import withDataSSR from 'src/utils/pageWrappers/withDataSSR' @@ -102,7 +103,9 @@ import SearchbarSFACSellNotification from 'src/components/SearchbarSFACSellNotif import GroupImpactContainer from 'src/components/groupImpactComponents/GroupImpactContainer' import ShopFullPage from 'src/components/promos/ShopFullPage' import SearchFullPage from 'src/components/promos/SearchFullPage' -import Notification from 'src/components/Notification' + +// import Notification from 'src/components/Notification' + import AddShortcutPageContainer from 'src/components/AddShortcutPageContainer' import FrontpageShortcutListContainer from 'src/components/FrontpageShortcutListContainer' import Modal from '@material-ui/core/Modal' @@ -755,10 +758,10 @@ const Index = ({ data: fallbackData, userAgent }) => { notifSearch = null } - // Our survey notification - const surveyNotif = notificationsToShow.find( - (res) => res.code === 'user-survey-december-2023' - ) + // // Our survey notification + // const surveyNotif = notificationsToShow.find( + // (res) => res.code === 'user-survey-december-2023' + // ) // Don't load the page until there is data. Data won't exist // if the user doesn't have auth cookies and thus doesn't fetch @@ -1005,7 +1008,7 @@ const Index = ({ data: fallbackData, userAgent }) => { * that appear via the UserImpact component. */}
- {surveyNotif ? ( + {/* surveyNotif ? ( { your feedback. Thanks for Tabbing!
- {/* + Thanks for your help! - */} +
} buttons={ @@ -1041,7 +1044,7 @@ const Index = ({ data: fallbackData, userAgent }) => { includeClose onClose={surveyNotif.onDismiss} /> - ) : null} + ) : null */} {/* {notif && notif.variation === 'Version1' ? ( Date: Fri, 15 Dec 2023 17:15:57 -0800 Subject: [PATCH 6/7] Upgraded our tab-ads to v1.1.24 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1bda927f..8f771c53 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,7 @@ "remark-parse": "^9.0.0", "remark-rehype": "^8.0.0", "swr": "^1.0.1", - "tab-ads": "^1.1.23", + "tab-ads": "^1.1.24", "tab-cmp": "^0.15.0-alpha.0", "unified": "^9.0.0", "uuid": "^8.3.2" From 71d0e8e36cd259ffeec31865dd4c46d0e7e58fce Mon Sep 17 00:00:00 2001 From: Spicer Matthews Date: Tue, 9 Jan 2024 20:21:43 -0800 Subject: [PATCH 7/7] Launch of raptive ads --- src/pages/_document.js | 17 +++++++++ src/pages/index.js | 82 +++++++++++++++++++++--------------------- 2 files changed, 58 insertions(+), 41 deletions(-) diff --git a/src/pages/_document.js b/src/pages/_document.js index bed25b84..ce645d85 100644 --- a/src/pages/_document.js +++ b/src/pages/_document.js @@ -19,6 +19,23 @@ class CustomDocument extends Document { +