Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(build:ui): read GTAG from environment variable #2274

Merged
merged 2 commits into from
Mar 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion ui/scripts/setenv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,20 @@ const enableMaintenace = () => {
}
};

const enableGTAG = () => {
if (process.env.GTAGID) {
return `
GTAGID: '${ process.env.GTAGID }',
`;
} else {
return '';
}
};

// we have access to our environment variables
// in the process.env object thanks to dotenv
const environmentFileContent = `
export const environment = {${enablePS()}${enableMaintenace()}};
export const environment = {${enablePS()}${enableMaintenace()}${enableGTAG()}};
`;

// write the content to the respective file
Expand Down
2 changes: 1 addition & 1 deletion ui/src/environments/environment.prod.beta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const {orbApi: {apiUrl, version, urlKeys, servicesUrls}} = defaultEnvironment;

export const environment = {
production: true,
GTAGID: 'G-T0RBPQ9HSJ',
GTAGID: '',
...defaultEnvironment,
...envVars,
// ORB api --prod
Expand Down
2 changes: 1 addition & 1 deletion ui/src/environments/environment.prod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const {orbApi: {apiUrl, version, urlKeys, servicesUrls}} = defaultEnvironment;

export const environment = {
production: true,
GTAGID: 'G-T0RBPQ9HSJ',
GTAGID: '',
...defaultEnvironment,
...envVars,
// ORB api --prod
Expand Down