Skip to content

Commit

Permalink
Merge pull request #2117 from HHS/mb/TTAHUB-2399/remove-feature-flags
Browse files Browse the repository at this point in the history
[TTAHUB-2399] Remove feature flags
  • Loading branch information
thewatermethod authored Apr 26, 2024
2 parents 6f66787 + 471c942 commit c0d7e37
Show file tree
Hide file tree
Showing 10 changed files with 60 additions and 60 deletions.
2 changes: 1 addition & 1 deletion docs/logical_data_model.encoded

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions docs/logical_data_model.puml
Original file line number Diff line number Diff line change
Expand Up @@ -1059,10 +1059,7 @@ class Users{
enum enum_Users_flags {
anv_statistics
closed_goal_merge_override
merge_goals
monitoring
regional_goal_dashboard
resources_dashboard
training_reports_dashboard
}

Expand Down
4 changes: 1 addition & 3 deletions frontend/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,7 @@ function App() {
path="/dashboards/resources-dashboard"
render={() => (
<AppWrapper authenticated logout={logout}>
<FeatureFlag flag="resources_dashboard" renderNotFound>
<ResourcesDashboard user={user} />
</FeatureFlag>
<ResourcesDashboard user={user} />
</AppWrapper>
)}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ describe('GoalDataController', () => {
const DEFAULT_USER = {
name: '',
id: 1,
flags: ['merge_goals'],
};

const REGION_ID = 1;
Expand Down
16 changes: 7 additions & 9 deletions frontend/src/components/SiteNav.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,13 @@ const SiteNav = ({
</NavLink>
</li>
</FeatureFlag>
<FeatureFlag flag="resources_dashboard">
<li>
<NavLink
to="/dashboards/resources-dashboard"
>
Resources Dashboard
</NavLink>
</li>
</FeatureFlag>
<li>
<NavLink
to="/dashboards/resources-dashboard"
>
Resources Dashboard
</NavLink>
</li>
<li>
<NavLink
to="/recipient-tta-records"
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/filter/DateRangePicker.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@use '../../mixins.scss';

.ttahub-custom-date-range-picker {
.ttahub-custom-date-range-picker-fields:not([hidden]) {
z-index: 2;
}

Expand Down
63 changes: 30 additions & 33 deletions frontend/src/pages/RecipientRecord/pages/Profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import RecipientSummary from '../components/RecipientSummary';
import GrantList from '../components/GrantsList';
import RecipientLeadership from '../components/RecipientLeadership';
import './Profile.css';
import FeatureFlag from '../../../components/FeatureFlag';
import ClassReview from './components/ClassReview';
import MonitoringReview from './components/MonitoringReview';
import { useGrantData } from './GrantDataContext';
Expand Down Expand Up @@ -35,39 +34,37 @@ export default function Profile({
<Grid desktop={{ col: 12 }} tabletLg={{ col: 12 }}>
<GrantList summary={recipientSummary} />
</Grid>
<FeatureFlag flag="monitoring">
{activeGrants.map((grant) => (
<React.Fragment key={grant.number}>
{hasMonitoringData(grant.number) || hasClassData(grant.number) ? (
<Grid desktop={{ col: 12 }}>
<h2 className="smart-hub-title-big-serif">
Grant number
{' '}
{grant.number}
</h2>
</Grid>
) : null}
<Grid desktop={{ col: 6 }} tabletLg={{ col: 12 }}>
<div>
<ClassReview
grantNumber={grant.number}
regionId={regionId}
recipientId={recipientId}
/>
</div>
{activeGrants.map((grant) => (
<React.Fragment key={grant.number}>
{hasMonitoringData(grant.number) || hasClassData(grant.number) ? (
<Grid desktop={{ col: 12 }}>
<h2 className="smart-hub-title-big-serif">
Grant number
{' '}
{grant.number}
</h2>
</Grid>
<Grid desktop={{ col: 6 }} tabletLg={{ col: 12 }}>
<div>
<MonitoringReview
grantNumber={grant.number}
regionId={regionId}
recipientId={recipientId}
/>
</div>
</Grid>
</React.Fragment>
))}
</FeatureFlag>
) : null}
<Grid desktop={{ col: 6 }} tabletLg={{ col: 12 }}>
<div>
<ClassReview
grantNumber={grant.number}
regionId={regionId}
recipientId={recipientId}
/>
</div>
</Grid>
<Grid desktop={{ col: 6 }} tabletLg={{ col: 12 }}>
<div>
<MonitoringReview
grantNumber={grant.number}
regionId={regionId}
recipientId={recipientId}
/>
</div>
</Grid>
</React.Fragment>
))}
</Grid>
</div>
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,6 @@ describe('Goals and Objectives', () => {
...user,
};

if (canMergeGoals) {
userForContext.flags = [
'merge_goals',
];
}

render(
<Router history={memoryHistory}>
<AppLoadingContext.Provider value={{ setIsAppLoading: () => {}, isAppLoading: false }}>
Expand Down
3 changes: 0 additions & 3 deletions src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,11 +244,8 @@ const MAINTENANCE_TYPE = {
};

const FEATURE_FLAGS = [
'resources_dashboard',
'anv_statistics',
'regional_goal_dashboard',
'merge_goals',
'monitoring',
'closed_goal_merge_override',
'training_reports_dashboard',
];
Expand Down
20 changes: 20 additions & 0 deletions src/migrations/20240426130641-remove-three-flags.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const { prepMigration, updateUsersFlagsEnum } = require('../lib/migration');

/** @type {import('sequelize-cli').Migration} */
module.exports = {
async up(queryInterface) {
await queryInterface.sequelize.transaction(async (transaction) => {
const sessionSig = __filename;
await prepMigration(queryInterface, transaction, sessionSig);
return updateUsersFlagsEnum(
queryInterface,
transaction,
['merge_goals', 'monitoring', 'resources_dashboard'],
);
});
},

async down() {
// no rollbacks on enum mods, create a new migration to do that
},
};

0 comments on commit c0d7e37

Please sign in to comment.