Skip to content

Commit c4d8885

Browse files
Restore lfooter
Signed-off-by: Amol Sontakke <[email protected]>
1 parent b1e45ef commit c4d8885

19 files changed

+181
-180
lines changed

edge/security-headers.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ function generateCSP(env, isDevServer) {
4040
'https://api-gw.staging.platform.linuxfoundation.org/',
4141
'https://api-gw.platform.linuxfoundation.org/',
4242
'https://api.lfcla.staging.platform.linuxfoundation.org/',
43-
'https://api.lfcla.dev.platform.linuxfoundation.org/'
43+
'https://api.lfcla.dev.platform.linuxfoundation.org/',
44+
'https://easycla.dev.communitybridge.org/',
45+
'https://easycla.lfx.linuxfoundation.org/',
46+
'https://contributor.easycla.lfx.linuxfoundation.org/'
4447
];
4548
let scriptSources = [SELF, UNSAFE_EVAL, UNSAFE_INLINE,
4649
'https://cdn.dev.platform.linuxfoundation.org/lfx-header-v2.js',

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"url": "https://www.linuxfoundation.org/"
88
},
99
"engines": {
10-
"node": ">=16.0.0",
10+
"node": ">=12.0.0",
1111
"npm": ">=8.0.0"
1212
},
1313
"version": "1.0.0",
@@ -56,9 +56,10 @@
5656
"@fortawesome/fontawesome-free": "^6.4.0",
5757
"@ng-bootstrap/ng-bootstrap": "^6.1.0",
5858
"@silvermine/serverless-plugin-cloudfront-lambda-edge": "^2.1.1",
59+
"@linuxfoundation/lfx-ui-core": "^0.0.12",
60+
"aws-sdk": "2.1558.0",
5961
"@types/node": "^18.16.0",
6062
"auth0-spa-js": "^1.6.5",
61-
"aws-sdk": "2.1558.0",
6263
"bootstrap": "^4.4.0",
6364
"file-saver": "^2.0.5",
6465
"query-string": "^6.13.8",

serverless.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ package:
1212

1313
provider:
1414
name: aws
15-
runtime: nodejs14.x
15+
runtime: nodejs16.x
1616
stage: ${opt:stage}
1717
region: us-east-1 # Region can't be configurable, lambda@edge is us-east-1 only.
1818
deploymentBucket:

src/app/app.component.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,4 @@
66
<app-alert></app-alert>
77
<router-outlet></router-outlet>
88
</div>
9-
109
<lfx-footer></lfx-footer>

src/app/app.component.scss

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
/* Copyright The Linux Foundation and each contributor to CommunityBridge.
22
SPDX-License-Identifier: MIT */
33
.fix-header-margin {
4-
transition: margin 0.3s;
5-
margin-top: 25px;
6-
padding: 25px 0;
7-
min-height: calc(100vh - 167px);
8-
&.expanded {
9-
margin-top: 100px;
10-
min-height: calc(100vh - 242px);
11-
}
4+
margin-top: 35px;
5+
padding: 25px 0 0 0;
6+
min-height: calc(100vh - 125px);
127
}

src/app/app.component.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
// SPDX-License-Identifier: MIT
33

44
import { Component } from '@angular/core';
5-
import { AppSettings } from './config/app-settings';
65
import { LfxHeaderService } from './shared/services/lfx-header.service';
7-
import { EnvConfig } from './config/cla-env-utils';
86
import { environment } from 'src/environments/environment';
97

