try fix imports
This commit is contained in:
parent
8ac4bbfd9f
commit
a71e094e55
@ -1,4 +1,3 @@
|
|||||||
export * from './lib/common-ui.module';
|
|
||||||
export * from './lib/buttons';
|
export * from './lib/buttons';
|
||||||
export * from './lib/dialog';
|
export * from './lib/dialog';
|
||||||
export * from './lib/form';
|
export * from './lib/form';
|
||||||
@ -6,7 +5,6 @@ export * from './lib/listing';
|
|||||||
export * from './lib/help-mode';
|
export * from './lib/help-mode';
|
||||||
export * from './lib/inputs';
|
export * from './lib/inputs';
|
||||||
export * from './lib/services';
|
export * from './lib/services';
|
||||||
export * from './lib/shared';
|
|
||||||
export * from './lib/loading';
|
export * from './lib/loading';
|
||||||
export * from './lib/error';
|
export * from './lib/error';
|
||||||
export * from './lib/search';
|
export * from './lib/search';
|
||||||
@ -17,4 +15,3 @@ export * from './lib/translations';
|
|||||||
export * from './lib/pipes';
|
export * from './lib/pipes';
|
||||||
export * from './lib/permissions';
|
export * from './lib/permissions';
|
||||||
export * from './lib/directives';
|
export * from './lib/directives';
|
||||||
export * from './lib/tenants';
|
|
||||||
|
|||||||
@ -11,12 +11,11 @@ import { IFilter } from './models/filter.model';
|
|||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class FilterService {
|
export class FilterService {
|
||||||
readonly showResetFilters$: Observable<boolean>;
|
|
||||||
readonly filterGroups$: Observable<IFilterGroup[]>;
|
|
||||||
|
|
||||||
readonly #singleFilters = new Map<string, BehaviorSubject<IFilter | undefined>>();
|
readonly #singleFilters = new Map<string, BehaviorSubject<IFilter | undefined>>();
|
||||||
readonly #filterGroups$ = new BehaviorSubject<IFilterGroup[]>([]);
|
readonly #filterGroups$ = new BehaviorSubject<IFilterGroup[]>([]);
|
||||||
readonly #refresh$ = new Subject();
|
readonly #refresh$ = new Subject();
|
||||||
|
readonly showResetFilters$: Observable<boolean>;
|
||||||
|
readonly filterGroups$: Observable<IFilterGroup[]>;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
this.filterGroups$ = this.#refresh$.pipe(
|
this.filterGroups$ = this.#refresh$.pipe(
|
||||||
|
|||||||
@ -1,27 +0,0 @@
|
|||||||
import { ActivatedRouteSnapshot, CanActivateFn, Router } from '@angular/router';
|
|
||||||
import { inject } from '@angular/core';
|
|
||||||
import { NGXLogger } from 'ngx-logger';
|
|
||||||
import { KeycloakService } from 'keycloak-angular';
|
|
||||||
|
|
||||||
export const ifNotLoggedIn: CanActivateFn = async (route: ActivatedRouteSnapshot) => {
|
|
||||||
const logger = inject(NGXLogger);
|
|
||||||
const router = inject(Router);
|
|
||||||
const keycloakService = inject(KeycloakService);
|
|
||||||
|
|
||||||
const isLoggedIn = await keycloakService.isLoggedIn();
|
|
||||||
|
|
||||||
if (!isLoggedIn) {
|
|
||||||
logger.info('[ROUTES] Not logged in, continuing to selected route');
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
const tenant = route.paramMap.get('tenant') || keycloakService.getKeycloakInstance().realm;
|
|
||||||
if (!tenant) {
|
|
||||||
logger.error('[ROUTES] Tenant not found in route or keycloak realm');
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
logger.warn('[ROUTES] Is logged in for ' + tenant + ', redirecting to /' + tenant);
|
|
||||||
await router.navigate([tenant]);
|
|
||||||
return false;
|
|
||||||
};
|
|
||||||
@ -1,5 +1,4 @@
|
|||||||
export * from './keycloak-initializer';
|
export * from './keycloak-initializer';
|
||||||
export * from './guards/if-not-logged-in.guard';
|
|
||||||
export * from './services';
|
export * from './services';
|
||||||
export * from './tenant.pipe';
|
export * from './tenant.pipe';
|
||||||
export * from './tenants.module';
|
export * from './tenants.module';
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user