add assessment home
This commit is contained in:
1
.tool-versions
Normal file
1
.tool-versions
Normal file
@@ -0,0 +1 @@
|
||||
ruby 3.1.2
|
||||
@@ -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
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
]
|
||||
|
||||
9
app/javascript/pages/assessment/Assessment.tsx
Normal file
9
app/javascript/pages/assessment/Assessment.tsx
Normal file
@@ -0,0 +1,9 @@
|
||||
import React from 'react'
|
||||
|
||||
export const Assessment = () => {
|
||||
return (
|
||||
<div>
|
||||
<h1>Assessment</h1>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
1
app/javascript/pages/assessment/index.ts
Normal file
1
app/javascript/pages/assessment/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from './Assessment'
|
||||
@@ -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 }>()
|
||||
|
||||
@@ -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 (
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -16,3 +16,8 @@ export const SessionRoutePaths = {
|
||||
export const DashboardRoutePaths = {
|
||||
index: "/dashboard",
|
||||
};
|
||||
|
||||
|
||||
export const AssessmentRoutePaths = {
|
||||
index: "/assessments",
|
||||
}
|
||||
@@ -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>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user