add assessment home

This commit is contained in:
2022-10-17 09:50:24 -03:00
parent 4bc00301b4
commit 6732308631
11 changed files with 30 additions and 8 deletions

1
.tool-versions Normal file
View File

@@ -0,0 +1 @@
ruby 3.1.2

View File

@@ -194,6 +194,8 @@ GEM
net-protocol
timeout
nio4r (2.5.8)
nokogiri (1.13.7-arm64-darwin)
racc (~> 1.4)
nokogiri (1.13.7-x86_64-linux)
racc (~> 1.4)
oauth2 (1.4.10)
@@ -335,6 +337,7 @@ GEM
zeitwerk (2.6.0)
PLATFORMS
arm64-darwin-21
x86_64-linux
DEPENDENCIES

View File

@@ -3,7 +3,7 @@ import React, { useState } from 'react';
import { useDispatch, useSelector } from "react-redux";
import { useHistory, useLocation } from 'react-router';
import { DashboardRoutePaths, QuestionRoutePaths } from "../../routes";
import { AssessmentRoutePaths, DashboardRoutePaths, QuestionRoutePaths } from "../../routes";
import { RootState } from "../../services/store";
import { turnOff } from "../../services/store/unsavedChanges";
import { Dialog } from '../Dialog';
@@ -49,7 +49,7 @@ export const AppbarTabs = () => {
{
icon: <DocumentIcon className="w-6" />,
tabel: 'Avaliações',
pathname: QuestionRoutePaths.index,
pathname: AssessmentRoutePaths.index,
isCurrent: false,
}
]

View File

@@ -0,0 +1,9 @@
import React from 'react'
export const Assessment = () => {
return (
<div>
<h1>Assessment</h1>
</div>
)
}

View File

@@ -0,0 +1 @@
export * from './Assessment'

View File

@@ -32,7 +32,7 @@ const UPDATE_QUESTION_MUTATOIN = gql`
}
`
export const Edit: FC = () => {
export const Edit = () => {
const history = useHistory()
const [alert, setAlert] = useState<AlertV2Props>()
const params = useParams<{ id: string }>()

View File

@@ -6,7 +6,7 @@ import { QuestionsFilter } from "./QuestionFilter";
import { QuestionsPainel } from "./QuestionsPainel";
import { FiltersProvider } from './QuestionFilter/QuestionsFilterProvider'
export const List: FC = () => {
export const List = () => {
const [filterOpen, setFilterOpen] = useState(false);
return (

View File

@@ -21,7 +21,7 @@ export const GET_QUESTION = gql`
}
`
export const Review: FC = () => {
export const Review = () => {
const { id } = useParams<{ id: string }>()
const { loading, data, refetch } = useQuery<Query>(GET_QUESTION, {
variables: {

View File

@@ -54,7 +54,7 @@ const DESTROY_QUESTION = gql`
}
`
export const Show: FC = () => {
export const Show = () => {
const history = useHistory();
const {id} = useParams<{ id: string }>();
const [confirmRegister, setConfirmRegister] = useState(false)

View File

@@ -16,3 +16,8 @@ export const SessionRoutePaths = {
export const DashboardRoutePaths = {
index: "/dashboard",
};
export const AssessmentRoutePaths = {
index: "/assessments",
}

View File

@@ -1,10 +1,12 @@
import React from "react";
import { Switch, Route, Redirect } from "react-router-dom";
import { Profile } from "../pages/session";
import { Dashboard } from '../pages/dashboard'
import { List, New, Show, Review, Edit } from "../pages/question";
import { Profile } from "../pages/session";
import { QuestionRoutePaths, SessionRoutePaths, DashboardRoutePaths } from './paths'
import { Assessment } from "../pages/assessment";
import { QuestionRoutePaths, SessionRoutePaths, DashboardRoutePaths, AssessmentRoutePaths } from './paths'
export const PrivateRoutes = () => (
<Switch>
@@ -18,5 +20,6 @@ export const PrivateRoutes = () => (
<Route exact path={QuestionRoutePaths.show} component={Show} />
<Route exact path={QuestionRoutePaths.edit} component={Edit} />
<Route exact path={QuestionRoutePaths.review} component={Review} />
<Route exact path={AssessmentRoutePaths.index} component={Assessment} />
</Switch>
);