Skip to content
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
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,14 @@
"@angular/router": "~11.2.14",
"@auth0/auth0-angular": "1.5.1",
"@fortawesome/fontawesome-free": "^6.4.0",
"@linuxfoundation/lfx-ui-core": "^0.0.12",
"@ng-bootstrap/ng-bootstrap": "^6.1.0",
"@silvermine/serverless-plugin-cloudfront-lambda-edge": "^2.1.1",
"@linuxfoundation/lfx-ui-core": "^0.0.12",
"aws-sdk": "2.1558.0",
"@types/node": "^18.16.0",
"auth0-spa-js": "^1.6.5",
"aws-sdk": "2.1558.0",
"bootstrap": "^4.4.0",
"detectincognitojs": "^1.5.0",
"file-saver": "^2.0.5",
"query-string": "^6.13.8",
"rxjs": "~6.6.3",
Expand Down
9 changes: 2 additions & 7 deletions src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,14 @@ import { IndividualDashboardComponent } from './modules/individual-contributor/c
import { CorporateDashboardComponent } from './modules/corporate-contributor/container/corporate-dashboard/corporate-dashboard.component';
import { ClaRequestAuthorizationComponent } from './modules/corporate-contributor/container/cla-request-authorization/cla-request-authorization.component';
import { GerritDashboardComponent } from './modules/dashboard/container/gerrit-dashboard/gerrit-dashboard.component';
import { AuthComponent } from './shared/components/auth/auth.component';
import { AuthDashboardComponent } from './modules/dashboard/container/auth-dashboard/auth-dashboard.component';


