Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User favorites #3255

Merged
merged 156 commits into from
Feb 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
156 commits
Select commit Hold shift + click to select a range
d4dbd3b
Added user favorites actions
Nov 27, 2018
14909dd
Package json updates
Nov 27, 2018
ad10cc0
Add favorites effect and create favorite entity interface
Nov 27, 2018
4e03601
Start favoriting applications on app wall
Nov 27, 2018
d5426d5
Fix test helper
Nov 28, 2018
85a431d
Fix isFavorite$ observable
Nov 28, 2018
592f119
Move favorites fetch into base page
Nov 28, 2018
4cd140d
Get faved entity from store
Nov 28, 2018
8a205cf
Fix store test helpe
Nov 28, 2018
a5b9730
Wire in entity service to hydrate class
Nov 28, 2018
cb9abfe
DB Store for User Favorites and go backend
nwmac Nov 29, 2018
d7ed9da
Start to wire in the api request to the FE
Nov 30, 2018
a79980f
Fix user favorite db creation
nwmac Nov 30, 2018
0bc8ada
Save favorites to BE
Nov 30, 2018
14fa2a8
Fetch all favorites
Nov 30, 2018
38d5fd7
Allow user to remove favorite
Nov 30, 2018
f911900
Be able to favorite and hydrate organizations
Nov 30, 2018
3e1420e
Import tidy up
Dec 3, 2018
072ac60
Add favorite icon to meta cards
Dec 3, 2018
c6008f9
Add favorite star to application
Dec 3, 2018
0d8bcbc
Add favoritre button to CF header
Dec 4, 2018
5f0cb37
Ensure endpoint in in fav list if child entity is faved
Dec 4, 2018
7b3379f
Add back missinfg class
Dec 5, 2018
f39c7c1
Group entities by endpoint
Dec 5, 2018
153ef09
Begin work to render favorites on home page
Dec 5, 2018
3771f8f
Added card mappers for cf entity types
Dec 5, 2018
65cdfbe
Added missing file and ensure that favorite card can values can be ob…
Dec 5, 2018
84d6cab
Added faux stats panel to home page
Dec 5, 2018
59de898
Fix application summary favoriting
Dec 6, 2018
f692f84
Added messaging when favorite could not be fetched
Dec 6, 2018
b999e5f
Make CF favorites clickable
Dec 6, 2018
884cd9c
Add collapsable entites panel on favorite list
Dec 6, 2018
46e1157
Merge branch 'v2-master' into user-favorites
Dec 7, 2018
4608fcf
Improve ¸..
Dec 7, 2018
2e68e9d
Ensure we can register favorite action generators
Dec 7, 2018
1afb246
Move favorite icon on card when menu button is present
Dec 7, 2018
230dbfa
Fixed the app card favorite star
Dec 7, 2018
a767b91
Add favorite button to all the places
Dec 7, 2018
8cbece8
Fix space link on fav card
Dec 7, 2018
621fc1c
Add endpoint error bar to home page
Dec 10, 2018
1d53fb1
Renamed config mapper
Dec 10, 2018
9c37ea2
Add confirmation dialog to not found favorite removal
Dec 10, 2018
c196e10
Fix jetstream errors
Dec 10, 2018
b626bf5
Fix homepage excpetion when endpoint isn't connected
Dec 10, 2018
2d9f3b8
Remove console.log
Dec 10, 2018
986f358
Add fetching placeholder
Dec 10, 2018
1a98567
Ensure we show message when the user has no favorites
Dec 11, 2018
676beeb
Make homepage the redirect page.
Dec 11, 2018
8bb5c3a
Fix layout of homepage and favorites list
Dec 11, 2018
6185fec
Fix home route
Dec 11, 2018
4bd0ce9
Update e2e po and spec
Dec 11, 2018
51993d3
Give a better error message when unregistering a favorited endpoint
Dec 11, 2018
715d37b
Allow favorite cards to add menu items
Dec 11, 2018
94847c0
Fixed semi colon error
Dec 12, 2018
9388521
Fixed exception when empty action menu is provided to meta-card
Dec 12, 2018
c33c75f
Fixed CC issues
Dec 12, 2018
2f7eaaa
Add org status to org card
Dec 12, 2018
73bebc4
Fix org favorite on summary page
Dec 12, 2018
f3ea75b
Tidy up app module
Dec 12, 2018
e4fcdce
Simplify favorite meta card constructor
Dec 12, 2018
4eaa76c
CC Issues fixed
Dec 12, 2018
734ba62
Merge branch 'v2-master' into user-favorites
Dec 12, 2018
1f0c9ff
Added comments to config mapper
Dec 12, 2018
54e9a7b
Fixed liniting
Dec 12, 2018
9c3a8ea
Fix unit tests
Dec 12, 2018
1bb518d
Merge remote-tracking branch 'origin/v2-master' into user-favorites
richard-cox Dec 17, 2018
51e878c
Merge remote-tracking branch 'origin/v2-master' into user-favorites
richard-cox Dec 17, 2018
077c18c
Fixed package-lock.json after merge
richard-cox Dec 17, 2018
8eb0935
Ensure we don't attempt to fetch entities from a disconnected endpoint.
Dec 18, 2018
b127cbe
Minor updates
Dec 18, 2018
3f323d5
Show good messaging when showing favorites from a disconnected endpoint
Dec 18, 2018
fd649de
Remove user favorites when un registering an endpoint
Dec 19, 2018
8119983
Remove old debug messgae
Dec 19, 2018
43aa8ae
FE Linting
Dec 19, 2018
1282675
Fix disconnected message on favorites
Dec 20, 2018
668d46e
Ensure we refetch favorites when we un-register an endpoint
Dec 20, 2018
d39ba31
Fix endpoints login logout test
Dec 20, 2018
214e288
Fix homepage e2e test
Dec 20, 2018
2755b33
Merge branch 'v2-master' into user-favorites
Dec 21, 2018
680cab1
Fix unregister -> register flow
Dec 21, 2018
037533b
Remove navigateTo on home page e2e class
Dec 21, 2018
413f794
Merge remote-tracking branch 'origin/v2-master' into user-favorites
richard-cox Jan 11, 2019
c31db8d
Merge fixes
richard-cox Jan 11, 2019
8e634f4
Fix e2e test
richard-cox Jan 11, 2019
b3518d6
Ensure the cf favorites deploy action adds cf into first dropdown.
Jan 14, 2019
d712d22
Removed duplicate listCards
richard-cox Jan 14, 2019
8f4b4b6
Create Favourites table cell, apply to Endpoint & CF App tables
richard-cox Jan 14, 2019
8902b94
Fix lint issue
richard-cox Jan 14, 2019
e7c9350
Test fixes, add favourites to space apps table
richard-cox Jan 15, 2019
90025de
Fix tests
richard-cox Jan 15, 2019
051edc1
Fix lint
richard-cox Jan 15, 2019
fa376e5
WIP Store entity metadata in favorite
Jan 18, 2019
a505f0b
Update typing to cope with new metadata based favorite model
Jan 22, 2019
b4616d8
Ensure we correctly store metatdata
Jan 23, 2019
2396720
Favorites meta cards can now render correctly again
Jan 23, 2019
fb30b8b
Add back in error, empty and fetching state into favorite list
Jan 23, 2019
84b89f3
Sync favorites when we notice that metadata is out of sync
Jan 24, 2019
6aca8ed
Allow users to unfavorite a favorite from the home page.
Jan 24, 2019
72df823
Tidy up favorite mapper config and remove the requirement for lines
Jan 24, 2019
dc0dd92
Add filtering and searching to favorites list
Jan 25, 2019
f1cc8b3
Fix user favorites migration
Jan 28, 2019
e2f1a1b
Add and fix search and filtering to favorites homepage
Jan 28, 2019
99beba8
Add favorite groups reducer
Jan 28, 2019
a8a4601
Finish favorite group reducer and endpoint favorite metacard fixes
Jan 28, 2019
4584b13
Fix hydration
Jan 28, 2019
23c3a1d
Wait for fav entities to load before trying to render it.
Jan 28, 2019
4214302
Favorite list: Don't render entities list when there is no entities
Jan 28, 2019
4342bd1
Add space between favorite filters
Jan 28, 2019
7779373
Remove unused file
Jan 28, 2019
112c65d
Update is favorite selector to use new groups section of the store
Jan 28, 2019
ae94f8a
Remove the need for a pagination section
Jan 28, 2019
0bdba9f
Fix styling of empty favorite entity list
Jan 28, 2019
9d01060
Fix favorite sync for endpoint entities
Jan 29, 2019
78fe412
Ensure we correctly add new favorite to the store
Jan 29, 2019
7a2c05a
Fix some english
Jan 29, 2019
4c39cd5
Ensure we only show the star favorite for endpoints that can be fav'd
Jan 29, 2019
1a809f9
Put the favorite star at the end of table columns
Jan 29, 2019
cea44ab
Merge branch 'v2-master' into user-favorites
Jan 29, 2019
e500c2f
Ensure we remove ethereal groups correctly
Jan 29, 2019
3af1e3b
Fix linting
Jan 29, 2019
5db9bbe
Unit test fixes
Jan 29, 2019
8ad664d
Add favorite group reducer unit tests
Jan 30, 2019
0ada4de
Remove fdescribe
Jan 30, 2019
7ce2b8d
Put recent entities into store
Jan 31, 2019
de52597
Added links to recently visited panel
Jan 31, 2019
59cae6e
Improve presentation of recent entities on homepage
Feb 1, 2019
3339776
Sync recents to local storage
Feb 1, 2019
6ce826e
Only store 500 recent entities
Feb 1, 2019
3a80fd3
Remove favorite star from recent entity and update count modifiers
Feb 1, 2019
f888368
Rename propagation directive
Feb 1, 2019
cdca99d
Rename prop directive
Feb 1, 2019
22380b4
Tidy ups for recent list
Feb 1, 2019
a2c13e9
Merge remote-tracking branch 'origin/v2-master' into user-favorites
richard-cox Feb 4, 2019
0febd01
Refactored recents to allow for better syncing
Feb 4, 2019
0d8e7aa
Add top and history to recnts list
Feb 5, 2019
94453ca
Tidy up recent tabs
Feb 5, 2019
c4c2c7c
Ensure we only clean up endpoint we disconnect
Feb 5, 2019
67b8c40
Improve store tidy up logic
Feb 5, 2019
e80b53f
Sync recents with store
Feb 5, 2019
c6fda80
Remove local storage sync
Feb 5, 2019
8334645
Lint fixes
Feb 5, 2019
87ce81d
Add History icon to top nav
Feb 6, 2019
a06edf3
Fix space page header favorite
Feb 6, 2019
7c01082
Add history to page header
Feb 7, 2019
8eb198a
Add no registered endpoints message to home page
Feb 7, 2019
2fed486
Move connect endpoint arrow on endpoints page
Feb 7, 2019
7662d23
Fix typing
Feb 7, 2019
5760ab6
History -> Recent
Feb 7, 2019
2ec0b85
Finally remove outline on favorites card select
Feb 7, 2019
a3cb40f
Unit test fixes
Feb 7, 2019
bc3a321
Stop paginationResetPagination from added invalid fields
Jan 30, 2019
446605e
Merge branch 'v2-master' into user-favorites
Feb 12, 2019
c266666
Fixes for echo v3 upgrade
Feb 12, 2019
317cf15
E2E: Updated endpoint table data getter
Feb 12, 2019
81b4d02
Changes following review
richard-cox Feb 14, 2019
7a9658f
Merge remote-tracking branch 'origin/v2-master' into user-favorites
richard-cox Feb 14, 2019
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
4,613 changes: 2,313 additions & 2,300 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
"@angular/common": "^6.1.1",
"@angular/compiler": "^6.1.1",
"@angular/core": "^6.1.1",
"@angular/forms": "^6.1.1",
"@angular/flex-layout": "^6.0.0-beta.16",
"@angular/forms": "^6.1.1",
"@angular/http": "^6.1.1",
"@angular/material": "^6.1.0",
"@angular/material-moment-adapter": "^6.4.7",
Expand All @@ -60,7 +60,6 @@
"@ngrx/store-devtools": "^6.0.1",
"@swimlane/ngx-charts": "^9.0.0",
"angular2-virtual-scroll": "^0.3.1",
"stratos-angular6-json-schema-form": "1.0.3",
"core-js": "^2.5.7",
"hammerjs": "^2.0.8",
"js-yaml": "^3.11.0",
Expand All @@ -72,6 +71,7 @@
"rxjs": "^6.2.0",
"rxjs-spy": "^7.0.2",
"rxjs-websockets": "~6.0.0",
"stratos-angular6-json-schema-form": "1.0.3",
"ts-md5": "^1.2.4",
"web-animations-js": "^2.3.1",
"xterm": "^3.5.0",
Expand Down Expand Up @@ -124,4 +124,4 @@
"tslint": "~5.10.0",
"typescript": "~2.9.0"
}
}
}
236 changes: 231 additions & 5 deletions src/frontend/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,54 @@
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { Params, RouterStateSnapshot } from '@angular/router';
import { Params, RouterStateSnapshot, RouteReuseStrategy } from '@angular/router';
import { RouterStateSerializer, StoreRouterConnectingModule } from '@ngrx/router-store';

