Skip to content

Commit 7bbe113

Browse files
committed
Merge branch 'develop' of github.com:Nolanus/ngx-page-scroll into develop
2 parents 8c101ff + c30b95a commit 7bbe113

File tree

16 files changed

+5160
-6479
lines changed

16 files changed

+5160
-6479
lines changed

.github/workflows/main.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: CI
2+
3+
# Controls when the action will run.
4+
on:
5+
# Trigger the workflow on push or pull request,
6+
# but only for the main branch
7+
push:
8+
9+
pull_request:
10+
branches:
11+
- main
12+
13+
# Allows you to run this workflow manually from the Actions tab
14+
workflow_dispatch:
15+
16+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
17+
jobs:
18+
# This workflow contains a single job called "build"
19+
build:
20+
# The type of runner that the job will run on
21+
runs-on: ubuntu-latest
22+
23+
# Steps represent a sequence of tasks that will be executed as part of the job
24+
steps:
25+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
26+
- uses: actions/checkout@v2
27+
with:
28+
fetch-depth: 0
29+
30+
- uses: wagoid/commitlint-github-action@v3
31+
32+
# Install Chrome Browser
33+
- name: Setup Chrome
34+
# You may pin to the exact commit or the version.
35+
# uses: browser-actions/setup-chrome@4fa655aad48f56911cad16db9252399a9e592848
36+
uses: browser-actions/setup-chrome@latest
37+
with:
38+
# The Chromium version to install and use.
39+
chrome-version: stable
40+
41+
- name: Print chrome version
42+
run: chrome --version
43+
44+
# Install NodeJS
45+
- name: Setup Node.js environment
46+
uses: actions/[email protected]
47+
48+
- name: Cache node modules
49+
uses: actions/cache@v2
50+
env:
51+
cache-name: cache-node-modules
52+
with:
53+
# npm cache files are stored in `~/.npm` on Linux/macOS
54+
path: ~/.npm
55+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
56+
restore-keys: |
57+
${{ runner.os }}-build-${{ env.cache-name }}-
58+
${{ runner.os }}-build-
59+
${{ runner.os }}-
60+
61+
# Runs npm install
62+
- name: Install dependencies
63+
run: npm install
64+
65+
- name: Lint files
66+
run: npm run lint
67+
68+
- name: Build lib
69+
run: npm run build:lib
70+
71+
- name: Run tests
72+
run: npm run test -- --watch false --browsers ChromeHeadless
73+
74+
- name: Run e2e tests
75+
run: npm run e2e -- --protractor-config='e2e/protractor.ci.conf.js'

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
### 7.0.5 (2021-06-03)
2+
3+
### Fix
4+
5+
- Peer dependency version mismatch ([#429](https://github.com/Nolanus/ngx-page-scroll/issues/429))
6+
7+
### Other
8+
9+
- Remove existing instance warning
10+
111
### 7.0.4 (2021-02-07)
212

313
### Other

README.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,12 @@
22

33
Animated scrolling functionality for angular written in pure typescript with no additional dependencies
44

5-
[![Build Status](https://travis-ci.org/Nolanus/ngx-page-scroll.svg?branch=master)](https://travis-ci.org/Nolanus/ngx-page-scroll)
5+
[![Build Status](https://github.com/Nolanus/ngx-page-scroll/actions/workflows/main.yml/badge.svg)](https://github.com/Nolanus/ngx-page-scroll/actions/workflows/main.yml)
66
[![Dependencies Status](https://david-dm.org/Nolanus/ngx-page-scroll.svg?path=projects/ngx-page-scroll)](https://david-dm.org/Nolanus/ngx-page-scroll?path=projects/ngx-page-scroll)
77
[![devDependencies Status](https://david-dm.org/Nolanus/ngx-page-scroll/dev-status.svg?path=projects/ngx-page-scroll)](https://david-dm.org/Nolanus/ngx-page-scroll?path=projects/ngx-page-scroll&type=dev)
88
[![peerDependencies Status](https://david-dm.org/Nolanus/ngx-page-scroll/peer-status.svg?path=projects/ngx-page-scroll)](https://david-dm.org/Nolanus/ngx-page-scroll?path=projects/ngx-page-scroll&type=peer)
9-
[![Greenkeeper badge](https://badges.greenkeeper.io/Nolanus/ngx-page-scroll.svg)](https://greenkeeper.io/)
10-
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/2b93ea8939824803b0807b72a8c2f5a0)](https://www.codacy.com/app/sebastian-fuss/ngx-page-scroll?utm_source=github.com&utm_medium=referral&utm_content=Nolanus/ngx-page-scroll&utm_campaign=Badge_Grade)
11-
12-
**Breaking Change**: Starting with v6 this library consists of two modules: `ngx-page-scroll-core` (the service) and `ngx-page-scroll` (the directive). [➡ How to upgrade](https://github.com/Nolanus/ngx-page-scroll/issues/88#issuecomment-456824209)
9+
[![Known Vulnerabilities](https://snyk.io/test/github/Nolanus/ngx-page-scroll/badge.svg)](https://snyk.io/test/github/Nolanus/ngx-page-scroll)
10+
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/aa10be6ea5654211bb451c6ade2f1ff6)](https://www.codacy.com/gh/Nolanus/ngx-page-scroll/dashboard?utm_source=github.com&utm_medium=referral&utm_content=Nolanus/ngx-page-scroll&utm_campaign=Badge_Grade)
1311

1412
## Features
1513

@@ -32,15 +30,16 @@ routing has finished) and in both directions (horizontal/vertical)
3230
- [Setup](#setup-1)
3331
- [Usage](#usage-1)
3432
- [Directive API](#directive-api)
35-
36-
33+
- [FAQ and common problems](#faq-and-common-problems)
34+
35+
3736
### Version compatibility
3837

3938
Install later versions in case your app is not running the very latest angular version.
4039

4140
| ngx-page-scroll/ngx-page-scroll-core version | compatible angular version | Documentation |
4241
| -------------------------------------------- | -------------------------- | -------------------------------------------------------------------------- |
43-
| v7.x | v11, v10, v9, v8 | [README](README.md) |
42+
| v7.x | v12, v11, v10, v9, v8 | [README](README.md) |
4443
| v6.x | v8, v7 | [README](https://github.com/Nolanus/ngx-page-scroll/blob/v6.0.2/README.md) |
4544
| v5.x | v6 | [README](https://github.com/Nolanus/ngx-page-scroll/blob/v5.0.1/README.md) |
4645
| v4.x | v5, v4 | [README](https://github.com/Nolanus/ngx-page-scroll/blob/v4.0.2/README.md) |
@@ -95,7 +94,6 @@ Note: The `scroll()` method is a shorthand from creating a `PageScrollInstance`
9594
relevant for performing a scroll animation) using `PageScrollService#create` and starting it using
9695
the `PageScrollService#start` method.
9796

98-
9997
### Configuration
10098

10199
When importing the `PageScrollCoreModule` one can provide option overrides:
@@ -233,6 +231,10 @@ defined in the component
233231
}
234232
```
235233

234+
## FAQ and common problems
235+
236+
Please have a look at the wiki section of the GitHub repo at [https://github.com/Nolanus/ngx-page-scroll/wiki/FAQ](https://github.com/Nolanus/ngx-page-scroll/wiki/FAQ) for frequent questions and problems.
237+
236238
## License
237239

238240
[MIT](LICENSE)

SECURITY.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Security Policy
2+
3+
## Supported Versions
4+
5+
6+
| Version | Supported |
7+
| ------- | ------------------ |
8+
| 7.0.x | :white_check_mark: |
9+
| < 7.0 | :x: |
10+
11+
## Reporting a Vulnerability
12+
13+
Please open an issue on this GitHub repo.

angular.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
"main": "src/main.ts",
2323
"polyfills": "src/polyfills.ts",
2424
"tsConfig": "tsconfig.app.json",
25-
"aot": true,
2625
"assets": [
2726
"src/favicon.ico",
2827
"src/assets"
@@ -32,7 +31,13 @@
3231
"./node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
3332
"src/styles.scss"
3433
],
35-
"scripts": []
34+
"scripts": [],
35+
"vendorChunk": true,
36+
"extractLicenses": false,
37+
"buildOptimizer": false,
38+
"sourceMap": true,
39+
"optimization": false,
40+
"namedChunks": true
3641
},
3742
"configurations": {
3843
"production": {
@@ -62,7 +67,8 @@
6267
}
6368
]
6469
}
65-
}
70+
},
71+
"defaultConfiguration": ""
6672
},
6773
"serve": {
6874
"builder": "@angular-devkit/build-angular:dev-server",

e2e/src/app.po.ts

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export abstract class AppPage {
99
return browser.get(this.getPath()) as promise.Promise<any>;
1010
}
1111

12-
scrollToElement(elm: ElementFinder): promise.Promise<{}> {
12+
scrollToElement(elm: ElementFinder): promise.Promise<unknown> {
1313
return elm.getLocation().then((loc) => {
1414
return browser.driver.executeScript('window.scrollTo(0,arguments[0]);', loc.y);
1515
});
@@ -20,15 +20,15 @@ export abstract class AppPage {
2020
}
2121

2222
protected getOffsetTop(selector: By): promise.Promise<number> {
23-
return element(selector).getAttribute('offsetTop').then((offsetTopString) => {
24-
return +offsetTopString;
25-
});
23+
return browser.driver.executeScript('return (arguments[0].offsetTop);', element(selector).getWebElement());
2624
}
2725

2826
protected getScrollTop(selector: By): promise.Promise<number> {
29-
return element(selector).getAttribute('scrollTop').then((scrollTop) => {
30-
return +scrollTop;
31-
});
27+
return browser.driver.executeScript('return (arguments[0].scrollTop);', element(selector).getWebElement());
28+
}
29+
30+
protected getScrollHeight(selector: By): promise.Promise<number> {
31+
return browser.driver.executeScript('return (arguments[0].scrollHeight);', element(selector).getWebElement());
3232
}
3333

3434
protected getVerticalPosition(selector: By): promise.Promise<number> {
@@ -46,11 +46,7 @@ export abstract class AppPage {
4646
}
4747

4848
getBodyScrollHeight(): promise.Promise<number> {
49-
const body: ElementFinder = element(by.css('body'));
50-
51-
return body.getAttribute('scrollHeight').then((bodyScrollHeightString: string) => {
52-
return +bodyScrollHeightString;
53-
});
49+
return this.getScrollHeight(by.css('body'));
5450
}
5551

5652
getWindowInnerHeight(): promise.Promise<number> {

e2e/src/namespaces.e2e-spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ describe('Namespace Feature', () => {
1212
});
1313

1414
it('should have only one scroll animation running in one namespace', () => {
15-
const trigger: ElementFinder = element(by.css('#startDefaultNamespaceScrollsButton'));
16-
1715
// Check that both containers start at the top
1816
protractor.promise.all([page.getContainer1ScrollTop(), page.getContainer2ScrollTop()]).then(
1917
([container1ScrollTop, container2ScrollTop]) => {

0 commit comments

Comments
 (0)