const routes: Routes = [
{
path: '',
pathMatch: 'full',
redirectTo: '/cla'
},
{
path: 'auth',
pathMatch: 'full',
component: AuthComponent
component: AuthDashboardComponent
},
{
path: 'cla/project/:projectId/user/:userId',
Expand Down
4 changes: 4 additions & 0 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

import { Component } from '@angular/core';
import { environment } from 'src/environments/environment';
import { AuthService } from './shared/services/auth.service';
import { ActivatedRoute } from '@angular/router';

@Component({
selector: 'app-root',
Expand All @@ -14,6 +16,8 @@ export class AppComponent {
hasExpanded: boolean;
links: any[];

constructor(private auth:AuthService, private route: ActivatedRoute){}

onToggled() {
this.hasExpanded = !this.hasExpanded;
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import { InterceptorService } from './shared/services/interceptor.service';
DashboardModule,
IndividualContributorModule,
CorporateContributorModule,
FormsModule
FormsModule,
],
providers: [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,6 @@ 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
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- Copyright The Linux Foundation and each contributor to CommunityBridge.
SPDX-License-Identifier: MIT -->

<app-project-title [projectId]="projectId" [userId]="userId"></app-project-title>
<app-project-title></app-project-title>

<div class="col-12 corporate-dashboard">
<div class="container">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
<!-- Copyright The Linux Foundation and each contributor to CommunityBridge.
SPDX-License-Identifier: MIT -->

<app-project-title
[projectId]="projectId"
[userId]="userId"
></app-project-title>

<div class="col-12 corporate-dashboard">
<div class="container">
<div class="row justify-content-center align-items-center">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<!-- Copyright The Linux Foundation and each contributor to CommunityBridge.
SPDX-License-Identifier: MIT -->
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/* Copyright The Linux Foundation and each contributor to CommunityBridge.
SPDX-License-Identifier: MIT */
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Copyright The Linux Foundation and each contributor to CommunityBridge.
// SPDX-License-Identifier: MIT

import { ComponentFixture, TestBed } from '@angular/core/testing';

import { AuthDashboardComponent } from './auth-dashboard.component';

describe('AuthDashboardComponent', () => {
let component: AuthDashboardComponent;
let fixture: ComponentFixture<AuthDashboardComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ AuthDashboardComponent ]
})
.compileComponents();
});

beforeEach(() => {
fixture = TestBed.createComponent(AuthDashboardComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Copyright The Linux Foundation and each contributor to CommunityBridge.
// SPDX-License-Identifier: MIT

import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { AppSettings } from 'src/app/config/app-settings';
import { StorageService } from 'src/app/shared/services/storage.service';

@Component({
selector: 'app-auth-dashboard',
templateUrl: './auth-dashboard.component.html',
styleUrls: ['./auth-dashboard.component.scss']
})
export class AuthDashboardComponent implements OnInit {

constructor(private router:Router, private storageService:StorageService) { }

ngOnInit(): void {
const projectId = JSON.parse(this.storageService.getItem(AppSettings.PROJECT_ID));
const userId = JSON.parse(this.storageService.getItem(AppSettings.USER_ID));
const redirectUrl = JSON.parse(this.storageService.getItem(AppSettings.REDIRECT));

this.router.navigate([`/cla/project/${projectId}/user/${userId}`], { queryParams: { redirect:redirectUrl} })
}

}
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
<!-- Copyright The Linux Foundation and each contributor to CommunityBridge.
SPDX-License-Identifier: MIT -->

<app-project-title [projectId]="projectId" [userId]="userId" (successEmitter)="onAPILoad($event)"
(errorEmitter)="hasErrorPresent($event)"></app-project-title>
<app-project-title (successEmitter)="setProject($event)" (errorEmitter)="hasErrorPresent($event)"></app-project-title>

<div class="container-fluid dashboard-container">

<div class="contributor-type-container">
<div class="container">
<div class="row">
Expand All @@ -18,12 +15,12 @@
<div class="container-fluid">
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
<app-dashboard-contributor-card [type]="corporateContributor" [highlights]="corporateHightlights"
<app-dashboard-contributor-card [type]="corporateContributor" [highlights]="corporateHightLights"
(btnEmitter)="onClickCorporateProceed()">
</app-dashboard-contributor-card>
</div>
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
<app-dashboard-contributor-card [type]="individualContributor" [highlights]="individualHightlights"
<app-dashboard-contributor-card [type]="individualContributor" [highlights]="individualHightLights"
(btnEmitter)="onClickIndividualProceed()">
</app-dashboard-contributor-card>
</div>
Expand All @@ -32,7 +29,7 @@

<div class="row justify-content-center preview-buttons">
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
<div *ngIf="project.project_ccla_enabled && project.project_corporate_documents.length > 0"
<div *ngIf="project?.project_ccla_enabled && project?.project_corporate_documents.length > 0"
class="row justify-content-center">
<div class="col-auto preview-btn" (click)="onClickPreviewPDF('ccla')">
<i class="far fa-file-pdf"></i>
Expand All @@ -41,7 +38,7 @@
</div>
</div>
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
<div *ngIf="project.project_icla_enabled && project.project_individual_documents.length > 0"
<div *ngIf="project?.project_icla_enabled && project?.project_individual_documents.length > 0"
class="row justify-content-center">
<div class="col-auto preview-btn" (click)="onClickPreviewPDF('icla')">
<i class="far fa-file-pdf"></i>
Expand All @@ -55,15 +52,15 @@
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
<ng-container>
<app-dashboard-contributor-buttons [type]="corporateContributor"
[hasEnabled]="project.project_ccla_enabled && !hasError"
[hasEnabled]="hasCclaEnabled"
(proceedBtnEmitter)="onClickCorporateProceed()">
</app-dashboard-contributor-buttons>
</ng-container>
</div>
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
<ng-container>
<app-dashboard-contributor-buttons [type]="individualContributor"
[hasEnabled]="project.project_icla_enabled && !hasError"
[hasEnabled]="hasIclaEnabled"
(proceedBtnEmitter)="onClickIndividualProceed()">
</app-dashboard-contributor-buttons>
</ng-container>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import { StorageService } from 'src/app/shared/services/storage.service';
import { AlertService } from 'src/app/shared/services/alert.service';
import { AppSettings } from 'src/app/config/app-settings';
import { ClaContributorService } from 'src/app/core/services/cla-contributor.service';
import { AuthService } from 'src/app/shared/services/auth.service';
import detectIncognito from 'detectincognitojs';

@Component({
selector: 'app-cla-dashboard',
Expand All @@ -17,42 +19,81 @@ import { ClaContributorService } from 'src/app/core/services/cla-contributor.ser
export class ClaDashboardComponent implements OnInit {
projectId: string;
userId: string;
corporateHightlights: string[];
individualHightlights: string[];
corporateHightLights: string[];
individualHightLights: string[];
corporateContributor = 'Corporate Contributor';
individualContributor = 'Individual Contributor';
exitEasyCLA = 'exitEasyCLA';
hasError: boolean;
hasPrivateWindow: boolean;
project = new ProjectModel();


constructor(
private route: ActivatedRoute,
private router: Router,
private storageService: StorageService,
private alertService: AlertService,
private claContributorService: ClaContributorService
private claContributorService: ClaContributorService,
private authService:AuthService
) {
this.storageService.removeGerritItems();
this.storageService.setItem(AppSettings.HAS_GERRIT, false);
this.projectId = this.route.snapshot.paramMap.get('projectId');
this.userId = this.route.snapshot.paramMap.get('userId');
const redirect = this.route.snapshot.queryParamMap.get('redirect');
this.storageService.setItem(AppSettings.REDIRECT, redirect);
this.hasErrorPresent();
}

ngOnInit(): void {
this.corporateHightlights = [
this.corporateHightLights = [
'If you are making a contribution of content owned by your employer, you should proceed as a corporate contributor.',
'The Corporate CLA process requires you to be approved by your organization\'s CLA Manager. A CLA Manager at your organization will receive your request via email immediately after you submit it. To expedite the process, you can follow up with them directly.',
'If your organization has not yet signed a CLA for this project, you will be able to coordinate designating a CLA Manager and having the CLA signed by someone at your organization who is authorized to sign.',
'If your organization is not registered, then you can optionally create a profile for your organization during the CLA authorization process.'
];

this.individualHightlights = [
this.individualHightLights = [
'If you are making a contribution of content that you own, and not content owned by your employer, you should proceed as an individual contributor.',
'If you are in doubt whether your contribution is owned by you or your employer, you should check with your employer or an attorney.'
];
}

ngOnInit(): void {
this.storageService.removeItem(AppSettings.PROJECT)
this.storageService.removeGerritItems();
this.storageService.setItem(AppSettings.HAS_GERRIT, false);
this.projectId = this.route.snapshot.paramMap.get('projectId');
this.userId = this.route.snapshot.paramMap.get('userId');
const redirect = this.route.snapshot.queryParamMap.get('redirect');

this.project = JSON.parse(this.storageService.getItem(AppSettings.PROJECT));
this.storageService.setItem(AppSettings.REDIRECT, redirect);
this.storageService.setItem(AppSettings.PROJECT_ID, this.route.snapshot.paramMap.get('projectId'));
this.storageService.setItem(AppSettings.USER_ID, this.route.snapshot.paramMap.get('userId'));

this.hasErrorPresent();

detectIncognito().then((result) => {
this.hasPrivateWindow = result.isPrivate;
if(this.hasPrivateWindow){
this.alertService.error('There are some features that will not work in a private window, as this site requires cookies');
}
});

this.authService.loading$.subscribe((loading) => {
if (!loading) {
this.authService.isAuthenticated$.subscribe((authenticated) => {
if (!authenticated && !this.hasPrivateWindow) {
this.authService.login();
}
});
}
});
}

public get hasCclaEnabled():boolean{
return this.project?.project_ccla_enabled && !this.hasError;
}

public get hasIclaEnabled():boolean{
return this.project?.project_icla_enabled && !this.hasError;
}

setProject(project){
this.project = project;
}


Expand Down Expand Up @@ -82,13 +123,6 @@ export class ClaDashboardComponent implements OnInit {
}
}

onAPILoad(APIType: string) {
if (APIType === 'Project') {
this.project = JSON.parse(this.storageService.getItem(AppSettings.PROJECT));
}
}


onExitEasyCLA() {
const redirectUrl = JSON.parse(this.storageService.getItem(AppSettings.REDIRECT));
if (redirectUrl !== null) {
Expand Down
4 changes: 3 additions & 1 deletion src/app/modules/dashboard/dashboard.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ import {DashboardContributorCardComponent} from './component/dashboard-contribut
import {SharedModule} from 'src/app/shared/shared.module';
import {DashboardContributorButtonsComponent} from './component/dashboard-contributor-buttons/dashboard-contributor-buttons.component';
import {GerritDashboardComponent} from './container/gerrit-dashboard/gerrit-dashboard.component';
import { AuthDashboardComponent } from './container/auth-dashboard/auth-dashboard.component';

@NgModule({
declarations: [ClaDashboardComponent,
DashboardContributorCardComponent,
DashboardContributorButtonsComponent,
GerritDashboardComponent
GerritDashboardComponent,
AuthDashboardComponent
],
imports: [
CommonModule,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- Copyright The Linux Foundation and each contributor to CommunityBridge.
SPDX-License-Identifier: MIT -->

<app-project-title [projectId]="projectId" [userId]="userId"></app-project-title>
<app-project-title></app-project-title>
<div class="col-12 individual-dashboard">
<app-docusign-signature-model [status]="status" (signCLAEmitter)="onClickSignCLA()"
(backBtnEmitter)="onBackClick()"></app-docusign-signature-model>
Expand Down
1 change: 0 additions & 1 deletion src/app/shared/components/alert/alert.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

.alert {
left: 0;
position: fixed;
width: 100%;
z-index: 1000;
}
8 changes: 0 additions & 8 deletions src/app/shared/components/auth/auth.component.html

This file was deleted.

11 changes: 0 additions & 11 deletions src/app/shared/components/auth/auth.component.scss

This file was deleted.

Loading
Loading