import { Store } from '@ngrx/store';
import { debounceTime, withLatestFrom } from 'rxjs/operators';
import { AppComponent } from './app.component';
import { RouteModule } from './app.routing';
import { IAppFavMetadata, IOrgFavMetadata, ISpaceFavMetadata } from './cf-favourite-types';
import { IApp, IOrganization, ISpace } from './core/cf-api.types';
import { CoreModule } from './core/core.module';
import { CurrentUserPermissions } from './core/current-user-permissions.config';
import { CurrentUserPermissionsService } from './core/current-user-permissions.service';
import { DynamicExtensionRoutes } from './core/extension/dynamic-extension-routes';
import { ExtensionService } from './core/extension/extension-service';
import { getGitHubAPIURL, GITHUB_API_URL } from './core/github.helpers';
import { UserFavoriteManager } from './core/user-favorite-manager';
import { CustomImportModule } from './custom-import.module';
import { AboutModule } from './features/about/about.module';
import { createGetApplicationAction } from './features/applications/application.service';
import { ApplicationsModule } from './features/applications/applications.module';
import { DashboardModule } from './features/dashboard/dashboard.module';
import { getFullEndpointApiUrl, initEndpointExtensions } from './features/endpoints/endpoint-helpers';
import { HomeModule } from './features/home/home.module';
import { LoginModule } from './features/login/login.module';
import { NoEndpointsNonAdminComponent } from './features/no-endpoints-non-admin/no-endpoints-non-admin.component';
import { ServiceCatalogModule } from './features/service-catalog/service-catalog.module';
import { SetupModule } from './features/setup/setup.module';
import { LoggedInService } from './logged-in.service';
import { ApplicationStateService } from './shared/components/application-state/application-state.service';
import { favoritesConfigMapper } from './shared/components/favorites-meta-card/favorite-config-mapper';
import { SharedModule } from './shared/shared.module';
import { GetAllEndpoints } from './store/actions/endpoint.actions';
import { GetOrganization } from './store/actions/organization.actions';
import { RouterNav } from './store/actions/router.actions';
import { GetSpace } from './store/actions/space.actions';
import { UpdateUserFavoriteMetadataAction } from './store/actions/user-favourites-actions/update-user-favorite-metadata-action';
import { AppState } from './store/app-state';
import { applicationSchemaKey, endpointSchemaKey, organizationSchemaKey, spaceSchemaKey } from './store/helpers/entity-factory';
import { getAPIRequestDataState } from './store/selectors/api.selectors';
import { AppStoreModule } from './store/store.module';
import { APIResource } from './store/types/api.types';
import { EndpointModel } from './store/types/endpoint.types';
import { IRequestDataState } from './store/types/entity.types';
import { IEndpointFavMetadata, IFavoriteMetadata, UserFavorite } from './store/types/user-favorites.types';
import { XSRFModule } from './xsrf.module';
import { initEndpointExtensions } from './features/endpoints/endpoint-helpers';
import { recentlyVisitedSelector } from './store/selectors/recently-visitied.selectors';
import { SetRecentlyVisitedEntityAction } from './store/actions/recently-visited.actions';
import { CustomReuseStrategy } from './route-reuse-stragegy';


