Skip to content

Commit

Permalink
Merge branch 'main' into DAH-1865-render-salesforce-input-html-entity
Browse files Browse the repository at this point in the history
  • Loading branch information
jimlin-sfgov authored Dec 22, 2023
2 parents 4d6b8f1 + 7d99f6e commit d815088
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 5 deletions.
2 changes: 2 additions & 0 deletions app/assets/javascripts/config/angularInitialize.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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) ->
Expand Down
3 changes: 3 additions & 0 deletions app/assets/javascripts/shared/SharedService.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
4 changes: 2 additions & 2 deletions cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/listingDetails/machineTranslations.e2e.ts
Original file line number Diff line number Diff line change
@@ -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)
Expand Down

0 comments on commit d815088

Please sign in to comment.