Skip to content

Commit

Permalink
Fix SSO Error message & helm chart list on helm hub register/unregist…
Browse files Browse the repository at this point in the history
…er (#477)

* Fix sso warning message

* Reset helm pagination sections on unregister helm endpoint

* Reset helm chart pagination on helm hub register
  • Loading branch information
richard-cox authored Sep 14, 2020
1 parent 2c3ccbd commit 2122aae
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
@mixin login-page-theme($theme, $app-theme) {
$primary: map-get($theme, primary);
$warn: map-get($theme, warn);

.login {
background-color: map-get($app-theme, app-background-color);
&__title {
Expand All @@ -9,4 +11,10 @@
color: mat-contrast($primary, 500);
}
}

.suse-login-sso {
.suse-login__message {
color: mat-color($warn);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,26 @@ import { MatSnackBar } from '@angular/material/snack-bar';
import { Actions, Effect, ofType } from '@ngrx/effects';
import { Action, Store } from '@ngrx/store';
import { combineLatest, Observable, of } from 'rxjs';
import { catchError, flatMap, map, mergeMap, withLatestFrom } from 'rxjs/operators';
import { catchError, first, flatMap, map, mergeMap, withLatestFrom } from 'rxjs/operators';

import { environment } from '../../../../../core/src/environments/environment';
import { GET_ENDPOINTS_SUCCESS, GetAllEndpointsSuccess } from '../../../../../store/src/actions/endpoint.actions';
import { ClearPaginationOfType } from '../../../../../store/src/actions/pagination.actions';
import {
EndpointActionComplete,
GET_ENDPOINTS_SUCCESS,
GetAllEndpointsSuccess,
REGISTER_ENDPOINTS_SUCCESS,
UNREGISTER_ENDPOINTS_SUCCESS,
UnregisterEndpoint,
} from '../../../../../store/src/actions/endpoint.actions';
import { ClearPaginationOfType, ResetPaginationOfType } from '../../../../../store/src/actions/pagination.actions';
import { AppState } from '../../../../../store/src/app-state';
import { entityCatalog } from '../../../../../store/src/entity-catalog/entity-catalog';
import { isJetstreamError } from '../../../../../store/src/jetstream';
import { ApiRequestTypes } from '../../../../../store/src/reducers/api-request-reducer/request-helpers';
import { endpointOfTypeSelector } from '../../../../../store/src/selectors/endpoint.selectors';
import { stratosEntityCatalog } from '../../../../../store/src/stratos-entity-catalog';
import { NormalizedResponse } from '../../../../../store/src/types/api.types';
import { EndpointModel } from '../../../../../store/src/types/endpoint.types';
import {
EntityRequestAction,
StartRequestAction,
Expand Down Expand Up @@ -276,6 +285,38 @@ export class HelmEffects {
})
);

@Effect()
endpointUnregister$ = this.actions$.pipe(
ofType<UnregisterEndpoint>(UNREGISTER_ENDPOINTS_SUCCESS),
flatMap(action => stratosEntityCatalog.endpoint.store.getEntityMonitor(action.guid).entity$.pipe(
first(),
mergeMap(endpoint => {
if (endpoint.cnsi_type !== HELM_ENDPOINT_TYPE) {
return [];
}
return [
new ResetPaginationOfType(helmEntityCatalog.chart.getSchema()),
new ResetPaginationOfType(helmEntityCatalog.chartVersions.getSchema()),
new ResetPaginationOfType(helmEntityCatalog.version.getSchema()),
];
})
))
);

@Effect()
registerEndpoint$ = this.actions$.pipe(
ofType<EndpointActionComplete>(REGISTER_ENDPOINTS_SUCCESS),
flatMap(action => {
const endpoint: EndpointModel = action.endpoint as EndpointModel;
if (endpoint && endpoint.cnsi_type === HELM_ENDPOINT_TYPE && endpoint.sub_type === HELM_HUB_ENDPOINT_TYPE) {
return [
new ResetPaginationOfType(helmEntityCatalog.chart.getSchema()),
];
}
return [];
})
);

private static createHelmErrorMessage(err: any): string {
if (err) {
if (err.error && err.error.message) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,9 @@ app-suse-login {
.suse-login__sso-button.mat-button.suse-login__submit {
align-self: flex-start;
}


.suse-login__message {
padding-top: 0;
}
}

@media only screen and (max-width: 1120px) {
Expand Down

0 comments on commit 2122aae

Please sign in to comment.