Commit 4ffd1c86 authored by David Burke's avatar David Burke

Updated to latest angular cli version

parent 56f28ac3
Pipeline #5534596 failed with stage
in 60 minutes and 56 seconds
......@@ -9,5 +9,5 @@ insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
max_line_length = 0
max_line_length = off
trim_trailing_whitespace = false
{
"project": {
"version": "1.0.0-beta.19-3",
"version": "1.0.0-beta.24",
"name": "passit-frontend"
},
"apps": [
......@@ -13,13 +13,12 @@
"index": "index.html",
"main": "main.ts",
"test": "test.ts",
"tsconfig": "../tsconfig.json",
"tsconfig": "tsconfig.json",
"prefix": "app",
"mobile": false,
"styles": [
],
"scripts": [
],
"scripts": [],
"environments": {
"source": "environments/environment.ts",
"dev": "environments/environment.ts",
......@@ -27,10 +26,8 @@
}
}
],
"addons": [
],
"packages": [
],
"addons": [],
"packages": [],
"e2e": {
"protractor": {
"config": "./protractor.conf.js"
......@@ -52,7 +49,7 @@
"class": false,
"component": true,
"directive": true,
"module": true,
"module": false,
"pipe": true,
"service": true
}
......
......@@ -2,11 +2,12 @@
// https://karma-runner.github.io/0.13/config/configuration-file.html
module.exports = function (config) {
var options = {
config.set({
basePath: '',
frameworks: ['jasmine', 'angular-cli'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-remap-istanbul'),
require('angular-cli/plugins/karma')
],
......@@ -16,6 +17,9 @@ module.exports = function (config) {
preprocessors: {
'./src/test.ts': ['angular-cli']
},
mime: {
'text/x-typescript': ['ts','tsx']
},
remapIstanbulReporter: {
reports: {
html: 'coverage',
......@@ -26,45 +30,14 @@ module.exports = function (config) {
config: './angular-cli.json',
environment: 'dev'
},
reporters: ['progress', 'karma-remap-istanbul'],
reporters: config.angularCli && config.angularCli.codeCoverage
? ['progress', 'karma-remap-istanbul']
: ['progress'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false
}
if (process.env.CI) {
console.log("KARMA: Using SauceLabs");
options.sauceLabs = {
testName: 'passit-frontend karma',
startConnect: true,
recordVideo: true,
recordScreenshots: true,
}
options.customLaunchers = {
sl_chrome: {
base: 'SauceLabs',
browserName: 'chrome',
version: '53'
},
sl_firefox: {
base: 'SauceLabs',
browserName: 'firefox',
version: '49'
}
};
options.browsers = Object.keys(options.customLaunchers);
options.reporters.push('saucelabs');
options.singleRun = true;
options.plugins.push(require('karma-sauce-launcher'));
options.browserDisconnectTimeout = 10000;
options.browserDisconnectTolerance = 1;
options.browserNoActivityTimeout = 10 * 60 *1000;
} else {
console.log("KARMA: Using local chrome");
options.plugins.push(require('karma-chrome-launcher'));
}
config.set(options);
});
};
......@@ -13,56 +13,59 @@
},
"license": "AGPL-3.0",
"homepage": "https://gitlab.com/burke-software/passit-frontend",
"repository": {
"type": "git",
"url": "git@gitlab.com:burke-software/passit-frontend.git"
},
"dependencies": {
"@angular/common": "~2.2.4",
"@angular/compiler": "~2.2.4",
"@angular/core": "~2.2.4",
"@angular/forms": "~2.2.4",
"@angular/http": "~2.2.4",
"@angular/platform-browser": "~2.2.4",
"@angular/platform-browser-dynamic": "~2.2.4",
"@angular/router": "~3.2.4",
"@angular/common": "^2.3.1",
"@angular/compiler": "^2.3.1",
"@angular/core": "^2.3.1",
"@angular/forms": "^2.3.1",
"@angular/http": "^2.3.1",
"@angular/platform-browser": "^2.3.1",
"@angular/platform-browser-dynamic": "^2.3.1",
"@angular/router": "^3.3.1",
"@ngrx/core": "^1.2.0",
"@ngrx/router-store": "^1.2.5",
"@ngrx/store": "^2.2.1",
"@ngrx/store-devtools": "^3.2.2",
"angular2-clipboard": "1.0.2",
"ngx-clipboard": "^3.0.1",
"angular2-select": "^1.0.0-alpha.12",
"clipboard-js": "^0.3.1",
"codelyzer": "^1.0.0-beta.4",
"clipboard-js": "^0.3.2",
"codelyzer": "^1.0.0-beta.1",
"core-js": "^2.4.1",
"ng2-inline-svg": "^1.3.1",
"ng-inline-svg": "^2.0.0",
"normalize-scss": "^6.0.0",
"passit-sdk-js": "^0.1.1",
"reselect": "^2.5.4",
"rxjs": "5.0.1",
"ts-helpers": "^1.1.2",
"susy": "^2.2.12",
"zone.js": "0.7.2"
},
"devDependencies": {
"@types/jasmine": "^2.5.38",
"@types/node": "^6.0.51",
"@types/selenium-webdriver": "~2.53.35",
"angular-cli": "1.0.0-beta.21",
"breakpoint-sass": "^2.7.0",
"@types/node": "^6.0.53",
"@types/selenium-webdriver": "~2.53.38",
"@angular/compiler-cli": "^2.3.1",
"angular-cli": "1.0.0-beta.24",
"breakpoint-sass": "^2.7.1",
"jasmine-core": "^2.5.2",
"jasmine-spec-reporter": "2.7.0",
"karma": "^1.3.0",
"karma-chrome-launcher": "^2.0.0",
"karma-cli": "^1.0.1",
"karma-firefox-launcher": "^1.0.0",
"karma-jasmine": "^1.0.2",
"karma-remap-istanbul": "^0.2.1",
"karma-jasmine": "^1.1.0",
"karma-remap-istanbul": "^0.4.0",
"karma-sauce-launcher": "^1.1.0",
"ng2-inline-svg": "^1.3.0",
"ngrx-store-freeze": "^0.1.4",
"normalize-scss": "^6.0.0",
"protractor": "4.0.11",
"ts-helpers": "^1.1.2",
"ts-node": "^1.7.0",
"tslint": "4.0.2",
"typescript": "~2.0.10",
"typings": "^2.0.0",
"webdriver-manager": "10.2.8"
"ngrx-store-freeze": "^0.1.6",
"protractor": "4.0.14",
"ts-node": "^1.7.2",
"tslint": "4.2.0",
"typescript": "^2.0.10",
"typings": "^2.1.0",
"webdriver-manager": "11.1.0"
}
}
// Protractor configuration file, see link for more information
// https://github.com/angular/protractor/blob/master/docs/referenceConf.js
// https://github.com/angular/protractor/blob/master/lib/config.ts
/*global jasmine */
var SpecReporter = require('jasmine-spec-reporter');
var path = require("path");
var process = require("process");
var _root = path.resolve(__dirname);
function root(args) {
args = Array.prototype.slice.call(arguments, 0);
return path.join.apply(path, [_root].concat(args));
}
exports.config = {
allScriptsTimeout: 11000,
specs: [
root("src/**/**.e2e.ts"),
root("src/**/*.e2e.ts")
'./e2e/**/*.e2e-spec.ts'
],
chromeDriver: `./node_modules/webdriver-manager/selenium/chromedriver_2.24${process.platform.indexOf('win') === 0 ? '.exe' : ''}`,
capabilities: {
'browserName': 'chrome'
},
directConnect: true,
baseUrl: 'http://localhost:4200/',
framework: 'jasmine',
jasmineNodeOpts: {
......@@ -28,55 +21,12 @@ exports.config = {
print: function() {}
},
useAllAngular2AppRoots: true,
onPrepare: function() {
// https://github.com/angular/angular-cli/issues/975#issuecomment-224341465
beforeLaunch: function() {
require('ts-node').register({
project: '.'
project: 'e2e'
});
},
onPrepare: function() {
jasmine.getEnv().addReporter(new SpecReporter());
}
};
if (process.env.CI) {
console.log("Testing on Sauce Labs");
exports.config.sauceUser = process.env.SAUCE_USERNAME;
exports.config.sauceKey = process.env.SAUCE_ACCESS_KEY;
exports.config.getMultiCapabilities = function() {
return new Promise(function(resolve, reject) {
var sauceConnectLauncher = require('sauce-connect-launcher');
// copied from karma
// https://github.com/karma-runner/karma-sauce-launcher/blob/2e8ff42492252766b63295edc52f4024257e9408/lib/sauce_launcher.js#L17
var tunnelIdentifier = 'protractor' + Math.round(new Date().getTime() / 1000)
sauceConnectLauncher({
username: process.env.SAUCE_USERNAME,
accessKey: process.env.SAUCE_ACCESS_KEY,
tunnelIdentifier: tunnelIdentifier,
}, function (err, sauceConnectProcess) {
if (err) {
console.log("error starting sauce connect", err);
process.exit(1);
}
resolve([{
browserName: 'firefox',
version: '49',
name: "passit-frontend e2e",
'tunnel-identifier': tunnelIdentifier,
}, {
browserName: 'chrome',
version: '53',
name: "passit-frontend e2e",
'tunnel-identifier': tunnelIdentifier,
}]);
});
});
};
} else {
console.log("Testing locally")
exports.config.directConnect = true;
exports.config.capabilities = {
'browserName': 'chrome'
};
}
......@@ -13,9 +13,9 @@ import { appRoutingProviders, routing, routingStore } from "./app.routing";
*/
import { StoreModule } from "@ngrx/store";
import { StoreDevtoolsModule } from "@ngrx/store-devtools";
import { ClipboardModule } from "angular2-clipboard";
import { SelectModule } from "angular2-select";
import { InlineSVGModule } from "ng2-inline-svg";
import { InlineSVGModule } from "ng-inline-svg";
import { ClipboardModule } from "ngx-clipboard";
/*
* Passit
......
......@@ -6,9 +6,8 @@ import { Component, EventEmitter } from "@angular/core";
/*
* Passit
*/
import { GroupService } from "../group-services/group.service";
import { Group } from "../group-services/group";
import { Secret } from "../../list";
import { GroupService } from "../group-services/group.service";
@Component({
inputs: ["secret"],
......@@ -41,7 +40,7 @@ export class GroupChoiceComponent {
* send group id (groupValue) and secret object to group service
* calls add_group method on sdk to add group to secret
*/
public addGroup(groupValue: string, secret: Secret) {
public addGroup(groupValue: string, secret: any) {
let groupId = parseInt(groupValue, 10);
this.groupService.addGroupToSecret(groupId, secret)
......
......@@ -29,7 +29,7 @@
[(ngModel)]="secret.visible_data.username">
<div class="secret__field__actions">
<button type="button"
ngIIclipboard [cbContent]="secret.visible_data.username"
ngxClipboard [cbContent]="secret.visible_data.username"
class="secret__field__action">
<div class="button__icon button__icon--no-text" [inlineSVG]="'../assets/svg/clipboard.svg'"></div>
</button>
......
......@@ -104,7 +104,7 @@ export class SecretFormComponent {
}
public goToUrl() {
let url = this.secret.visible_data.url;
let url = this.secret.visible_data["url"];
if (!url.match(/^https?:\/\//)) {
url = "http://" + url;
}
......
import { Directive, ElementRef, Input } from "@angular/core";
import { ClipboardDirective } from "angular2-clipboard/src/clipboard.directive";
import { ClipboardDirective } from "ngx-clipboard/src/clipboard.directive";
import Clipboard = require("clipboard");
import * as Clipboard from "clipboard";
import { SecretService } from "../../secrets/secret.service";
......@@ -24,14 +24,14 @@ export class CopySecretDirective extends ClipboardDirective {
}
public ngOnInit() {
let option: ClipboardOptions;
let option: Clipboard.Options;
option = !!this.targetElm ? { target: () => <any> this.targetElm } : { text: () => this.cbContent };
if ((/^[0-9]*$/g).test(this.cbContent) === true) {
let secretId = parseInt(this.cbContent, 10);
this.secretService.copySecret(secretId)
.then((resp) => {
.then((resp: any) => {
return this.cbContent = resp.password;
});
}
......
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