Skip to content

Commit 0273c35

Browse files
authored
Merge pull request #3425 from ProgrammeVitam/cp_8.1__bugs_15511
CP V8.1 - bugs #15511 fix(pastis/standalone): create profile view
2 parents a586e9c + f11c367 commit 0273c35

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

ui/ui-frontend/projects/pastis/src/app/core/services/profile.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,10 +224,10 @@ export class ProfileService implements OnDestroy {
224224
return this.paService.check(profile, headers);
225225
}
226226

227-
createProfile(path: string, type: ProfileType, version: ProfileVersion): Observable<ProfileResponse> {
227+
createProfile(type: ProfileType, version: ProfileVersion): Observable<ProfileResponse> {
228228
const params = new HttpParams().set('type', type).set('version', version);
229229
this.profileType = type;
230-
return this.apiService.get<ProfileResponse>(path, { params });
230+
return this.apiService.get<ProfileResponse>(this.pastisConfig.createProfileByTypeUrl, { params });
231231
}
232232

233233
createProfilePa(profile: Profile) {

ui/ui-frontend/projects/pastis/src/app/main/main.component.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ import { ProfileService } from '../core/services/profile.service';
8686
import { SedaService } from '../core/services/seda.service';
8787
import { NgxUiLoaderService } from 'ngx-ui-loader';
8888
import { tap } from 'rxjs/operators';
89+
import { ProfileType } from '../models/profile-type.enum';
90+
import { ProfileVersion } from '../models/profile-version.enum';
8991

9092
@Component({
9193
selector: 'app-home',
@@ -144,7 +146,9 @@ export class MainComponent implements OnInit, OnDestroy {
144146
// Check for query params to create a new profile
145147
this.route.queryParams.subscribe((queryParams) => {
146148
if (queryParams['type'] && queryParams['version']) {
147-
this.createNewProfile(queryParams['type'], queryParams['version']);
149+
const type: ProfileType = queryParams?.type;
150+
const version: ProfileVersion = queryParams?.version;
151+
this.createNewProfile(type, version);
148152
} else {
149153
// No valid params, redirect to list
150154
this.router.navigate(['/'], { skipLocationChange: false });
@@ -217,10 +221,10 @@ export class MainComponent implements OnInit, OnDestroy {
217221
});
218222
}
219223

220-
private createNewProfile(profileType: string, profileVersion: string) {
224+
private createNewProfile(profileType: ProfileType, profileVersion: ProfileVersion) {
221225
this.loaderService.start();
222226
this.profileService
223-
.createProfile('/pastis/profile', profileType as any, profileVersion as any)
227+
.createProfile(profileType, profileVersion)
224228
.pipe(
225229
tap((profileResponse) => {
226230
this.uploadedProfileResponse = profileResponse;

0 commit comments

Comments
 (0)