From 4b277252a12d0432561b447e284db06e43332bb5 Mon Sep 17 00:00:00 2001 From: stevepodell Date: Wed, 8 Nov 2023 16:26:06 -0800 Subject: [PATCH] Fixed path handling for "Followers" link on OrganizationVoterGuide in Cordova Also fixed page layout in Cordova for VoterGuideFollowers -- added a PageContentCordova element Resolves https://wevoteusa.atlassian.net/browse/WV-72 the fix for which is not in V2.4.2 --- package.json | 2 +- .../Style/CampaignDetailsStyles.jsx | 3 +- .../Settings/VoterPhoneVerificationEntry.jsx | 2 +- .../VoterGuide/VoterGuideFollowers.jsx | 143 +++++++++--------- .../VoterGuide/OrganizationVoterGuide.jsx | 3 +- src/js/utils/cordovaCalculatedOffsets.js | 6 +- 6 files changed, 84 insertions(+), 75 deletions(-) diff --git a/package.json b/package.json index 580fcc0db..4d9277257 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "wdio:upgrade": "ncu -u *wdio* webdriver*", "build": "node node/buildDateFile.js && MINIMIZED=1 webpack --mode production", "buildCordova": "node node/buildDateFile.js && node node/buildSrcCordova && CORDOVA=1 && webpack --mode development && node node/logCompileDate.js", - "buildCordovaAndLinks": "node node/buildDateFile.js && node node/buildSrcCordova && CORDOVA=1 && webpack --mode development && node node/buildSymLinksRemote.js && node node/logCompileDate.js && bash ./node/unSymLinkIOS.sh", + "buildCordovaAndLinks": "node node/buildDateFile.js && node node/buildSrcCordova && CORDOVA=1 && webpack --mode development && node node/buildSymLinksRemote.js && bash ./node/unSymLinkIOS.sh && node node/logCompileDate.js", "lint": "eslint --format stylish --ext .jsx --ext .js src/js", "lintCordova": "eslint --format stylish --ext .jsx --ext .js srcCordova/js", "prod": "node node/buildDateFile.js && MINIMIZED=1 webpack --mode production", diff --git a/src/js/common/components/Style/CampaignDetailsStyles.jsx b/src/js/common/components/Style/CampaignDetailsStyles.jsx index 1245d3e91..5c4c26214 100644 --- a/src/js/common/components/Style/CampaignDetailsStyles.jsx +++ b/src/js/common/components/Style/CampaignDetailsStyles.jsx @@ -1,5 +1,5 @@ import styled from 'styled-components'; -import { isAndroid, isAndroidSizeWide, isIPad, isIPadMini } from '../../utils/cordovaUtils'; +import { isAndroid, isAndroidSizeWide, isIPad, isIPadMini, isIPhoneMiniOrSmaller } from '../../utils/cordovaUtils'; import { isCordova, isWebApp } from '../../utils/isCordovaOrWebApp'; export const CampaignDescription = styled('div')` @@ -282,6 +282,7 @@ export const SupportButtonFooterWrapperAboveFooterButtons = styled('div')` if (isWebApp()) return '55px'; if (isIPad() || isAndroidSizeWide()) return '0px'; if (isAndroid()) return '68px'; + if (isIPhoneMiniOrSmaller()) return '54px'; return '88px'; }}; `; diff --git a/src/js/components/Settings/VoterPhoneVerificationEntry.jsx b/src/js/components/Settings/VoterPhoneVerificationEntry.jsx index a2f5ce8d6..b69934490 100644 --- a/src/js/components/Settings/VoterPhoneVerificationEntry.jsx +++ b/src/js/components/Settings/VoterPhoneVerificationEntry.jsx @@ -491,7 +491,7 @@ class VoterPhoneVerificationEntry extends Component { autoFocus={false} className={classes.input} error={displayIncorrectPhoneNumberError} - helperText={(displayIncorrectPhoneNumberError) ? 'Enter valid phone number' : ''} + helperText={(displayIncorrectPhoneNumberError) ? 'Enter a valid phone number' : ''} id="enterVoterPhone" InputProps={{ startAdornment: ( diff --git a/src/js/components/VoterGuide/VoterGuideFollowers.jsx b/src/js/components/VoterGuide/VoterGuideFollowers.jsx index 6da694c16..2b1811bf0 100755 --- a/src/js/components/VoterGuide/VoterGuideFollowers.jsx +++ b/src/js/components/VoterGuide/VoterGuideFollowers.jsx @@ -11,6 +11,7 @@ import VoterStore from '../../stores/VoterStore'; import { renderLog } from '../../common/utils/logging'; import LoadingWheel from '../../common/components/Widgets/LoadingWheel'; import SearchBar from '../Search/SearchBar'; +import { PageContentContainer } from '../Style/pageLayoutStyles'; import GuideList from './GuideList'; const DelayedLoad = React.lazy(() => import(/* webpackChunkName: 'DelayedLoad' */ '../../common/components/Widgets/DelayedLoad')); @@ -156,78 +157,80 @@ class VoterGuideFollowers extends Component { } return ( - - {/* Since VoterGuidePositions, VoterGuideFollowing, and VoterGuideFollowers are in tabs the title seems to use the Helmet values from the last tab */} - -
-
    - {((voterGuideFollowersList && voterGuideFollowersList.length > 0) || - (voterGuideFollowersListFilteredBySearch && voterGuideFollowersListFilteredBySearch.length > 0)) ? ( - - {lookingAtSelf ? ( - <> - Your Followers - - ) : ( - <> - Followers of - {' '} - {organizationName} - - )} - - ) : ( - }> - - - {lookingAtSelf ? ( - <> - No followers can be found. - - ) : ( - <> - No followers of - {' '} - {organizationName} - {' '} - can be found. - - )} - - - + + + {/* Since VoterGuidePositions, VoterGuideFollowing, and VoterGuideFollowers are in tabs the title seems to use the Helmet values from the last tab */} + +
    +
      + {((voterGuideFollowersList && voterGuideFollowersList.length > 0) || + (voterGuideFollowersListFilteredBySearch && voterGuideFollowersListFilteredBySearch.length > 0)) ? ( + + {lookingAtSelf ? ( + <> + Your Followers + + ) : ( + <> + Followers of + {' '} + {organizationName} + + )} + + ) : ( + }> + + + {lookingAtSelf ? ( + <> + No followers can be found. + + ) : ( + <> + No followers of + {' '} + {organizationName} + {' '} + can be found. + + )} + + + + )} + {/* ********** */} + {/* Search Box */} + {voterGuideFollowersList && voterGuideFollowersList.length > 0 && ( + + + )} - {/* ********** */} - {/* Search Box */} - {voterGuideFollowersList && voterGuideFollowersList.length > 0 && ( - - + " + {searchTerm} + " not found + + )} + + - - )} - {/* ***************** */} - {/* Results Not Found */} - {(searchTerm && (voterGuideFollowersListFilteredBySearch && voterGuideFollowersListFilteredBySearch.length === 0)) && ( - - " - {searchTerm} - " not found - - )} - - - -
    -
    -
    + +
