Skip to content

Commit

Permalink
Update Angular 11
Browse files Browse the repository at this point in the history
  • Loading branch information
cyanez committed Dec 30, 2020
1 parent 91f05e7 commit 1b591b7
Show file tree
Hide file tree
Showing 29 changed files with 2,938 additions and 5,064 deletions.
13 changes: 9 additions & 4 deletions .browserslistrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries

# For the full list of supported browsers by the Angular framework, please see:
# https://angular.io/guide/browser-support

# You can see what browsers were selected by your queries by running:
# npx browserslist

> 0.5%
last 2 versions
last 1 Chrome version
last 1 Firefox version
last 2 Edge major versions
last 2 Safari major versions
last 2 iOS major versions
Firefox ESR
not dead
not IE 9-11 # For IE 9-11 support, remove 'not'.
not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line.
5 changes: 4 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Editor configuration, see http://editorconfig.org
# Editor configuration, see https://editorconfig.org
root = true

[*]
Expand All @@ -8,6 +8,9 @@ indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.ts]
quote_type = single

[*.md]
max_line_length = off
trim_trailing_whitespace = false
10 changes: 7 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,16 @@
/dist
/tmp
/out-tsc
# Only exists if Bazel was run
/bazel-out

# dependencies
/node_modules

# profiling files
chrome-profiler-events*.json
speed-measure-plugin*.json

# IDEs and editors
/.idea
.project
Expand All @@ -23,6 +29,7 @@
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*

# misc
/.sass-cache
Expand All @@ -37,6 +44,3 @@ testem.log
# System Files
.DS_Store
Thumbs.db

# Application related
empiria.config.json
698 changes: 0 additions & 698 deletions LICENSE

This file was deleted.

55 changes: 14 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,54 +1,27 @@
# Empiria OnePoint ESign Application
# Esing

## Overview
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 11.0.1.

This Empiria One Point's web application allows electronical sign of documents.
## Development server

## Quick start
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.

This project is being built with Angular 10 and TypeScript 4.
## Code scaffolding

It uses [Angular CLI](https://github.com/angular/angular-cli), so both the CLI and generated project, have dependencies that require Node 10.16 or higher, together with NPM 6.9 or higher.
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.

Make sure you have **Node version >= 10.16** and **NPM >= 6.9**
## Build

Then install **[Angular CLI](https://github.com/angular/angular-cli)** (globally if possible), ensuring that you have installed **version 10.1** or higher.
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.

## Running unit tests

```bash
# install Angular CLI globally
npm install -g @angular/cli
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).

# check Angular CLI, Angular and TypeScript versions
ng --version
```
## Running end-to-end tests

After that, please download and install this repo:
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).

```bash
# clone (or fork) this repo
git clone https://github.com/Ontica/Empiria.OnePoint.ESign
## Further help

# change directory
cd Empiria.OnePoint.ESign

# install the repo with npm
npm install

# Use Angular CLI to start the server
ng serve --open
```

By default, you have to navigate to [http://localhost:4200](http://localhost:4200) to see the application running.

## Backend access

In order to run this application, you MUST have a valid API KEY and access credentials to connect to the system's backend. Please request them by sending us an email.

## License

This web application is distributed by the [GNU AFFERO](https://github.com/Ontica/Empiria.OnePoint.ESign/blob/master/LICENSE.txt) GENERAL PUBLIC LICENSE.

## Copyright

Copyright © 2017-2020. La Vía Óntica SC, Ontica LLC and contributors.
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
29 changes: 16 additions & 13 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
"version": 1,
"newProjectRoot": "projects",
"projects": {
"onepoint-esign": {
"esing": {
"projectType": "application",
"schematics": {
"@schematics/angular:component": {
"style": "scss"
},
"@schematics/angular:application": {
"strict": true
}
},
"root": "",
Expand All @@ -17,7 +20,7 @@
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/onepoint-esign",
"outputPath": "dist/esing",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
Expand All @@ -43,20 +46,20 @@
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
"maximumWarning": "500kb",
"maximumError": "1mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "6kb"
"maximumWarning": "2kb",
"maximumError": "4kb"
}
]
}
Expand All @@ -65,18 +68,18 @@
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "onepoint-esign:build"
"browserTarget": "esing:build"
},
"configurations": {
"production": {
"browserTarget": "onepoint-esign:build:production"
"browserTarget": "esing:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "onepoint-esign:build"
"browserTarget": "esing:build"
}
},
"test": {
Expand Down Expand Up @@ -113,19 +116,19 @@
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "onepoint-esign:serve"
"devServerTarget": "esing:serve"
},
"configurations": {
"production": {
"devServerTarget": "onepoint-esign:serve:production"
"devServerTarget": "esing:serve:production"
}
}
}
}
}
},
"defaultProject": "onepoint-esign",
"defaultProject": "esing",
"cli": {
"analytics": "54862f35-4564-4283-a544-5d732da55c7f"
"analytics": "c9988363-a9bf-4dca-96a5-a98d8566dc43"
}
}
1 change: 1 addition & 0 deletions debug.log
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[1229/164706.144:ERROR:directory_reader_win.cc(43)] FindFirstFile: El sistema no puede encontrar la ruta especificada. (0x3)
15 changes: 10 additions & 5 deletions e2e/protractor.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Protractor configuration file, see link for more information
// https://github.com/angular/protractor/blob/master/lib/config.ts

