diff --git a/app/assets/javascripts/config/angularInitialize.js.coffee b/app/assets/javascripts/config/angularInitialize.js.coffee index fe1e18712b..41c2ec8ea2 100644 --- a/app/assets/javascripts/config/angularInitialize.js.coffee +++ b/app/assets/javascripts/config/angularInitialize.js.coffee @@ -44,6 +44,8 @@ AccountService.signOut() $state.go('dahlia.sign-in', {timeout: true}) else if ShortFormApplicationService.isShortFormPage($state.current) + # we don't want to show the beforeunload dialog, because it would allow the applicant to stay on the page after session expiration + $window.removeEventListener('beforeunload', ShortFormApplicationService.onExit) $state.go('dahlia.listing', {timeout: true, id: ShortFormApplicationService.listing.Id}) $rootScope.$on '$stateChangeStart', (e, toState, toParams, fromState, fromParams) -> diff --git a/app/assets/javascripts/shared/SharedService.js.coffee b/app/assets/javascripts/shared/SharedService.js.coffee index 92a82ab3fe..b855002642 100644 --- a/app/assets/javascripts/shared/SharedService.js.coffee +++ b/app/assets/javascripts/shared/SharedService.js.coffee @@ -42,6 +42,9 @@ SharedService = ($http, $state, $window, $document) -> 'dahlia.listings-for-sale': buildUrl: (state, params) -> Service._addLanguageAndParamsToUrl(params.lang, "/listings/for-sale") shouldRailsRoute: (isFirstLoad) -> !isFirstLoad && $window.DIRECTORY_PAGE_REACT is "true" + 'dahlia.listing': + buildUrl: (state, params) -> Service._addLanguageAndParamsToUrl(params.lang, "/listings/#{params.id}") + shouldRailsRoute: (isFirstLoad) -> !isFirstLoad && $window.LISTING_DETAIL_PAGE_REACT is "true" 'dahlia.redirect-home': buildUrl: (state, params) -> Service._addLanguageAndParamsToUrl(params.lang, "") shouldRailsRoute: (isFirstLoad) -> true diff --git a/app/assets/javascripts/short-form/components/application-summary.html.slim b/app/assets/javascripts/short-form/components/application-summary.html.slim index 0d723ac596..c7799e398e 100644 --- a/app/assets/javascripts/short-form/components/application-summary.html.slim +++ b/app/assets/javascripts/short-form/components/application-summary.html.slim @@ -168,9 +168,9 @@ div | {{::$ctrl.applicant.genderOther ? $ctrl.applicant.genderOther : $ctrl.applicant.gender }} review-summary-item label="{{'label.sexual_orientation_or_sexual_identity' | translate}}" ng-if="::$ctrl.applicant.sexualOrientation" | {{::$ctrl.applicant.sexualOrientationOther ? $ctrl.applicant.sexualOrientationOther : $ctrl.applicant.sexualOrientation }} - review-summary-item label="{{'label.applicant_veteran' | translate}}" ng-if="::$ctrl.applicant.isVeteran && !::$ctrl.showVeteransApplicationQuestion" + review-summary-item label="{{'label.applicant_veteran' | translate}}" ng-if="::$showVeteransDemographics()" | {{::$ctrl.getIsVeteran()}} - review-summary-item label="{{'label.household_veteran' | translate}}" ng-if="::$ctrl.application.isNonPrimaryMemberVeteran && !::$ctrl.showVeteransApplicationQuestion" + review-summary-item label="{{'label.household_veteran' | translate}}" ng-if="::$ctrl.showNonPrimaryVeteransDemographics()" | {{::$ctrl.getIsNonPrimaryMemberVeteran()}} review-summary-item label="{{'label.how_you_heard_about_this_listing' | translate}}" ng-if="::$ctrl.applicant.referral" diff --git a/app/assets/javascripts/short-form/components/applicationSummary.js.coffee b/app/assets/javascripts/short-form/components/applicationSummary.js.coffee index e9c3439b3b..ac9cce1b0e 100644 --- a/app/assets/javascripts/short-form/components/applicationSummary.js.coffee +++ b/app/assets/javascripts/short-form/components/applicationSummary.js.coffee @@ -111,6 +111,12 @@ angular.module('dahlia.components') ctrl.applicant.referral ) + ctrl.showVeteransDemographics = -> + ctrl.application.isVeteran && !ctrl.showVeteransApplicationQuestion + + ctrl.showNonPrimaryVeteransDemographics = -> + ctrl.application.isNonPrimaryMemberVeteran && !ctrl.showVeteransApplicationQuestion + ctrl.translatedYesNoNoAnswer = (val) -> if val == 'Yes' $translate.instant('t.yes') diff --git a/cypress.config.ts b/cypress.config.ts index c79ee8e3d7..8474241256 100644 --- a/cypress.config.ts +++ b/cypress.config.ts @@ -2,9 +2,9 @@ import 'dotenv/config' import { defineConfig } from 'cypress' export default defineConfig({ - defaultCommandTimeout: 10000, + defaultCommandTimeout: 120000, // 2 mins projectId: 'dahlia-housing-portal', - pageLoadTimeout: 10000, + pageLoadTimeout: 120000, // 2 mins reporterOptions: { mochaFile: 'cypress/results/tests-[hash].xml', toConsole: true, diff --git a/cypress/e2e/listingDetails/machineTranslations.e2e.ts b/cypress/e2e/listingDetails/machineTranslations.e2e.ts index 69a134a0b4..8be3121c3b 100644 --- a/cypress/e2e/listingDetails/machineTranslations.e2e.ts +++ b/cypress/e2e/listingDetails/machineTranslations.e2e.ts @@ -1,5 +1,5 @@ const verifyMachineTranslations = (language, id, translation) => { - cy.intercept("POST", "https://translate-pa.googleapis.com/v1/translateHtml").as("getTranslate") + cy.intercept("POST", /^https:\/\/translate/).as("getTranslate") cy.visit(`${language}/listings/${id}?react=true`) cy.wait("@getTranslate") return cy.contains(translation)