diff --git a/client/public/locales/en/translation.json b/client/public/locales/en/translation.json index 491100601..c6fb5d4f4 100644 --- a/client/public/locales/en/translation.json +++ b/client/public/locales/en/translation.json @@ -188,6 +188,7 @@ "inheritedReviewTooltip_plural": "This application is inheriting reviews from {{count}} archetypes.", "inheritedAssessmentTooltip": "This application is inheriting an assessment from an archetype.", "inheritedAssessmentTooltip_plural": "This application is inheriting assessments from {{count}} archetypes.", + "dependentQuestionTooltip": "This question is conditionally included or excluded based on tags:", "jiraInstanceNotConnected": "Jira instance {{name}} is not connected.", "manageDependenciesInstructions": "Add northbound and southbound dependencies for the selected application here. Note that any selections made will be saved automatically. To undo any changes, you must manually delete the applications from the dropdowns.", "noDataAvailableBody": "No data available to be shown here.", @@ -302,6 +303,7 @@ "date": "Date", "decision": "Decision", "dependencies": "Dependencies", + "dependentQuestion": "Dependent question", "description": "Description", "details": "Details", "displayName": "Display name", @@ -310,6 +312,7 @@ "email": "Email", "error": "Error", "errorReport": "Error report", + "exclude": "Exclude", "exportToIssue": "Export to Issue Manager", "facts": "Facts", "failed": "Failed", @@ -327,6 +330,7 @@ "impactfulButNotAdvisableToMove": "Impactful but not advisable to move", "image": "Image", "imports": "Imports", + "include": "Include", "importSummary": "Import summary", "importSummaryDeleted": "Import summary deleted", "inadvisable": "Inadvisable", diff --git a/client/public/templates/questionnaire-template.yaml b/client/public/templates/questionnaire-template.yaml index 1e82596de..4163e6edc 100644 --- a/client/public/templates/questionnaire-template.yaml +++ b/client/public/templates/questionnaire-template.yaml @@ -8,6 +8,9 @@ sections: - order: 1 text: What is the main technology in your application? explanation: Identify the main framework or technology used in your application. + includeFor: + - category: Language + tag: Java answers: - order: 1 text: Quarkus @@ -15,7 +18,10 @@ sections: rationale: Quarkus is a modern, container-friendly framework. mitigation: No mitigation needed. applyTags: - - category: Technology + - category: Runtime + tag: Quarkus + autoAnswerFor: + - category: Runtime tag: Quarkus - order: 2 text: Spring Boot @@ -23,16 +29,16 @@ sections: rationale: Spring Boot is versatile and widely used. mitigation: Ensure container compatibility. applyTags: - - category: Technology + - category: Runtime + tag: Spring Boot + autoAnswerFor: + - category: Runtime tag: Spring Boot - order: 3 text: Legacy Monolithic Application risk: red rationale: Legacy monoliths are challenging for cloud adaptation. mitigation: Consider refactoring into microservices. - applyTags: - - category: Architecture - tag: Monolith - order: 2 text: Does your application use a microservices architecture? explanation: Assess if the application is built using a microservices architecture. @@ -42,9 +48,6 @@ sections: risk: green rationale: Microservices are well-suited for cloud environments. mitigation: Continue monitoring service dependencies. - applyTags: - - category: Architecture - tag: Microservices - order: 2 text: No risk: yellow @@ -59,6 +62,9 @@ sections: - order: 3 text: Is your application's data storage cloud-optimized? explanation: Evaluate if the data storage solution is optimized for cloud usage. + includeFor: + - category: Language + tag: Java answers: - order: 1 text: Cloud-Native Storage Solution diff --git a/client/src/app/components/questions-table/questions-table.tsx b/client/src/app/components/questions-table/questions-table.tsx index 81a6f9a10..40f8e7da5 100644 --- a/client/src/app/components/questions-table/questions-table.tsx +++ b/client/src/app/components/questions-table/questions-table.tsx @@ -17,7 +17,7 @@ import { useTranslation } from "react-i18next"; import spacing from "@patternfly/react-styles/css/utilities/Spacing/spacing"; import { Assessment, Question, Questionnaire } from "@app/api/models"; import { useLocalTableControls } from "@app/hooks/table-controls"; -import { Label } from "@patternfly/react-core"; +import { Label, Tooltip } from "@patternfly/react-core"; import { NoDataEmptyState } from "@app/components/NoDataEmptyState"; import AnswerTable from "@app/components/answer-table/answer-table"; import { AxiosError } from "axios"; @@ -99,6 +99,35 @@ const QuestionsTable: React.FC<{ data?.sections.find((section) => section.questions.includes(question) )?.name || ""; + + const getConditionalTooltipContent = (question: Question) => { + const includeTags = question?.includeFor + ?.map((tag) => tag.tag) + .join(", "); + const excludeTags = question?.excludeFor + ?.map((tag) => tag.tag) + .join(", "); + + return ( +