Lucas ARRIESSE commited on
Commit
984824e
Β·
1 Parent(s): 620e712

Fix UI to display if step is draft or FTO

Browse files
Files changed (1) hide show
  1. static/js/ui.js +6 -4
static/js/ui.js CHANGED
@@ -536,8 +536,9 @@ function renderDraftTimeline(timelineContainer, currentIndex, drafts) {
536
  drafts.forEach((state, idx) => {
537
  const li = document.createElement('li');
538
  li.className = `step ${idx <= currentIndex ? 'step-primary' : ''}`;
539
- li.textContent = `Draft #${idx + 1}`;
540
- li.setAttribute('data-content', state.type == "draft" ? "D" : "F")
 
541
  li.onclick = () => jumpToDraft(idx);
542
  timelineContainer.appendChild(li);
543
  });
@@ -652,7 +653,7 @@ export function handleDraftRefine() {
652
  })
653
  .catch(error => {
654
  // Handle any errors
655
- alert("An error occurred:" + error);
656
  }).finally(() => {
657
  hideLoadingOverlay();
658
  });
@@ -674,7 +675,7 @@ export function handleFTOAnalysis() {
674
 
675
  console.log("Launching FTO analysis");
676
 
677
- showLoadingOverlay("Running FTO analysis...");
678
 
679
  runFTOAnalysis(providerUrl, providerModel, providerToken, currentState.solution, businessPortfolio)
680
  .then(result => {
@@ -691,6 +692,7 @@ export function handleFTOAnalysis() {
691
  });
692
 
693
  draftCurrentIndex++;
 
694
  })
695
  .catch(e => alert(e))
696
  .finally(() => hideLoadingOverlay());
 
536
  drafts.forEach((state, idx) => {
537
  const li = document.createElement('li');
538
  li.className = `step ${idx <= currentIndex ? 'step-primary' : ''}`;
539
+ li.innerHTML = `<span class="step-icon">${state.type == "draft" ? "πŸ“" : `πŸ”Ž`}</span>${state.type == "draft" ? `Draft #${idx + 1}` : "FTO analysis "}`
540
+ // li.textContent = ;
541
+ // li.setAttribute('data-content', state.type == "draft" ? "D" : "F")
542
  li.onclick = () => jumpToDraft(idx);
543
  timelineContainer.appendChild(li);
544
  });
 
653
  })
654
  .catch(error => {
655
  // Handle any errors
656
+ alert("An error occurred while refining a draft:" + error);
657
  }).finally(() => {
658
  hideLoadingOverlay();
659
  });
 
675
 
676
  console.log("Launching FTO analysis");
677
 
678
+ showLoadingOverlay("Running FTO analysis... This may take a while");
679
 
680
  runFTOAnalysis(providerUrl, providerModel, providerToken, currentState.solution, businessPortfolio)
681
  .then(result => {
 
692
  });
693
 
694
  draftCurrentIndex++;
695
+ renderDraftUI();
696
  })
697
  .catch(e => alert(e))
698
  .finally(() => hideLoadingOverlay());