Skip to content

Commit

Permalink
fix: #2218 remove grants table feature flag, and logic specific to ol…
Browse files Browse the repository at this point in the history
…d grants table
  • Loading branch information
adele-usdr committed Dec 4, 2023
1 parent 5eb553d commit e6ff1d1
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 44 deletions.
7 changes: 1 addition & 6 deletions packages/client/src/components/Layout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@
<b-nav tabs justified fill style="margin-top: 20px">
<b-nav-item to="/my-grants" exact exact-active-class="active">My Grants</b-nav-item>
<b-nav-item to="/grants" exact exact-active-class="active">Browse Grants</b-nav-item>
<b-nav-item v-if="!useNewGrantsTable" to="/eligibility-codes" exact exact-active-class="active">Eligibility Codes</b-nav-item>
<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="newTerminologyEnabled ? '/teams' : '/agencies'" exact exact-active-class="active">{{newTerminologyEnabled ? 'Teams' : 'Agencies'}}</b-nav-item>
Expand All @@ -86,7 +84,7 @@

<script>
import { mapGetters } from 'vuex';
import { myProfileEnabled, newTerminologyEnabled, useNewGrantsTable } from '@/helpers/featureFlags';
import { myProfileEnabled, newTerminologyEnabled } from '@/helpers/featureFlags';
import ProfileSettingsModal from '@/components/Modals/ProfileSettings.vue';
import AlertBox from '../arpa_reporter/components/AlertBox.vue';
import UserAvatar from './UserAvatar.vue';
Expand Down Expand Up @@ -120,9 +118,6 @@ export default {
myProfileEnabled() {
return myProfileEnabled();
},
useNewGrantsTable() {
return useNewGrantsTable();
},
showTabs() {
return !(this.$route.meta.hideLayoutTabs === true);
},
Expand Down
3 changes: 0 additions & 3 deletions packages/client/src/helpers/featureFlags/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ import { getFeatureFlags } from './utils';
/**
* @returns { boolean } true if the new grants table should be active, else false.
*/
export function useNewGrantsTable() {
return getFeatureFlags().useNewTable === true;
}

export function myProfileEnabled() {
return getFeatureFlags().myProfileEnabled === true;
Expand Down
21 changes: 1 addition & 20 deletions packages/client/src/router/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Vue from 'vue';
import VueRouter from 'vue-router';

import { myProfileEnabled, newTerminologyEnabled, useNewGrantsTable } from '@/helpers/featureFlags';
import { myProfileEnabled, newTerminologyEnabled } from '@/helpers/featureFlags';
import Login from '../views/Login.vue';
import Layout from '../components/Layout.vue';
import ArpaAnnualPerformanceReporter from '../views/ArpaAnnualPerformanceReporter.vue';
Expand Down Expand Up @@ -73,24 +73,6 @@ const routes = [
requiresAuth: true,
},
},
{
path: '/eligibility-codes',
name: 'eligibilityCodes',
component: () => import('../views/EligibilityCodes.vue'),
meta: {
requiresAuth: true,
enabledWithOldGrantsTableOnly: true,
},
},
{
path: '/keywords',
name: 'keywords',
component: () => import('../views/Keywords.vue'),
meta: {
requiresAuth: true,
enabledWithOldGrantsTableOnly: true,
},
},
{
path: '/tenants',
name: 'tenants',
Expand Down Expand Up @@ -173,7 +155,6 @@ router.beforeEach((to, from, next) => {
} else if (to.name === 'login' && authenticated) {
next({ name: 'grants' });
} else if (to.name === 'not-found'
|| (to.meta.enabledWithOldGrantsTableOnly && useNewGrantsTable())
|| (to.meta.requiresMyProfileEnabled && !myProfileEnabled())
|| (to.meta.requiresNewTerminologyEnabled && !newTerminologyEnabled())
) {
Expand Down
9 changes: 2 additions & 7 deletions packages/client/src/views/Dashboard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@
</template>
</b-table>
</b-card>

<GrantDetails :selected-grant.sync="selectedGrant" />
</section>
</template>
Expand Down Expand Up @@ -145,7 +146,7 @@
import { mapActions, mapGetters } from 'vuex';
import resizableTableMixin from '@/mixin/resizableTable';
import GrantDetails from '@/components/Modals/GrantDetails.vue';
import { newTerminologyEnabled, useNewGrantsTable } from '@/helpers/featureFlags';
import { newTerminologyEnabled } from '@/helpers/featureFlags';

export default {
components: { GrantDetails },
Expand Down Expand Up @@ -325,9 +326,6 @@ export default {
team: 'users/agency',
currentGrant: 'grants/currentGrant',
}),
showStats() {
return !useNewGrantsTable();
},
activityItems() {
const rtf = new Intl.RelativeTimeFormat('en', {
numeric: 'auto',
Expand Down Expand Up @@ -399,9 +397,6 @@ export default {
fetchClosestGrants: 'grants/fetchClosestGrants',
}),
async setup() {
if (this.showStats) {
this.fetchDashboard();
}
this.fetchGrantsInterested({ perPage: this.perPage, currentPage: this.currentPage });
this.fetchClosestGrants({ perPage: this.perPageClosest, currentPage: this.currentPage });
},
Expand Down
5 changes: 1 addition & 4 deletions packages/client/src/views/Grants.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@

<script>
import GrantsTable from '@/components/GrantsTable.vue';
import GrantsTableNext from '@/components/GrantsTableNext.vue';
import { useNewGrantsTable } from '@/helpers/featureFlags';
export default {
components: { GrantsTable },
data() {
return {
Expand All @@ -18,7 +15,7 @@ export default {
methods: {},
computed: {
tableComponent() {
return useNewGrantsTable() ? GrantsTableNext : GrantsTable;
return GrantsTableNext;
},
},
};
Expand Down
5 changes: 1 addition & 4 deletions packages/client/src/views/MyGrants.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,9 @@
<script>
import { mapGetters } from 'vuex';
import GrantsTable from '@/components/GrantsTable.vue';
import GrantsTableNext from '@/components/GrantsTableNext.vue';
import { useNewGrantsTable } from '@/helpers/featureFlags';
export default {
components: { GrantsTable },
data() {
return {
Expand All @@ -36,7 +33,7 @@ export default {
selectedAgencyId: 'users/selectedAgencyId',
}),
tableComponent() {
return useNewGrantsTable() ? GrantsTableNext : GrantsTable;
return GrantsTableNext;
},
},
methods: {},
Expand Down

0 comments on commit e6ff1d1

Please sign in to comment.