-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add script to check tracking configuration
- in the past it happens that we forgot to adjust all the test numbers/start dates for banners in the campaigns_info.toml file This commit adds a node command that runs a script to check the configuration file for consistency on those 2 issues. - cleans up some codestyle in related files - update documentation
- Loading branch information
Showing
7 changed files
with
53 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# How to get an overview which banner uses which theme | ||
|
||
You can use the shell script `show_theme_usage.sh` used to get an overview which banner uses which theme(s). It filters the `UseOfFunds` and `Fijitiv` themes, because the `UseOfFunds` is used in all banners and the `Fijitiv` theme is only for the desktop fallback banner that we display when the regular banner does not fit the screen. | ||
You can use the shell script `tools/show_theme_usage.sh` used to get an overview which banner uses which theme(s). It filters the `UseOfFunds` and `Fijitiv` themes, because the `UseOfFunds` is used in all banners and the `Fijitiv` theme is only for the desktop fallback banner that we display when the regular banner does not fit the screen. | ||
|
||
The output shows the banner name and the theme(s) used in the banner. The count at the end of the line shows how many files from the theme are included in the banner. For Banners that have two style files, the count will be inaccurate (i.e twice as high), because most themes files are included in both styles. | ||
The output shows the banner name and the theme(s) used in the banner. The count at the end of the line shows how many files from the theme are included in the banner. For Banners that have two style files, the count will be inaccurate (i.e. twice as high), because most themes files are included in both styles. | ||
|
||
Ideally, each banner should use only one theme. If a banner uses more than one theme, please have a look and adjust the banner. The Desktop banners up until 04 accidentally use some variables from the `Treedip` theme even when their main theme is `Svingle`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { parse as parseTOML } from 'toml'; | ||
import { readFileSync } from 'fs'; | ||
import { campaignInfoToCampaignConfig } from '../webpack/convert_info_to_type.js'; | ||
|
||
const campaignConfig = parseTOML( readFileSync( 'campaign_info.toml', 'utf-8' ) ); | ||
const configObject = campaignInfoToCampaignConfig( campaignConfig ); | ||
|
||
for ( const configEntry of Object.entries( configObject ) ) { | ||
const configValues = configEntry[ 1 ]; | ||
|
||
// check test number | ||
let testNumber = ''; | ||
const testNumberMatchResult = configValues.campaign.match( /_\d{2}/ ); | ||
if ( testNumberMatchResult === null ) { | ||
console.log( 'Cannot parse test number ( "_dd" format) for ' + configValues.campaign ); | ||
break; | ||
} | ||
testNumber = testNumberMatchResult[ 0 ]; | ||
const testNumberSearchString = testNumber.slice( 1 ) + '-'; | ||
if ( !configValues.tracking.includes( testNumberSearchString ) || | ||
!configValues.banners.ctrl.tracking.includes( testNumberSearchString ) || | ||
!configValues.banners.var.tracking.includes( testNumberSearchString ) ) { | ||
console.log( 'Faulty tracking config (test number) for ' + configValues.campaign ); | ||
break; | ||
} | ||
|
||
// check start date | ||
let startDate = ''; | ||
const startDateMatchResult = configValues.tracking.match( /-\d{6}$/ ); | ||
if ( startDateMatchResult === null ) { | ||
console.log( 'Cannot parse 6-digit start date for ' + configValues.campaign ); | ||
break; | ||
} | ||
startDate = startDateMatchResult[ 0 ]; | ||
if ( !configValues.tracking.includes( startDate ) || | ||
!configValues.banners.ctrl.tracking.includes( startDate ) || | ||
!configValues.banners.var.tracking.includes( startDate ) ) { | ||
console.log( 'Faulty tracking config (start date) for ' + configValues.campaign ); | ||
break; | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters