Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge into master branch #364

Open
wants to merge 60 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
ec30de9
Multiple improvements
Senyoret1 Jul 10, 2019
ef490c3
Small fix for the search bar
Senyoret1 Jul 11, 2019
357ef07
Update README.md
gz-c Jul 12, 2019
46a1003
Use the singular form of the coin hours name when appropriate
Senyoret1 Jul 17, 2019
9f7f402
Merge branch 'develop' into improvements
gz-c Jul 26, 2019
4388d8a
Merge pull request #305 from Senyoret1/improvements
gz-c Jul 26, 2019
e192bee
Solve the travis build problem
Senyoret1 Aug 5, 2019
ebfb42a
Improve the code that calculates pending coins and hours
Senyoret1 Aug 5, 2019
338434d
Improve the code and add comments
Senyoret1 Aug 9, 2019
d7fa4e3
Fix small code error
Senyoret1 Aug 9, 2019
46fa6ca
Improve the code and add comments p2
Senyoret1 Aug 10, 2019
2a61abf
Remove unused assets
Senyoret1 Aug 11, 2019
f7721c9
Improve AmountPipe
Senyoret1 Aug 11, 2019
9df0742
Improve the documentation
Senyoret1 Aug 11, 2019
c2b73e6
Improvements for the scss classes
Senyoret1 Aug 12, 2019
95ec9ae
Update to Angular 8
Senyoret1 Aug 17, 2019
8a8aee4
Updaste the Spanish translation
Senyoret1 Aug 17, 2019
3e1058e
Update the Node.js version used by Travis
Senyoret1 Aug 17, 2019
5fc9037
Update the docs for Angular 8
Senyoret1 Aug 17, 2019
bce7925
Merge pull request #307 from Senyoret1/improvements-2
gz-c Aug 22, 2019
a19370b
Rename to skycoin.com
iketheadore Aug 29, 2019
0160204
Remove merch.skycoin.com
iketheadore Feb 3, 2020
7b629a6
Update protractor to fix the incompatible webdriver and chrome
iketheadore Feb 3, 2020
11e26a4
Use chrome: stable
iketheadore Feb 3, 2020
41dc6e0
Merge pull request #7 from iketheadore/fix/remove-merch
iketheadore Feb 3, 2020
adcc0da
Bump js-yaml from 3.12.0 to 3.13.1
dependabot[bot] Feb 3, 2020
2d4d268
Merge pull request #10 from SkycoinProject/dependabot/npm_and_yarn/js…
iketheadore Feb 18, 2020
3da741f
Use /api/v2/transactions to get transactions for addresses
Senyoret1 Feb 23, 2020
0bf3e6a
Remove hook for docker building
iketheadore Feb 25, 2020
cee9ac1
Merge pull request #12 from iketheadore/fix/remove-docker-hook
iketheadore Feb 25, 2020
ef0d71b
Add dockerignore
iketheadore Feb 25, 2020
87dff36
Merge pull request #13 from iketheadore/fix/add-docker-ignore
iketheadore Feb 25, 2020
13f39df
Merge pull request #11 from Senyoret1/pagination
iketheadore Feb 25, 2020
29522f9
Format explorer.go to fix lint error
iketheadore Feb 26, 2020
08a9773
Add pull requet template
iketheadore Feb 26, 2020
8509420
Merge pull request #14 from iketheadore/fix/go-format
iketheadore Feb 26, 2020
a7d59ab
Update to Angular 9
Senyoret1 Apr 18, 2020
f6e20f6
Improve how the current balance is displayed
Senyoret1 Apr 18, 2020
71785c8
Fix the e2e tests and a small bug
Senyoret1 Apr 19, 2020
c9c65f4
Update to Angular 10
Senyoret1 Aug 3, 2020
cecd28c
Improvements for the explorer
Senyoret1 Oct 25, 2020
24cfa19
Fix e2e tests
Senyoret1 Oct 25, 2020
b7ce592
Update Snyk
Senyoret1 Oct 25, 2020
61206c7
Remove unused test files
Senyoret1 Oct 25, 2020
aba0f07
Improvements for using a local node directly
Senyoret1 Nov 3, 2020
dd2bb91
Add node-sass as dependency
Senyoret1 Dec 25, 2020
e9120a1
Update to Angular 11
Senyoret1 Jan 13, 2021
129a064
Rename org skyconproject to skycoin
iketheadore Mar 6, 2021
7e7e93a
Merge pull request #345 from iketheadore/develop
SkycoinSynth Mar 6, 2021
92aa4ad
Fix docker image build error
iketheadore Mar 7, 2021
72b20e7
Merge pull request #352 from iketheadore/fix/dockerfile
SkycoinSynth Mar 7, 2021
ebc10ca
Fix Travis build
Senyoret1 Mar 7, 2021
e357ca5
Merge pull request #354 from Senyoret1/travis-b
iketheadore Mar 9, 2021
e333c3a
Merge remote-tracking branch 'upstream/develop' into balance
Senyoret1 Mar 9, 2021
065646f
Merge remote-tracking branch 'upstream/develop' into improvements-v10
Senyoret1 Mar 9, 2021
14b38a9
Fix problems with dependencies
Senyoret1 Mar 11, 2021
ebebea9
Merge pull request #351 from Senyoret1/improvements-v10
iketheadore May 2, 2021
d7dec51
Merge remote-tracking branch 'upstream/develop' into balance
Senyoret1 May 3, 2021
c2df581
Merge pull request #350 from Senyoret1/balance
iketheadore May 4, 2021
b8be1b3
Merge branch 'develop'
iketheadore May 4, 2021
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
12 changes: 12 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries

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

> 0.5%
last 2 versions
Firefox ESR
not dead
not IE 9-11 # For IE 9-11 support, remove 'not'.
21 changes: 21 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.DS_Store
.DS_Store?
._*
.Trashes
.vscode
.github
.dockerignore
.editorconfig
.gitignore
.travis.yml

*.md

Makefile
Gopkg.lock
Gopkg.toml

**/doc_images/*
**/e2e/*
**/node_modules/*
**/dist/*
6 changes: 6 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Fixes #

Changes:
-

Does this change need to mentioned in CHANGELOG.md?
43 changes: 21 additions & 22 deletions .snyk
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
# Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities.
version: v1.13.3
version: v1.14.1
# ignores vulnerabilities until expiry date; change duration by modifying expiry date
ignore:
'npm:shelljs:20140723':
- '*':
reason: No fix available - Dev dependency
expires: 2019-12-31T00:00:00.000Z
# patches apply the minimum changes required to fix a vulnerability
patch:
'npm:debug:20170905':
- karma > socket.io > socket.io-adapter > socket.io-parser > debug:
patched: '2018-04-18T04:53:49.215Z'
- karma > log4js > mailgun-js > debug:
patched: '2018-05-04T03:41:07.077Z'
'npm:ms:20170412':
- karma > socket.io > socket.io-adapter > socket.io-parser > debug > ms: null
- karma > log4js > mailgun-js > debug > ms:
patched: '2018-05-04T03:41:07.077Z'
'npm:tunnel-agent:20170305':
- karma > log4js > loggly > request > tunnel-agent:
patched: '2018-06-26T08:10:05.074Z'
- '@angular-devkit/build-angular > node-sass > request > tunnel-agent':
patched: '2018-06-26T08:10:05.074Z'
patched: '2018-04-18T04:53:49.215Z'
SNYK-JS-ADMZIP-1065796:
- protractor > webdriver-manager > adm-zip:
reason: Dev dependency - No upgrade available
expires: '2021-12-31'
SNYK-JS-ANGULARCORE-1070902:
- codelyzer > @angular/core:
reason: Dev dependency - No upgrade available
expires: '2021-12-31'
SNYK-JS-GLOBPARENT-1016905:
- '@angular-devkit/build-angular > webpack-dev-server > chokidar > glob-parent':
reason: Dev dependency - No upgrade available
expires: '2021-12-31'
- '@angular-devkit/build-angular > webpack > watchpack > watchpack-chokidar2 > chokidar > glob-parent':
reason: Dev dependency - No upgrade available
expires: '2021-12-31'
'npm:jasmine-core:20180216':
- protractor > jasmine > jasmine-core:
reason: Dev dependency - No upgrade available
expires: '2021-12-31'
patch: {}
8 changes: 2 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,10 @@ services:
- docker

addons:
apt:
sources:
- google-chrome
packages:
- google-chrome-stable
chrome: stable

before_install:
- nvm install 8.9
- nvm install 10.16

install:
- go get -t ./...
Expand Down
22 changes: 18 additions & 4 deletions CUSTOMIZATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,27 @@

The explorer is designed in such a way that it is possible to make simple customizations with relative ease.

## Page title

To change the page title (the one shown in the browser tab), simply change the content of the `<title>` tag in [index.html](src/index.html).

## Favicon

The favicon file is [favicon.ico](src/favicon.ico), so you can change the favicon by replacing that file. You can also change the content of the `<link>` tag used for setting the favicon in [index.html](src/index.html).

## Basic identifiers

The explorer automatically tries to obtain from the node the name of the coins and hours. If, for example, the explorer is connected to a Skycoin node, it will automatically get the "SKY" name from the node and use it to identify the amounts of coins.

However, because old versions of the node do not return that information, you should add the coin identifiers in the `CoinIdentifiers` object inside the [app.config.ts](src/app/app.config.ts) file.

## QR codes

To simplify copying addresses with mobile devices, the explorer shows qr codes. The qr codes contain the addresses prefixed with the name of the coin, in this way: `skycoin:abcd...` (More information in this link: https://github.com/bitcoin/bips/blob/master/bip-0021.mediawiki). If needed, the `skycoin:` prefix can be changed by modifying the value of `QrConfig.prefix`, inside [app.config.ts](src/app/app.config.ts).

## Search functionality

The explorer is integrated with the browser's search functionality. This means that the user can search for elements of the blockchain directly from the search functionality of the browser. For this to work properly, you must modify the [search.xml](src/search.xml) file. Simply replace the `https://explorer.skycoin.net/` prefix of all URLs with the URL where the browser will reside (it is not necessary to replace the text that may be to the right of that prefix). Also, replace the `ShortName` and `Description` as deemed necessary.
The explorer is integrated with the browser's search functionality. This means that the user can search for elements of the blockchain directly from the search functionality of the browser. For this to work properly, you must modify the [search.xml](src/search.xml) file. Simply replace the `https://explorer.skycoin.com/` prefix of all URLs with the URL where the browser will reside (it is not necessary to replace the text that may be to the right of that prefix). Also, replace the `ShortName` and `Description` as deemed necessary.

You can find more information about the file format in [opensearch-1-1-draft-6.md](https://github.com/dewitt/opensearch/blob/master/opensearch-1-1-draft-6.md)

Expand All @@ -28,7 +42,7 @@ The generic header may be activated simply by opening [app.config.ts](src/app/ap

The "website" link opens the URL specified in `HeaderConfig.genericHeaderUrl`, inside [app.config.ts](src/app/app.config.ts).

The logo may be modified by replacing the [HeaderComponent]((src/assets/img/logo.png) file. In case of modifying the logo, it is important to keep in mind that the new image should be less than 110px high and 220px wide.
The logo may be modified by replacing the [logo.png]((src/assets/img/logo.png) file. In case of modifying the logo, it is important to keep in mind that the new image should be less than 110px high and 220px wide.

The header colors may be modified by changing the values of `$col-generic-header-background`, `$col-generic-header-text` and `$col-generic-header-border`, in [_variables.scss](src/assets/scss/_variables.scss). For example, consider the following values:
```
Expand Down Expand Up @@ -71,7 +85,7 @@ Although it may seem that the second parameter is complicated to configure, its

![GitHub Logo](/doc_images/code.png)

Taking all this into account, it is possible to add a link to a Twitter account simply by adding and element like the following one to the `FooterConfig.contactLinks` array:
Taking all this into account, it is possible to add a link to a Twitter account simply by adding an element like the following one to the `FooterConfig.contactLinks` array:
```
{
url: "https://twitter.com/skycoinproject",
Expand All @@ -89,4 +103,4 @@ $col-generic-footer-middle-border: orange;
```
The previous values generate the following style:

![GitHub Logo](/doc_images/footer2.png)
![GitHub Logo](/doc_images/footer2.png)
118 changes: 118 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
# Development

The explorer is divided in 2 parts: the server and the frontend. This file has general development information about both parts.

# Table of Contents

<!-- MarkdownTOC levels="1,2,3,4,5" autolink="true" bracket="round" -->

- [Server](#Server)
- [Server file structure](#server-file-structure)
- [Formatting](#formatting)
- [Frontend](#frontend)
- [Frontend file structure](#frontend-file-structure)
- [Integration with the browser's search functionality](#integration-with-the-browser's-search-functionality)
- [Page reuse strategy](#page-reuse-strategy)
- [General configuration and customization](#general-configuration-and-customization)
- [Translations](#translations)
- [Dependence with the server](#dependence-with-the-server)
- [How to start the Angular dev server](#how-to-start-the-angular-dev-server)
- [Compiling the frontend](#compiling-the-frontend)
- [Code linting](#code-linting)
- [e2e Tests](#e2e-Tests)

<!-- /MarkdownTOC -->

## Server

The server is a small program written in Go (Golang) which two functions: serve the contents of the `/dist` folder (the compiled frontend) in [http://127.0.0.1:8001](http://127.0.0.1:8001) and provide an API for getting data from the blockchain. The API provided by the server is just a proxy that gets the data from a Skycoin node.

### Server file structure

The server has only one code file: [explorer.go](explorer.go).

The dependencies have been vendored with `dep`.

### Formatting

`explorer.go` should be formatted with `goimports`. You can do this with:

```sh
make format
```

You must have goimports installed (use `make install-linters`).

## Frontend

The frontend is an Angular application that can be viewed in a web browser. I currently uses Angular 8.

### Frontend file structure

The frontend code is inside the [src](src) folder and it follows the normal structure of an Angular project.

You can find the components, pipes and services (most of the code) in in the [src/app](src/app) folder. Resource files are in [src/assets](src/assets) and the JS libs/tools that were not included with NPM are in [src/js](src/js).

You can find the code of the e2e tests in the [e2e](e2e) folder. The unit tests are currently not being used.

### Integration with the browser's search functionality

The explorer is integrated with the browser's search functionality. This means that the user can search for elements of the blockchain directly from the search bar of the browser. The initial configuration is done in [src/environments/environment.ts](src/environments/environment.ts) (development builds) and [src/environments/environment.ts](src/environments/environment.ts) (production builds). The configuration files are [src/search.dev.xml](src/search.dev.xmll) (development builds) and [src/search.xml](src/search.xml) (production builds).

You can find more information about the format of the configuration files in [opensearch-1-1-draft-6.md](https://github.com/dewitt/opensearch/blob/master/opensearch-1-1-draft-6.md)

### Page reuse strategy

This app has a custom `RouteReuseStrategy` that makes the navigator reuse only the page with information about an address. This means that when changing to a URL (even if only the params were changed), Angular destroys and recreates the page component (custom behavior), except in some cases when navigating to `AddressDetailComponent` (normal Angular behavior).

You can find the custom `RouteReuseStrategy` in [src/app/app.reuse-strategy.ts](src/app/app.reuse-strategy.ts).

### General configuration and customization

The general configuration settings are in [src/app/app.config.ts](src/app/app.config.ts). You can find much more information in [CUSTOMIZATION.md](CUSTOMIZATION.md).

### Translations

You can find information about how to work with translation files in the [Translations README](/src/assets/i18n/README.md).

### Dependence with the server

The frontend needs the Go server for getting the data. The frontend will not normally work well if it is not opened with the Go server or the Angular dev server. This is due to how the connections are made in [src/app/services/api/api.service.ts](src/app/services/api/api.service.ts).

### How to start the Angular dev server

As it's very inconvenient having to build the frontend evey time a change is made, to be able to see it, you can run the frontend using a development server, which shows the changes every time a file is modified. To do so, simply run `npm start` in the root of the repository. After the development server is started, you can access the frontend via [http://localhost:4200](http://localhost:4200).

NOTE: when using the development server you still need to run the Go server and a Skycoin node for the frontend to work.

### Compiling the frontend

To create a production build of the frontend, run:
```sh
make build-ng
```

### Code linting

The code must pass the linting process. To test the code, run:
```sh
npm run lint
```

### e2e Tests

Note: before running the e2e tests you must compile the frontend and run the server. The e2e testing process will use the compiled frontend, so if you forget to run the compilation process your lastest changes will be ignored.

If you are running a Skycoin node normally, you can run the e2e tests with:

```sh
npm run e2e
```

If you are running a Skycoin node using the test database (`blockchain-180.db`), you can run the e2e tests with:

```sh
npm run e2e-blockchain-180
```

The second method is the one used in Travis.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ check-ui: ## runs e2e tests connecting to a containerized node
docker volume create skycoin-data
docker volume create skycoin-wallet
chmod 777 $(PWD)/e2e/test-fixtures/blockchain-180.db

docker run -d --rm \
-v skycoin-data:/data \
-v skycoin-wallet:/wallet \
Expand Down
Loading