From 264d126414bd38422b9261e9302e3ff127def753 Mon Sep 17 00:00:00 2001 From: WindowsCrashed Date: Tue, 8 Aug 2023 23:23:11 -0300 Subject: [PATCH] add filter side bar --- .../pages/assessment/NewAssessmentManual.tsx | 55 ++++++++------- .../assessment/components/FiltersSideBar.tsx | 69 +++++++++++++++++++ .../assessment/components/QuestionCard.tsx | 14 ++-- .../components/RangeFilterField.tsx | 23 +++++++ .../components/SelectFilterField.tsx | 19 +++++ .../components/SelectedQuestionsSideBar.tsx | 4 +- .../pages/assessment/components/SideBar.tsx | 17 +++-- 7 files changed, 159 insertions(+), 42 deletions(-) create mode 100644 app/javascript/pages/assessment/components/FiltersSideBar.tsx create mode 100644 app/javascript/pages/assessment/components/RangeFilterField.tsx create mode 100644 app/javascript/pages/assessment/components/SelectFilterField.tsx diff --git a/app/javascript/pages/assessment/NewAssessmentManual.tsx b/app/javascript/pages/assessment/NewAssessmentManual.tsx index 0ebd371..348755d 100644 --- a/app/javascript/pages/assessment/NewAssessmentManual.tsx +++ b/app/javascript/pages/assessment/NewAssessmentManual.tsx @@ -8,6 +8,7 @@ import { SideBar } from "./components/SideBar"; import { QuestionCard } from "./components/QuestionCard"; import { Link } from "react-router-dom"; import { SelectedQuestionsSideBar } from "./components/SelectedQuestionsSideBar"; +import { FiltersSideBar } from "./components/FiltersSideBar"; type NewAssessementManualForm = { axisWeights: Record @@ -66,34 +67,32 @@ export const NewAssessementManual = () => { return ( <> -
- {/*bgColor="bg-red-700"*/} - Filters - -
{/*bg-blue-500*/} - - - - - - - -
- +
+ +
{/*bg-blue-500*/} + + + + + + + +
+
) diff --git a/app/javascript/pages/assessment/components/FiltersSideBar.tsx b/app/javascript/pages/assessment/components/FiltersSideBar.tsx new file mode 100644 index 0000000..8ef4757 --- /dev/null +++ b/app/javascript/pages/assessment/components/FiltersSideBar.tsx @@ -0,0 +1,69 @@ +import React, { FC, } from "react"; +import { SideBar } from "./SideBar"; +import { SelectedQuestionCard } from "./SelectedQuestionCard"; +import { Button } from "../../../components"; +import { SelectFilterField } from "./SelectFilterField"; +import { RangeFilterField } from "./RangeFilterField"; + +type Props = { + questions?: { + id: string, label: string, removeHandler: Function + }[] +} + +export const FiltersSideBar: FC = () => { + return ( + +
+
+ + + + + + + + +
+ + +
+ + +
+
+ ) +} \ No newline at end of file diff --git a/app/javascript/pages/assessment/components/QuestionCard.tsx b/app/javascript/pages/assessment/components/QuestionCard.tsx index d009238..df8c487 100644 --- a/app/javascript/pages/assessment/components/QuestionCard.tsx +++ b/app/javascript/pages/assessment/components/QuestionCard.tsx @@ -37,14 +37,14 @@ export const QuestionCard: FC = ({ title, onAddQuestion, onRemoveQuestion {!collapsed &&
Grau de Dificuldade: - Media + Média
Categoria: Modelagem
- Eixo de Formacao: + Eixo de Formação: Infra Sistemas
@@ -52,17 +52,21 @@ export const QuestionCard: FC = ({ title, onAddQuestion, onRemoveQuestion Fisica
- Habilidade Cogn: + Habilidade Cognitiva: Compreender
- Ano: - 2023 + Tipo: + Resposta Multipla
Autoria: UNIFESO
+
+ Ano: + 2023 +
Enunciado:
diff --git a/app/javascript/pages/assessment/components/RangeFilterField.tsx b/app/javascript/pages/assessment/components/RangeFilterField.tsx new file mode 100644 index 0000000..8dbff06 --- /dev/null +++ b/app/javascript/pages/assessment/components/RangeFilterField.tsx @@ -0,0 +1,23 @@ +import React, { FC, } from "react"; + +type Props = { + label: string +} + +export const RangeFilterField: FC = ({ label }) => { + return ( +
+ {label} +
+
+ Início + +
+
+ Fim + +
+
+
+ ) +} \ No newline at end of file diff --git a/app/javascript/pages/assessment/components/SelectFilterField.tsx b/app/javascript/pages/assessment/components/SelectFilterField.tsx new file mode 100644 index 0000000..3b5891d --- /dev/null +++ b/app/javascript/pages/assessment/components/SelectFilterField.tsx @@ -0,0 +1,19 @@ +import React, { FC, } from "react"; + +type Props = { + options: {id: number, label: string,}[] + label: string +} + +export const SelectFilterField: FC = ({ options, label }) => { + return ( +
+ {label} + +
+ ) +} \ No newline at end of file diff --git a/app/javascript/pages/assessment/components/SelectedQuestionsSideBar.tsx b/app/javascript/pages/assessment/components/SelectedQuestionsSideBar.tsx index e374c7a..bc5ea11 100644 --- a/app/javascript/pages/assessment/components/SelectedQuestionsSideBar.tsx +++ b/app/javascript/pages/assessment/components/SelectedQuestionsSideBar.tsx @@ -10,9 +10,7 @@ type Props = { export const SelectedQuestionsSideBar: FC = ({ questions }) => { return ( - -

Questões Selecionadas

-
+
{questions.length ? questions.map(q => = ({ bgColor, children }) => { +export const SideBar: FC = ({ header, children }) => { return ( -
-
- {children} -
+
+ {header && + <> +

{header}

+
+ } +
+ {children}
+
) } \ No newline at end of file