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

Commit

Permalink
Merge remote-tracking branch 'origin/master' into customization-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-cox committed Aug 7, 2020
2 parents 993a137 + d7102e7 commit 1de99e3
Show file tree
Hide file tree
Showing 18 changed files with 279 additions and 312 deletions.
1 change: 1 addition & 0 deletions .cfignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ deploy/uaa/
docs/
build/dev_config.json
e2e-reports/
website/
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,4 @@ go-vendor-*.tgz

website/build
website/site-dist
website/.docusaurus
website/.docusaurus
71 changes: 71 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,76 @@
# Change Log

## 4.0.0

[Full Changelog](https://github.com/cloudfoundry/stratos/compare/3.2.1...4.0.0)

This release contains a number of fixes and improvements:

**Improvements:**

- Extensions: Allow typed access to store entities and their actions [\#4494](https://github.com/cloudfoundry/stratos/issues/4494)
- Extensions: Remove the need for symlinks and improve the build process [\#4472](https://github.com/cloudfoundry/stratos/issues/4472)
- Extensions: Allow Themes to be published and installed to/from npm [\#4471](https://github.com/cloudfoundry/stratos/issues/4471)
- Extensions: Move to extensions and themes to be packages [\#4470](https://github.com/cloudfoundry/stratos/issues/4470)
- Show service broker space scope information in service wall list [\#4458](https://github.com/cloudfoundry/stratos/issues/4458)
- Client Secret is shown in the clear in the UI [\#4445](https://github.com/cloudfoundry/stratos/issues/4445)
- Improve sizing of UI elements on desktop browsers [\#4419](https://github.com/cloudfoundry/stratos/issues/4419)
- Theming: Allow more control over link and side navigation colors [\#4406](https://github.com/cloudfoundry/stratos/issues/4406)
- Update to latest set of icons [\#4403](https://github.com/cloudfoundry/stratos/issues/4403)
- Theming: Allow more control over page header colors and style [\#4396](https://github.com/cloudfoundry/stratos/issues/4396)
- Helm Chart: Remove encryption volume [\#4351](https://github.com/cloudfoundry/stratos/issues/4351)
- Improve app summary responsiveness [\#4348](https://github.com/cloudfoundry/stratos/issues/4348)
- Improve UI for the case when we can't determine cf app deployment info [\#4347](https://github.com/cloudfoundry/stratos/issues/4347)
- Change recent activity icon to avoid confusion with the refresh button [\#4346](https://github.com/cloudfoundry/stratos/issues/4346)
- Helm Chart: Change default image pull policy to Always [\#4342](https://github.com/cloudfoundry/stratos/issues/4342)
- Permissions: Org Managers: Disable org role checkboxes in roles stepper if not admin/org manager [\#4332](https://github.com/cloudfoundry/stratos/issues/4332)
- Autoscaler: Add support for custom metrics [\#4298](https://github.com/cloudfoundry/stratos/issues/4298)
- Add support for copying endpoint address in list view [\#4238](https://github.com/cloudfoundry/stratos/issues/4238)
- Update to Angular 9 framework [\#4214](https://github.com/cloudfoundry/stratos/issues/4214)
- Update docker logo in deploy app stepper [\#4133](https://github.com/cloudfoundry/stratos/issues/4133)
- Helm Chart: Remove need for --recreate-pods when upgrading [\#4132](https://github.com/cloudfoundry/stratos/issues/4132)
- Make permissions model extension friendly [\#3789](https://github.com/cloudfoundry/stratos/issues/3789)
- User Favourites: Add icons to cards [\#3409](https://github.com/cloudfoundry/stratos/issues/3409)
- Improve log out experience [\#2587](https://github.com/cloudfoundry/stratos/issues/2587)

**Fixes:**

- Ensure `cf push` works from Windows [\#4465](https://github.com/cloudfoundry/stratos/issues/4465)
- SSLMode is not respected for database connections [\#4434](https://github.com/cloudfoundry/stratos/issues/4434)
- Visiting marketplace tab breaks service list [\#4397](https://github.com/cloudfoundry/stratos/issues/4397)
- CF Application reports error after restage [\#4392](https://github.com/cloudfoundry/stratos/issues/4392)
- Helm Chart: Icon is missing [\#4370](https://github.com/cloudfoundry/stratos/issues/4370)
- Permissions: Users with no developer roles can click on create app button [\#4361](https://github.com/cloudfoundry/stratos/issues/4361)
- Edit endpoint not available in table view [\#4349](https://github.com/cloudfoundry/stratos/issues/4349)
- CF: Routes List: Filter by org breaks when user is an org auditor [\#4343](https://github.com/cloudfoundry/stratos/issues/4343)
- Permissions: Only space developers should be able to see add service instance buttons [\#4331](https://github.com/cloudfoundry/stratos/issues/4331)
- Permissions: Only Space Developers should be able to change count, terminate or ssh to instances [\#4330](https://github.com/cloudfoundry/stratos/issues/4330)
- App: Gitlab Tab: Fix console errors [\#4325](https://github.com/cloudfoundry/stratos/issues/4325)
- Permissions: Only space developers should be able to create/unbind/delete routes in app routes list [\#4324](https://github.com/cloudfoundry/stratos/issues/4324)
- Permissions: Only Space Developers should be able to create/edit/delete an Autoscaler policy [\#4323](https://github.com/cloudfoundry/stratos/issues/4323)
- Permissions: Only space developers should be able to see the app summary deployment card [\#4322](https://github.com/cloudfoundry/stratos/issues/4322)
- Duplicated documentation between deploy/kubernetes and Helm Chart README.md [\#4315](https://github.com/cloudfoundry/stratos/issues/4315)
- App Service Edit Binding: cancel of stepper results in leaked subscription [\#4295](https://github.com/cloudfoundry/stratos/issues/4295)
- Exceptions thrown when navigating back from marketplace [\#4287](https://github.com/cloudfoundry/stratos/issues/4287)
- Unbind services stepper fails to show bound services [\#4246](https://github.com/cloudfoundry/stratos/issues/4246)
- Progress icon appears too close to right-hand size of table [\#4234](https://github.com/cloudfoundry/stratos/issues/4234)
- Cancel/create in service instance stepper returns to incorrect locations [\#4052](https://github.com/cloudfoundry/stratos/issues/4052)
- Exception thrown in setup steppers [\#3897](https://github.com/cloudfoundry/stratos/issues/3897)
- Logout leaves the UI as is if the verify or logout call fails [\#2633](https://github.com/cloudfoundry/stratos/issues/2633)
- Cf Build Packs: file name should wrap to next line if too long [\#1803](https://github.com/cloudfoundry/stratos/issues/1803)

**Breaking Changes:**

- **Customizations in `custom-src` are now npm packages**

Stratos customizations were previously in `./custom-src` and included in the build via symlinks. These customizations have now moved into local npm packages located in `./src/frontend/packages`. For more details please see our customization documentation at `./website/docs/extensions/introduction.md` or `https://stratos.app/docs/extensions/introduction`. There you will also find instructions on migrating to npm packages and a tool to help automate most of the process.
- **Kubernetes: Upgrade only possible from version 3.0.0 or later**

When deploying into Kubernetes using Helm and upgrading from an earlier version of Stratos using `helm upgrade`, upgrade is **only** supported from version 3.0.0 or later. If you are using an earlier version, first upgrade to version 3.x before then upgrading to the latest version.
- **Angular 9 requires extensions to be declared**

Extension components must now be made known to the extensions system in the module that they are declared in, using `ExtensionService.declare`. Please check the documentation. This is required to ensure that the new Angular compiler for Ivy does not remove these components for being unreferenced in the application.

## 3.2.1

[Full Changelog](https://github.com/cloudfoundry/stratos/compare/3.2.0...3.2.1)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Take a look at the [Feature Set](docs/features.md) for details on the feature se

Get an [Overview](docs/overview.md) of Stratos, its components and the different ways in which it can be deployed.

Take a look at the [Development Roadmap](docs/roadmap.md) to see where we are heading. We update our status page each week to summarize what we are working on - see the [Status Page](docs/status_updates.md).
Take a look at the [Development Roadmap](docs/roadmap.md) to see where we are heading.

Browse through features and issues in the project's [issues](https://github.com/cloudfoundry/stratos/issues) page.

Expand Down
13 changes: 6 additions & 7 deletions docs/issue_template.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
id: issue_template
title: Issue report template
sidebar_label: Issue report template
---
<!--------- For bugs and general issues --------->
### Stratos Version
<!-- What version of Stratos does this related to? -->
<!-- Version information can be seen in the `About` page reached via the User Icon top right -->
<!-- If directly using code which branch, commit, etc did the source come from, what repository was it cloned from? -->

<!--- For bugs and general issues -->
### Frontend Deployment type
<!--- Where is the frontend deployed? -->
<!--- Put an 'x' in one of the boxes below. -->
Expand Down Expand Up @@ -35,7 +34,7 @@ Insert log hereCopy
```


<!--- For feature requests -->
<!--------- For feature requests --------->
### Detailed Description
<!--- Provide a detailed description of the change or addition you are proposing -->

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "stratos",
"version": "3.2.1",
"version": "4.0.0",
"description": "Stratos Console",
"main": "index.js",
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
pointer-events: none;
}
&__field {
align-items: center;
display: flex;
}
&__input {
Expand Down
31 changes: 31 additions & 0 deletions src/frontend/packages/store/src/actions/entity.delete.actions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { Action } from '@ngrx/store';

import { EntityRequestAction } from '../types/request.types';
import { IFavoriteMetadata, UserFavorite } from '../types/user-favorites.types';

export class EntityDeleteCompleteAction implements Action {

public static ACTION_TYPE = '[Entity] Entity delete complete';
public type = EntityDeleteCompleteAction.ACTION_TYPE;

constructor(
public entityGuid: string,
public entityType: string,
public endpointGuid: string,
public endpointType: string,
public action: EntityRequestAction,
) {}

// Create an entity delete action if we have all of the properties we need
public static parse(action: EntityRequestAction): EntityDeleteCompleteAction {
if (action.guid && action.entityType && action.endpointType && action.endpointGuid) {
return new EntityDeleteCompleteAction(action.guid, action.entityType, action.endpointGuid, action.endpointType, action);
}
return null;
}

public asFavorite(): UserFavorite<IFavoriteMetadata> {
return new UserFavorite<IFavoriteMetadata>(this.endpointGuid, this.endpointType, this.entityType, this.entityGuid);
}

}
27 changes: 22 additions & 5 deletions src/frontend/packages/store/src/effects/api.effects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ import { Actions, Effect, ofType } from '@ngrx/effects';
import { Store } from '@ngrx/store';
import { mergeMap, withLatestFrom } from 'rxjs/operators';

import { EntityDeleteCompleteAction } from '../actions/entity.delete.actions';
import { baseRequestPipelineFactory } from '../entity-request-pipeline/base-single-entity-request.pipeline';
import { basePaginatedRequestPipeline } from '../entity-request-pipeline/entity-pagination-request-pipeline';
import { apiRequestPipelineFactory } from '../entity-request-pipeline/entity-request-pipeline';
import { PipelineHttpClient } from '../entity-request-pipeline/pipline-http-client.service';
import { PaginatedAction } from '../types/pagination.types';
import { ICFAction } from '../types/request.types';
import { ApiActionTypes } from './../actions/request.actions';
import { ICFAction, WrapperRequestActionSuccess } from '../types/request.types';
import { ApiActionTypes, RequestTypes } from './../actions/request.actions';
import { InternalAppState } from './../app-state';

@Injectable()
Expand All @@ -18,9 +19,7 @@ export class APIEffect {
private actions$: Actions,
private store: Store<InternalAppState>,
private httpClient: PipelineHttpClient
) {

}
) { }

@Effect()
apiRequest$ = this.actions$.pipe(
Expand All @@ -44,4 +43,22 @@ export class APIEffect {
}),
);

// Whenever we spot a delete success operation, look to see if the action
// fulfils the entity delete requirements and dispatch an entity delete action if it does
@Effect()
apiDeleteRequest$ = this.actions$.pipe(
ofType<WrapperRequestActionSuccess>(RequestTypes.SUCCESS),
withLatestFrom(this.store),
mergeMap(([action, appState]) => {
if (action.requestType === 'delete') {
const deleteAction = EntityDeleteCompleteAction.parse(action.apiAction);
if (deleteAction) {
// Dispatch a delete action for the entity
this.store.dispatch(deleteAction);
}
}
return [];
})
);

}
25 changes: 21 additions & 4 deletions src/frontend/packages/store/src/effects/user-favorites-effect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Actions, Effect, ofType } from '@ngrx/effects';
import { Store } from '@ngrx/store';
import { catchError, first, mergeMap, switchMap } from 'rxjs/operators';
import { catchError, first, mergeMap, switchMap, withLatestFrom } from 'rxjs/operators';

import { EntityDeleteCompleteAction } from '../actions/entity.delete.actions';
import { ClearPaginationOfEntity } from '../actions/pagination.actions';
import {
GetUserFavoritesAction,
Expand All @@ -17,24 +18,24 @@ import {
UpdateUserFavoriteMetadataAction,
UpdateUserFavoriteMetadataSuccessAction,
} from '../actions/user-favourites.actions';
import { DispatchOnlyAppState } from '../app-state';
import { InternalAppState } from '../app-state';
import { entityCatalog } from '../entity-catalog/entity-catalog';
import { proxyAPIVersion } from '../jetstream';
import { NormalizedResponse } from '../types/api.types';
import { StartRequestAction, WrapperRequestActionFailed, WrapperRequestActionSuccess } from '../types/request.types';
import { IFavoriteMetadata, UserFavorite, userFavoritesPaginationKey } from '../types/user-favorites.types';
import { UserFavoriteManager } from '../user-favorite-manager';
import { STRATOS_ENDPOINT_TYPE, userFavouritesEntityType } from './../helpers/stratos-entity-factory';

const favoriteUrlPath = `/pp/${proxyAPIVersion}/favorites`;


@Injectable()
export class UserFavoritesEffect {

constructor(
private http: HttpClient,
private actions$: Actions,
private store: Store<DispatchOnlyAppState>,
private store: Store<InternalAppState>,
private userFavoriteManager: UserFavoriteManager
) {
}
Expand Down Expand Up @@ -144,4 +145,20 @@ export class UserFavoritesEffect {
);
})
);

@Effect()
entityDeleteRequest$ = this.actions$.pipe(
ofType<EntityDeleteCompleteAction>(EntityDeleteCompleteAction.ACTION_TYPE),
withLatestFrom(this.store),
mergeMap(([action, appState]) => {
// If there is a favorite, delete it
const fav = action.asFavorite();
const entityKey = entityCatalog.getEntityKey(STRATOS_ENDPOINT_TYPE, userFavouritesEntityType);
if (appState.requestData && appState.requestData[entityKey] && appState.requestData[entityKey][fav.guid]) {
this.store.dispatch(new RemoveUserFavoriteAction(fav));
}
return [];
})
);

}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { EntityDeleteCompleteAction } from '../../actions/entity.delete.actions';
import { AddRecentlyVisitedEntityAction } from '../../actions/recently-visited.actions';
import { IRecentlyVisitedEntity, IRecentlyVisitedState } from '../../types/recently-visited.types';

Expand Down Expand Up @@ -62,3 +63,11 @@ export function cleanRecentsList(state: IRecentlyVisitedState, endpointGuids: st
// Convert the array back into a map
return filtered.reduce(recentArrayToMap, {});
}

export function clearEntityFromRecentsList(state: IRecentlyVisitedState, action: EntityDeleteCompleteAction): IRecentlyVisitedState {
// Remove entity from the map if it exists
const fav = action.asFavorite();
const newState = { ...state };
delete newState[fav.guid];
return newState;
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,25 @@ import {
GetAllEndpointsSuccess,
UNREGISTER_ENDPOINTS_SUCCESS,
} from '../../actions/endpoint.actions';
import { EntityDeleteCompleteAction } from '../../actions/entity.delete.actions';
import { AddRecentlyVisitedEntityAction, SetRecentlyVisitedEntityAction } from '../../actions/recently-visited.actions';
import { entityCatalog } from '../../entity-catalog/entity-catalog';
import { endpointEntityType, STRATOS_ENDPOINT_TYPE } from '../../helpers/stratos-entity-factory';
import { IRecentlyVisitedState } from '../../types/recently-visited.types';
import { addRecentlyVisitedEntity, cleanRecentsList, getDefaultRecentState } from './recently-visited.reducer.helpers';
import {
addRecentlyVisitedEntity,
cleanRecentsList,
clearEntityFromRecentsList,
getDefaultRecentState,
} from './recently-visited.reducer.helpers';

export function recentlyVisitedReducer(
state: IRecentlyVisitedState = getDefaultRecentState(),
action: Action
): IRecentlyVisitedState {
switch (action.type) {
case EntityDeleteCompleteAction.ACTION_TYPE:
return clearEntityFromRecentsList(state, action as EntityDeleteCompleteAction);
case AddRecentlyVisitedEntityAction.ACTION_TYPE:
return addRecentlyVisitedEntity(state, action as AddRecentlyVisitedEntityAction);
case SetRecentlyVisitedEntityAction.ACTION_TYPE:
Expand Down
6 changes: 3 additions & 3 deletions src/jetstream/datastore/database_cf_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ func ParseCFEnvs(db *DatabaseConfig, env *env.VarSet) (bool, error) {
log.Info("No DB configurations defined, will use SQLite")
return false, nil
}
return findDatabaseConfig(vcapServices, db), nil
return findDatabaseConfig(vcapServices, db, env), nil
}

func findDatabaseConfig(vcapServices map[string][]VCAPService, db *DatabaseConfig) bool {
func findDatabaseConfig(vcapServices map[string][]VCAPService, db *DatabaseConfig, env *env.VarSet) bool {
var service VCAPService
configs := findDatabaseConfigurations(vcapServices)
log.Infof("Found %d database service instances", len(configs))
Expand Down Expand Up @@ -78,7 +78,7 @@ func findDatabaseConfig(vcapServices map[string][]VCAPService, db *DatabaseConfi
db.Username = getDBCredentialsValue(dbCredentials["username"])
db.Password = getDBCredentialsValue(dbCredentials["password"])
db.Host = getDBCredentialsValue(dbCredentials["hostname"])
db.SSLMode = "disable"
db.SSLMode = env.String("DB_SSL_MODE", "disable")
db.Port, _ = strconv.Atoi(getDBCredentialsValue(dbCredentials["port"]))
// Note - Both isPostgresService and isMySQLService look at the credentials uri & tags
if isPostgresService(service) {
Expand Down
2 changes: 1 addition & 1 deletion website/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This website is built using [Docusaurus 2](https://v2.docusaurus.io/), a modern
### Installing Dependencies

```
$ npm
$ npm install
```

### Local Development
Expand Down
Loading

0 comments on commit 1de99e3

Please sign in to comment.