Skip to content

Commit

Permalink
Merge branch 'main' into jmo-grant-details-input-blur
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffsmohan authored Mar 12, 2024
2 parents b44e385 + 8eb4fa6 commit bd2ccf5
Show file tree
Hide file tree
Showing 53 changed files with 563 additions and 269 deletions.
4 changes: 4 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ categories:
collapse-after: 10
labels:
- bug
- title: 🗂️ Database Changes
collapse-after: 1
labels:
- database-changes
- title: 📖 Documentation improvements
collapse-after: 10
labels:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ jobs:
with:
platforms: linux/amd64,linux/arm64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
uses: docker/setup-buildx-action@0d103c3126aa41d772a8362f6aa67afac040f80c # v3.1.0
with:
platforms: linux/amd64,linux/arm64
- name: Authenticate docker
Expand Down Expand Up @@ -154,7 +154,7 @@ jobs:
BAKEFILE_PATH: ${{ steps.meta.outputs.bake-file }}
- name: Build and push Docker image
id: build-push
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5.1.0
uses: docker/build-push-action@af5a7ed5ba88268d5278f7203fb52cd833f66d6e # v5.2.0
with:
context: .
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,12 @@ jobs:
github.com:443
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Download website build artifacts
uses: actions/download-artifact@eaceaf801fd36c7dee90939fad912460b18a1ffe # v4.1.2
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
with:
name: ${{ needs.build.outputs.website-artifacts-key }}
path: ${{ needs.build.outputs.website-artifacts-path }}
- name: Download docker build attestation artifacts
uses: actions/download-artifact@eaceaf801fd36c7dee90939fad912460b18a1ffe # v4.1.2
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
with:
name: ${{ needs.build.outputs.server-attestation-artifacts-key }}
path: ${{ needs.build.outputs.server-attestation-artifacts-path }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ jobs:
ref: ${{ inputs.ref }}
show-progress: 'false'
persist-credentials: 'false'
- uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
- uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1
name: Cache plugin dir
with:
path: .tflint.d/plugins
Expand All @@ -279,4 +279,4 @@ jobs:
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Run TFLint
run: tflint --format compact --recursive --minimum-failure-severity=error
run: tflint --format compact --recursive --minimum-failure-severity=warning
4 changes: 2 additions & 2 deletions .github/workflows/terraform-apply.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
registry.terraform.io:443
releases.hashicorp.com:443
- name: Download Terraform artifacts
uses: actions/download-artifact@eaceaf801fd36c7dee90939fad912460b18a1ffe # v4.1.2
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
with:
name: ${{ inputs.tf-plan-artifacts-key }}
path: ${{ github.workspace }}/terraform
Expand All @@ -94,7 +94,7 @@ jobs:
with:
terraform_version: ${{ steps.get_tf_version.outputs.TF_VERSION }}
- name: Download website artifacts
uses: actions/download-artifact@eaceaf801fd36c7dee90939fad912460b18a1ffe # v4.1.2
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
with:
name: ${{ inputs.website-artifacts-key }}
path: ${{ inputs.website-artifacts-path }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/terraform-plan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ jobs:
env:
GPG_PASSPHRASE: ${{ secrets.gpg-passphrase }}
- name: Download website artifacts
uses: actions/download-artifact@eaceaf801fd36c7dee90939fad912460b18a1ffe # v4.1.2
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
with:
name: ${{ inputs.website-artifacts-key }}
path: ${{ inputs.website-artifacts-path }}
Expand Down
8 changes: 7 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
{
"recommendations": ["Vue.volar", "dbaeumer.vscode-eslint"]
"recommendations": [
"Vue.volar",
"hashicorp.terraform",
"ms-azuretools.vscode-docker",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode"
]
}
2 changes: 1 addition & 1 deletion docs/decisions/0007-adopt-vue-recommended-linting.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# 0007. Adopt vue/recommended linting

Date: 2024-02-26
Status: Proposed
Status: Accepted

## Context and Problem Statement

Expand Down
113 changes: 109 additions & 4 deletions packages/client/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = {
es6: true,
},
extends: [
'plugin:vue/essential',
'plugin:vue/recommended',
'@vue/airbnb',
],
parserOptions: {
Expand All @@ -24,11 +24,116 @@ module.exports = {
'no-restricted-syntax': 'off',

'import/prefer-default-export': 'off',

'vue/multi-word-component-names': 'off',
'vue/no-mutating-props': 'off',
},
overrides: [
// This override is part of the process of upgrading plugin:vue/essential -> plugin:vue/recommended.
// In order to avoid a huge stop-the-world PR, we're introducing the plugin upgrade and a file list here
// that ignores the added rules. That way, we can bring individual files into compliance in smaller, less
// disruptive PRs. We'll plan to burn down the list of files in this list until we're done and can remove
// this override entirely.
{
files: [
// File list to ignore generated by `yarn run lint --no-fix --format unix | sed -E 's/:.+//g' | uniq`
'./src/App.vue',
'./src/arpa_reporter/App.vue',
'./src/arpa_reporter/components/AlertBox.vue',
'./src/arpa_reporter/components/DownloadButton.vue',
'./src/arpa_reporter/components/DownloadFileButton.vue',
'./src/arpa_reporter/components/DownloadFileButtonSmall.vue',
'./src/arpa_reporter/components/DownloadTemplateBtn.vue',
'./src/arpa_reporter/components/Navigation.vue',
'./src/arpa_reporter/components/StandardForm.vue',
'./src/arpa_reporter/views/Agencies.vue',
'./src/arpa_reporter/views/Agency.vue',
'./src/arpa_reporter/views/Home.vue',
'./src/arpa_reporter/views/Login.vue',
'./src/arpa_reporter/views/NewTemplate.vue',
'./src/arpa_reporter/views/NewUpload.vue',
'./src/arpa_reporter/views/ReportingPeriod.vue',
'./src/arpa_reporter/views/ReportingPeriods.vue',
'./src/arpa_reporter/views/Subrecipient.vue',
'./src/arpa_reporter/views/Subrecipients.vue',
'./src/arpa_reporter/views/Upload.vue',
'./src/arpa_reporter/views/Uploads.vue',
'./src/arpa_reporter/views/User.vue',
'./src/arpa_reporter/views/Users.vue',
'./src/arpa_reporter/views/Validation.vue',
'./src/components/GrantsTable.vue',
'./src/components/Layout.vue',
'./src/components/Modals/AddKeyword.vue',
'./src/components/Modals/AddOrganization.vue',
'./src/components/Modals/AddTeam.vue',
'./src/components/Modals/AddUser.vue',
'./src/components/Modals/EditOrganization.vue',
'./src/components/Modals/EditTeam.vue',
'./src/components/Modals/EditUser.vue',
'./src/components/Modals/GrantDetailsLegacy.vue',
'./src/components/Modals/ImportTeams.vue',
'./src/components/Modals/ImportUsers.vue',
'./src/components/Modals/ProfileSettings.vue',
'./src/components/Modals/SavedSearchPanel.vue',
'./src/components/Modals/SearchPanel.vue',
'./src/components/SearchFilter.vue',
'./src/components/Uploader.vue',
'./src/components/UserAvatar.vue',
'./src/main.js',
'./src/views/ArpaAnnualPerformanceReporter.vue',
'./src/views/Dashboard.vue',
'./src/views/EligibilityCodes.vue',
'./src/views/GrantDetails.vue',
'./src/views/Grants.vue',
'./src/views/Home.vue',
'./src/views/Keywords.vue',
'./src/views/Login.vue',
'./src/views/MyGrants.vue',
'./src/views/MyProfile.vue',
'./src/views/NotFound.vue',
'./src/views/Organizations.vue',
'./src/views/RecentActivity.vue',
'./src/views/Teams.vue',
'./src/views/UpcomingClosingDates.vue',
'./src/views/Users.vue',
],
rules: {
// List of essential rules we previously had turned off
'vue/multi-word-component-names': 'off',
'vue/no-mutating-props': 'off',
// List of strongly recommended rules introduced (https://eslint.vuejs.org/rules/#priority-b-strongly-recommended-improving-readability)
'vue/attribute-hyphenation': 'off',
'vue/component-definition-name-casing': 'off',
'vue/first-attribute-linebreak': 'off',
'vue/html-closing-bracket-newline': 'off',
'vue/html-closing-bracket-spacing': 'off',
'vue/html-end-tags': 'off',
'vue/html-indent': 'off',
'vue/html-quotes': 'off',
'vue/html-self-closing': 'off',
'vue/max-attributes-per-line': 'off',
'vue/multiline-html-element-content-newline': 'off',
'vue/mustache-interpolation-spacing': 'off',
'vue/no-multi-spaces': 'off',
'vue/no-spaces-around-equal-signs-in-attribute': 'off',
'vue/no-template-shadow': 'off',
'vue/one-component-per-file': 'off',
'vue/prop-name-casing': 'off',
'vue/require-default-prop': 'off',
'vue/require-explicit-emits': 'off',
'vue/require-prop-types': 'off',
'vue/singleline-html-element-content-newline': 'off',
'vue/v-bind-style': 'off',
'vue/v-on-event-hyphenation': 'off',
'vue/v-on-style': 'off',
'vue/v-slot-style': 'off',
// List of recommended rules introduced (https://eslint.vuejs.org/rules/#priority-b-strongly-recommended-improving-readability)
'vue/attributes-order': 'off',
'vue/component-tags-order': 'off',
'vue/no-lone-template': 'off',
'vue/no-multiple-slot-args': 'off',
'vue/no-v-html': 'off',
'vue/order-in-components': 'off',
'vue/this-in-template': 'off',
},
},
{
files: [
'**/__tests__/*.{j,t}s?(x)',
Expand Down
16 changes: 3 additions & 13 deletions packages/client/src/components/GrantsTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
@sort-changed="currentPage = 1"
>
<template #cell(award_ceiling)="row">
<p> {{ formatMoney(row.item.award_ceiling) }}</p>
<p> {{ formatCurrency(row.item.award_ceiling) }}</p>
</template>
<template #table-busy>
<div class="text-center text-info my-2" style="height: 1200px;">
Expand Down Expand Up @@ -104,6 +104,7 @@ import { datadogRum } from '@datadog/browser-rum';
import { titleize } from '@/helpers/form-helpers';
import { daysUntil } from '@/helpers/dates';
import { defaultCloseDateThresholds } from '@/helpers/constants';
import { formatCurrency } from '@/helpers/currency';
import GrantDetailsLegacy from './Modals/GrantDetailsLegacy.vue';
import SearchPanel from './Modals/SearchPanel.vue';
import SavedSearchPanel from './Modals/SavedSearchPanel.vue';
Expand Down Expand Up @@ -345,6 +346,7 @@ export default {
fetchSavedSearches: 'grants/fetchSavedSearches',
}),
titleize,
formatCurrency,
extractStateFromRoute() {
this.currentPage = Number(this.$route.query.page) || DEFAULT_CURRENT_PAGE;
this.orderBy = this.$route.query.sort || DEFAULT_ORDER_BY;
Expand Down Expand Up @@ -499,18 +501,6 @@ export default {
assignedToAgency: this.showAssignedToAgency,
});
},
formatMoney(value) {
if (value === undefined || value === null) {
return '';
}
const res = Number(value).toLocaleString('en-US', {
minimumFractionDigits: 2,
maximumFractionDigits: 2,
style: 'currency',
currency: 'USD',
});
return (`${res}`);
},
},
};
</script>
Expand Down
14 changes: 14 additions & 0 deletions packages/client/src/helpers/currency.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const currencyFormatter = new Intl.NumberFormat('en-US', {
minimumFractionDigits: 2,
maximumFractionDigits: 2,
style: 'currency',
currency: 'USD',
currencyDisplay: 'narrowSymbol',
});

export function formatCurrency(value) {
if (value === undefined || value === null) {
return '';
}
return currencyFormatter.format(value);
}
2 changes: 1 addition & 1 deletion packages/client/src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export const routes = [
},
},
{
path: '/grant/:id',
path: '/grants/:id',
name: 'grantDetail',
component: () => import('../views/GrantDetails.vue'),
meta: {
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/views/Dashboard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export default {
if (!newGrantsDetailPageEnabled()) {
return;
}
this.$router.push(`grant/${item.grant_id}`);
this.$router.push({ name: 'grantDetail', params: { id: item.grant_id } });
},
},
};
Expand Down
31 changes: 19 additions & 12 deletions packages/client/src/views/GrantDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@
</div>
<b-container fluid v-if="selectedGrant && !loading">
<div class="grant-details-container">
<div class="grant-details-back-link" v-if="isFirstPageLoad">
<router-link :to="{ name: 'grants' }">Browse Grants</router-link>
</div>
<div class="grant-details-back-link" v-else>
<a @click="$router.back()">Back</a>
<div class="grant-details-back-link">
<router-link v-if="isFirstPageLoad" :to="{ name: 'grants' }">Browse Grants</router-link>
<a href="#" @click="$router.back()" v-else>Back to Results</a>
</div>
<!-- Left page column: headline -->
<h2 class="grant-details-headline m-0">{{ selectedGrant.title }}</h2>
Expand Down Expand Up @@ -164,6 +162,8 @@ import { mapActions, mapGetters } from 'vuex';
import { datadogRum } from '@datadog/browser-rum';
import { debounce } from 'lodash';
import { newTerminologyEnabled } from '@/helpers/featureFlags';
import { formatCurrency } from '@/helpers/currency';
import { titleize } from '@/helpers/form-helpers';
import { DateTime } from 'luxon';
import UserAvatar from '@/components/UserAvatar.vue';
Expand Down Expand Up @@ -268,11 +268,11 @@ export default {
name: 'Grant ID',
value: this.selectedGrant.grant_id,
}, {
name: 'Federal Awarding',
name: 'Agency Code',
value: this.selectedGrant.agency_code,
}, {
name: 'Award Ceiling',
value: this.selectedGrant.award_ceiling,
value: formatCurrency(this.selectedGrant.award_ceiling),
}, {
name: 'Category of Funding Activity',
value: this.selectedGrant.funding_activity_categories?.join(', '),
Expand All @@ -281,7 +281,7 @@ export default {
value: this.selectedGrant.opportunity_category,
}, {
name: 'Opportunity Status',
value: this.selectedGrant.opportunity_status,
value: titleize(this.selectedGrant.opportunity_status),
}, {
name: 'Appropriation Bill',
value: this.selectedGrant.bill,
Expand Down Expand Up @@ -358,6 +358,8 @@ export default {
fetchAgencies: 'agencies/fetchAgencies',
fetchGrantDetails: 'grants/fetchGrantDetails',
}),
titleize,
formatCurrency,
debounceSearchInput: debounce(function bounce(newVal) {
this.debouncedSearchInput = newVal;
}, 500),
Expand Down Expand Up @@ -449,6 +451,7 @@ export default {
</script>
<style lang="css">
.grant-details-container {
padding-right: 80px;
padding-left: 80px;
Expand All @@ -463,12 +466,16 @@ export default {
column-gap: 90px;
row-gap: 48px;
.grant-details-back-link {
padding-top: 20px;
font-size: 1rem;
margin-top: 24px;
font-size: 14px;
font-weight: 700;
color: #6D7278;
a {
color: #6D7278;
cursor: pointer;
color: black;
text-decoration: none;
&::hover {
text-decoration: underline;
}
}
}
}
Expand Down
Loading

0 comments on commit bd2ccf5

Please sign in to comment.