Skip to content

Commit

Permalink
Fix fetching visualisation fields
Browse files Browse the repository at this point in the history
  • Loading branch information
MohamedHamouGisaia committed Nov 26, 2024
1 parent 85a6ad4 commit 8fc6502
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/app/services/visualize.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,13 @@ export class VisualizeService {

public getVisuFields(urlTemplate): string[] {
if (urlTemplate.indexOf('{') >= 0) {
const fields = urlTemplate.split(/[{}]/).filter(v => v.length > 0);
/** Fetch all elements between {} in the template. */
const regex = new RegExp(/{([^}]+)}/g);
const fields = [];
let match;
while ((match = regex.exec(urlTemplate)) !== null) {
fields.push(match[1]);
}
if (fields) {
return fields
.filter(f => f !== 'x')
Expand Down

0 comments on commit 8fc6502

Please sign in to comment.