diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..2f4eb3c62 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,3 @@ +*.js text eol=lf +*.vue text eol=lf +*.scss text eol=lf \ No newline at end of file diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c06ae5c43..f6d88a03d 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -20,13 +20,15 @@ resources: - container: node image: packagerepository.sagaws.net:8082/safelite/node-build:15 - container: awscli - image: packagerepository.sagaws.net:8082/safelite/awscli-build:3.7 + image: packagerepository.sagaws.net:8082/safelite/awscli2-build:3.9 + - container: prettier-node + image: packagerepository.sagaws.net:8082/safelite/prettier-node-build:18 repositories: - repository: AzureDevOps type: github name: Safelite/AzureDevOps endpoint: Safelite - ref: refs/tags/t5.5.31 + ref: refs/tags/t5.5.40 variables: - group: Digital-Infrastructure @@ -35,17 +37,25 @@ variables: stages: # PR's - ${{ if eq(variables['Build.Reason'], 'PullRequest') }}: - - stage: TestPr - displayName: Run Unit Tests For PullRequest - jobs: - - template: templates/digital/vue-jest-run-unit-tests.yml@AzureDevOps - parameters: - nodeContainer: node - npmLocation: $(Build.SourcesDirectory) - testResultsFile: junit.xml - summaryFileLocation: $(Build.SourcesDirectory)/coverage/cobertura-coverage.xml - - + - stage: TestFormat + displayName: Test Code Format + jobs: + - job: checkFormatting + displayName: Check formatting + container: prettier-node + steps: + - bash: prettier --check "$(Build.SourcesDirectory)/src/**/*.(js|vue)" + displayName: Run Prettier check + + - stage: TestPr + displayName: Run Unit Tests For PullRequest + jobs: + - template: templates/digital/vue-jest-run-unit-tests.yml@AzureDevOps + parameters: + nodeContainer: node + npmLocation: $(Build.SourcesDirectory) + testResultsFile: junit.xml + summaryFileLocation: $(Build.SourcesDirectory)/coverage/cobertura-coverage.xml - ${{ else }}: # Dev Build/Deploy - stage: Dev @@ -91,8 +101,66 @@ stages: indexDeployVariables: __VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY__: $(__VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY__) __VUE_APP_GOOGLE_TAG_MANAGER_NOSCRIPT_FRAME_SRC__: $(__VUE_APP_GOOGLE_TAG_MANAGER_NOSCRIPT_FRAME_SRC__) - cfDistributionId: $(cfDistributionId) + cfDistributionId: $(vueCfDistributionId) + - template: templates/digital/invalidate-cloudfront-cache.yml@AzureDevOps + parameters: + awsCliContainer: awscli + distributionId: $(apiCfDistributionId) + paths: /fmg/* + awsProfile: $(devDeploymentProfile) + # Test Build/Deploy + - stage: Test + condition: eq(variables['Build.SourceBranch'], variables['test-branch'] ) + variables: + - group: FixMyGlassTest + jobs: + - deployment: testBuildDeployment + displayName: Build and Deploy FMG - Test + environment: digitalCloud-sys + container: node + workspace: + clean: all + strategy: + runOnce: + deploy: + steps: + - checkout: self + clean: true + - template: templates/digital/step-build-vue.yml@AzureDevOps + parameters: + buildOutputDir: dist + environment: Test + - template: templates/digital/step-deploy-vue.yml@AzureDevOps + parameters: + artifactName: vueDistTest + awsProfile: $(sysDeploymentProfile) + outputPath: /fmg/ + deployBuckets: + safelite-sys-fmg-us-east-1: + clearFolder: true + deployFolder: "" + region: us-east-1 + safelite-sys-fmg-us-east-2: + clearFolder: true + deployFolder: "" + region: us-east-2 + appDeployVariables: + __VUE_APP_CONSUMER_CF_DISTRO__: $(__VUE_APP_CONSUMER_CF_DISTRO__) + __VUE_APP_GOOGLE_PLACES_API_KEY__: $(__VUE_APP_GOOGLE_PLACES_API_KEY__) + __VUE_APP_HERITAGE_FUNNEL__: $(__VUE_APP_HERITAGE_FUNNEL__) + __VUE_APP_CURRENT_ENVIRONMENT__: $(__VUE_APP_CURRENT_ENVIRONMENT__) + indexDeployVariables: + __VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY__: $(__VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY__) + __VUE_APP_GOOGLE_TAG_MANAGER_NOSCRIPT_FRAME_SRC__: $(__VUE_APP_GOOGLE_TAG_MANAGER_NOSCRIPT_FRAME_SRC__) + cfDistributionId: $(vueCfDistributionId) + - template: templates/digital/invalidate-cloudfront-cache.yml@AzureDevOps + parameters: + awsCliContainer: awscli + distributionId: $(apiCfDistributionId) + paths: /fmg/* + awsProfile: $(sysDeploymentProfile) + # QA Build/Deploy - stage: Qa condition: eq(variables['Build.SourceBranch'], variables['qa-branch'] ) @@ -137,7 +205,13 @@ stages: indexDeployVariables: __VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY__: $(__VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY__) __VUE_APP_GOOGLE_TAG_MANAGER_NOSCRIPT_FRAME_SRC__: $(__VUE_APP_GOOGLE_TAG_MANAGER_NOSCRIPT_FRAME_SRC__) - cfDistributionId: $(cfDistributionId) + cfDistributionId: $(vueCfDistributionId) + - template: templates/digital/invalidate-cloudfront-cache.yml@AzureDevOps + parameters: + awsCliContainer: awscli + distributionId: $(apiCfDistributionId) + paths: /fmg/* + awsProfile: $(qaDeploymentProfile) # Prod Build/Deploy - stage: Prod @@ -183,7 +257,13 @@ stages: indexDeployVariables: __VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY__: $(__VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY__) __VUE_APP_GOOGLE_TAG_MANAGER_NOSCRIPT_FRAME_SRC__: $(__VUE_APP_GOOGLE_TAG_MANAGER_NOSCRIPT_FRAME_SRC__) - cfDistributionId: $(cfDistributionId) + cfDistributionId: $(apiCfDistributionId) + - template: templates/digital/invalidate-cloudfront-cache.yml@AzureDevOps + parameters: + awsCliContainer: awscli + distributionId: $(apiCfDistributionId) + paths: /fmg/* + awsProfile: $(prodDeploymentProfile) - template: templates/digital/auto-tag.yml@AzureDevOps parameters: dependsOn: prodBuildDeployment diff --git a/src/common-components/modal/modal.vue b/src/common-components/modal/modal.vue index a375cf8cc..12055ed05 100644 --- a/src/common-components/modal/modal.vue +++ b/src/common-components/modal/modal.vue @@ -16,7 +16,7 @@ aria-label="Close">