From 08484d31cab84337debbcc96ffed6ed0159e12c5 Mon Sep 17 00:00:00 2001 From: lotte Date: Tue, 14 Jul 2020 15:45:33 +0200 Subject: [PATCH 01/10] renamed project to dspace-angular and fixed broken tests --- .travis.yml | 2 +- angular.json | 16 +++++----- karma.conf.js | 2 +- package.json | 4 +-- .../form/process-form.component.spec.ts | 4 +-- yarn.lock | 32 +++++++++---------- 6 files changed, 30 insertions(+), 30 deletions(-) diff --git a/.travis.yml b/.travis.yml index 90d50d1b08..b3ed67f221 100644 --- a/.travis.yml +++ b/.travis.yml @@ -60,4 +60,4 @@ after_script: # After a successful build and test (see 'script'), send code coverage reports to coveralls.io # These code coverage reports are generated by the coveralls node module in our package.json after_success: - - cat coverage/dspace-angular-cli/lcov.info | ./node_modules/coveralls/bin/coveralls.js + - cat coverage/dspace-angular/lcov.info | ./node_modules/coveralls/bin/coveralls.js diff --git a/angular.json b/angular.json index 92c0f27d2b..9c55d648b3 100644 --- a/angular.json +++ b/angular.json @@ -3,7 +3,7 @@ "version": 1, "newProjectRoot": "projects", "projects": { - "dspace-angular-cli": { + "dspace-angular": { "projectType": "application", "schematics": { "@schematics/angular:component": { @@ -21,7 +21,7 @@ "path": "./webpack/webpack.common.ts", "mergeStrategies": { "loaders": "prepend" - }, + } }, "outputPath": "dist/browser", "index": "src/index.html", @@ -65,19 +65,19 @@ "serve": { "builder": "@angular-builders/custom-webpack:dev-server", "options": { - "browserTarget": "dspace-angular-cli:build", + "browserTarget": "dspace-angular:build", "port": 4000 }, "configurations": { "production": { - "browserTarget": "dspace-angular-cli:build:production" + "browserTarget": "dspace-angular:build:production" } } }, "extract-i18n": { "builder": "@angular-devkit/build-angular:extract-i18n", "options": { - "browserTarget": "dspace-angular-cli:build" + "browserTarget": "dspace-angular:build" } }, "test": { @@ -119,11 +119,11 @@ "builder": "@angular-devkit/build-angular:protractor", "options": { "protractorConfig": "e2e/protractor.conf.js", - "devServerTarget": "dspace-angular-cli:serve" + "devServerTarget": "dspace-angular:serve" }, "configurations": { "production": { - "devServerTarget": "dspace-angular-cli:serve:production" + "devServerTarget": "dspace-angular:serve:production" } } }, @@ -153,5 +153,5 @@ } } }, - "defaultProject": "dspace-angular-cli" + "defaultProject": "dspace-angular" } diff --git a/karma.conf.js b/karma.conf.js index 9844d65904..a3b6803e6d 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -17,7 +17,7 @@ module.exports = function (config) { clearContext: false // leave Jasmine Spec Runner output visible in browser }, coverageIstanbulReporter: { - dir: require('path').join(__dirname, './coverage/dspace-angular-cli'), + dir: require('path').join(__dirname, './coverage/dspace-angular'), reports: ['html', 'lcovonly', 'text-summary'], fixWebpackSourcePaths: true }, diff --git a/package.json b/package.json index 0bbf156c9d..bd52f75b4b 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "dspace-angular-cli", + "name": "dspace-angular", "version": "0.0.0", "scripts": { "ng": "ng", @@ -23,7 +23,7 @@ "build": "ng build", "build:prod": "yarn run build:ssr", "build:ssr": "yarn run build:client-and-server-bundles && yarn run compile:server", - "build:client-and-server-bundles": "node --max_old_space_size=8192 node_modules/@angular/cli/bin/ng build --prod && ng run dspace-angular-cli:server:production --bundleDependencies all", + "build:client-and-server-bundles": "node --max_old_space_size=8192 node_modules/@angular/cli/bin/ng build --prod && ng run dspace-angular:server:production --bundleDependencies all", "test:watch": "npm-run-all --parallel config:test:watch test", "test": "node --max_old_space_size=8192 node_modules/@angular/cli/bin/ng test --sourceMap=true --watch=true", "test:headless": "node --max_old_space_size=8192 node_modules/@angular/cli/bin/ng test --watch=false --sourceMap=true --browsers=ChromeHeadless --code-coverage", diff --git a/src/app/process-page/form/process-form.component.spec.ts b/src/app/process-page/form/process-form.component.spec.ts index 12326111da..95f266ed6f 100644 --- a/src/app/process-page/form/process-form.component.spec.ts +++ b/src/app/process-page/form/process-form.component.spec.ts @@ -59,8 +59,8 @@ describe('ProcessFormComponent', () => { providers: [ { provide: ScriptDataService, useValue: scriptService }, { provide: NotificationsService, useClass: NotificationsServiceStub }, - { provide: RequestService, useValue: jasmine.createSpyObj('requestService', ['removeBySubstring']) }, - { provide: Router, useValue: {} }, + { provide: RequestService, useValue: jasmine.createSpyObj('requestService', ['removeBySubstring', 'removeByHrefSubstring']) }, + { provide: Router, useValue: jasmine.createSpyObj('router', ['navigateByUrl']) }, ], schemas: [NO_ERRORS_SCHEMA] }) diff --git a/yarn.lock b/yarn.lock index 7a38500e9e..3a36e692d7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3061,16 +3061,16 @@ coverage-istanbul-loader@2.0.3: merge-source-map "^1.1.0" schema-utils "^2.6.1" -coveralls@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/coveralls/-/coveralls-3.0.0.tgz#22ef730330538080d29b8c151dc9146afde88a99" - integrity sha512-ZppXR9y5PraUOrf/DzHJY6gzNUhXYE3b9D43xEXs4QYZ7/Oe0Gy0CS+IPKWFfvQFXB3RG9QduaQUFehzSpGAFw== +coveralls@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/coveralls/-/coveralls-3.1.0.tgz#13c754d5e7a2dd8b44fe5269e21ca394fb4d615b" + integrity sha512-sHxOu2ELzW8/NC1UP5XVLbZDzO4S3VxfFye3XYCznopHy02YjNkHcj5bKaVw2O7hVaBdBjEdQGpie4II1mWhuQ== dependencies: - js-yaml "^3.6.1" - lcov-parse "^0.0.10" - log-driver "^1.2.5" - minimist "^1.2.0" - request "^2.79.0" + js-yaml "^3.13.1" + lcov-parse "^1.0.0" + log-driver "^1.2.7" + minimist "^1.2.5" + request "^2.88.2" create-ecdh@^4.0.0: version "4.0.3" @@ -5928,7 +5928,7 @@ js-tokens@^3.0.2: resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" integrity sha1-mGbfOVECEw449/mWvOtlRDIJwls= -js-yaml@^3.13.0, js-yaml@^3.13.1, js-yaml@^3.6.1: +js-yaml@^3.13.0, js-yaml@^3.13.1: version "3.13.1" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw== @@ -6169,10 +6169,10 @@ lcid@^2.0.0: dependencies: invert-kv "^2.0.0" -lcov-parse@^0.0.10: - version "0.0.10" - resolved "https://registry.yarnpkg.com/lcov-parse/-/lcov-parse-0.0.10.tgz#1b0b8ff9ac9c7889250582b70b71315d9da6d9a3" - integrity sha1-GwuP+ayceIklBYK3C3ExXZ2m2aM= +lcov-parse@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/lcov-parse/-/lcov-parse-1.0.0.tgz#eb0d46b54111ebc561acb4c408ef9363bdc8f7e0" + integrity sha1-6w1GtUER68VhrLTECO+TY73I9+A= less-loader@5.0.0: version "5.0.0" @@ -6324,7 +6324,7 @@ lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17 resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== -log-driver@^1.2.5: +log-driver@^1.2.7: version "1.2.7" resolved "https://registry.yarnpkg.com/log-driver/-/log-driver-1.2.7.tgz#63b95021f0702fedfa2c9bb0a24e7797d71871d8" integrity sha512-U7KCmLdqsGHBLeWqYlFA0V0Sl6P08EE1ZrmA9cxjUE0WVqT9qnyVDPz1kzpFEP0jdJuFnasWIfSd7fsaNXkpbg== @@ -8923,7 +8923,7 @@ repeat-string@^1.6.1: resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= -request@^2.79.0, request@^2.83.0, request@^2.87.0, request@^2.88.0: +request@^2.83.0, request@^2.87.0, request@^2.88.0, request@^2.88.2: version "2.88.2" resolved "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3" integrity sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw== From 1bfc12fe9b9defb62350da7b0a033cb398e63142 Mon Sep 17 00:00:00 2001 From: lotte Date: Tue, 14 Jul 2020 16:20:52 +0200 Subject: [PATCH 02/10] added travis_wait to yarn ci command --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b3ed67f221..02c17c3e1b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -51,7 +51,7 @@ before_script: script: # build app and run all tests - - yarn run ci + - travis_wait yarn run ci after_script: # Shutdown docker after everything runs From d558a056aabda5a718fa21465180b83523d5dd7d Mon Sep 17 00:00:00 2001 From: lotte Date: Tue, 14 Jul 2020 16:37:26 +0200 Subject: [PATCH 03/10] updates to travis scripts to prevent timeout --- .travis.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 02c17c3e1b..54b3c4752a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -51,7 +51,10 @@ before_script: script: # build app and run all tests - - travis_wait yarn run ci + - ng lint + - travis_wait yarn run build:prod + - yarn test:headless + - yarn run e2e:ci after_script: # Shutdown docker after everything runs From 1d7a9cd78b6eb69d5d774d645b7ee4ae2dbf2b64 Mon Sep 17 00:00:00 2001 From: lotte Date: Tue, 14 Jul 2020 16:39:04 +0200 Subject: [PATCH 04/10] removed unused ci script from package.json --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index bd52f75b4b..c1e5b05010 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,6 @@ "e2e:ci": "ng e2e --protractor-config=./e2e/protractor-ci.conf.js", "compile:server": "webpack --config webpack.server.config.js --progress --colors", "serve:ssr": "node dist/server", - "ci": "ng lint && yarn run build:prod && yarn test:headless && yarn run e2e:ci", "clean:coverage": "rimraf coverage", "clean:dist": "rimraf dist", "clean:doc": "rimraf doc", From 47e735270bee5f7ada7698f7e3f101b8bb9a54fa Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Tue, 14 Jul 2020 10:44:38 -0500 Subject: [PATCH 05/10] Rename master to main --- .github/pull_request_template.md | 2 +- README.md | 2 +- docker/cli.ingest.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 682f67294b..df2424fc03 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -25,4 +25,4 @@ _This checklist provides a reminder of what we are going to look for when review * Include tests for different user types (if behavior differs), including: (1) Anonymous user, (2) Logged in user (non-admin), and (3) Administrator. * Include tests for error scenarios, e.g. when errors/warnings should appear (or buttons should be disabled). * For bug fixes, include a test that reproduces the bug and proves it is fixed. For clarity, it may be useful to provide the test in a separate commit from the bug fix. -- [ ] If my PR includes new, third-party dependencies (in `package.json`), I've made sure their licenses align with the [DSpace BSD License](https://github.com/DSpace/DSpace/blob/master/LICENSE) based on the [Licensing of Contributions](https://wiki.lyrasis.org/display/DSPACE/Code+Contribution+Guidelines#CodeContributionGuidelines-LicensingofContributions) documentation. +- [ ] If my PR includes new, third-party dependencies (in `package.json`), I've made sure their licenses align with the [DSpace BSD License](https://github.com/DSpace/DSpace/blob/main/LICENSE) based on the [Licensing of Contributions](https://wiki.lyrasis.org/display/DSPACE/Code+Contribution+Guidelines#CodeContributionGuidelines-LicensingofContributions) documentation. diff --git a/README.md b/README.md index 5d8a323461..4addff3e1a 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build Status](https://travis-ci.org/DSpace/dspace-angular.svg?branch=master)](https://travis-ci.org/DSpace/dspace-angular) [![Coverage Status](https://coveralls.io/repos/github/DSpace/dspace-angular/badge.svg?branch=master)](https://coveralls.io/github/DSpace/dspace-angular?branch=master) [![Universal Angular](https://img.shields.io/badge/universal-angular2-brightgreen.svg?style=flat)](https://github.com/angular/universal) +[![Build Status](https://travis-ci.com/DSpace/dspace-angular.svg?branch=main)](https://travis-ci.com/DSpace/dspace-angular) [![Coverage Status](https://coveralls.io/repos/github/DSpace/dspace-angular/badge.svg?branch=main)](https://coveralls.io/github/DSpace/dspace-angular?branch=main) [![Universal Angular](https://img.shields.io/badge/universal-angular2-brightgreen.svg?style=flat)](https://github.com/angular/universal) dspace-angular ============== diff --git a/docker/cli.ingest.yml b/docker/cli.ingest.yml index f5ec7eb90d..3972a87d50 100644 --- a/docker/cli.ingest.yml +++ b/docker/cli.ingest.yml @@ -11,7 +11,7 @@ version: "3.7" services: dspace-cli: environment: - - AIPZIP=https://github.com/DSpace-Labs/AIP-Files/raw/master/dogAndReport.zip + - AIPZIP=https://github.com/DSpace-Labs/AIP-Files/raw/main/dogAndReport.zip - ADMIN_EMAIL=test@test.edu - AIPDIR=/tmp/aip-dir entrypoint: From 8d399fdde83557c295b2d61c8f19efb456327257 Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Tue, 14 Jul 2020 16:48:15 -0500 Subject: [PATCH 06/10] Initial issue templates Starting with just a bug report & feature request. --- .github/ISSUE_TEMPLATE/bug_report.md | 22 ++++++++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 20 ++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000000..f345922a31 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,22 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: bug +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. Include the version(s) of DSpace where you've seen this problem & what web browser you were using. Link to examples if they are public. + +**To Reproduce** +Steps to reproduce the behavior: +1. Do this +2. Then this... + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Related work** +Link to any related tickets or PRs here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000000..c6ff660e04 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest a new feature for this project +title: '' +labels: new feature +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives or workarounds you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. From eeec39bf3ff6a19b449b813aea88b0d3eb806291 Mon Sep 17 00:00:00 2001 From: Art Lowel Date: Wed, 15 Jul 2020 18:16:45 +0200 Subject: [PATCH 07/10] remove debug log --- src/app/core/auth/auth.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/core/auth/auth.service.ts b/src/app/core/auth/auth.service.ts index f45fb824ff..85e5eebb9e 100644 --- a/src/app/core/auth/auth.service.ts +++ b/src/app/core/auth/auth.service.ts @@ -206,7 +206,7 @@ export class AuthService { return this.store.pipe( select(getAuthenticatedUserId), hasValueOperator(), - switchMap((id: string) => { console.log('ID: ', id); return this.epersonService.findById(id) }), + switchMap((id: string) => this.epersonService.findById(id)), getAllSucceededRemoteDataPayload() ) } From 5088da484e41cb1ca57c4ede82fb1aad5765b483 Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Wed, 15 Jul 2020 14:53:44 -0500 Subject: [PATCH 08/10] Create pull_request_opened.yml --- .github/workflows/pull_request_opened.yml | 24 +++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/pull_request_opened.yml diff --git a/.github/workflows/pull_request_opened.yml b/.github/workflows/pull_request_opened.yml new file mode 100644 index 0000000000..20cc3cd65c --- /dev/null +++ b/.github/workflows/pull_request_opened.yml @@ -0,0 +1,24 @@ +# This workflow runs whenever a new pull request is created +name: Pull Request opened + +# Only run for newly opened PRs against the "main" branch +on: + pull_request: + types: [opened] + branches: + - main + +jobs: + automation: + runs-on: ubuntu-latest + steps: + # Assign the PR to whomever created it. This is useful for visualizing assignments on project boards + # See https://github.com/marketplace/actions/pull-request-assigner + - name: Assign PR to creator + uses: thomaseizinger/assign-pr-creator-action@v1.0.0 + # Note, this authentication token is created automatically + # See: https://docs.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + # Ignore errors. It is possible the PR was created by someone who cannot be assigned + continue-on-error: true From 2959b736325095fc1cc2f16a703f62bb2799bed0 Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Wed, 15 Jul 2020 14:56:00 -0500 Subject: [PATCH 09/10] Create issue_opened.yml --- .github/workflows/issue_opened.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/issue_opened.yml diff --git a/.github/workflows/issue_opened.yml b/.github/workflows/issue_opened.yml new file mode 100644 index 0000000000..6b9a273ab6 --- /dev/null +++ b/.github/workflows/issue_opened.yml @@ -0,0 +1,29 @@ +# This workflow runs whenever a new issue is created +name: Issue opened + +on: + issues: + types: [opened] + +jobs: + automation: + runs-on: ubuntu-latest + steps: + # Add the new issue to a project board, if it needs triage + # See https://github.com/marketplace/actions/create-project-card-action + - name: Add issue to project board + # Only add to project board if issue is flagged as "needs triage" or has no labels + # NOTE: By default we flag new issues as "needs triage" in our issue template + if: (contains(github.event.issue.labels.*.name, 'needs triage') || join(github.event.issue.labels.*.name) == '') + uses: technote-space/create-project-card-action@v1 + # Note, the authentication token below is an ORG level Secret. + # It must be created/recreated manually via a personal access token with "public_repo" and "admin:org" permissions + # See: https://docs.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token#permissions-for-the-github_token + # This is necessary because the "DSpace Backlog" project is an org level project (i.e. not repo specific) + with: + GITHUB_TOKEN: ${{ secrets.ORG_PROJECT_TOKEN }} + PROJECT: DSpace Backlog + COLUMN: Triage + CHECK_ORG_PROJECT: true + # Ignore errors + continue-on-error: true From a38df3811b887b033ab9fb3fa2df4f58e9c61361 Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Wed, 15 Jul 2020 15:10:53 -0500 Subject: [PATCH 10/10] Update issue templates --- .github/ISSUE_TEMPLATE/bug_report.md | 4 ++-- .github/ISSUE_TEMPLATE/feature_request.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index f345922a31..8e4ed0811d 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -2,13 +2,13 @@ name: Bug report about: Create a report to help us improve title: '' -labels: bug +labels: bug, needs triage assignees: '' --- **Describe the bug** -A clear and concise description of what the bug is. Include the version(s) of DSpace where you've seen this problem & what web browser you were using. Link to examples if they are public. +A clear and concise description of what the bug is. Include the version(s) of DSpace where you've seen this problem & what *web browser* you were using. Link to examples if they are public. **To Reproduce** Steps to reproduce the behavior: diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index c6ff660e04..34cc2c9e4f 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -2,7 +2,7 @@ name: Feature request about: Suggest a new feature for this project title: '' -labels: new feature +labels: new feature, needs triage assignees: '' ---