Skip to content
This repository has been archived by the owner on Apr 1, 2020. It is now read-only.

Commit

Permalink
Merge pull request #1044 from Financial-Times/anthony/product-name
Browse files Browse the repository at this point in the history
Specify a product value other than 'next' for spoor
  • Loading branch information
dapenguin committed Aug 1, 2017
2 parents 947c934 + 853da2e commit b13f90c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion browser/js/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ class JsSetup {
this.appInfo = {
isProduction: document.documentElement.hasAttribute('data-next-is-production'),
version: document.documentElement.getAttribute('data-next-version'),
name: document.documentElement.getAttribute('data-next-app')
name: document.documentElement.getAttribute('data-next-app'),
product: document.documentElement.getAttribute('data-next-product')
};

const flags = window.nextFeatureFlags.reduce((obj, flag) => {
Expand Down
2 changes: 1 addition & 1 deletion browser/layout/partials/html-tag.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<html lang="en-GB" prefix="og: http://ogp.me/ns# article: http://ogp.me/ns/article# video: http://ogp.me/ns/video#" data-ab-state="{{__abState}}" class="no-js core o-hoverable-on o-typography--loading-sans o-typography--loading-sansBold o-typography--loading-serifDisplay o-typography--loading-serifDisplayBold" data-next-app="{{__name}}" {{#if __edition}} data-next-edition="{{__edition}}"{{/if}}{{#if __isProduction}} data-next-is-production{{/if}}{{#if __version}} data-next-version="{{__version}}"{{/if}}{{#if adsLayout}} data-ads-layout="{{adsLayout}}"{{/if}}{{#if barrierType}} data-barrier-type="{{barrierType}}"{{/if}}{{#if corporateId}} data-corporate-id="{{corporateId}}"{{/if}} {{#outputBlock 'globalDataAttributes'}}{{/outputBlock}}>
<html lang="en-GB" prefix="og: http://ogp.me/ns# article: http://ogp.me/ns/article# video: http://ogp.me/ns/video#" data-ab-state="{{__abState}}" class="no-js core o-hoverable-on o-typography--loading-sans o-typography--loading-sansBold o-typography--loading-serifDisplay o-typography--loading-serifDisplayBold" data-next-app="{{__name}}"{{#if __product}} data-next-product="{{__product}}"{{/if}}{{#if __edition}} data-next-edition="{{__edition}}"{{/if}}{{#if __isProduction}} data-next-is-production{{/if}}{{#if __version}} data-next-version="{{__version}}"{{/if}}{{#if adsLayout}} data-ads-layout="{{adsLayout}}"{{/if}}{{#if barrierType}} data-barrier-type="{{barrierType}}"{{/if}}{{#if corporateId}} data-corporate-id="{{corporateId}}"{{/if}} {{#outputBlock 'globalDataAttributes'}}{{/outputBlock}}>
2 changes: 2 additions & 0 deletions server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@ module.exports = options => {
withFlags: true,
withBackendAuthentication: true,
withServiceMetrics: true,
product: '',
layoutsDir: path.join(__dirname, '../browser/layout'),
}, options || {});

const {app, meta, addInitPromise} = nExpress.getAppContainer(options);

app.locals.__name = meta.name;
app.locals.__product = options.product;
app.locals.__environment = process.env.NODE_ENV || '';
app.locals.__isProduction = app.locals.__environment.toUpperCase() === 'PRODUCTION';
app.locals.__rootDirectory = meta.directory;
Expand Down

0 comments on commit b13f90c

Please sign in to comment.