Skip to content

Commit 4f01be7

Browse files
committed
Merge branch 'hotfix/18.2.2'
2 parents dedd31a + fbf9541 commit 4f01be7

File tree

5 files changed

+39
-9
lines changed

5 files changed

+39
-9
lines changed

CHANGELOG.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,17 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

7-
## [18.2.1] - 2018-12-06
7+
## [18.2.2] - 2018-12-18
8+
### Added:
9+
- Flags:
10+
- `enable_inactive_schemas`
11+
12+
### Changed:
13+
- Components:
14+
- regisitries:
15+
- `registries-registration-type-facet` - only add ERPC schema when `enable_inactive_schemas` flag is off
16+
17+
## [18.2.1] - 2018-12-18
818
### Added
919
- Mirage:
1020
- `queryParamIsTruthy` util

config/environment.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ declare const config: {
145145
institutions: string;
146146
};
147147
storageI18n: string;
148+
enableInactiveSchemas: string;
148149
};
149150
gReCaptcha: {
150151
siteKey: string;

config/environment.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ module.exports = function(environment) {
227227
institutions: 'institutions_nav_bar',
228228
},
229229
storageI18n: 'storage_i18n',
230+
enableInactiveSchemas: 'enable_inactive_schemas',
230231
},
231232
gReCaptcha: {
232233
siteKey: RECAPTCHA_SITE_KEY,

lib/registries/addon/components/registries-registration-type-facet/component.ts

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,49 @@ import EmberArray, { A } from '@ember/array';
44
import Component from '@ember/component';
55
import { task } from 'ember-concurrency';
66
import DS from 'ember-data';
7+
import Features from 'ember-feature-flags/services/features';
8+
import appConfig from 'ember-get-config';
79
import I18N from 'ember-i18n/services/i18n';
10+
import Toast from 'ember-toastr/services/toast';
11+
812
import RegistrationSchema from 'ember-osf-web/adapters/registration-schema';
913
import requiredAction from 'ember-osf-web/decorators/required-action';
1014
import Analytics from 'ember-osf-web/services/analytics';
1115
import defaultTo from 'ember-osf-web/utils/default-to';
12-
import Toast from 'ember-toastr/services/toast';
13-
import config from 'registries/config/environment';
16+
17+
import engineConfig from 'registries/config/environment';
1418
import { SearchOptions } from 'registries/services/search';
1519
import { ShareTermsFilter } from 'registries/services/share-search';
1620
import layout from './template';
1721

22+
const {
23+
sourcesWhitelist,
24+
} = engineConfig;
25+
26+
const {
27+
featureFlagNames: {
28+
enableInactiveSchemas,
29+
},
30+
} = appConfig;
31+
1832
export default class RegistriesRegistrationTypeFacet extends Component.extend({
1933
fetchRegistrationTypes: task(function *(this: RegistriesRegistrationTypeFacet): any {
2034
try {
2135
const metaschemas: RegistrationSchema[] = yield this.store.findAll('registration-schema');
2236

23-
this.set('registrationTypes', A(
24-
metaschemas.mapBy('name').concat([
37+
const metaschemaNames = metaschemas.mapBy('name');
38+
if (!this.features.isEnabled(enableInactiveSchemas)) {
39+
metaschemaNames.push(
2540
// Manually add 'Election Research Preacceptance Competition' to the list of possible
2641
// facets. Metaschema was removed from the API as a possible registration type
2742
// but should still be searchable
2843
'Election Research Preacceptance Competition',
29-
]).sort(),
30-
));
44+
);
45+
}
46+
this.set('registrationTypes', A(metaschemaNames.sort()));
3147
} catch (e) {
3248
this.toast.error(this.i18n.t('registries.facets.registration_type.registration_schema_error'));
49+
throw e;
3350
}
3451
}).on('init'),
3552
}) {
@@ -39,6 +56,7 @@ export default class RegistriesRegistrationTypeFacet extends Component.extend({
3956
@service toast!: Toast;
4057
@service store!: DS.Store;
4158
@service analytics!: Analytics;
59+
@service features!: Features;
4260

4361
searchOptions!: SearchOptions;
4462
@requiredAction onSearchOptionsUpdated!: (options: SearchOptions) => void;
@@ -53,7 +71,7 @@ export default class RegistriesRegistrationTypeFacet extends Component.extend({
5371
get onlyOSF() {
5472
return this.searchOptions.filters.filter(filter => filter.key === 'sources').size === 1
5573
&& this.searchOptions.filters.contains(
56-
new ShareTermsFilter('sources', 'OSF', config.sourcesWhitelist.find(x => x.name === 'OSF')!.display!),
74+
new ShareTermsFilter('sources', 'OSF', sourcesWhitelist.find(x => x.name === 'OSF')!.display!),
5775
);
5876
}
5977

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ember-osf-web",
3-
"version": "18.2.1",
3+
"version": "18.2.2",
44
"description": "Ember front-end for the Open Science Framework",
55
"license": "Apache-2.0",
66
"author": "Center for Open Science <[email protected]>",

0 commit comments

Comments
 (0)