Lucas ARRIESSE
commited on
Commit
·
49c8d46
1
Parent(s):
f2a0397
List addressed requirements in solution
Browse files- static/script.js +18 -8
static/script.js
CHANGED
@@ -755,7 +755,6 @@ function createSingleAccordionItem(item, index, versionIndex, solutionCriticized
|
|
755 |
|
756 |
// Récupérer le titre de la catégorie
|
757 |
const categoryTitle = categorizedRequirements.categories.find(c => c.id == solution['Category_Id']).title;
|
758 |
-
// const categoryTitle = document.querySelector(`#category-${solution['Category_Id']} h2`)?.textContent || `Catégorie ${solution['Category_Id'] + 1}`;
|
759 |
|
760 |
// Container pour chaque solution
|
761 |
const solutionCard = document.createElement('div');
|
@@ -827,6 +826,22 @@ function createSingleAccordionItem(item, index, versionIndex, solutionCriticized
|
|
827 |
<p class="text-xs text-gray-700 leading-relaxed">${solution['Problem Description'] || 'Aucune description du problème disponible.'}</p>
|
828 |
`;
|
829 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
830 |
// Section Solution Description
|
831 |
const solutionSection = document.createElement('div');
|
832 |
solutionSection.className = 'bg-green-50 border-l-2 border-green-400 p-3 rounded-r-md';
|
@@ -938,7 +953,7 @@ function createSingleAccordionItem(item, index, versionIndex, solutionCriticized
|
|
938 |
className: 'flex flex-wrap mt-1'
|
939 |
});
|
940 |
|
941 |
-
// create reference pills
|
942 |
solution['References'].forEach(source => {
|
943 |
const pillLink = createEl('a', {
|
944 |
href: source.url,
|
@@ -956,6 +971,7 @@ function createSingleAccordionItem(item, index, versionIndex, solutionCriticized
|
|
956 |
|
957 |
// Ajouter les sections au contenu
|
958 |
content.appendChild(problemSection);
|
|
|
959 |
content.appendChild(solutionSection);
|
960 |
content.appendChild(critiqueSection);
|
961 |
content.appendChild(sourcesSection);
|
@@ -976,12 +992,6 @@ function createSingleAccordionItem(item, index, versionIndex, solutionCriticized
|
|
976 |
content.classList.remove('hidden');
|
977 |
});
|
978 |
|
979 |
-
// Delete solution accordion button
|
980 |
-
// header.querySelector('#solution-delete-btn')?.addEventListener('click', (e) => {
|
981 |
-
// e.stopPropagation();
|
982 |
-
// solutionCard.remove();
|
983 |
-
// });
|
984 |
-
|
985 |
// Événements de navigation pour cette catégorie spécifique
|
986 |
header.querySelector('.version-btn-left')?.addEventListener('click', (e) => {
|
987 |
e.stopPropagation();
|
|
|
755 |
|
756 |
// Récupérer le titre de la catégorie
|
757 |
const categoryTitle = categorizedRequirements.categories.find(c => c.id == solution['Category_Id']).title;
|
|
|
758 |
|
759 |
// Container pour chaque solution
|
760 |
const solutionCard = document.createElement('div');
|
|
|
826 |
<p class="text-xs text-gray-700 leading-relaxed">${solution['Problem Description'] || 'Aucune description du problème disponible.'}</p>
|
827 |
`;
|
828 |
|
829 |
+
// Section Problem requirements
|
830 |
+
const reqsSection = document.createElement('div');
|
831 |
+
reqsSection.className = "bg-gray-50 border-l-2 border-red-400 p-3 rounded-r-md";
|
832 |
+
const reqItemsUl = solution["Requirements"].map(req => `<li>${req}</li>`).join('');
|
833 |
+
reqsSection.innerHTML = `
|
834 |
+
<h4 class="text-sm font-semibold text-gray-800 mb-2 flex items-center">
|
835 |
+
<svg class="w-4 h-4 mr-1" fill="currentColor" viewBox="0 0 20 20">
|
836 |
+
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd"></path>
|
837 |
+
</svg>
|
838 |
+
Addressed requirements
|
839 |
+
</h4>
|
840 |
+
<ul class="list-disc pl-5 space-y-1 text-gray-700 text-xs">
|
841 |
+
${reqItemsUl}
|
842 |
+
</ul>
|
843 |
+
`
|
844 |
+
|
845 |
// Section Solution Description
|
846 |
const solutionSection = document.createElement('div');
|
847 |
solutionSection.className = 'bg-green-50 border-l-2 border-green-400 p-3 rounded-r-md';
|
|
|
953 |
className: 'flex flex-wrap mt-1'
|
954 |
});
|
955 |
|
956 |
+
// create source reference pills
|
957 |
solution['References'].forEach(source => {
|
958 |
const pillLink = createEl('a', {
|
959 |
href: source.url,
|
|
|
971 |
|
972 |
// Ajouter les sections au contenu
|
973 |
content.appendChild(problemSection);
|
974 |
+
content.appendChild(reqsSection);
|
975 |
content.appendChild(solutionSection);
|
976 |
content.appendChild(critiqueSection);
|
977 |
content.appendChild(sourcesSection);
|
|
|
992 |
content.classList.remove('hidden');
|
993 |
});
|
994 |
|
|
|
|
|
|
|
|
|
|
|
|
|
995 |
// Événements de navigation pour cette catégorie spécifique
|
996 |
header.querySelector('.version-btn-left')?.addEventListener('click', (e) => {
|
997 |
e.stopPropagation();
|