Skip to content

Commit

Permalink
Merge pull request #7440 from jrjohnson/cleanup-feature-flags
Browse files Browse the repository at this point in the history
Cleanup feature flags
  • Loading branch information
jrjohnson authored Sep 29, 2023
2 parents b4304d1 + a3e66fa commit 782ceb9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 27 deletions.
2 changes: 1 addition & 1 deletion app/components/program-year/overview.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{{t "general.overview"}}
</h5>
<div class="programyear-overview-actions" data-test-actions>
{{#if this.programYearVisualizations}}
{{#if (feature-flag "programYearVisualizations")}}
<LinkTo
@route="program-year-visualize-objectives"
@model={{@programYear}}
Expand Down
9 changes: 0 additions & 9 deletions app/components/program-year/overview.js

This file was deleted.

16 changes: 4 additions & 12 deletions config/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,9 @@ module.exports = function (environment) {
// Here you can pass flags/options to your application instance
// when it is created
},
//Hide a feature while it is in development
IliosFeatures: {
programYearVisualizations: false,
},
//using ember-feature-flags provided by common
featureFlags: {
sessionLinkingAdminUi: true,
globalSearch: true,
programYearVisualizations: false,
},
};

Expand All @@ -100,9 +96,7 @@ module.exports = function (environment) {
enabled: false,
};

ENV.IliosFeatures.programYearVisualizations = true;

ENV.featureFlags['globalSearch'] = true;
ENV.featureFlags['programYearVisualizations'] = true;

//put ember concurrency tasks into debug mode to make errors much easier to spot
ENV.EmberENV.DEBUG_TASKS = true;
Expand All @@ -122,16 +116,14 @@ module.exports = function (environment) {
ENV.serverVariables.defaults['api-name-space'] = 'api';
ENV.serverVariables.defaults['api-host'] = '';
ENV.disableServiceWorker = true;
ENV.featureFlags['globalSearch'] = true;

ENV.APP.autoboot = false;
}

if (environment === 'production') {
// here you can enable a production-specific feature
if (process.env.ENABLE_PREVIEW_FEATURES) {
ENV.IliosFeatures.programYearVisualizations = true;
ENV.featureFlags['globalSearch'] = true;
ENV.featureFlags['programYearVisualizations'] = true;
}
}

Expand Down
9 changes: 4 additions & 5 deletions tests/integration/components/program-year/overview-test.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { module, skip, test } from 'qunit';
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { setupIntl } from 'ember-intl/test-support';
import { render } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';
import { setupMirage } from 'ember-cli-mirage/test-support';
import ENV from 'ilios/config/environment';
import a11yAudit from 'ember-a11y-testing/test-support/audit';
import { component } from 'ilios/tests/pages/components/program-year/overview';
import { enableFeature } from 'ember-feature-flags/test-support';

module('Integration | Component | program-year/overview', function (hooks) {
setupRenderingTest(hooks);
Expand All @@ -29,15 +29,14 @@ module('Integration | Component | program-year/overview', function (hooks) {
assert.ok(true, 'no a11y errors found!');
});

// @todo figure out a way how this can be tested. [ST 2022/08/05]
skip('visualizations button present', async function (assert) {
ENV.IliosFeatures.programYearVisualizations = true; //this doesn't work.
test('visualizations button present', async function (assert) {
const program = this.server.create('program');
const programYear = this.server.create('programYear', { program });
const programYearModel = await this.owner
.lookup('service:store')
.findRecord('programYear', programYear.id);
this.set('program', programYearModel);
enableFeature('programYearVisualizations');
await render(hbs`<ProgramYear::Overview
@programYear={{this.programYear}}
/>`);
Expand Down

0 comments on commit 782ceb9

Please sign in to comment.