Skip to content

Commit

Permalink
Tidy up and refactor user favorites (#4757)
Browse files Browse the repository at this point in the history
* Allow k8s namespaces to be added as favourites

* Improve the home page

* Fix lint issue

* Tweaks and refactoring

* Add separator to layout menu

* Improve incremental loading

* Various tidyups and improvements

* Tidy ups and improvemts to async loading

* Fix progress spinner alignment

* Unscubribe

* Minor bug fixes and a few tidy ups

* Further tidy ups

* Fix front end unit tests

* Unit test fix

* Further unit tests fixes

* Endpoint card unit test fixes

* Fix unit tests

* Tidy up favorite card

* Further refinement to the UI

* Fix missing dates from recents on CF view

* Get app deploy from home screen working

* Add message for when no connected endpoints

* Unit test fixes

* Kubernetes Home Card unit test fixes

* Fix unit test error

* Move components to remove dependency on large shared module

* Fix unit test and add deploy tiles to CF Home Card

* Fix word wrap on favorite name

* Add tool tip

* Style tidy ups

* Minor tidy ups

* Check favorites exists before navigating to them

* Fix test imports

* First round of tidy ups of the user favorites code

* Further refactor to reduce the complexity of user favorites

* Fix unit tests

* Allow Kubernetes namespaces to be favorited

* Fix duplicate import

* Tidy ups

* e2e Debugging

* Fix for org delete e2e test

* E2e Test fix

* Refactor out common entity operator

* Slight refactor

* Fix frontend unit tests

* Address PR feedback so far

* Address PR feedback

* Fix connected endpoint state check on home screen

* Address PR feedback

* Restore apps link

* Improve typing

* Fix undefined error

* Fix unit test

* Fix ordering issue

* Add a default home card

* Fix frong end lint issues

* Merge fixes

* Fix unit tests

* Fix lint issue

* Fix lint issue

* Fix unit test

* Fix merge issue

* Fix merge issue

* Fix kube favorites not showing and sizing issue

* Fix kube endpoint card shortcuts

* Reinstate entity validation checks for CF app/org/space

* Fix favorite validation

* Tidy ups

* Fix merge issue

* Remove unrelated change

* Address PR feedback

* Bug fixes

* Address PR feedback

* Fix link for kubernetes endpoints
  • Loading branch information
nwmac authored Nov 25, 2020
1 parent 90a8ea5 commit 16efc6a
Show file tree
Hide file tree
Showing 58 changed files with 679 additions and 729 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { IOrgFavMetadata } from '../../../cloud-foundry/src/cf-metadata-types';
import {
StratosBaseCatalogEntity,
StratosCatalogEntity,
Expand Down Expand Up @@ -114,5 +113,5 @@ function generateMetricEntity(endpointDefinition: IStratosEndpointDefinition) {
labelPlural: 'Autoscaler Metrics',
endpoint: endpointDefinition,
};
return new StratosCatalogEntity<IOrgFavMetadata, APIResource<any>>(definition);
return new StratosCatalogEntity<IFavoriteMetadata, APIResource<any>>(definition);
}
53 changes: 27 additions & 26 deletions src/frontend/packages/cloud-foundry/src/cf-entity-catalog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
StratosCatalogEndpointEntity,
} from '../../store/src/entity-catalog/entity-catalog-entity/entity-catalog-entity';
import { APIResource } from '../../store/src/types/api.types';
import { IFavoriteMetadata } from '../../store/src/types/user-favorites.types';
import {
IService,
IServiceBinding,
Expand All @@ -29,7 +30,7 @@ import {
ISpaceQuotaDefinition,
IStack,
} from './cf-api.types';
import { IAppFavMetadata, IBasicCFMetaData, IOrgFavMetadata, ISpaceFavMetadata } from './cf-metadata-types';
import { ISpaceFavMetadata } from './cf-metadata-types';
import { AppEnvVarActionBuilders } from './entity-action-builders/application-env-var.action-builders';
import { AppStatsActionBuilders } from './entity-action-builders/application-stats.action-builders';
import { AppSummaryActionBuilders } from './entity-action-builders/application-summary.action-builders';
Expand Down Expand Up @@ -65,132 +66,132 @@ export class CfEntityCatalog {
public cfEndpoint: StratosCatalogEndpointEntity;

public quotaDefinition: StratosBaseCatalogEntity<
IBasicCFMetaData,
IFavoriteMetadata,
APIResource<IOrgQuotaDefinition>,
QuotaDefinitionActionBuilder
>;

public appEnvVar: StratosBaseCatalogEntity<
IBasicCFMetaData,
IFavoriteMetadata,
APIResource,
AppEnvVarActionBuilders
>;

public appSummary: StratosBaseCatalogEntity<
IBasicCFMetaData,
IFavoriteMetadata,
IAppSummary,
AppSummaryActionBuilders
>;

public spaceQuota: StratosBaseCatalogEntity<
IBasicCFMetaData,
IFavoriteMetadata,
APIResource<ISpaceQuotaDefinition>,
SpaceQuotaDefinitionActionBuilders
>;

public privateDomain: StratosBaseCatalogEntity<
IBasicCFMetaData,
IFavoriteMetadata,
APIResource<IPrivateDomain>
>;

public cfInfo: StratosBaseCatalogEntity<
IBasicCFMetaData,
IFavoriteMetadata,
APIResource<ICfV2Info>,
CfInfoDefinitionActionBuilders
>;

public appStats: StratosBaseCatalogEntity<
IBasicCFMetaData,
IFavoriteMetadata,
AppStat,
AppStatsActionBuilders
>;

public buildPack: StratosBaseCatalogEntity<
IBasicCFMetaData,
IFavoriteMetadata,
APIResource<IBuildpack>,
BuildpackActionBuilders
>;

public serviceBroker: StratosBaseCatalogEntity<
IBasicCFMetaData,
IFavoriteMetadata,
APIResource<IServiceBroker>,
ServiceBrokerActionBuilders
>;

public servicePlanVisibility: StratosBaseCatalogEntity<
IBasicCFMetaData,
IFavoriteMetadata,
APIResource<IServicePlanVisibility>,
ServicePlanVisibilityActionBuilders
>;

public securityGroup: StratosBaseCatalogEntity<
IBasicCFMetaData,
IFavoriteMetadata,
APIResource<ISecurityGroup>,
SecurityGroupBuilders
>;

public serviceBinding: StratosBaseCatalogEntity<
IBasicCFMetaData,
IFavoriteMetadata,
APIResource<IServiceBinding>,
ServiceBindingActionBuilders
>;

public service: StratosBaseCatalogEntity<
IBasicCFMetaData,
IFavoriteMetadata,
APIResource<IService>,
ServiceActionBuilders
>;

public servicePlan: StratosBaseCatalogEntity<
IBasicCFMetaData,
IFavoriteMetadata,
APIResource<IServicePlan>,
ServicePlanActionBuilders
>;

public serviceInstance: StratosBaseCatalogEntity<
IBasicCFMetaData,
IFavoriteMetadata,
APIResource<IServiceInstance>,
ServiceInstanceActionBuilders
>;

public user: StratosBaseCatalogEntity<
IBasicCFMetaData,
IFavoriteMetadata,
APIResource<CfUser>,
UserActionBuilders
>;

public domain: StratosBaseCatalogEntity<
IBasicCFMetaData,
IFavoriteMetadata,
APIResource<IDomain>,
DomainActionBuilders
>;

public event: StratosBaseCatalogEntity<
IBasicCFMetaData,
IFavoriteMetadata,
APIResource<CfEvent>,
CfEventActionBuilders
>;

public route: StratosBaseCatalogEntity<
IBasicCFMetaData,
IFavoriteMetadata,
APIResource<IRoute>,
RoutesActionBuilders
>;

public stack: StratosBaseCatalogEntity<
IBasicCFMetaData,
IFavoriteMetadata,
APIResource<IStack>,
StackActionBuilders
>;

public featureFlag: StratosBaseCatalogEntity<
IBasicCFMetaData,
IFavoriteMetadata,
IFeatureFlag,
FeatureFlagActionBuilders
>;

public application: StratosBaseCatalogEntity<
IAppFavMetadata,
IFavoriteMetadata,
APIResource<IApp>,
ApplicationActionBuilders
>;
Expand All @@ -202,17 +203,17 @@ export class CfEntityCatalog {
>;

public org: StratosBaseCatalogEntity<
IOrgFavMetadata,
IFavoriteMetadata,
APIResource<IOrganization>,
OrganizationActionBuilders
>;

public metric: StratosBaseCatalogEntity<
IBasicCFMetaData
IFavoriteMetadata
>;

public userProvidedService: StratosBaseCatalogEntity<
IBasicCFMetaData,
IFavoriteMetadata,
APIResource<IUserProvidedServiceInstance>,
UserProvidedServiceActionBuilder
>;
Expand Down
Loading

0 comments on commit 16efc6a

Please sign in to comment.