Commit 274ee164 authored by Emily Jensen's avatar Emily Jensen

Merge from Dev

parents aad95014 c8b3081f
Pipeline #36776739 passed with stage
in 9 minutes and 5 seconds
......@@ -26,9 +26,7 @@
"output": "/"
}
],
"styles": [
"src/styles.scss"
],
"styles": ["src/styles.scss"],
"scripts": []
},
"configurations": {
......@@ -150,9 +148,7 @@
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.spec.json",
"scripts": [],
"styles": [
"src/styles.css"
],
"styles": ["src/styles.scss"],
"assets": [
"src/assets",
"src/manifest.json",
......@@ -168,13 +164,8 @@
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"src/tsconfig.app.json",
"src/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**/*"
]
"tsConfig": ["src/tsconfig.app.json", "src/tsconfig.spec.json"],
"exclude": ["**/node_modules/**/*"]
}
}
}
......@@ -199,12 +190,8 @@
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"e2e/tsconfig.e2e.json"
],
"exclude": [
"**/node_modules/**/*"
]
"tsConfig": ["e2e/tsconfig.e2e.json"],
"exclude": ["**/node_modules/**/*"]
}
}
}
......
......@@ -28,90 +28,89 @@
"url": "git@gitlab.com:burke-software/passit-frontend.git"
},
"dependencies": {
"@angular/animations": "^6.0.0",
"@angular/common": "^6.0.0",
"@angular/compiler": "^6.0.0",
"@angular/core": "^6.0.0",
"@angular/forms": "^6.0.0",
"@angular/http": "^6.0.0",
"@angular/platform-browser": "^6.0.0",
"@angular/platform-browser-dynamic": "^6.0.0",
"@angular/pwa": "^0.7.5",
"@angular/router": "^6.0.0",
"@angular/service-worker": "^6.0.0",
"@angular/animations": "^7.0.4",
"@angular/common": "^7.0.4",
"@angular/compiler": "^7.0.4",
"@angular/core": "^7.0.4",
"@angular/forms": "^7.0.4",
"@angular/http": "^7.0.4",
"@angular/platform-browser": "^7.0.4",
"@angular/platform-browser-dynamic": "^7.0.4",
"@angular/pwa": "^0.10.6",
"@angular/router": "^7.0.4",
"@angular/service-worker": "^7.0.4",
"@braintree/sanitize-url": "~2.1.0",
"@ngrx/effects": "^6.0.1",
"@ngrx/entity": "^6.0.1",
"@ngrx/router-store": "^6.0.1",
"@ngrx/store": "^6.0.1",
"@ngrx/store-devtools": "^6.0.1",
"@types/file-saver": "^1.3.0",
"@types/jspdf": "^1.1.31",
"@types/papaparse": "~4.5.2",
"@types/qrcode": "^1.2.0",
"@ngrx/effects": "^6.1.2",
"@ngrx/entity": "^6.1.2",
"@ngrx/router-store": "^6.1.2",
"@ngrx/store": "^6.1.2",
"@ngrx/store-devtools": "^6.1.2",
"@types/file-saver": "^2.0.0",
"@types/jspdf": "^1.2.1",
"@types/papaparse": "~4.5.5",
"@types/qrcode": "^1.3.0",
"@types/storybook__addon-actions": "^3.4.1",
"@types/storybook__addon-knobs": "^3.4.1",
"angular2-hotkeys": "^2.1.2",
"angular2-hotkeys": "^2.1.4",
"babel-loader": "^8.0.2",
"canvg": "^1.5.3",
"core-js": "^2.5.1",
"file-saver": "~1.3.3",
"file-saver": "~2.0.0",
"global": "^4.3.2",
"jasmine-marbles": "^0.3.1",
"jasmine-marbles": "^0.4.0",
"jspdf": "^1.4.1",
"jsqr": "^1.1.1",
"ng-inline-svg": "~8.0.0",
"ng-select": "~1.0.0",
"ngrx-forms": "^3.0.2",
"ngrx-store-localstorage": "~5.0.0",
"ngx-clipboard": "^11.0.0",
"ngx-tooltip": "~0.0.9",
"karma-webdriver-launcher": "^1.0.5",
"ng-inline-svg": "~8.1.0",
"ng-select": "~1.0.1",
"ngrx-forms": "^3.1.0",
"ngrx-store-localstorage": "~5.1.0",
"ngx-clipboard": "^11.1.9",
"ngx-tooltip": "^0.0.9",
"normalize-scss": "~7.0.0",
"papaparse": "~4.6.0",
"passit-sdk-js": "2.3.2",
"qrcode": "^1.2.2",
"raven-js": "^3.26.4",
"rxjs": "~6.1.0",
"rxjs-compat": "^6.1.0",
"qrcode": "^1.3.2",
"raven-js": "^3.27.0",
"rxjs": "^6.3.3",
"rxjs-tslint": "^0.1.5",
"stream": "^0.0.2",
"susy": "^2.2.12",
"url-parse": "^1.2.0",
"webextension-polyfill": "^0.3.0",
"url-parse": "^1.4.4",
"webextension-polyfill": "^0.3.1",
"zone.js": "~0.8.18"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.8.3",
"@angular/cli": "^6.1.2",
"@angular/compiler-cli": "^6.0.0",
"@angular-devkit/build-angular": "~0.10.0",
"@angular/cli": "^7.0.6",
"@angular/compiler-cli": "^7.0.4",
"@babel/core": "^7.1.0",
"@storybook/addon-actions": "^4.0.4",
"@storybook/addon-knobs": "^4.0.4",
"@storybook/addons": "^4.0.4",
"@storybook/angular": "^4.0.4",
"@storybook/addon-actions": "^4.0.7",
"@storybook/addon-knobs": "^4.0.7",
"@storybook/addon-links": "^4.0.7",
"@storybook/addon-notes": "^4.0.7",
"@storybook/addons": "^4.0.7",
"@storybook/angular": "^4.0.7",
"@types/jasmine": "~2.8.2",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~8.5.2",
"@types/node": "~10.12.8",
"breakpoint-sass": "~2.7.1",
"codelyzer": "~4.4.3",
"jasmine-core": "~2.8.0",
"codelyzer": "~4.5.0",
"jasmine-core": "^2.99.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~1.7.0",
"karma": "~3.1.1",
"karma-chrome-launcher": "~2.2.0",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "~1.3.0",
"karma-coverage-istanbul-reporter": "~2.0.4",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "~0.2.2",
"karma-webdriver-launcher": "^1.0.5",
"prettier": "^1.10.2",
"protractor": "~5.4.0",
"ts-node": "~7.0.0",
"tslint": "~5.11.0",
"typescript": "~2.9.2",
"web-ext": "^2.4.0",
"web-ext-types": "^2.1.0",
"webpack-bundle-analyzer": "^3.0.2",
"@storybook/addon-notes": "^4.0.2",
"@storybook/addon-links": "^4.0.2"
"typescript": "~3.1.6",
"web-ext": "^2.9.2",
"web-ext-types": "^3.0.0",
"webpack-bundle-analyzer": "^3.0.2"
}
}
import { take } from "rxjs/operators";
import { fakeAsync, inject, TestBed } from "@angular/core/testing";
import { Store, StoreModule, select } from "@ngrx/store";
import "rxjs/add/operator/take";
import { logout } from "../app.reducers";
import {
......
import { Injectable } from "@angular/core";
import { Effect } from "@ngrx/effects";
import { Store, select } from "@ngrx/store";
import { IState } from "../../app.reducers";
import * as fromAccount from "../account.reducer";
import {
filter,
switchMap,
......@@ -10,14 +8,16 @@ import {
distinctUntilChanged,
catchError
} from "rxjs/operators";
import { timer } from "rxjs/observable/timer";
import {
StartAsyncValidationAction,
ClearAsyncErrorAction,
SetAsyncErrorAction
} from "ngrx-forms";
import { concat, timer } from "rxjs";
import { UserService } from "../user";
import { concat } from "rxjs";
import { IState } from "../../app.reducers";
import * as fromAccount from "../account.reducer";
@Injectable()
export class LoginFormEffects {
......
......@@ -6,10 +6,6 @@ import {
withLatestFrom,
catchError
} from "rxjs/operators";
import "rxjs/add/operator/do";
import "rxjs/add/operator/exhaustMap";
import "rxjs/add/operator/map";
import "rxjs/add/operator/filter";
import { Injectable } from "@angular/core";
import { Actions, Effect, ofType } from "@ngrx/effects";
......
......@@ -8,7 +8,6 @@ import { UserService } from "../../user";
import {
VerifyAndLogin,
ResetPasswordVerifyActionTypes,
SetError,
VerifyAndLoginSuccess,
VerifyAndLoginFailure
} from "./reset-password-verify.actions";
......@@ -41,9 +40,8 @@ export class ResetPasswordVerifyEffects {
map(auth => new VerifyAndLoginSuccess(auth)),
catchError(err => of(new VerifyAndLoginFailure(err)))
);
} else {
return of(new SetError("Invalid recovery link"));
}
return of(new VerifyAndLoginFailure("Invalid recovery link"));
})
);
......
......@@ -2,15 +2,6 @@ import { take, mergeMap, map, exhaustMap, catchError } from "rxjs/operators";
import { HttpClient } from "@angular/common/http";
import { Injectable } from "@angular/core";
import { Store, select } from "@ngrx/store";
import "rxjs/add/operator/toPromise";
import { IPassitSDKError } from "../../ngsdk";
import { NgPassitSDK } from "../../ngsdk/sdk";
import { DeleteAccountFailureAction } from "../delete/delete.actions";
import * as fromAccount from "../account.reducer";
import { selectAuthState } from "../account.reducer";
import { LogoutSuccessAction, SetUrlAction } from "../account.actions";
import { IAuthStore, IResetPasswordVerifyResponse } from "./user.interfaces";
import {
decryptPrivateKey,
fromBase64,
......@@ -27,6 +18,14 @@ import {
import { hashPassword } from "passit-sdk-js/js/hash";
import { forkJoin, from } from "rxjs";
import { IPassitSDKError } from "../../ngsdk";
import { NgPassitSDK } from "../../ngsdk/sdk";
import { DeleteAccountFailureAction } from "../delete/delete.actions";
import * as fromAccount from "../account.reducer";
import { selectAuthState } from "../account.reducer";
import { LogoutSuccessAction, SetUrlAction } from "../account.actions";
import { IAuthStore, IResetPasswordVerifyResponse } from "./user.interfaces";
@Injectable()
export class UserService {
constructor(
......@@ -296,24 +295,26 @@ export class UserService {
code: emailCode,
message: toBase64(encryptedMessage)
};
return this.http.post<ILoginResonse>(url, data).map(resp => {
this.sdk.set_up(
resp.user.public_key,
toBase64(privateKey),
resp.user.id,
resp.token
);
const auth: IAuthStore = {
privateKey: resp.user.private_key,
publicKey: resp.user.public_key,
userId: resp.user.id,
email,
userToken: resp.token,
rememberMe: false,
optInErrorReporting: resp.user.opt_in_error_reporting
};
return auth;
});
return this.http.post<ILoginResonse>(url, data).pipe(
map(resp => {
this.sdk.set_up(
resp.user.public_key,
toBase64(privateKey),
resp.user.id,
resp.token
);
const auth: IAuthStore = {
privateKey: resp.user.private_key,
publicKey: resp.user.public_key,
userId: resp.user.id,
email,
userToken: resp.token,
rememberMe: false,
optInErrorReporting: resp.user.opt_in_error_reporting
};
return auth;
})
);
}
/** Final step of reset password process, set new password.
......
/*
* @angular
*/
import { Component, ViewEncapsulation, OnInit } from "@angular/core";
import { Title } from "@angular/platform-browser";
import { Router, RoutesRecognized } from "@angular/router";
import { filter } from "rxjs/operators";
import { Store, select } from "@ngrx/store";
import * as Raven from "raven-js";
import { environment } from "../environments/environment";
import * as fromRoot from "./app.reducers";
import { GetConfAction } from "./get-conf/conf.actions";
/*
* passit
*/
import { AppDataService } from "./shared/app-data/app-data.service";
@Component({
......@@ -55,8 +47,10 @@ export class AppComponent implements OnInit {
ngOnInit() {
this.store.dispatch(new GetConfAction());
this.store
.pipe(select(fromRoot.getConfState))
.filter(conf => conf.ravenDsn !== null)
.pipe(
select(fromRoot.getConfState),
filter(conf => conf.ravenDsn !== null)
)
.subscribe(conf => {
Raven.config(conf.ravenDsn!, {
release: environment.VERSION,
......
import { ActionReducer, createSelector, MetaReducer } from "@ngrx/store";
import "rxjs/add/operator/let";
import "rxjs/add/operator/switchMap";
import { localStorageSync } from "./store-localstorage";
......
......@@ -500,12 +500,12 @@ const fillLoginForm = (formData: IFormDict) => {
// this may work for forms without submit buttons (e.g. buttons with onclick)
try {
// if form has input[name="submit"] it shadows submit() method causing TypeError
$pass_form![0].submit();
($pass_form![0] as any).submit();
} catch (e) {
if (e instanceof TypeError) {
try {
// console.log('form.submit not a method; trying to click');
$pass_form![0].submit.click();
($pass_form![0] as any).submit.click();
} catch (e2) {
// console.log('trying to click on the submit button');
const $submit_thing = $user_form!.querySelector(
......
......@@ -25,17 +25,28 @@ export class ImporterComponent {
toggleAllUseMinus = false;
tooltipDisabled = false;
@Input() fileName: string;
@Input() finishedSavingMessage: string;
@Input() hasStartedSaving: boolean;
@Input() hasFinishedSaving: boolean;
@Input() secrets: ImportableSecret[];
@Output() resetForm = new EventEmitter();
@Output() resetFinishedMessage = new EventEmitter();
@Output() setFileName = new EventEmitter<string>();
@Output() setImportableSecrets = new EventEmitter<ImportableSecret[]>();
@Output() saveSecrets = new EventEmitter<ImportableSecret[]>();
@ViewChild("fileInput") fileInput: ElementRef;
@Input()
fileName: string;
@Input()
finishedSavingMessage: string;
@Input()
hasStartedSaving: boolean;
@Input()
hasFinishedSaving: boolean;
@Input()
secrets: ImportableSecret[];
@Output()
resetForm = new EventEmitter();
@Output()
resetFinishedMessage = new EventEmitter();
@Output()
setFileName = new EventEmitter<string>();
@Output()
setImportableSecrets = new EventEmitter<ImportableSecret[]>();
@Output()
saveSecrets = new EventEmitter<ImportableSecret[]>();
@ViewChild("fileInput")
fileInput: ElementRef;
constructor(private importerService: ImporterService) {}
......@@ -69,7 +80,7 @@ export class ImporterComponent {
myReader.onloadend = e => {
this.resetFinishedMessage.emit();
this.fileInput.nativeElement.value = "";
this.importText = myReader.result;
this.importText = myReader.result as string;
const secrets = this.importerService.textToSecrets(this.importText);
this.setImportableSecrets.emit(secrets);
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment