Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions node/buildSrcCordova.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,8 @@ fs.remove('./build').then(() => {
console.log('> Cordova: Files that (incorrectly) still contain React.lazy: ');
console.log(out);
console.error('> Cordova: The files listed above, need to be fixed before proceeding!'); // Or the regex needs adjustment
} else {
console.log('> Cordova: Begin WebApp compile ---------------------');
}
});
});
Expand Down
38 changes: 21 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"@wdio/protocols": "^8.32.0",
"@wdio/spec-reporter": "^8.32.4",
"@wdio/visual-service": "^9.0.0",
"axios": "^1.8.3",
"axios": "^1.13.2",
"babel-loader": "^9.1.3",
"babel-plugin-styled-components": "^2.1.4",
"chai": "^4.3.7",
Expand Down Expand Up @@ -143,7 +143,7 @@
"indefinite": "^2.5.2",
"jquery": "^3.7.1",
"keymirror": "~0.1.1",
"lodash-es": "^4.17.21",
"lodash-es": "^4.17.23",
"moment": "^2.29.4",
"mui-file-dropzone": "^4.0.1",
"object-assign": "~4.1.1",
Expand Down
2 changes: 1 addition & 1 deletion src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ class App extends Component {
}

if (isCordova()) {
console.log(`Cordova: window.device ${JSON.stringify(window.device)}`);
// console.log(`Cordova: window.device ${JSON.stringify(window.device)}`);
console.log(`Cordova: Header, isIOS ${hasDynamicIsland()}, heightOfCordovaSpacer ${heightOfCordovaSpacer()}), hasCordovaNotch ${hasCordovaNotch()}`);
}

Expand Down
12 changes: 12 additions & 0 deletions src/js/actions/VoterActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,18 @@ export default {
});
},

updateReviewedAppFields (appReviewState, appReviewVersion, appReviewPlatform,
appReviewBodyNegativeBypass, appReviewEmail) {
Dispatcher.loadEndpoint('voterReviewedApp',
{
app_review_state: appReviewState,
app_review_version: appReviewVersion,
app_review_platform: appReviewPlatform,
app_review_body_negative_bypass: appReviewBodyNegativeBypass, // not a database field
app_review_email: appReviewEmail, // not a database field
});
},