const { SpecReporter } = require('jasmine-spec-reporter');
const { SpecReporter, StacktraceOption } = require('jasmine-spec-reporter');

/**
* @type { import("protractor").Config }
Expand All @@ -13,20 +13,25 @@ exports.config = {
'./src/**/*.e2e-spec.ts'
],
capabilities: {
'browserName': 'chrome'
browserName: 'chrome'
},
directConnect: true,
SELENIUM_PROMISE_MANAGER: false,
baseUrl: 'http://localhost:4200/',
framework: 'jasmine',
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000,
print: () => {}
print: function() {}
},
onPrepare() {
require('ts-node').register({
project: require('path').join(__dirname, './tsconfig.json')
});
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
jasmine.getEnv().addReporter(new SpecReporter({
spec: {
displayStacktrace: StacktraceOption.PRETTY
}
}));
}
};
};
6 changes: 3 additions & 3 deletions e2e/src/app.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ describe('workspace-project App', () => {
page = new AppPage();
});

it('should display welcome message', () => {
page.navigateTo();
expect(page.getTitleText()).toEqual('Welcome to onepoint esign!');
it('should display welcome message', async () => {
await page.navigateTo();
expect(await page.getTitleText()).toEqual('esing app is running!');
});

afterEach(async () => {
Expand Down
8 changes: 4 additions & 4 deletions e2e/src/app.po.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { browser, by, element } from 'protractor';

export class AppPage {
navigateTo() {
return browser.get(browser.baseUrl) as Promise<any>;
async navigateTo(): Promise<unknown> {
return browser.get(browser.baseUrl);
}

getTitleText() {
return element(by.css('app-root h1')).getText() as Promise<string>;
async getTitleText(): Promise<string> {
return element(by.css('app-root .content span')).getText();
}
}
2 changes: 1 addition & 1 deletion e2e/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
"extends": "../tsconfig.json",
"compilerOptions": {
Expand All @@ -6,7 +7,6 @@
"target": "es2018",
"types": [
"jasmine",
"jasminewd2",
"node"
]
}
Expand Down
16 changes: 10 additions & 6 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,27 @@ module.exports = function (config) {
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('karma-coverage'),
require('@angular-devkit/build-angular/plugins/karma')
],
client: {
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
dir: require('path').join(__dirname, '../coverage/onepoint-esign'),
reports: ['html', 'lcovonly'],
fixWebpackSourcePaths: true
coverageReporter: {
dir: require('path').join(__dirname, './coverage/esing'),
subdir: '.',
reporters: [
{ type: 'html' },
{ type: 'text-summary' }
]
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false
singleRun: false,
restartOnFileChange: true
});
};
Loading

0 comments on commit 1b591b7

Please sign in to comment.