+
+
+ ); } } diff --git a/src/js/pages/VoterGuide/OrganizationVoterGuide.jsx b/src/js/pages/VoterGuide/OrganizationVoterGuide.jsx index fc67e20f4..e2cdbb034 100755 --- a/src/js/pages/VoterGuide/OrganizationVoterGuide.jsx +++ b/src/js/pages/VoterGuide/OrganizationVoterGuide.jsx @@ -278,7 +278,8 @@ export default class OrganizationVoterGuide extends Component { goToVoterGuideDetailsPage (destinationTab) { const { pathname: editLink, href: editLinkCordova } = window.location; - const editPathCordova = editLinkCordova.replace(/file:\/\/.*?Vote.app\/www\/index.html#\//, ''); + const editPathCordova = editLinkCordova.replace(/file:\/\/.*?Vote.app\/www\/index.html#\//, '') + .replace(/app.*?index.html#/, ''); historyPush(`${isWebApp() ? editLink : editPathCordova}/m/${destinationTab}`); } diff --git a/src/js/utils/cordovaCalculatedOffsets.js b/src/js/utils/cordovaCalculatedOffsets.js index b41137016..09ed716ac 100644 --- a/src/js/utils/cordovaCalculatedOffsets.js +++ b/src/js/utils/cordovaCalculatedOffsets.js @@ -188,7 +188,11 @@ export function headroomWrapperOffset (includePosition) { const page = pageEnumeration(); if (page === 'candidatelist' || page === 'values') { if (isIOS()) { - offset /= isIPad() ? 2 : 3; + if (page === 'values') { + offset /= 3 / 2; + } else { + offset /= isIPad() ? 2 : 3; + } } else if (isAndroidSizeXL()) { offset = 1; } else {