Skip to content
This repository has been archived by the owner on Jan 24, 2023. It is now read-only.

Angular 9 migration #4213

Merged
merged 69 commits into from
May 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
80f5de1
Remove @nrwl
nwmac Apr 1, 2020
02f0e1d
Update dependencies
nwmac Apr 1, 2020
64ea234
Update lock file
nwmac Apr 1, 2020
875c9c9
Package update
nwmac Apr 5, 2020
bae8e49
Package update
nwmac Apr 5, 2020
c262649
Angular 9 migration
nwmac Apr 6, 2020
adc0804
Fixes for angular 9 issues observed
nwmac Apr 7, 2020
ee819b7
Rebase
nwmac Apr 7, 2020
7486a8c
Use npm registry
nwmac Apr 7, 2020
574a7de
Fix package lock
nwmac Apr 7, 2020
0c1b43a
Fix front-end unit test
nwmac Apr 7, 2020
354aa08
E2E test fix
nwmac Apr 9, 2020
77628e8
Fix mat-select option selection for e2e tests
nwmac Apr 10, 2020
0efa6dc
Fix git ignore with secrets.yaml
nwmac Apr 10, 2020
da8a57d
Update angular to fix prod build issue
nwmac Apr 10, 2020
2a8457a
Fix routing event change
nwmac Apr 12, 2020
a5cfd7a
Fix autoscaler issue with the mat-select fill
nwmac Apr 16, 2020
f4f7ee7
Merge remote-tracking branch 'origin/master' into angular9
nwmac Apr 16, 2020
0821dac
Bump rxjs-tslint
nwmac Apr 16, 2020
7d62b61
Update to 9.1.2
nwmac Apr 17, 2020
0d64630
Fix frontend unit tests
nwmac May 1, 2020
367490b
Merge remote-tracking branch 'origin/master' into angular9
nwmac May 1, 2020
c92dcac
Fix angular 9 issue
nwmac May 1, 2020
a4ad722
Add deep link warnings on ajsf
nwmac May 1, 2020
3302f87
Update to Angular 9.1.6
nwmac May 11, 2020
4d22033
Merge remote-tracking branch 'origin/master' into angular9
nwmac May 15, 2020
7e2a4bb
Merge remote-tracking branch 'origin/master' into angular9
nwmac May 18, 2020
95069b9
Review fixes
nwmac May 18, 2020
d1e8abd
Increase node max old space size
nwmac May 18, 2020
8078842
Fix Autoscaler material imports for Angular 9
nwmac May 18, 2020
476d46b
Remove checked on radio buttons as well as value
nwmac May 18, 2020
4f9670e
Merge remote-tracking branch 'origin/master' into angular9
nwmac May 18, 2020
29cc80e
Autoscaler E2E Test debugging
nwmac May 19, 2020
d0f4ac4
Autoscaler E2E Test debugging
nwmac May 19, 2020
49ab381
Just run autoscaler tests
nwmac May 19, 2020
ff25955
Fix autoscaler events page
richard-cox May 19, 2020
c665f4a
Remove debugging
nwmac May 19, 2020
8d4e4a0
Fix typing
richard-cox May 19, 2020
0edc4f8
Merge remote-tracking branch 'origin/fix-autoscaler-events' into angu…
nwmac May 19, 2020
8f1a701
Merge remote-tracking branch 'origin/master' into angular9
nwmac May 20, 2020
440d6b3
Merge remote-tracking branch 'origin/autoscaler-e2e' into angular9
nwmac May 20, 2020
1f8c2e9
Retry
nwmac May 20, 2020
9a82fb7
Just run autoscaler tests
nwmac May 20, 2020
c3a0bf3
Travis file update
nwmac May 20, 2020
de64488
Merge remote-tracking branch 'origin/master' into angular9
nwmac May 20, 2020
066c670
Fix merge issues with cf code re-ogr
nwmac May 20, 2020
7082907
Fix retry for create session
nwmac May 20, 2020
2c798db
Tidy up debugging
nwmac May 20, 2020
e02b8fc
Fix retry message
nwmac May 20, 2020
55cd589
Docker image tweak
nwmac May 20, 2020
5859848
Fix retry mechanism
nwmac May 20, 2020
400e05f
Implement retry on all api calls
nwmac May 20, 2020
5f4caa7
Fix retry mechanism
nwmac May 20, 2020
4b4db2a
Fix ertry when 401
nwmac May 20, 2020
7cea7c0
Update .travis.yml
nwmac May 20, 2020
5992893
Tweak logging
nwmac May 21, 2020
7f40aba
Add console logging during e2e tests
nwmac May 21, 2020
86b8dd8
Extend setup timeout
nwmac May 21, 2020
04ac0b9
Bump timeout, run UAA ealier
nwmac May 21, 2020
1b4df49
Enable e2e logging to be toggled by a label
nwmac May 21, 2020
0a2b4d1
Ensure we don't log passwords in e2e logs
nwmac May 21, 2020
566418e
Give more time for the tab to appear
nwmac May 21, 2020
7f0af9c
Merge remote-tracking branch 'origin/e2e-logging-label' into angular9
nwmac May 21, 2020
5dd26c9
FIx issue with Angular build optimizer
nwmac May 21, 2020
ee99293
Fix for autoscaler tab not appearing
nwmac May 22, 2020
73c60c3
Update extensions docs
nwmac May 22, 2020
8cd73fd
Fix examples to ensure extensions are declared
nwmac May 22, 2020
3be83a6
Fix load of boolean indicator result when type has not yet been set
richard-cox May 26, 2020
f815d79
Remove uneeded imports
richard-cox May 26, 2020
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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ src/backend/*/vendor/
.v8flags*

*.bak
./secrets.yaml
/secrets.yaml
build/dev_config.json
e2e-reports/
.stratos-git-metadata.json
Expand Down
39 changes: 34 additions & 5 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"aot": true,
"preserveSymlinks": true,
"outputPath": "dist",
"index": "src/frontend/packages/core/src/index.html",
Expand All @@ -35,6 +36,12 @@
},
"configurations": {
"production": {
"budgets": [
{
"type": "anyComponentStyle",
"maximumWarning": "6kb"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
Expand Down Expand Up @@ -101,6 +108,7 @@
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"aot": true,
"preserveSymlinks": true,
"outputPath": "dist/core",
"index": "src/frontend/packages/core/src/index.html",
Expand All @@ -124,6 +132,12 @@
},
"configurations": {
"production": {
"budgets": [
{
"type": "anyComponentStyle",
"maximumWarning": "6kb"
}
],
"fileReplacements": [
{
"replace": "src/frontend/packages/core/src/environments/environment.ts",
Expand Down Expand Up @@ -216,7 +230,12 @@
"tsConfig": "src/frontend/packages/store/tsconfig.lib.json",
"project": "src/frontend/packages/store/ng-package.json"
}
},
, "configurations": {
"production": {
"tsConfig": "src/frontend/packages/store/tsconfig.lib.prod.json"
}
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
Expand Down Expand Up @@ -254,7 +273,12 @@
"tsConfig": "src/frontend/packages/cloud-foundry/tsconfig.lib.json",
"project": "src/frontend/packages/cloud-foundry/ng-package.json"
}
},
, "configurations": {
"production": {
"tsConfig": "src/frontend/packages/cloud-foundry/tsconfig.lib.prod.json"
}
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
Expand Down Expand Up @@ -292,7 +316,12 @@
"tsConfig": "src/frontend/packages/cf-autoscaler/tsconfig.lib.json",
"project": "src/frontend/packages/cf-autoscaler/ng-package.json"
}
},
, "configurations": {
"production": {
"tsConfig": "src/frontend/packages/cf-autoscaler/tsconfig.lib.prod.json"
}
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
Expand Down Expand Up @@ -323,13 +352,13 @@
"schematics": {
"@schematics/angular:component": {
"prefix": "app",
"styleext": "scss"
"style": "scss"
},
"@schematics/angular:directive": {
"prefix": "app"
}
},
"cli": {
"defaultCollection": "@nrwl/angular"
"_defaultCollection": "@nrwl/angular"
}
}
12 changes: 12 additions & 0 deletions deploy/ci/travis/check-e2e-pr.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

if [ -n "${TRAVIS_PULL_REQUEST}" ]; then
if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then
echo "Checking labels on ${TRAVIS_PULL_REQUEST_SLUG} #${TRAVIS_PULL_REQUEST}"
LABEL=$(curl -s "https://api.github.com/repos/${TRAVIS_PULL_REQUEST_SLUG}/pulls/${TRAVIS_PULL_REQUEST}" | jq -r '.labels[] | select(.name == "e2e-debug") | .name')
if [ "${LABEL}" == "e2e-debug" ]; then
echo "PR has the 'e2e-debug' label - enabling debug logging for E2E tests"
export STRATOS_E2E_DEBUG=true
fi
fi
fi
8 changes: 5 additions & 3 deletions deploy/ci/travis/e2e-build-script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ LOCAL_BUILD="true"
# TRAVIS_COMMIT

if [ -z "$TRAVIS_REPO_SLUG" ]; then
echo "Need to be running in Trvis"
echo "Need to be running in Travis"
exit 1
fi

if [ -z "$TRAVIS_COMMIT" ]; then
echo "Need to be running in Trvis"
echo "Need to be running in Travis"
exit 1
fi

Expand All @@ -40,9 +40,11 @@ function tryGetExistingBuild() {
if [ $? -eq 0 ]; then
# We found an existing build, so download and unpack it
echo "Downloading build package"
tar -xvf ${GZIP_NAME}
tar -xvf ${GZIP_NAME} > /dev/null
if [ $? -eq 0 ]; then
LOCAL_BUILD="false"
else
echo "Failed to untar the build package"
fi
rm -rf ${GZIP_NAME}
fi
Expand Down
3 changes: 3 additions & 0 deletions deploy/ci/travis/job-e2e-before_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ if [ "${MAILCATCHER}" == "true" ]; then
docker run -d -p 1080:80 -p 1025:25 --name mail tophfr/mailcatcher
fi

# Start a local UAA - this will take a few seconds to come up in the background
docker run -d -p 8080:8080 splatform/stratos-uaa

# Check that the S3 server is available
curl -k --max-time 20 ${AWS_ENDPOINT}
if [ $? -ne 0 ]; then
Expand Down
7 changes: 5 additions & 2 deletions deploy/ci/travis/run-e2e-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ set -e
echo "Stratos e2e tests"
echo "================="

DIRPATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && cd ../../.. && pwd)"

echo "Checking docker version"

docker version
Expand Down Expand Up @@ -40,8 +42,6 @@ fi

echo "Using local deployment for e2e tests"
# Quick deploy locally
# Start a local UAA - this will take a few seconds to come up in the background
docker run -d -p 8080:8080 splatform/stratos-uaa

# Build if needed or use existing build for this commit
DIRNAME="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
Expand All @@ -64,6 +64,9 @@ export STRATOS_E2E_BASE_URL="https://127.0.0.1:5443"

E2E_TARGET="e2e -- --no-webdriver-update --dev-server-target= --base-url=https://127.0.0.1:5443 --suite=${SUITE}"

# Set Stratos debug if running a PR with the appropriate label
source "${DIRPATH}/deploy/ci/travis/check-e2e-pr.sh"

# Capture video if configured
if [ "$CAPTURE_VIDEO" == "video" ]; then
echo "Waiting for ffmpeg install to complete..."
Expand Down
30 changes: 23 additions & 7 deletions docs/extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,20 @@ For example:
The approach for all of these is the same:

1. Create a new component that will provide the tab contents
2. Ensure that your component is included in the `EntryComponent` section of your custom module
2. Ensure that your component is declared with the `ExtensionService` in the imports of your custom module, for example:
```
@NgModule({
imports: [
ExtensionService.declare([
ExtensionComponent,
])
],
declarations: [
ExtensionComponent
]
})
```

2. Decorate the component with the `StratosTab` decorator, for example:

```
Expand Down Expand Up @@ -122,8 +135,8 @@ An action is a icon button that appears at the top-right of a View. For example:
The approach for all of these is the same:

1. Create a new component that will provide the contents to show when the action is clicked
2. Ensure that your component is included in the `EntryComponent` section of your custom module
2. Decorate the component with the `StratosAction` decorator, for example:
2. Ensure that your component is declared with the `ExtensionService` in the imports of your custom module
3. Decorate the component with the `StratosAction` decorator, for example:

```
@StratosAction({
Expand Down Expand Up @@ -243,16 +256,19 @@ export class ExampleTabExtensionComponent implements OnInit {
Save the file.


### Mark the component as an entry component
### Mark the component as an extensions component

The last thing we need to do is to mark our Extension component as an entry component.
The last thing we need to do is to mark our Extension component as an extensions component.

To do this, in a text editor, open the file `src/frontend/app/custom/custom.module.ts` and add the entry components section so it looks like this:
To do this, in a text editor, open the file `src/frontend/app/custom/custom.module.ts` and add the `ExtensionService.declare` to the import sesion, so it looks like this:

```
@NgModule({
imports: [
CommonModule
CommonModule,
ExtensionService.declare([
ExampleTabExtensionComponent,
])
],
declarations: [ExampleTabExtensionComponent],
entryComponents: [ExampleTabExtensionComponent]
Expand Down
5 changes: 5 additions & 0 deletions examples/custom-src/frontend/app/custom/custom.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { AcmeLoginComponent } from './acme-login/acme-login.component';
import { AcmeSupportInfoComponent } from './acme-support-info/acme-support-info.component';
import { AppActionExtensionComponent } from './app-action-extension/app-action-extension.component';
import { AppTabExtensionComponent } from './app-tab-extension/app-tab-extension.component';
import { ExtensionService } from '../core/extension/extension-service';

const AcmeCustomizations: CustomizationsMetadata = {
copyright: '© 2018 ACME Corp',
Expand All @@ -20,6 +21,10 @@ const AcmeCustomizations: CustomizationsMetadata = {
CoreModule,
SharedModule,
MDAppModule,
ExtensionService.declare([
AppTabExtensionComponent,
AppActionExtensionComponent,
])
],
declarations: [
AcmeLoginComponent,
Expand Down
16 changes: 16 additions & 0 deletions ngcc.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Ignore the deep import warnings on the AJSF library
module.exports = {
packages: {
'@cfstratos/ajsf-core': {
ignorableDeepImportMatchers: [
/lodash\//,
/json-schema-draft-06.json$/,
]
},
'@cfstratos/ajsf-material': {
ignorableDeepImportMatchers: [
/lodash\//,
]
},
},
};
Loading