Skip to content

Commit

Permalink
Merge develop to main for latest release (#988)
Browse files Browse the repository at this point in the history
* collaps result summary in mobile

* title language fix

* changed date to 1900 to match error message

* Checking in tests

* force white background on select

* check benefit exists

* just to check deployment

* update title

* final test fixes.

* update

* change reference to ALWS

* change year to 1899

* initial commit

* Update build-and-push-dev.yml

* Update build-and-push-prod.yml

* Update build-and-push-dev.yml

* Update build-and-push-prod.yml

* fixing trigger and cleanup

* fix:updated rates for Q1 2024

* updated links and border color on focus

* fix:updated rates for Q1 2024

* fix: removed excess packages

* Adding pipeline secrets

* Use fieldDefinition instead of categoryMapping

* Adding values for variables, removing unused secrets

* ADO 134595: Refactor benefitHandler (#960)

* Undoing previous commit, cleaning up the variable names

* Using a new service principal

* July 2013 OAS deferral (#945)

Co-authored-by: VeroBr0~ <[email protected]>
Co-authored-by: Veronique B <[email protected]>

* updated link anchor for footer

* update width

* update

* Adding the NEXT_AUTH_SECRET variable

* Adding the EXPOSE instruction for the proper port of this app

* Revert "Q124 rate update"

* removing an underscore (#971)

* Pipeline underscore (#972)

* removing an underscore

* testing new home var

* Pipeline underscore2 (#974)

testing new home var

* Fix 143948

* fix for failing tests

* Pipeline updates (#977)

* Updating pipelines

* Updating pipelines

* Pipeline underscore (#973)

* removing an underscore

* testing new home var

* testing new home var

* clarify comment

* Pipeline updates (#978)

* Updating pipelines

* Updating pipelines

* Fixing a docker tag problem

---------

Co-authored-by: Jeremy Kennedy <[email protected]>
Co-authored-by: Marco <[email protected]>

* added condition for partner legal status

* updated dev yml

* hotfix typo

* Remove leading space in message, fix for 40 years not displaying

* added params to current result benefit handler

* super hotfix

* Merge main (#989)

* Updating pipelines

* Fixing pipeline files

* merge main

---------

Co-authored-by: shawn320 <[email protected]>
Co-authored-by: MarcoGoC <[email protected]>
Co-authored-by: Maxim Lam <[email protected]>
Co-authored-by: Marco <[email protected]>
Co-authored-by: Adam <[email protected]>
Co-authored-by: Maxim Lam <[email protected]>
Co-authored-by: Adam Andrews <[email protected]>
Co-authored-by: “Patrick“ <[email protected]>
Co-authored-by: VeroBr0~ <[email protected]>
Co-authored-by: Veronique B <[email protected]>
Co-authored-by: Jeremy Kennedy <[email protected]>
  • Loading branch information
12 people authored Dec 20, 2023
1 parent 7d98631 commit cd2284e
Show file tree
Hide file tree
Showing 47 changed files with 2,070 additions and 726 deletions.
98 changes: 98 additions & 0 deletions .azuredevops/dynamic-branches.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
trigger:
- none

pr: develop

variables:
azure.servicePrincipal: ''
webapp.name: ''
webapp.resourceGroup: ''
webapp.slotName: null
azureContainerRegistry.name: ''
azureContainerRegistry.repository: ''
azureContainerRegistry.domain: ''
azureContainerRegistry.tag: ''
System.Debug: false

steps:
- task: Docker@2
inputs:
containerRegistry: '$(azureContainerRegistry.name)'
repository: '$(azureContainerRegistry.repository)'
command: 'login'
- script: 'docker pull $(azureContainerRegistry.domain)/$(azureContainerRegistry.repository):latest'
displayName: Pull latest for layer caching
continueOnError: true

- task: Docker@2
displayName: 'Build image'
inputs:
containerRegistry: '$(azureContainerRegistry.name)'
repository: '$(azureContainerRegistry.repository)'
command: 'build'
Dockerfile: '**/Dockerfile'
tags: |
$(azureContainerRegistry.tag)
latest
arguments: |
--cache-from $(azureContainerRegistry.domain)/$(azureContainerRegistry.repository):latest
- task: Docker@2
displayName: 'Push image'
inputs:
containerRegistry: '$(azureContainerRegistry.name)'
repository: '$(azureContainerRegistry.repository)'
command: 'push'
tags: |
$(azureContainerRegistry.tag)
latest
- task: PowerShell@2
displayName: 'Decide which AppService slot to put this preview in'
inputs:
targetType: 'inline'
script: |
[int] $slotNumber = $(System.PullRequest.PullRequestId) % 4
Write-Host "Generated slot number:"
Write-Host "$slotNumber"
Write-Host "From PRID"
Write-Host "$(System.PullRequest.PullRequestId)"
Write-Host "##vso[task.setvariable variable=webapp.slotName]$slotNumber"
- task: AzureCLI@2
displayName: 'Create new slot in App Service'
inputs:
azureSubscription: $(azure.servicePrincipal)
scriptType: 'bash'
scriptLocation: 'inlineScript'
inlineScript: |
az webapp deployment slot create \
--name $(webapp.name) \
--resource-group $(webapp.resourceGroup) \
--slot pr-preview-$(webapp.slotName) \
--configuration-source $(webapp.name)
az webapp identity assign \
-g $(webapp.resourceGroup) \
-n $(webapp.name) \
--slot pr-preview-$(webapp.slotName) \
--identities /subscriptions/400c5730-25f5-4ee6-a933-8b289b9ccb0d/resourcegroups/rg-dts-id-shared/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id-SCLabs-Shared
- task: AzureCLI@2
displayName: 'Deploy pr image to new slot'
inputs:
azureSubscription: $(azure.servicePrincipal)
scriptType: 'bash'
scriptLocation: 'inlineScript'
inlineScript: |
az webapp config container set \
--docker-custom-image-name $(azureContainerRegistry.domain)/$(azureContainerRegistry.repository):$(azureContainerRegistry.tag) \
--name $(webapp.name) \
--slot pr-preview-$(webapp.slotName) \
--resource-group $(webapp.resourceGroup)
- task: GitHubComment@0
displayName: 'Post a comment with a link to the new PR preview'
inputs:
gitHubConnection: "Adam'sGitHub-9/15/2023"
repositoryName: '$(Build.Repository.Name)'
comment: 'Check out a preview of your pull request here: https://$(webapp.name)-pr-preview-$(webapp.slotName).azurewebsites.net'
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,6 @@ COPY --chown=55:$group public ./public
RUN VERSION_NEXT=`node -p -e "require('./package.json').dependencies.next"`&& yarn add next@"$VERSION_NEXT"
USER $user

EXPOSE 3000

CMD [ "yarn", "start" ]
8 changes: 4 additions & 4 deletions __tests__/pages/api/general.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ describe('translation checks', () => {
describe('country checks', () => {
const COUNTRY_COUNT = 196
const handlerEn = new BenefitHandler({ _language: Language.EN })
handlerEn.requiredFields = [FieldKey.LIVING_COUNTRY]
const fieldDataEn = handlerEn.fieldData as Array<FieldConfigDropdown>
handlerEn.fields.requiredFields = [FieldKey.LIVING_COUNTRY]
const fieldDataEn = handlerEn.fields.fieldData as Array<FieldConfigDropdown>
const handlerFr = new BenefitHandler({ _language: Language.FR })
handlerFr.requiredFields = [FieldKey.LIVING_COUNTRY]
const fieldDataFr = handlerFr.fieldData as Array<FieldConfigDropdown>
handlerFr.fields.requiredFields = [FieldKey.LIVING_COUNTRY]
const fieldDataFr = handlerFr.fields.fieldData as Array<FieldConfigDropdown>
it(`produces a list of ${COUNTRY_COUNT} countries (EN and FR)`, async () => {
expect(fieldDataEn[0].values.length).toEqual(COUNTRY_COUNT)
expect(fieldDataFr[0].values.length).toEqual(COUNTRY_COUNT)
Expand Down
10 changes: 5 additions & 5 deletions __tests__/pages/api/gisCoupleAlwBenefit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,12 @@ describe('gisCoupleALWBenefit', () => {
const res = await mockGetRequest(extractedPayload)

//client results
expectOasEligible(res, EntitlementResultType.FULL, 1045.11)
expectOasEligible(res, EntitlementResultType.FULL, 768.46)
expectGisEligible(res, 241.52)
expectAlwTooOld(res)
expectAlwsMarital(res)
//Future Benefit
expectFutureOasGisBenefitEligible(res, 100, 1045.11, 8.3, 0)
expectFutureOasGisBenefitEligible(res, 100, 768.46, 8.3, 0)

//partner results
expectOasNotEligible(res, true)
Expand All @@ -177,12 +177,12 @@ describe('gisCoupleALWBenefit', () => {
const res = await mockGetRequest(extractedPayload)

//client results
expectOasEligible(res, EntitlementResultType.PARTIAL, 857.6)
expectGisEligible(res, 318.37)
expectOasEligible(res, EntitlementResultType.FULL, 768.46)
expectGisEligible(res, 241.52)
expectAlwTooOld(res)
expectAlwsMarital(res)
//Future Benefit
expectFutureOasGisBenefitEligible(res, 94, 857.6, 72.15, 0)
expectFutureOasGisBenefitEligible(res, 94, 768.46, 0, 0)

//partner results
expectOasNotEligible(res, true)
Expand Down
7 changes: 4 additions & 3 deletions __tests__/pages/api/gisCoupleOnePenBenefit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,17 +108,18 @@ describe('gisCoupleOnePenBenefit', () => {
it('should pass 51 test - CALC-51', async () => {
const desiredName = 'CALC-51' // Replace with the desired name
const extractedPayload = getTransformedPayloadByName(filePath, desiredName)

const res = await mockGetRequest(extractedPayload)

//client results
expectOasEligible(res, EntitlementResultType.FULL, 1045.11)
expectOasEligible(res, EntitlementResultType.FULL, 768.46)
expectGisEligible(res, 0.82)
expectAlwTooOld(res)
expectAlwsMarital(res)

//Future Benefit
expectFutureOasGisBenefitEligible(res, 82, 1045.11, 0.82, 0)
expectFutureOasGisBenefitEligible(res, 87, 1045.11, 0.0, 1)
expectFutureOasGisBenefitEligible(res, 82, 768.46, 0.82, 0)
expectFutureOasGisBenefitEligible(res, 87, 768.46, 0.0, 1)

//partner results
expectAllIneligible(res, true)
Expand Down
10 changes: 5 additions & 5 deletions __tests__/pages/api/gisCoupleTwoPensBenefit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,8 @@ describe('gisCoupleTwoPensBenefit', () => {
const res = await mockGetRequest(extractedPayload)

//client results
expectOasEligible(res, EntitlementResultType.PARTIAL, 731.57)
expectGisEligible(res, 1066.99)
expectOasEligible(res, EntitlementResultType.PARTIAL, 717.6)
expectGisEligible(res, 1047.78)
expectAlwTooOld(res)
expectAlwsMarital(res)

Expand All @@ -314,7 +314,7 @@ describe('gisCoupleTwoPensBenefit', () => {
const res = await mockGetRequest(extractedPayload)

//client results
expectOasEligible(res, EntitlementResultType.FULL, 1045.11)
expectOasEligible(res, EntitlementResultType.FULL, 999)
expectGisEligible(res, 561.45)
expectAlwTooOld(res)
expectAlwsMarital(res)
Expand All @@ -332,7 +332,7 @@ describe('gisCoupleTwoPensBenefit', () => {
const res = await mockGetRequest(extractedPayload)

//client results
expectOasEligible(res, EntitlementResultType.FULL, 1045.11)
expectOasEligible(res, EntitlementResultType.FULL, 860.68)
expectGisEligible(res, 92.82)
expectAlwTooOld(res)
expectAlwsMarital(res)
Expand All @@ -350,7 +350,7 @@ describe('gisCoupleTwoPensBenefit', () => {
const res = await mockGetRequest(extractedPayload)

//client results
expectOasEligible(res, EntitlementResultType.PARTIAL, 857.6)
expectOasEligible(res, EntitlementResultType.FULL, 768.46)
expectGisEligible(res, 0.0)
expect(res.body.results.gis.eligibility.reason).toEqual(ResultReason.INCOME)
expectAlwTooOld(res)
Expand Down
4 changes: 2 additions & 2 deletions __tests__/pages/api/gisSingleBenefit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@ describe('gisSingleBenefit', () => {
const res = await mockGetRequest(extractedPayload)

//client results
expectOasEligible(res, EntitlementResultType.PARTIAL, 267.89)
expectGisEligible(res, 537.74)
expectOasEligible(res, EntitlementResultType.PARTIAL, 288.18)
expectGisEligible(res, 480.11)
expectAlwTooOld(res)
expectAlwsMarital(res)
})
Expand Down
Loading

0 comments on commit cd2284e

Please sign in to comment.