Reverting back the dataset header links

#11
by fzoll - opened
Files changed (1) hide show
  1. app/backend/data_page.py +2 -48
app/backend/data_page.py CHANGED
@@ -344,54 +344,8 @@ def render_page(group_name):
344
  const fieldName = params.column.colId;
345
 
346
  if (fieldName.includes('Average')) {{
347
- // For group columns (like "Code Average", "English Average"), create clickable link to respective page
348
- const groupName = fieldName.replace(' Average', '').toLowerCase();
349
- const link = document.createElement('a');
350
- link.href = '#';
351
- link.style.color = 'white';
352
- link.style.textDecoration = 'underline';
353
- link.style.cursor = 'pointer';
354
- link.textContent = columnName;
355
-
356
- // Prevent event bubbling to avoid sorting trigger and navigate directly
357
- link.addEventListener('click', function(e) {{
358
- e.stopPropagation();
359
- e.preventDefault();
360
-
361
- // Try multiple navigation approaches
362
- const targetUrl = '/' + groupName;
363
-
364
- try {{
365
- // First try: Navigate the top-level window
366
- if (window.top && window.top.location && window.top !== window) {{
367
- window.top.location.assign(targetUrl);
368
- return;
369
- }}
370
- }} catch (ex1) {{
371
- console.log('Top navigation blocked:', ex1);
372
- }}
373
-
374
- try {{
375
- // Second try: Navigate the parent window
376
- if (window.parent && window.parent.location && window.parent !== window) {{
377
- window.parent.location.assign(targetUrl);
378
- return;
379
- }}
380
- }} catch (ex2) {{
381
- console.log('Parent navigation blocked:', ex2);
382
- }}
383
-
384
- try {{
385
- // Third try: Replace current window location
386
- window.location.replace(targetUrl);
387
- }} catch (ex3) {{
388
- console.log('Current window navigation blocked:', ex3);
389
- // Last resort: simple assignment
390
- window.location.href = targetUrl;
391
- }}
392
- }});
393
-
394
- this.eGui.appendChild(link);
395
  }} else {{
396
  // For dataset columns, create clickable link to HuggingFace dataset
397
  const link = document.createElement('a');
 
344
  const fieldName = params.column.colId;
345
 
346
  if (fieldName.includes('Average')) {{
347
+ // For group columns (like "Code Average", "English Average"), display as plain text
348
+ this.eGui.textContent = columnName;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
349
  }} else {{
350
  // For dataset columns, create clickable link to HuggingFace dataset
351
  const link = document.createElement('a');