Removed sensitive information tab from prod features
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { Feature } from '@msfa-enums/feature.enum';
|
||||
import { IconType } from '@msfa-enums/icon-type.enum';
|
||||
import { RoleEnum } from '@msfa-enums/role.enum';
|
||||
import { environment } from '@msfa-environment';
|
||||
import { Avrop } from '@msfa-models/avrop.model';
|
||||
@@ -15,7 +14,7 @@ import { WorkExperience } from '@msfa-models/work-experience.model';
|
||||
import { UserService } from '@msfa-services/api/user.service';
|
||||
import { DeltagareCardService } from '@msfa-services/deltagare-card.service';
|
||||
import { BehaviorSubject, combineLatest, Observable } from 'rxjs';
|
||||
import { distinctUntilChanged, filter, map, shareReplay, startWith, switchMap } from 'rxjs/operators';
|
||||
import { distinctUntilChanged, map, shareReplay, startWith, switchMap } from 'rxjs/operators';
|
||||
|
||||
@Component({
|
||||
selector: 'msfa-deltagare-card',
|
||||
@@ -107,20 +106,12 @@ export class DeltagareCardComponent {
|
||||
return this._userRoles?.some(role => role.type === RoleEnum.MSFA_ReportAndPlanning);
|
||||
}
|
||||
get sensitiveDataVisible(): boolean {
|
||||
return this._userRoles?.some(role => role.type === RoleEnum.MSFA_ReportAndPlanning);
|
||||
return (
|
||||
this._activeFeatures.includes(Feature.SENSITIVE_INFORMATION) &&
|
||||
this._userRoles?.some(role => role.type === RoleEnum.MSFA_ReportAndPlanning)
|
||||
);
|
||||
}
|
||||
|
||||
firstVisibleWorkExperiences$: Observable<WorkExperience[]> = this.workExperiences$.pipe(
|
||||
filter(workExperiences => !!workExperiences),
|
||||
map(workExperiences => workExperiences.slice(0, 2))
|
||||
);
|
||||
hiddenWorkExperiences$: Observable<WorkExperience[]> = this.workExperiences$.pipe(
|
||||
filter(workExperiences => !!workExperiences),
|
||||
map(workExperiences => workExperiences.slice(2))
|
||||
);
|
||||
|
||||
iconType = IconType;
|
||||
|
||||
constructor(
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private deltagareCardService: DeltagareCardService,
|
||||
|
||||
@@ -9,4 +9,5 @@ export enum Feature {
|
||||
VERSION_INFO,
|
||||
ACCESSIBILITY_REPORT,
|
||||
REPORTING,
|
||||
SENSITIVE_INFORMATION,
|
||||
}
|
||||
|
||||
@@ -197,9 +197,9 @@ export class DeltagareApiService {
|
||||
);
|
||||
}
|
||||
|
||||
public fetchAvropInformation$(id: string): Observable<Avrop | Partial<Avrop>> {
|
||||
public fetchAvropInformation$(id: string): Observable<Avrop> {
|
||||
return this.httpClient.get<{ data: AvropResponse }>(`${this._apiBaseUrl}/${id}/avrop`).pipe(
|
||||
map(({ data }) => (data ? mapAvropResponseToAvrop(data) : {})),
|
||||
map(({ data }) => mapAvropResponseToAvrop(data)),
|
||||
catchError((error: Error) => {
|
||||
throw new CustomError(
|
||||
errorToCustomError({ ...error, message: `Kunde inte hämta avropsinformation.\n\n${error.message}` })
|
||||
|
||||
@@ -19,4 +19,5 @@ export const ACTIVE_FEATURES_TEST: Feature[] = [
|
||||
Feature.VERSION_INFO,
|
||||
Feature.ACCESSIBILITY_REPORT,
|
||||
Feature.REPORTING,
|
||||
Feature.SENSITIVE_INFORMATION,
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user