Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 2 additions & 13 deletions src/app/data/scenario.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ class CustomEncoder implements HttpParameterCodec {
}
}

@Injectable({
providedIn: 'root',
})
@Injectable({ providedIn: 'root' })
export class ScenarioService {
private cachedScenarioList: Scenario[] = [];
private fetchedList = false;
Expand All @@ -60,16 +58,7 @@ export class ScenarioService {
this.startedFetchedList = true;
return this.gargAdmin.get('/list').pipe(
map((s: ServerResponse) => {
const obj: Scenario[] = JSON.parse(atou(s.content)); // this doesn't encode a map though
// so now we need to go vmset-by-vmset and build maps
obj.forEach((s: Scenario) => {
s.virtualmachines = s.virtualmachines.map(
(v) =>
new Map<string, string>(
Object.entries(v as Record<string, string>),
),
) as unknown as typeof s.virtualmachines;
});
const obj: Scenario[] = JSON.parse(atou(s.content));
return obj;
}),

Expand Down