Skip to content

Commit

Permalink
Added Debug for Corporate Console - Resolved Vuls (#238)
Browse files Browse the repository at this point in the history
  • Loading branch information
dealako committed Oct 1, 2021
1 parent b9a834e commit 3d4350c
Show file tree
Hide file tree
Showing 4 changed files with 130 additions and 150 deletions.
15 changes: 13 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,21 +101,32 @@
"typescript": "~3.9.6"
},
"resolutions": {
"axios": "^0.21.1",
"browserslist": "^4.16.5",
"dns-packet": "^5.2.2",
"elliptic": "^6.5.4",
"hosted-git-info": "^3.0.8",
"ini": "^1.3.7",
"glob-parent": "^5.1.2",
"jszip": "^3.7.0",
"lodash": "^4.17.21",
"netmask": "^2.0.1",
"node-forge": "^0.10.0",
"normalize-url": "^6.0.1",
"object-path": "^0.11.5",
"pac-resolver": "^5.0.0",
"path-parse": "^1.0.7",
"set-getter": "^0.1.1",
"socket.io": "^2.4.0",
"socket.io-parser": "^4.0.4",
"ssri": "^8.0.1",
"tar": "^6.1.9",
"url-parse": "^1.5.2",
"ws": "^7.4.6"
"ua-parser-js": "^0.7.24",
"underscore": "^1.12.1",
"url-parse": "^1.5.3",
"ws": "^7.4.6",
"xmlhttprequest-ssl": "^1.6.1",
"y18n": "^5.0.5"
},
"husky": {
"hooks": {
Expand Down
18 changes: 11 additions & 7 deletions src/app/core/services/cla-contributor.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ export class ClaContributorService {
const claGroupModel: ProjectModel = JSON.parse(this.storageService.getItem(AppSettings.PROJECT));
// We may have zero or more SF Projects attached to this CLA Group
const projectDetails = claGroupModel.projects;
console.log('projectDetails: ', projectDetails);

// TODO: figure out the github repository that was used to come here...
// pick the matching SF Project based on the repository name, instead of just using the first project in the list
Expand All @@ -219,14 +220,17 @@ export class ClaContributorService {
// Signed at foundation level.
url = this.corporateV2Base + 'foundation/' + projectDetails[0].foundation_sfid + '/cla';
} else {
console.log('determining project from repo');
const project = this.getProjectFromRepo(projectDetails);
console.log('project: ', project);
if (project !== null) {
// For standalone project we must redirect to the SFID of The Linux Foundation
url = this.corporateV2Base + 'foundation/' + project.foundation_sfid + '/project/' + project.project_sfid + '/cla';
} else {
this.alertService.error('Unable to find project by repository, please contact to your administrator.');
}
}

return url;
}

Expand Down Expand Up @@ -307,13 +311,13 @@ export class ClaContributorService {
const redirectUrl = JSON.parse(
this.storageService.getItem(AppSettings.REDIRECT)
);
if(redirectUrl){
if (redirectUrl.indexOf(AppSettings.GITHUB_DOMAIN) >= 0) {
return AppSettings.GITHUB;
}
if (redirectUrl.indexOf(AppSettings.GITLAB_DOMAIN) >= 0) {
return AppSettings.GITLAB;
}
if (redirectUrl) {
if (redirectUrl.indexOf(AppSettings.GITHUB_DOMAIN) >= 0) {
return AppSettings.GITHUB;
}
if (redirectUrl.indexOf(AppSettings.GITLAB_DOMAIN) >= 0) {
return AppSettings.GITLAB;
}
}
return AppSettings.GITHUB;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ export class ConfigureClaManagerModalComponent implements OnInit {
this.modalService.dismissAll();
this.loaderService.show();
const corporateUrl = this.claContributorService.getLFXCorporateURL();
console.log('corporateURL: ', corporateUrl);
if (corporateUrl !== '') {
this.storageService.removeItem(AppSettings.ACTION_TYPE);
window.open(corporateUrl, '_self');
Expand Down
Loading

0 comments on commit 3d4350c

Please sign in to comment.