Skip to content

Commit 4b8c333

Browse files
murtaza-swatiDominikAlberski
authored andcommitted
added configurable temporary banner
1 parent 3c89501 commit 4b8c333

File tree

4 files changed

+26
-1
lines changed

4 files changed

+26
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import Component from '@ember/component';
2+
import config from 'travis/config/environment';
3+
4+
export default Component.extend({
5+
message: '',
6+
enabled: false,
7+
8+
init() {
9+
this._super(...arguments);
10+
this.set('enabled', config.tempBanner.tempBannerEnabled === 'true');
11+
this.set('message', config.tempBanner.tempBannerMessage || '');
12+
}
13+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{{#if this.enabled}}
2+
<div class="notice-banner--yellow align-center">
3+
{{this.message}}
4+
</div>
5+
{{/if}}

app/templates/components/top-bar.hbs

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
{{#if this.features.enterpriseVersion}}
2222
<EnterpriseBanner />
2323
{{/if}}
24+
<TemporaryAnnouncementBanner />
2425
{{#if this.user}}
2526
<RepositorySecurityBanner />
2627
{{/if}}

config/environment.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ const {
3030
DISABLE_SENTRY,
3131
TRAVIS_COMMIT,
3232
SOURCE_VERSION,
33-
DEPLOY_TARGET
33+
DEPLOY_TARGET,
34+
TEMPORARY_ANNOUNCEMENT_BANNER_ENABLED,
35+
TEMPORARY_ANNOUNCEMENT_MESSAGE
3436
} = process.env;
3537

3638
module.exports = function (environment) {
@@ -171,6 +173,10 @@ module.exports = function (environment) {
171173
gReCaptcha: {
172174
siteKey: GOOGLE_RECAPTCHA_SITE_KEY
173175
},
176+
tempBanner: {
177+
tempBannerEnabled: TEMPORARY_ANNOUNCEMENT_BANNER_ENABLED || false,
178+
tempBannerMessage: TEMPORARY_ANNOUNCEMENT_MESSAGE || ''
179+
}
174180
};
175181

176182
ENV.metricsAdapters = [];

0 commit comments

Comments
 (0)