voterCompleteYourProfileSave (firstName = '', firstNameChanged = false, lastName = '', lastNameChanged = false, voterPhotoQueuedToSave = '', voterPhotoQueuedToSaveSet = false) {
Dispatcher.loadEndpoint('voterUpdate',
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,12 @@ class PayToPromoteProcess extends Component {
// <LoadingWheelComp />
// );
// }
/*
TODO: Jan 16, 2026 -- Add in the ReviewAppModal.jsx (see ItemActionBar.js as an example)
https://wevoteusa.atlassian.net/browse/WV-887
We want this to be invoked AFTER they make the donation, so it is not practical to stub this in today.
*/

if (!loaded) {
return (
<LoadingWheelComp message="Waiting..." />
Expand Down
15 changes: 8 additions & 7 deletions src/js/common/components/Position/VoterPositionEditTripleDot.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import PropTypes from 'prop-types';
import { DeleteOutlined, EditOutlined, MoreHoriz } from '@mui/icons-material';
import Popover from '@mui/material/Popover';
import { withStyles } from '@mui/styles';
import withTheme from '@mui/styles/withTheme';
import PropTypes from 'prop-types';
import React, { useState } from 'react';
import styled from 'styled-components';
import { withStyles } from '@mui/styles';
import { DeleteOutlined, EditOutlined, MoreHoriz } from '@mui/icons-material';
import Popover from '@mui/material/Popover';
import isMobileScreenSize from '../../utils/isMobileScreenSize';
import DesignTokenColors from '../Style/DesignTokenColors';


Expand Down Expand Up @@ -56,13 +57,13 @@ const VoterPositionEditTripleDot = ({ triggerDeleteOpinion, triggerEditOpinion }
<PopoverWrapper>
<PopoverNameAndMessageText>
<StyledTypography onClick={triggerEditOpinionModeLocal}>
<EditOutlined style={{ fontSize: '14px', cursor: 'pointer', marginRight: '4px' }} />
<EditOutlined style={{ cursor: 'pointer', marginRight: '4px' }} />
Edit opinion
</StyledTypography>
</PopoverNameAndMessageText>
<PopoverViewDetailsText>
<StyledTypography onClick={triggerDeleteOpinionModeLocal}>
<DeleteOutlined style={{ fontSize: '14px', cursor: 'pointer', marginRight: '4px' }} />
<DeleteOutlined style={{ cursor: 'pointer', marginRight: '4px' }} />
Delete opinion
</StyledTypography>
</PopoverViewDetailsText>
Expand Down Expand Up @@ -114,7 +115,7 @@ const PopoverViewDetailsText = styled('div')`
`;

const StyledTypography = styled('div')`
font-size: 12px;
font-size: ${isMobileScreenSize() ? '15px' : '14px'};
font-family: inherit;
cursor: pointer;
`;
Expand Down
88 changes: 42 additions & 46 deletions src/js/common/pages/Campaign/CampaignDetailsPage.jsx
Original file line number Diff line number Diff line change
@@ -1,53 +1,35 @@
import styled from 'styled-components';
import withStyles from '@mui/styles/withStyles';
import PropTypes from 'prop-types';
import React, { Component, Suspense } from 'react';
import { Helmet } from 'react-helmet-async';
import { Link } from 'react-router-dom';
import styled from 'styled-components';
import ReviewAppModal from '../../../components/ReviewApps/ReviewAppModal';
import { PageContentContainer } from '../../../components/Style/pageLayoutStyles';
import webAppConfig from '../../../config';
import VoterStore from '../../../stores/VoterStore';
import CampaignSupporterActions from '../../actions/CampaignSupporterActions';
import {
CampaignDescription,
CampaignDescriptionDesktop,
CampaignDescriptionWrapper,
CampaignDescriptionDesktopWrapper,
CampaignImagePlaceholder,
CampaignImagePlaceholderText,
CampaignImage,
CampaignImageDesktop,
CampaignImageDesktopWrapper,
CampaignImageMobileWrapper,
CampaignOwnersDesktopWrapper,
CampaignOwnersWrapper,
CampaignSubSectionSeeAll,
CampaignSubSectionTitle,
CampaignSubSectionTitleWrapper,
CampaignTitleAndScoreBar,
CampaignTitleDesktop,
CampaignTitleMobile,
CommentsListWrapper,
DetailsSectionDesktopTablet,
DetailsSectionMobile,
SupportButtonFooterWrapper,
SupportButtonPanel,
CampaignPoliticianImageDesktop,
} from '../../components/Style/CampaignDetailsStyles';
import { PageWrapper } from '../../components/Style/stepDisplayStyles';
import DelayedLoad from '../../components/Widgets/DelayedLoad';
import historyPush from '../../utils/historyPush';
import { renderLog } from '../../utils/logging';
import returnFirstXWords from '../../utils/returnFirstXWords';
import CampaignOwnersList from '../../components/CampaignSupport/CampaignOwnersList';
import CampaignTopNavigation from '../../components/Navigation/CampaignTopNavigation';
import CompleteYourProfileModalController from '../../components/Settings/CompleteYourProfileModalController';
import { CampaignDescription, CampaignDescriptionDesktop, CampaignDescriptionDesktopWrapper, CampaignDescriptionWrapper,
CampaignImage, CampaignImageDesktop, CampaignImageDesktopWrapper, CampaignImageMobileWrapper, CampaignImagePlaceholder,
CampaignImagePlaceholderText, CampaignOwnersDesktopWrapper, CampaignOwnersWrapper, CampaignPoliticianImageDesktop,
CampaignSubSectionSeeAll, CampaignSubSectionTitle, CampaignSubSectionTitleWrapper, CampaignTitleAndScoreBar,
CampaignTitleDesktop, CampaignTitleMobile, CommentsListWrapper, DetailsSectionDesktopTablet, DetailsSectionMobile,
SupportButtonFooterWrapper, SupportButtonPanel } from '../../components/Style/CampaignDetailsStyles';
import { BlockedIndicator, BlockedReason, DraftModeIndicator, EditIndicator, ElectionInPast, IndicatorButtonWrapper, IndicatorRow } from '../../components/Style/CampaignIndicatorStyles';
import { PageContentContainer } from '../../../components/Style/pageLayoutStyles';
import { PageWrapper } from '../../components/Style/stepDisplayStyles';
import DelayedLoad from '../../components/Widgets/DelayedLoad';
import AppObservableStore, { messageService } from '../../stores/AppObservableStore';
import CampaignStore from '../../stores/CampaignStore';
import CampaignSupporterStore from '../../stores/CampaignSupporterStore';
import { getCampaignXValuesFromIdentifiers, retrieveCampaignXFromIdentifiersIfNeeded } from '../../utils/campaignUtils';
import historyPush from '../../utils/historyPush';
import initializejQuery from '../../utils/initializejQuery';
import keepHelpingDestination from '../../utils/keepHelpingDestination';
import { renderLog } from '../../utils/logging';
import returnFirstXWords from '../../utils/returnFirstXWords';

const CampaignCommentsList = React.lazy(() => import(/* webpackChunkName: 'CampaignCommentsList' */ '../../components/Campaign/CampaignCommentsList'));
const CampaignDetailsActionSideBox = React.lazy(() => import(/* webpackChunkName: 'CampaignDetailsActionSideBox' */ '../../components/CampaignSupport/CampaignDetailsActionSideBox'));
Expand Down Expand Up @@ -77,6 +59,7 @@ class CampaignDetailsPage extends Component {
payToPromoteStepCompleted: false,
payToPromoteStepTurnedOn: false,
sharingStepCompleted: false,
showNegativeModal: false,
step2Completed: false,
voterCanEditThisCampaign: false,
weVoteHostedProfileImageUrlLarge: '',
Expand All @@ -88,8 +71,8 @@ class CampaignDetailsPage extends Component {
const { match: { params } } = this.props;
const { campaignSEOFriendlyPath, campaignXWeVoteId } = params;
// console.log('componentDidMount campaignSEOFriendlyPath: ', campaignSEOFriendlyPath, ', campaignXWeVoteId: ', campaignXWeVoteId);
this.onAppObservableStoreChange();
this.appStateSubscription = messageService.getMessage().subscribe(() => this.onAppObservableStoreChange());
// this.onAppObservableStoreChange('');
this.appStateSubscription = messageService.getMessage().subscribe((token) => this.onAppObservableStoreChange(token));
this.onCampaignStoreChange();
this.campaignStoreListener = CampaignStore.addListener(this.onCampaignStoreChange.bind(this));
this.onCampaignSupporterStoreChange();
Expand Down Expand Up @@ -124,16 +107,23 @@ class CampaignDetailsPage extends Component {
this.campaignSupporterStoreListener.remove();
}

onAppObservableStoreChange () {
const chosenWebsiteName = AppObservableStore.getChosenWebsiteName();
const inPrivateLabelMode = AppObservableStore.inPrivateLabelMode();
// For now, we assume that paid sites with chosenSiteLogoUrl will turn off "Chip in"
const payToPromoteStepTurnedOn = !inPrivateLabelMode && webAppConfig.ENABLE_PAY_TO_PROMOTE;
this.setState({
chosenWebsiteName,
inPrivateLabelMode,
payToPromoteStepTurnedOn,
});
onAppObservableStoreChange (token) {
const tokenText = token ? token.text : '';
const showNegativeModal = tokenText.includes('showNegativeFeedbackModal') && tokenText.includes('CAMPAIGN');
if (showNegativeModal) {
console.log(`Cordova: CampaignDetailsPage negativeFeedbackPage: ${tokenText} `);
this.setState({ showNegativeModal });
} else {
const chosenWebsiteName = AppObservableStore.getChosenWebsiteName();
const inPrivateLabelMode = AppObservableStore.inPrivateLabelMode();
// For now, we assume that paid sites with chosenSiteLogoUrl will turn off "Chip in"
const payToPromoteStepTurnedOn = !inPrivateLabelMode && webAppConfig.ENABLE_PAY_TO_PROMOTE;
this.setState({
chosenWebsiteName,
inPrivateLabelMode,
payToPromoteStepTurnedOn,
});
}
}

onCampaignStoreChange () {
Expand Down Expand Up @@ -269,10 +259,13 @@ class CampaignDetailsPage extends Component {
campaignSEOFriendlyPath, campaignTitle, campaignXWeVoteId,
chosenWebsiteName, inPrivateLabelMode, isBlockedByWeVote, isBlockedByWeVoteReason,
finalElectionDateInPast, isSupportersCountMinimumExceeded, linkedPoliticianWeVoteId,
voterCanEditThisCampaign, voterSupportsThisCampaign, weVoteHostedProfileImageUrlLarge,
showNegativeModal, voterCanEditThisCampaign, voterSupportsThisCampaign,
weVoteHostedProfileImageUrlLarge,
} = this.state;
// console.log('render campaignPhotoLargeUrl: ', campaignPhotoLargeUrl, ', weVoteHostedProfileImageUrlLarge: ', weVoteHostedProfileImageUrlLarge);
const htmlTitle = `${campaignTitle} - ${chosenWebsiteName}`;
const initialEmail = VoterStore.getVoterEmail();

if (isBlockedByWeVote && !voterCanEditThisCampaign) {
return (
<PageContentContainer>
Expand Down Expand Up @@ -346,6 +339,9 @@ class CampaignDetailsPage extends Component {
)}
</BlockedReason>
)}
{showNegativeModal && (
<ReviewAppModal initialEmail={initialEmail} />
)}
<CampaignTopNavigation
campaignSEOFriendlyPath={campaignSEOFriendlyPath}
campaignXWeVoteId={campaignXWeVoteId}
Expand Down
7 changes: 2 additions & 5 deletions src/js/common/pages/Politician/PoliticianDetailsPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,7 @@ class PoliticianDetailsPage extends Component {
ballotpediaPoliticianUrl: '',
chosenWebsiteName: '',
finalElectionDateInPast: false,
// inPrivateLabelMode: false,
loadSlow: false,
// officeHeldList: [],
opponentCandidateList: [],
opponentCandidatesToShowCount: 5,
payToPromoteStepCompleted: false,
Expand All @@ -95,7 +93,6 @@ class PoliticianDetailsPage extends Component {
showMobileViewUpcomingBallot: false,
stateText: '',
step2Completed: false,
// supporterEndorsementsWithText: [],
voterCanEditThisPolitician: false,
wikipediaUrl: '',
politicianStateParsedFromURLBeforeLoad: '',
Expand All @@ -116,8 +113,8 @@ class PoliticianDetailsPage extends Component {
politicianNameParsedFromURLBeforeLoad: name,
});
// console.log('componentDidMount politicianSEOFriendlyPathFromUrl: ', politicianSEOFriendlyPathFromUrl, ', politicianWeVoteId: ', politicianWeVoteId);
this.onAppObservableStoreChange();
this.appStateSubscription = messageService.getMessage().subscribe(() => this.onAppObservableStoreChange());
this.onAppObservableStoreChange(''); // Jan 2025, is this line necessary?
this.appStateSubscription = messageService.getMessage().subscribe((token) => this.onAppObservableStoreChange(token));
this.campaignSupporterStoreListener = CampaignSupporterStore.addListener(this.onCampaignSupporterStoreChange.bind(this));
this.candidateStoreListener = CandidateStore.addListener(this.onCandidateStoreChange.bind(this));
this.officeHeldStoreListener = OfficeHeldStore.addListener(this.onOfficeHeldStoreChange.bind(this));
Expand Down
Loading