Skip to content

Commit

Permalink
1846 grantfinder terminology changes (#2187)
Browse files Browse the repository at this point in the history
* fix: #1846 terminology changes for Dashboard

Signed-off-by: Ed Snodgrass <[email protected]>

* fix: #1846 updating/renaming Agencies.vue view in grants-finder

Signed-off-by: Ed Snodgrass <[email protected]>

* fix: #1846 changing last usage of Teams on Dashboard.vue

Signed-off-by: Ed Snodgrass <[email protected]>

* fix: #1846 updating Tenants.vue to be Organizations.vue

Signed-off-by: Ed Snodgrass <[email protected]>

* fix: #1846 updating terms for Layout.vue and the routes

Signed-off-by: Ed Snodgrass <[email protected]>

* fix: #1846 export of recent activities using Team instead of Agency

Signed-off-by: Ed Snodgrass <[email protected]>

* fix: #1846 other tenant and agency components terminology changes

Signed-off-by: Ed Snodgrass <[email protected]>

* fix: #1846 providing labels for the table fields to show "team" instead of "agency"

Signed-off-by: Ed Snodgrass <[email protected]>

* fix: #1846 terminology changes for GrantDetails.vue

Signed-off-by: Ed Snodgrass <[email protected]>

* fix: #1846 added a few more bare-bones test files

Signed-off-by: Ed Snodgrass <[email protected]>

* fix: #1846 pr comments, missed an "Agency" change and some other fixes

Signed-off-by: Ed Snodgrass <[email protected]>

* fix: #1846 feature toggling all mentions of team and organization

Signed-off-by: Ed Snodgrass <[email protected]>

* fix: #1846 terraform formatting after adding feature flag

Signed-off-by: Ed Snodgrass <[email protected]>

* Update terraform/staging.tfvars

Co-authored-by: Tyler Hendrickson <[email protected]>

* Update packages/client/public/deploy-config.js

Co-authored-by: Tyler Hendrickson <[email protected]>

* fix: #1846 feature flag around tenant and agencies to redirect

Signed-off-by: Ed Snodgrass <[email protected]>

* fix: #1846 cleaner solution for redirect

Signed-off-by: Ed Snodgrass <[email protected]>

* fix: #1846 updating table header for grants to be plural for teams/agencies

Signed-off-by: Ed Snodgrass <[email protected]>

---------

Signed-off-by: Ed Snodgrass <[email protected]>
Co-authored-by: Tyler Hendrickson <[email protected]>
Co-authored-by: aditya <[email protected]>
  • Loading branch information
3 people authored and adele-usdr committed Nov 28, 2023
1 parent 3f49b46 commit 93d0be9
Show file tree
Hide file tree
Showing 31 changed files with 862 additions and 322 deletions.
3 changes: 2 additions & 1 deletion packages/client/public/deploy-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@ window.APP_CONFIG.overrideFeatureFlag = (flagName, overrideValue) => {
// configuring the `website_feature_flags` input variable in Terraform (see `terraform/*.tfvars`).
window.APP_CONFIG.featureFlags = {
useNewTable: true,
myProfileEnabled: true
myProfileEnabled: true,
newTerminologyEnabled: true,
};
2 changes: 2 additions & 0 deletions packages/client/src/components/GrantsTableNext.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@

<script>
import { mapActions, mapGetters } from 'vuex';
import { newTerminologyEnabled } from '@/helpers/featureFlags';
import { titleize } from '../helpers/form-helpers';
import GrantDetails from './Modals/GrantDetails.vue';
import SearchPanel from './Modals/SearchPanel.vue';
Expand Down Expand Up @@ -113,6 +114,7 @@ export default {
},
{
key: 'interested_agencies',
label: `Interested ${newTerminologyEnabled() ? 'Teams' : 'Agencies'}`,
},
{
// opportunity_status
Expand Down
21 changes: 11 additions & 10 deletions packages/client/src/components/Layout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<b-navbar-nav class="ml-auto">

<b-nav-text>
<b-badge>{{selectedAgency ? selectedAgency.name : ''}}</b-badge>
<b-badge>{{selectedTeam ? selectedTeam.name : ''}}</b-badge>
</b-nav-text>

<b-nav-item-dropdown right v-if="loggedInUser">
Expand All @@ -36,8 +36,8 @@
<b-nav-item v-if="!useNewGrantsTable" to="/keywords" exact exact-active-class="active">Keywords</b-nav-item>
<b-nav-item to="/dashboard" exact exact-active-class="active">Dashboard</b-nav-item>
<b-nav-item to="/users" exact exact-active-class="active" v-if="userRole === 'admin'">Users</b-nav-item>
<b-nav-item to="/Agencies" exact exact-active-class="active">Agencies</b-nav-item>
<b-nav-item v-if="canSeeTenantsTab" to="/tenants" exact exact-active-class="active">Tenants</b-nav-item>
<b-nav-item :to="newTerminologyEnabled ? '/teams' : '/agencies'" exact exact-active-class="active">{{newTerminologyEnabled ? 'Teams' : 'Agencies'}}</b-nav-item>
<b-nav-item v-if="canSeeOrganizationsTab" :to="newTerminologyEnabled ? '/organizations' : '/tenants'" exact exact-active-class="active">{{newTerminologyEnabled ? 'Organizations' : 'Tenants'}}</b-nav-item>
</b-nav>
</b-col>

Expand All @@ -48,14 +48,13 @@

<router-view />
</div>
<ProfileSettingsModal
:showModal.sync="showProfileSettingModal"/>
<ProfileSettingsModal :showModal.sync="showProfileSettingModal"/>
</div>
</template>

<script>
import { mapGetters } from 'vuex';
import { myProfileEnabled, useNewGrantsTable } from '@/helpers/featureFlags';
import { myProfileEnabled, newTerminologyEnabled, useNewGrantsTable } from '@/helpers/featureFlags';
import ProfileSettingsModal from '@/components/Modals/ProfileSettings.vue';
import AlertBox from '../arpa_reporter/components/AlertBox.vue';
Expand All @@ -73,14 +72,16 @@ export default {
},
computed: {
...mapGetters({
agency: 'users/agency',
loggedInUser: 'users/loggedInUser',
userRole: 'users/userRole',
selectedAgency: 'users/selectedAgency',
selectedTeam: 'users/selectedAgency',
alerts: 'alerts/alerts',
}),
canSeeTenantsTab() {
return this.loggedInUser && this.loggedInUser.isUSDRSuperAdmin;
canSeeOrganizationsTab() {
return true;
},
newTerminologyEnabled() {
return newTerminologyEnabled();
},
myProfileEnabled() {
return myProfileEnabled();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<b-modal
id="add-tenant-modal"
ref="modal"
title="Add Tenant"
:title="newTerminologyEnabled ? 'Add Organization' : 'Add Tenant'"
@show="resetModal"
@hidden="resetModal"
@ok="handleOk"
Expand All @@ -12,9 +12,9 @@
<form ref="form" @submit.stop.prevent="handleSubmit">
<b-form-group
:state="!$v.formData.tenantName.$invalid"
label="Tenant Name"
:label="newTerminologyEnabled ? 'Organization Name' : 'Tenant Name'"
label-for="tenantName-input"
invalid-feedback="Tenant name is invalid"
:invalid-feedback="newTerminologyEnabled ? 'Organization name is invalid' : 'Tenant name is invalid'"
>
<b-form-input
id="tenantName-input"
Expand All @@ -25,9 +25,9 @@
</b-form-group>
<b-form-group
:state="!$v.formData.agencyName.$invalid"
label="Agency Name"
:label="newTerminologyEnabled ? 'Team Name' : 'Agency Name'"
label-for="agencyName-input"
invalid-feedback="Agency name is invalid"
:invalid-feedback="newTerminologyEnabled ? 'Team name is invalid' : 'Agency name is invalid'"
>
<b-form-input
id="agencyName-input"
Expand All @@ -38,9 +38,9 @@
</b-form-group>
<b-form-group
:state="!$v.formData.agencyAbbreviation"
label="Agency Abbreviation"
:label="newTerminologyEnabled ? 'Team Abbreviation' : 'Agency Abbreviation'"
label-for="agencyAbbreviation-input"
invalid-feedback="Agency abbreviation is invalid"
:invalid-feedback="newTerminologyEnabled ? 'Team abbreviation is invalid' : 'Agency abbreviation is invalid'"
>
<b-form-input
id="agencyAbbreviation-input"
Expand Down Expand Up @@ -93,6 +93,7 @@
<script>
import { mapActions, mapGetters } from 'vuex';
import { required, email } from 'vuelidate/lib/validators';
import { newTerminologyEnabled } from '@/helpers/featureFlags';
export default {
props: {
Expand Down Expand Up @@ -138,6 +139,9 @@ export default {
computed: {
...mapGetters({
}),
newTerminologyEnabled() {
return newTerminologyEnabled();
},
},
mounted() {
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
id="add-agency-modal"
v-model="showDialog"
ref="modal"
title="Add Agency"
:title="newTerminologyEnabled ? 'Add Team' : 'Add Agency'"
@hidden="resetModal"
@ok="handleOk"
:ok-disabled="$v.formData.$invalid"
Expand All @@ -31,7 +31,7 @@
invalid-feedback="Required"
>
<template slot="label">Abbreviation</template>
<template slot="description">This is used for displaying lists of agencies in compact form (e.g. in a table).</template>
<template slot="description">This is used for displaying lists of {{newTerminologyEnabled ? 'teams' : 'agencies'}} in compact form (e.g. in a table).</template>
<b-form-input
id="abbreviation-input"
type="text"
Expand All @@ -47,7 +47,7 @@
invalid-feedback="Required"
>
<template slot="label">Code</template>
<template slot="description">This should match the Agency Code field in ARPA Reporter workbook uploads. If not using ARPA Reporter, you can set this the same as Abbreviation. This field must be unique across agencies.</template>
<template slot="description">This should match the Agency Code field in ARPA Reporter workbook uploads. If not using ARPA Reporter, you can set this the same as Abbreviation. This field must be unique across {{newTerminologyEnabled ? 'teams' : 'agencies'}}.</template>
<b-form-input
id="code-input"
type="text"
Expand All @@ -60,9 +60,9 @@
<b-form-group
:state="!$v.formData.parentAgency.$invalid"
label-for="agency-input"
invalid-feedback="Must select a parent agency"
:invalid-feedback="newTerminologyEnabled ? 'Must select a parent team' : 'Must select a parent agency'"
>
<template slot="label">Parent Agency</template>
<template slot="label">Parent {{newTerminologyEnabled ? 'Team' : 'Agency'}}</template>
<v-select :options="agencies" label="name" :value="formData.parentAgency" v-model="formData.parentAgency">
<template #search="{attributes, events}">
<input
Expand Down Expand Up @@ -117,6 +117,7 @@ import {
numeric,
minValue,
} from 'vuelidate/lib/validators';
import { newTerminologyEnabled } from '@/helpers/featureFlags';

export default {
props: {
Expand Down Expand Up @@ -179,6 +180,9 @@ export default {
canDefaultCodeToAbbreviation() {
return Boolean(this.formData.abbreviation && this.formData.abbreviation.trim().length > 0);
},
newTerminologyEnabled() {
return newTerminologyEnabled();
},
},
mounted() {
},
Expand Down
8 changes: 6 additions & 2 deletions packages/client/src/components/Modals/AddUser.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@
</b-form-group>
<b-form-group
:state="!$v.formData.agency.$invalid"
label="Agency"
:label="newTerminologyEnabled ? 'Team' : 'Agency'"
label-for="agency-select"
invalid-feedback="Please select your agency"
:invalid-feedback="`Please select your ${newTerminologyEnabled ? 'team' : 'agency'}`"
>
<b-form-select
id="agency-select"
Expand All @@ -62,6 +62,7 @@
<script>
import { mapActions, mapGetters } from 'vuex';
import { required, minLength, email } from 'vuelidate/lib/validators';
import { newTerminologyEnabled } from '@/helpers/featureFlags';
export default {
props: {
Expand Down Expand Up @@ -117,6 +118,9 @@ export default {
text: agency.name,
}));
},
newTerminologyEnabled() {
return newTerminologyEnabled();
},
},
mounted() {
if (this.roles.length === 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
id="edit-tenant-modal"
v-model="showDialog"
ref="modal"
title="Edit Tenant"
:title="newTerminologyEnabled ? 'Edit Organization' : 'Edit Tenant'"
@hidden="resetModal"
@ok="handleOk"
>
Expand All @@ -31,6 +31,7 @@

<script>
import { mapActions, mapGetters } from 'vuex';
import { newTerminologyEnabled } from '@/helpers/featureFlags';

export default {
props: {
Expand Down Expand Up @@ -67,6 +68,9 @@ export default {
bvModalEvt.preventDefault();
this.handleSubmit();
},
newTerminologyEnabled() {
return newTerminologyEnabled();
},
async handleSubmit() {
await this.updateDisplayName({ tenantId: this.tenant.id, ...this.formData });
this.resetModal();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
id="edit-agency-modal"
v-model="showDialog"
ref="modal"
title="Edit Agency"
:title="newTerminologyEnabled ? 'Edit Team' : 'Edit Agency'"
@hidden="resetModal"
@ok="handleOk"
:ok-disabled="$v.formData.$invalid"
Expand All @@ -29,7 +29,7 @@
label-for="abbreviation-input"
>
<template slot="label">Abbreviation</template>
<template slot="description">This is used for displaying lists of agencies in compact form (e.g. in a table).</template>
<template slot="description">This is used for displaying lists of {{newTerminologyEnabled ? 'teams' : 'agencies'}} in compact form (e.g. in a table).</template>
<b-form-input
id="abbreviation-input"
type="text"
Expand All @@ -43,7 +43,7 @@
label-for="code-input"
>
<template slot="label">Code</template>
<template slot="description">This should match the Agency Code field in ARPA Reporter workbook uploads. If not using ARPA Reporter, you can set this the same as Abbreviation. This field must be unique across agencies.</template>
<template slot="description">This should match the Agency Code field in ARPA Reporter workbook uploads. If not using ARPA Reporter, you can set this the same as Abbreviation. This field must be unique across {{newTerminologyEnabled ? 'teams' : 'agencies'}}.</template>
<b-form-input
id="code-input"
type="text"
Expand All @@ -55,7 +55,7 @@
<b-form-group
label-for="agency-input"
>
<template slot="label">Parent Agency</template>
<template slot="label">Parent {{newTerminologyEnabled ? 'Team' : 'Agency'}}</template>
<v-select :options="agencies" label="name" :value="this.formData.parentAgency" v-model="formData.parentAgency">
<template #search="{attributes, events}">
<input
Expand Down Expand Up @@ -101,11 +101,11 @@
<form ref="form" @click="handleDelete">
<span id="disabled-wrapper" class="d-inline-block" tabindex="0">
<b-button v-bind:disabled="userRole !== 'admin'" style="pointer-events: none;" variant="danger">
Admin Delete Agency
Admin Delete {{newTerminologyEnabled ? 'Team' : 'Agency'}}
</b-button>
</span>
<b-tooltip v-if="userRole !== 'admin'" target="disabled-wrapper" triggers="hover">
You cannot delete an agency with children. Reassign child agencies to continue deletion.
You cannot delete a {{newTerminologyEnabled ? 'team' : 'agency'}} with children. Reassign child {{newTerminologyEnabled ? 'teams' : 'agencies'}} to continue deletion.
</b-tooltip>
</form>
</form>
Expand All @@ -118,6 +118,7 @@ import { mapActions, mapGetters } from 'vuex';
import {
required, numeric, minValue,
} from 'vuelidate/lib/validators';
import { newTerminologyEnabled } from '@/helpers/featureFlags';

export default {
props: {
Expand Down Expand Up @@ -171,6 +172,9 @@ export default {
agencies: 'agencies/agencies',
userRole: 'users/userRole',
}),
newTerminologyEnabled() {
return newTerminologyEnabled();
},
},
mounted() {
},
Expand All @@ -195,9 +199,13 @@ export default {
return;
}
const msgBoxConfirmResult = await this.$bvModal.msgBoxConfirm(
'Are you sure you want to delete this agency? This cannot be undone. '
+ 'If the agency has children, reassign child agencies to continue deletion.',
{ okTitle: 'Delete', okVariant: 'danger', title: 'Delete Agency' },
`Are you sure you want to delete this ${this.newTerminologyEnabled ? 'team' : 'agency'}? This cannot be undone. `
+ `If the ${this.newTerminologyEnabled ? 'team' : 'agency'} has children, reassign child ${this.newTerminologyEnabled ? 'teams' : 'agencies'} to continue deletion.`,
{
okTitle: 'Delete',
okVariant: 'danger',
title: `Delete ${this.newTerminologyEnabled ? 'Team' : 'Agency'}`,
},
);
if (msgBoxConfirmResult === true) {
await this.deleteAgency({
Expand All @@ -210,7 +218,7 @@ export default {
}).then(() => {
this.resetModal();
}).catch(async (e) => {
await this.$bvModal.msgBoxOk(`Could not delete agency: ${e.message}`, {
await this.$bvModal.msgBoxOk(`Could not delete ${this.newTerminologyEnabled ? 'team' : 'agency'}: ${e.message}`, {
title: 'Error',
bodyTextVariant: 'danger',
});
Expand Down Expand Up @@ -244,7 +252,7 @@ export default {
if ((this.formData.parentAgency.id !== this.agency.id) && (this.formData.parentAgency.parent !== this.agency.id)) {
this.updateAgencyParent({ agencyId: this.agency.id, parentId: this.formData.parentAgency.id });
} else {
await this.$bvModal.msgBoxOk('Agency cannot be its own parent.');
await this.$bvModal.msgBoxOk(`${this.newTerminologyEnabled ? 'Team' : 'Agency'} cannot be its own parent.`);
ok = false;
}
}
Expand Down
Loading

0 comments on commit 93d0be9

Please sign in to comment.