// Create action for router navigation. See
// - https://github.com/ngrx/platform/issues/68
Expand Down Expand Up @@ -86,14 +111,215 @@ export class CustomRouterStateSerializer
ExtensionService,
DynamicExtensionRoutes,
{ provide: GITHUB_API_URL, useFactory: getGitHubAPIURL },
{ provide: RouterStateSerializer, useClass: CustomRouterStateSerializer } // Create action for router navigation
{ provide: RouterStateSerializer, useClass: CustomRouterStateSerializer }, // Create action for router navigation
{ provide: RouteReuseStrategy, useClass: CustomReuseStrategy }
],
bootstrap: [AppComponent]
})
export class AppModule {
constructor(private ext: ExtensionService) {
private userFavoriteManager: UserFavoriteManager;
constructor(
ext: ExtensionService,
private permissionService: CurrentUserPermissionsService,
private appStateService: ApplicationStateService,
private store: Store<AppState>,
) {
ext.init();
// Init Auth Types and Endpoint Types provided by extensions
initEndpointExtensions(ext);
// Once the CF modules become an extension point, these should be moved to a CF specific module
this.registerCfFavoriteMappers();
this.userFavoriteManager = new UserFavoriteManager(store);
const allFavs$ = this.userFavoriteManager.getAllFavorites();
const recents$ = this.store.select(recentlyVisitedSelector);
const debouncedApiRequestData$ = this.store.select(getAPIRequestDataState).pipe(debounceTime(2000));
debouncedApiRequestData$.pipe(
withLatestFrom(allFavs$)
).subscribe(
([entities, [favoriteGroups, favorites]]) => {
Object.keys(favoriteGroups).forEach(endpointId => {
const favoriteGroup = favoriteGroups[endpointId];
if (!favoriteGroup.ethereal) {
const endpointFavorite = favorites[endpointId];
this.syncFavorite(endpointFavorite, entities);
}
favoriteGroup.entitiesIds.forEach(id => {
const favorite = favorites[id];
this.syncFavorite(favorite, entities);
});
});
}
);

debouncedApiRequestData$.pipe(
withLatestFrom(recents$)
).subscribe(
([entities, recents]) => {
Object.values(recents.entities).forEach(recentEntity => {
const mapper = favoritesConfigMapper.getMapperFunction(recentEntity);
if (entities[recentEntity.entityType] && entities[recentEntity.entityType][recentEntity.entityId]) {
const entity = entities[recentEntity.entityType][recentEntity.entityId];
const entityToMetadata = favoritesConfigMapper.getEntityMetadata(recentEntity, entity);
const name = mapper(entityToMetadata).name;
if (name && name !== recentEntity.name) {
this.store.dispatch(new SetRecentlyVisitedEntityAction({
...recentEntity,
name
}));
}
}
});
}
);
}

private syncFavorite(favorite: UserFavorite<IFavoriteMetadata>, entities: IRequestDataState) {
if (favorite) {
const entity = entities[favorite.entityType][favorite.entityId || favorite.endpointId];
if (entity) {
const newMetadata = favoritesConfigMapper.getEntityMetadata(favorite, entity);
if (this.metadataHasChanged(favorite.metadata, newMetadata)) {
this.store.dispatch(new UpdateUserFavoriteMetadataAction({
...favorite,
metadata: newMetadata
}));
}
}
}
}

private metadataHasChanged(oldMeta: IFavoriteMetadata, newMeta: IFavoriteMetadata) {
if ((!oldMeta && newMeta) || (oldMeta && !newMeta)) {
return true;
}
const oldKeys = Object.keys(oldMeta);
const newKeys = Object.keys(newMeta);
const oldValues = Object.values(oldMeta);
const newValues = Object.values(newMeta);
if (oldKeys.length !== newKeys.length) {
return true;
}
if (oldKeys.sort().join(',') !== newKeys.sort().join(',')) {
return true;
}
if (oldValues.sort().join(',') !== newValues.sort().join(',')) {
return true;
}
return false;
}

private registerCfFavoriteMappers() {
const endpointType = 'cf';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the below are all registerCf<x> would they be anything other than cf?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No they wouldn't.


this.registerCfEndpointMapper(endpointType);
this.registerCfApplicationMapper(endpointType);
this.registerCfSpaceMapper(endpointType);
this.registerCfOrgMapper(endpointType);
}
private registerCfEndpointMapper(endpointType: string) {
favoritesConfigMapper.registerFavoriteConfig<EndpointModel, IEndpointFavMetadata>({
endpointType,
entityType: endpointSchemaKey
},
'Cloud Foundry',
(endpoint: IEndpointFavMetadata) => ({
type: endpointType,
routerLink: `/cloud-foundry/${endpoint.guid}`,
lines: [
['Address', endpoint.address],
['User', endpoint.user],
['Admin', endpoint.admin]
],
name: endpoint.name,
menuItems: [
{
label: 'Deploy application',
action: () => this.store.dispatch(new RouterNav({ path: ['applications/deploy'], query: { endpointGuid: endpoint.guid } })),
can: this.permissionService.can(CurrentUserPermissions.APPLICATION_CREATE)
}
]
}),
() => new GetAllEndpoints(false),
endpoint => ({
name: endpoint.name,
guid: endpoint.guid,
address: getFullEndpointApiUrl(endpoint),
user: endpoint.user ? endpoint.user.name : undefined,
admin: endpoint.user ? endpoint.user.admin ? 'Yes' : 'No' : undefined
})
);
}

private registerCfApplicationMapper(endpointType: string) {
favoritesConfigMapper.registerFavoriteConfig<APIResource<IApp>, IAppFavMetadata>({
endpointType,
entityType: applicationSchemaKey
},
'Application',
(app: IAppFavMetadata) => {
return {
type: applicationSchemaKey,
routerLink: `/applications/${app.cfGuid}/${app.guid}/summary`,
name: app.name
};
},
favorite => createGetApplicationAction(favorite.entityId, favorite.endpointId),
app => ({
guid: app.metadata.guid,
cfGuid: app.entity.cfGuid,
name: app.entity.name,
})
);
}

private registerCfSpaceMapper(endpointType: string) {
favoritesConfigMapper.registerFavoriteConfig<APIResource<ISpace>, ISpaceFavMetadata>({
endpointType,
entityType: spaceSchemaKey
},
'Space',
(space: ISpaceFavMetadata) => {
return {
type: spaceSchemaKey,
routerLink: `/cloud-foundry/${space.cfGuid}/organizations/${space.orgGuid}/spaces/${space.guid}/summary`,
name: space.name
};
},
favorite => new GetSpace(favorite.entityId, favorite.endpointId),
space => ({
guid: space.metadata.guid,
orgGuid: space.entity.organization_guid ? space.entity.organization_guid : space.entity.organization.metadata.guid,
name: space.entity.name,
cfGuid: space.entity.cfGuid,
})
);

}
private registerCfOrgMapper(endpointType: string) {

favoritesConfigMapper.registerFavoriteConfig<APIResource<IOrganization>, IOrgFavMetadata>({
endpointType,
entityType: organizationSchemaKey
},
'Organization',
(org: IOrgFavMetadata) => ({
type: organizationSchemaKey,
routerLink: `/cloud-foundry/${org.cfGuid}/organizations/${org.guid}`,
name: org.name
}),
favorite => new GetOrganization(favorite.entityId, favorite.endpointId),
org => ({
guid: org.metadata.guid,
status: this.getOrgStatus(org),
name: org.entity.name,
cfGuid: org.entity.cfGuid,
})
);
}
private getOrgStatus(org: APIResource<IOrganization>) {
if (!org || !org.entity || !org.entity.status) {
return 'Unknown';
}
return org.entity.status.charAt(0).toUpperCase() + org.entity.status.slice(1);
}
}
16 changes: 7 additions & 9 deletions src/frontend/app/app.routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@ import { UpgradePageComponent } from './features/setup/upgrade-page/upgrade-page
import { SharedModule } from './shared/shared.module';
import { PageNotFoundComponentComponent } from './core/page-not-found-component/page-not-found-component.component';
import { DomainMismatchComponent } from './features/setup/domain-mismatch/domain-mismatch.component';
import { environment } from '../environments/environment';
import { CustomRoutingImportModule } from './custom-import.module';

const appRoutes: Routes = [
{ path: '', redirectTo: 'applications', pathMatch: 'full' },
{ path: '', redirectTo: 'home', pathMatch: 'full' },
{ path: 'uaa', component: ConsoleUaaWizardComponent },
{ path: 'upgrade', component: UpgradePageComponent },
{ path: 'domainMismatch', component: DomainMismatchComponent },
Expand All @@ -29,19 +28,18 @@ const appRoutes: Routes = [
canActivate: [AuthGuardService, EndpointsService],
children: [
{
path: 'dashboard', component: HomePageComponent,
path: 'home', component: HomePageComponent,
data: {
stratosNavigation: {
text: 'Dashboard',
matIcon: 'assessment',
// Experimental - only show in development
hidden: observableOf(environment.production),
text: 'Home',
matIcon: 'home',
position: 10
}
}
},
{
path: 'applications', loadChildren: 'app/features/applications/applications.module#ApplicationsModule',
path: 'applications',
loadChildren: 'app/features/applications/applications.module#ApplicationsModule',
data: {
stratosNavigation: {
text: 'Applications',
Expand Down Expand Up @@ -120,7 +118,7 @@ const appRoutes: Routes = [
CommonModule,
CoreModule,
SharedModule,
RouterModule.forRoot(appRoutes),
RouterModule.forRoot(appRoutes, { onSameUrlNavigation: 'reload' }),
CustomRoutingImportModule,
]
})
Expand Down
22 changes: 22 additions & 0 deletions src/frontend/app/cf-favourite-types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { IFavoriteMetadata } from './store/types/user-favorites.types';

export interface ISpaceFavMetadata extends IFavoriteMetadata {
guid: string;
orgGuid: string;
name: string;
cfGuid: string;
}

export interface IOrgFavMetadata extends IFavoriteMetadata {
guid: string;
status: string;
name: string;
cfGuid: string;
}


export interface IAppFavMetadata extends IFavoriteMetadata {
guid: string;
cfGuid: string;
name: string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Directive, HostListener } from '@angular/core';
})
export class ClickStopPropagationDirective {
@HostListener('click', ['$event'])
public onClick(event: any): void {
public onClick(event: any) {
event.stopPropagation();
}
}
Loading