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

Commit

Permalink
Merge pull request #4213 from cloudfoundry/angular9
Browse files Browse the repository at this point in the history
Angular 9 migration
  • Loading branch information
richard-cox committed May 27, 2020
2 parents d9fb11f + f815d79 commit 5ef1e28
Show file tree
Hide file tree
Showing 63 changed files with 11,275 additions and 8,051 deletions.
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"
}
}
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
2 changes: 0 additions & 2 deletions deploy/ci/travis/run-e2e-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,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 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

0 comments on commit 5ef1e28

Please sign in to comment.