108
@Component({
@@ -26,7 +24,6 @@ export class AppComponent {
2624
ngOnInit() {
2725
this.mountHeader();
2826
this.hasExpanded = true;
29-
this.mountFooter();
3027
}
3128

3229
private mountHeader(): void {
@@ -35,10 +32,4 @@ export class AppComponent {
3532
script.setAttribute('async', 'true');
3633
document.head.appendChild(script);
3734
}
38-
39-
private mountFooter(): void {
40-
const script = document.createElement('script');
41-
script.setAttribute('src', EnvConfig.default[AppSettings.LFX_FOOTER]);
42-
document.head.appendChild(script);
43-
}
4435
}

src/app/config/scripts/prefetch-ssm.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
// Copyright The Linux Foundation and each contributor to CommunityBridge.
22
// SPDX-License-Identifier: MIT
3-
43
const fs = require('fs');
54
const RetrieveSSMValues = require('./read-ssm');
65
const configVarArray = ['auth0-clientId', 'auth0-domain', 'proj-console-link', 'corp-console-link', 'lfx-header', 'lfx-footer', 'corporate-v2-base', 'api-base', 'api-v4-base', 'admin-v2-base'];
76
const region = 'us-east-1';
8-
const profile = process.env.AWS_PROFILE;
97
const stageEnv = process.env.STAGE_ENV;
108
const AWS_SSM_JSON_PATH = './src/app/config/cla-env-config.json';
119

1210
async function prefetchSSM() {
1311
console.log(`Start to fetch SSM values at ${stageEnv}...`);
14-
const result = await RetrieveSSMValues(configVarArray, stageEnv, region, profile);
12+
const result = await RetrieveSSMValues(configVarArray, stageEnv, region);
1513
console.log('Fetching completed.');
1614

1715
//test for local

src/app/config/scripts/read-ssm.js

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,29 @@
1-
// @ts-check
2-
31
// Copyright The Linux Foundation and each contributor to CommunityBridge.
42
// SPDX-License-Identifier: MIT
53
const AWS = require('aws-sdk');
64

5+
// @ts-check
6+
7+
78
/**
89
* @param {string[]} variables
910
* @param {string} stage
1011
* @param {string} region
11-
* @param {string} profile
1212
* @returns {Promise<{ [key:string]: string}>}
1313
*/
14-
async function retrieveSSMValues(variables, stage, region, profile) {
14+
async function retrieveSSMValues(variables, stage, region) {
1515
const scopedVariables = variables.map((param) => `cla-${param}-${stage}`);
16-
const result = await requestSSMParameters(scopedVariables, stage, region, profile);
16+
const result = await requestSSMParameters(scopedVariables, stage, region);
1717
const parameters = result.Parameters;
1818
const error = result.$response.error;
1919
if (error !== null) {
2020
throw new Error(
21-
`Couldn't retrieve SSM parameters for stage ${stage} in region ${region} using profile ${profile} - error ${error}`
21+
`Couldn't retrieve SSM parameters for stage ${stage} in region ${region} - error ${error}`
2222
);
2323
}
2424
const scopedParams = createParameterMap(parameters, stage);
2525
const params = new Map();
2626
Object.keys(scopedParams).forEach((key) => {
27-
// console.log(`processing ${key}`);
2827
const param = scopedParams[key];
2928
key = key.replace('cla-', '');
3029
key = key.replace(`-${stage}`, '');
@@ -34,7 +33,7 @@ async function retrieveSSMValues(variables, stage, region, profile) {
3433
variables.forEach((variable) => {
3534
if (params[variable] === undefined) {
3635
throw new Error(
37-
`Missing SSM parameter with name ${variable} for stage ${stage} in region ${region} using profile ${profile}`,
36+
`Missing SSM parameter with name ${variable} for stage ${stage} in region ${region}`,
3837
);
3938
}
4039
});
@@ -47,20 +46,14 @@ async function retrieveSSMValues(variables, stage, region, profile) {
4746
* @param {string[]} variables
4847
* @param {string} stage
4948
* @param {string} region
50-
* @param {string} profile
5149
*/
52-
async function requestSSMParameters(variables, stage, region, profile) {
53-
console.log(`Loading AWS credentials from profile: ${profile}`)
54-
AWS.config.credentials = new AWS.SharedIniFileCredentials({ profile });
50+
async function requestSSMParameters(variables, stage, region) {
5551
const ssm = new AWS.SSM({ region });
5652
const ps = {
5753
Names: variables,
5854
WithDecryption: true
5955
};
60-
// console.log(AWS.config.credentials);
61-
// console.log(`fetching ssm parameters: ${variables}`);
6256
const response = await ssm.getParameters(ps).promise();
63-
// console.log(response);
6457
return response;
6558
}
6659

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!-- Copyright The Linux Foundation and each contributor to CommunityBridge.
22
SPDX-License-Identifier: MIT -->
3-
<div class="container-fluid">
4-
<div class="row justify-content-center align-items-center">
5-
<div class="col-auto message">You are being redirected to the login page.</div>
6-
</div>
3+
<div class="container">
4+
<div class="message">Welcome to Gerrit Window </div>
5+
<div class="subtitle">wait ... We are trying to login LFX portal</div>
6+
<div class="warning">If you are still viewing this screen, please <a class="link" (click)="login()">click here</a></div>
77
</div>
Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,28 @@
11
/* Copyright The Linux Foundation and each contributor to CommunityBridge.
22
SPDX-License-Identifier: MIT -->*/
3-
.row {
4-
.message {
5-
font-size: 18px;
6-
text-align: center;
7-
font-weight: bold;
8-
}
3+
.container {
4+
.message {
5+
margin-top: calc(100vh / 3);
6+
font-size: 24px;
7+
text-align: center;
8+
font-weight: bold;
9+
}
10+
11+
.subtitle {
12+
font-size: 18px;
13+
margin-top: 5px;
14+
text-align: center;
15+
font-weight: bold;
16+
}
17+
18+
.warning {
19+
font-size: 18px;
20+
margin-top: 20px;
21+
text-align: center;
22+
}
23+
24+
.link {
25+
color: #0099cc;
26+
cursor: pointer;
27+
}
928
}

0 commit comments

Comments
 (0)