Skip to content

Commit

Permalink
Merge master into release for V3.4.5 (#1150)
Browse files Browse the repository at this point in the history
Merge master into release to release V3.4.5
  • Loading branch information
vigneshsankariyer1234567890 authored Mar 5, 2023
1 parent d8c7240 commit 0c04506
Show file tree
Hide file tree
Showing 115 changed files with 1,440 additions and 320 deletions.
File renamed without changes.
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:
- package-ecosystem: 'npm'
directory: '/'
schedule:
interval: 'weekly'
open-pull-requests-limit: 0
2 changes: 1 addition & 1 deletion .github/workflows/coverage-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm run test -- "--code-coverage"
- run: npm run test -- "--code-coverage" "--source-map=false"
- uses: codecov/codecov-action@v3
with:
directory: ./tests/coverage
3 changes: 0 additions & 3 deletions .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ jobs:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm update
- run: npm run electron:linux
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: npm run lint
Expand All @@ -46,7 +45,6 @@ jobs:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm update
- run: npm run electron:mac
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: npm run lint
Expand All @@ -65,6 +63,5 @@ jobs:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm update
- run: npm run electron:windows
- run: npm run lint
- run: npm test -- "--karma-config=./tests/karma.ci.conf.js"
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,9 @@
* [Direct link to the **User Guide**](https://catcher-org.github.io/ug/)
* [Direct link to the **Developer Guide**](https://catcher-org.github.io/dg/)


This project is based in [NUS School of Computing](https://www.comp.nus.edu.sg/), and part of the [NUS-OSS initiative](https://nus-oss.github.io/).

Licence: MIT

Contact: `[email protected]`
21 changes: 20 additions & 1 deletion angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"aot": true,
"outputPath": "dist",
"index": "src/index.html",
"main": "src/main.ts",
Expand Down Expand Up @@ -39,6 +40,12 @@
},
"configurations": {
"staging": {
"budgets": [
{
"type": "anyComponentStyle",
"maximumWarning": "6kb"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
Expand All @@ -56,6 +63,12 @@
]
},
"production": {
"budgets": [
{
"type": "anyComponentStyle",
"maximumWarning": "6kb"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
Expand All @@ -73,6 +86,12 @@
]
},
"test": {
"budgets": [
{
"type": "anyComponentStyle",
"maximumWarning": "6kb"
}
],
"optimization": false,
"outputHashing": "all",
"sourceMap": true,
Expand Down Expand Up @@ -145,7 +164,7 @@
"schematics": {
"@schematics/angular:component": {
"prefix": "app",
"styleext": "css"
"style": "css"
},
"@schematics/angular:directive": {
"prefix": "app"
Expand Down
4 changes: 2 additions & 2 deletions electron-utils/oauth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { BrowserWindow, shell } from 'electron';
import { v4 as uuid } from 'uuid';

const nodeUrl = require('url');
const fetch = require('node-fetch');
const Logger = require('electron-log');
const fetch = require('node-fetch');

const CLIENT_ID = '6750652c0c9001314434';
const BASE_URL = 'https://github.com';
Expand All @@ -24,7 +24,7 @@ export function getAccessToken(window: BrowserWindow, repoPermissionLevel: strin
const accessTokenUrl = `${ACCESS_TOKEN_URL}/${code}`;
return fetch(accessTokenUrl)
.then((res) => res.json())
.then((data) => {
.then((data: { error }) => {
if (data.error) {
throw new Error(data.error);
}
Expand Down
68 changes: 35 additions & 33 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "CATcher",
"version": "3.4.4",
"version": "3.4.5",
"main": "main.js",
"scripts": {
"postinstall": "npm run postinstall:electron && electron-builder install-app-deps",
Expand Down Expand Up @@ -40,16 +40,18 @@
}
},
"dependencies": {
"@angular/animations": "^8.2.14",
"@angular/cdk": "^7.3.7",
"@angular/common": "^8.2.14",
"@angular/compiler": "^8.2.14",
"@angular/core": "^8.2.14",
"@angular/forms": "^8.2.14",
"@angular/material": "^7.3.7",
"@angular/platform-browser": "^8.2.14",
"@angular/platform-browser-dynamic": "^8.2.14",
"@angular/router": "^8.2.14",
"@angular/animations": "^10.2.5",
"@angular/cdk": "^10.2.7",
"@angular/common": "^10.2.5",
"@angular/compiler": "^10.2.5",
"@angular/core": "^10.2.5",
"@angular/forms": "^10.2.5",
"@angular/localize": "^10.2.5",
"@angular/material": "^10.2.7",
"@angular/platform-browser": "^10.2.5",
"@angular/platform-browser-dynamic": "^10.2.5",
"@angular/router": "^10.2.5",
"@github/markdown-toolbar-element": "^2.1.1",
"@octokit/rest": "^16.37.0",
"ajv": "^6.11.0",
"apollo-angular": "^1.9.1",
Expand All @@ -67,20 +69,20 @@
"graphql-tag": "2.11.0",
"karma-spec-reporter": "0.0.32",
"moment": "^2.24.0",
"ngx-markdown": "^8.2.1",
"ngx-mat-select-search": "^1.8.0",
"node-fetch": "^2.6.0",
"rxjs": "6.5.3",
"tslib": "^1.9.0",
"ngx-markdown": "^9.1.1",
"ngx-mat-select-search": "^3.3.3",
"node-fetch": "^2.6.8",
"rxjs": "6.6.7",
"tslib": "^2.0.0",
"uuid": "7.0.3",
"zone.js": "~0.9.1"
"zone.js": "~0.10.2"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.803.29",
"@angular/cli": "^8.3.29",
"@angular/compiler-cli": "^8.2.14",
"@angular/language-service": "^8.2.14",
"@graphql-codegen/cli": "1.17.7",
"@angular-devkit/build-angular": "~0.1002.4",
"@angular/cli": "^10.2.4",
"@angular/compiler-cli": "^10.2.5",
"@angular/language-service": "^10.2.5",
"@graphql-codegen/cli": "^2.6.4",
"@graphql-codegen/typescript": "1.17.7",
"@graphql-codegen/typescript-document-nodes": "1.17.7",
"@graphql-codegen/typescript-operations": "^1.18.4",
Expand All @@ -91,30 +93,30 @@
"@types/jasminewd2": "2.0.8",
"@types/node": "^15.6.1",
"angular-cli-ghpages": "^1.0.0-rc.2",
"codelyzer": "^5.0.1",
"codelyzer": "^5.1.2",
"electron": "11.4.8",
"electron-builder": "22.2.0",
"electron-reload": "1.5.0",
"graphql-codegen-fragment-matcher": "^0.18.2",
"husky": "^4.2.5",
"jasmine": "^3.9.0",
"jasmine-core": "3.5.0",
"jasmine-spec-reporter": "4.2.1",
"karma": "^4.4.1",
"karma-chrome-launcher": "3.1.0",
"karma-coverage-istanbul-reporter": "2.1.1",
"jasmine-core": "~3.5.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~5.0.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-firefox-launcher": "^2.1.1",
"karma-jasmine": "3.1.0",
"karma-jasmine-html-reporter": "1.5.1",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.5.0",
"npm-run-all": "4.1.5",
"prettier": "2.2.1",
"pretty-quick": "^3.1.1",
"protractor": "5.4.2",
"protractor": "~7.0.0",
"scuri": "^0.9.4",
"ts-node": "^7.0.1",
"tslint": "5.20.1",
"tslint": "~6.1.0",
"tslint-config-prettier": "^1.18.0",
"typescript": "3.5.3",
"typescript": "4.0.8",
"wait-on": "3.3.0",
"webdriver-manager": "12.1.7"
}
Expand Down
6 changes: 3 additions & 3 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ export class AppComponent implements AfterViewInit {
NOT_CONNECTED_ERROR: Error = new Error('You are not connected to the internet.');

constructor(public electronService: ElectronService, logger: LoggingService, public errorHandlingService: ErrorHandlingService) {
logger.info('AppConfig', AppConfig);
logger.info('AppComponent: AppConfig', AppConfig);

if (electronService.isElectron()) {
logger.info('Mode electron');
logger.info('AppComponent: Mode electron');
} else {
logger.info('Mode web');
logger.info('AppComponent: Mode web');
}
}

Expand Down
3 changes: 1 addition & 2 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ import { SharedModule } from './shared/shared.module';
useClass: ErrorHandlingService
}
],
bootstrap: [AppComponent],
entryComponents: [UserConfirmationComponent, SessionFixConfirmationComponent, LabelDefinitionPopupComponent]
bootstrap: [AppComponent]
})
export class AppModule {
constructor(
Expand Down
14 changes: 7 additions & 7 deletions src/app/auth/auth.component.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Component, NgZone, OnDestroy, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { Observable, Subscription } from 'rxjs';
import { filter, flatMap, map } from 'rxjs/operators';
import { filter, map, mergeMap } from 'rxjs/operators';
import { AppConfig } from '../../environments/environment';
import { GithubUser } from '../core/models/github-user.model';
import { ApplicationService } from '../core/services/application.service';
Expand Down Expand Up @@ -72,7 +72,7 @@ export class AuthComponent implements OnInit, OnDestroy {
// runs upon receiving oauthCode from the redirect
this.authService.changeAuthState(AuthState.AwaitingAuthentication);
this.restoreOrgDetailsFromLocalStorage();
this.logger.info('Obtained authorisation code from Github');
this.logger.info('AuthComponent: Obtained authorisation code from Github');
this.fetchAccessToken(oauthCode, state);
}
}
Expand All @@ -84,11 +84,11 @@ export class AuthComponent implements OnInit, OnDestroy {
*/
fetchAccessToken(oauthCode: string, state: string) {
if (!this.authService.isReturnedStateSame(state)) {
this.logger.info(`Received incorrect state ${state}, continue waiting for correct state`);
this.logger.info(`AuthComponent: Received incorrect state ${state}, continue waiting for correct state`);
return;
}

this.logger.info('Retrieving access token from Github');
this.logger.info('AuthComponent: Retrieving access token from Github');

const accessTokenUrl = `${AppConfig.accessTokenUrl}/${oauthCode}/client_id/${AppConfig.clientId}`;
fetch(accessTokenUrl)
Expand All @@ -98,10 +98,10 @@ export class AuthComponent implements OnInit, OnDestroy {
throw new Error(data.error);
}
this.authService.storeOAuthAccessToken(data.token);
this.logger.info('Sucessfully obtained access token');
this.logger.info('AuthComponent: Sucessfully obtained access token');
})
.catch((err) => {
this.logger.info(`Error in data fetched from access token URL: ${err}`);
this.logger.info(`AuthComponent: Error in data fetched from access token URL: ${err}`);
this.errorHandlingService.handleError(err);
this.authService.changeAuthState(AuthState.NotAuthenticated);
});
Expand Down Expand Up @@ -189,7 +189,7 @@ export class AuthComponent implements OnInit, OnDestroy {
this.accessTokenSubscription = this.authService.accessToken
.pipe(
filter((token: string) => !!token),
flatMap(() => this.userService.getAuthenticatedUser())
mergeMap(() => this.userService.getAuthenticatedUser())
)
.subscribe((user: GithubUser) => {
this.ngZone.run(() => {
Expand Down
3 changes: 1 addition & 2 deletions src/app/auth/auth.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { SessionSelectionComponent } from './session-selection/session-selection

@NgModule({
imports: [AuthRoutingModule, SharedModule, CommonModule],
declarations: [AuthComponent, ProfilesComponent, JsonParseErrorDialogComponent, ConfirmLoginComponent, SessionSelectionComponent],
entryComponents: [JsonParseErrorDialogComponent]
declarations: [AuthComponent, ProfilesComponent, JsonParseErrorDialogComponent, ConfirmLoginComponent, SessionSelectionComponent]
})
export class AuthModule {}
10 changes: 5 additions & 5 deletions src/app/auth/confirm-login/confirm-login.component.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Component, Input, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { flatMap } from 'rxjs/operators';
import { mergeMap } from 'rxjs/operators';
import { AuthService, AuthState } from '../../core/services/auth.service';
import { ElectronService } from '../../core/services/electron.service';
import { ErrorHandlingService } from '../../core/services/error-handling.service';
Expand Down Expand Up @@ -37,7 +37,7 @@ export class ConfirmLoginComponent implements OnInit {
}

logIntoAnotherAccount() {
this.logger.info('Logging into another account');
this.logger.info('ConfirmLoginComponent: Logging into another account');
this.electronService.clearCookies();
this.authService.startOAuthProcess();
}
Expand All @@ -60,8 +60,8 @@ export class ConfirmLoginComponent implements OnInit {
this.userService
.createUserModel(this.username)
.pipe(
flatMap(() => this.phaseService.sessionSetup()),
flatMap(() => this.githubEventService.setLatestChangeEvent())
mergeMap(() => this.phaseService.sessionSetup()),
mergeMap(() => this.githubEventService.setLatestChangeEvent())
)
.subscribe(
() => {
Expand All @@ -70,7 +70,7 @@ export class ConfirmLoginComponent implements OnInit {
(error) => {
this.authService.changeAuthState(AuthState.NotAuthenticated);
this.errorHandlingService.handleError(error);
this.logger.info(`Completion of login process failed with an error: ${error}`);
this.logger.info(`ConfirmLoginComponent: Completion of login process failed with an error: ${error}`);
}
);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { MatDialogRef } from '@angular/material';
import { MatDialogRef } from '@angular/material/dialog';
import { ProfilesComponent } from '../profiles.component';

/**
Expand Down
1 change: 1 addition & 0 deletions src/app/auth/profiles/profiles.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
mat-icon-button
(click)="this.fileSelectorInitiation(fileInput)"
disableRipple="true"
matTooltip="Configure your custom settings"
(mousedown)="this.animationActivated = true"
(mouseleave)="this.animationActivated = false"
>
Expand Down
2 changes: 1 addition & 1 deletion src/app/auth/profiles/profiles.component.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { animate, state, style, transition, trigger } from '@angular/animations';
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { MatDialog } from '@angular/material';
import { MatDialog } from '@angular/material/dialog';
import { isValidProfile, Profile } from '../../core/models/profile.model';
import { ErrorHandlingService } from '../../core/services/error-handling.service';
import { MALFORMED_PROFILES_ERROR, ProfileService } from '../../core/services/profile.service';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export class SessionSelectionComponent implements OnInit {
window.localStorage.setItem('dataRepo', dataRepo);
this.githubService.storeOrganizationDetails(org, dataRepo);

this.logger.info(`Selected Settings Repo: ${sessionInformation}`);
this.logger.info(`SessionSelectionComponent: Selected Settings Repo: ${sessionInformation}`);

this.phaseService.storeSessionData().subscribe(
() => {
Expand Down
Loading

0 comments on commit 0c04506

Please sign in to comment.