-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from codEnjoyer/decomposition-front
Decomposition front
- Loading branch information
Showing
36 changed files
with
578 additions
and
381 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
from .models import Module | ||
from .models import Level |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
from game.modules import Module | ||
from game.modules import Level | ||
from repository.sqlalchemy_repository import SQLAlchemyRepository | ||
|
||
|
||
class ModuleRepository(SQLAlchemyRepository): | ||
model = Module | ||
model = Level |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import React from 'react'; | ||
|
||
interface IHeaderModal { | ||
body: React.ReactNode | ||
} | ||
|
||
const HeaderModal: React.FC<IHeaderModal> = ({body}) => { | ||
return ( | ||
<div className="header-modal"> | ||
{body} | ||
</div> | ||
); | ||
}; | ||
|
||
export default HeaderModal; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import React from 'react'; | ||
import CustomInput from "../../UIComponents/customInput/CustomInput.tsx"; | ||
import authStore from "../../store/authStore.ts"; | ||
import CustomCheckbox from "../../UIComponents/customCheckbox/CustomCheckbox.tsx"; | ||
import CustomButton from "../../UIComponents/customButton/CustomButton.tsx"; | ||
import {useNavigate} from "react-router-dom" | ||
import {observer} from "mobx-react-lite"; | ||
|
||
const AuthForm: React.FC = observer(() => { | ||
const navigateTo = useNavigate() | ||
|
||
return ( | ||
<form className="auth__form"> | ||
<h2 className="auth-form-title">ВХОД</h2> | ||
<fieldset className="auth-fields"> | ||
<CustomInput type="email" value={authStore.userLogin} autoFocus={true} placeholder="Логин" | ||
handleOnChange={(e) => { | ||
authStore.changeUserLogin(e) | ||
authStore.changeUserEmail(e) | ||
}}/> | ||
<CustomInput | ||
type={authStore.isPasswordShows ? "text" : "password"} placeholder="Пароль" | ||
value={authStore.userPassword} handleOnChange={(e) => authStore.changeUserPassword(e)}/> | ||
</fieldset> | ||
<CustomCheckbox text="Показать пароль" id="is-remember" | ||
additionalClassName="is-remember-password__checkbox" | ||
handleOnChange={authStore.changeIsPasswordShows}/> | ||
<CustomButton additionalClassName="auth__btn" text="ВОЙТИ" handleOnClick={() => { | ||
authStore.signIn().then(() => navigateTo('/map')) | ||
}}/> | ||
</form> | ||
); | ||
}); | ||
|
||
export default AuthForm; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,19 @@ | ||
import React, {useState} from 'react'; | ||
import React from 'react'; | ||
import './../../styles/authentication.scss' | ||
import CustomButton from "../../UIComponents/customButton/CustomButton.tsx"; | ||
import CustomCheckbox from "../../UIComponents/customCheckbox/CustomCheckbox.tsx"; | ||
import authStore from "../../store/authStore.ts"; | ||
import {observer} from "mobx-react-lite"; | ||
import {useNavigate} from "react-router-dom"; | ||
import CustomInput from "../../UIComponents/customInput/CustomInput.tsx"; | ||
import AuthForm from "./AuthForm.tsx"; | ||
|
||
const Authentication: React.FC = observer(() => { | ||
const Authentication: React.FC = () => { | ||
const navigateTo = useNavigate() | ||
|
||
const [isPasswordShows, setIsPasswordShow] = useState(false) | ||
|
||
const changeShowPassword = () => { | ||
setIsPasswordShow(!isPasswordShows) | ||
} | ||
|
||
|
||
return ( | ||
<div className="auth-page"> | ||
<form className="auth__form"> | ||
<h2 className="auth-form-title">ВХОД</h2> | ||
<fieldset className="auth-fields"> | ||
<CustomInput type="email" value={authStore.userLogin} handleOnChange={(e) => { | ||
authStore.changeUserLogin(e) | ||
authStore.changeUserEmail(e) | ||
}} | ||
autoFocus={true} placeholder="Логин"/> | ||
<div className="auth-data__field"> | ||
<CustomInput type={isPasswordShows ? "text" : "password"} placeholder="Пароль" | ||
value={authStore.userPassword} | ||
handleOnChange={(e) => authStore.changeUserPassword(e)}/> | ||
</div> | ||
</fieldset> | ||
<CustomCheckbox text="Показать пароль" id="is-remember" | ||
additionalClassName="is-remember-password__checkbox" | ||
handleOnChange={changeShowPassword}/> | ||
<CustomButton additionalClassName="auth__btn" text="ВОЙТИ" handleOnClick={() => { | ||
authStore.signIn().then(() => navigateTo('/map')) | ||
}}/> | ||
</form> | ||
<AuthForm/> | ||
<CustomButton additionalClassName="back-to-welcome-page__btn" text="Вернуться обратно" | ||
handleOnClick={() => navigateTo('/')}></CustomButton> | ||
</div> | ||
); | ||
}); | ||
}; | ||
|
||
export default Authentication; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import React from 'react'; | ||
import Coins from "./UIMapMenu/Coins.tsx"; | ||
import ChooseModuleWindow from "./UIMapMenu/ChooseModuleWindow.tsx"; | ||
import mapMenuStore from "../../store/mapMenuStore.ts"; | ||
import UserProfile from "./UIMapMenu/UserProfile/UserProfile.tsx"; | ||
import Level from "./UIMapMenu/Level/Level.tsx"; | ||
import {IUserType} from "../../types/UserType.ts"; | ||
import {observer} from "mobx-react-lite"; | ||
import moduleMenuStore from "../../store/moduleMenuStore.ts"; | ||
|
||
interface IEmployeeMap { | ||
user?: IUserType, | ||
formattedDate: string | ||
} | ||
|
||
const EmployeeMap: React.FC<IEmployeeMap> = observer(({user, formattedDate}) => { | ||
return ( | ||
<div className="employee-interface"> | ||
<Coins coins={100} additionalClassname="coins"/> | ||
<ChooseModuleWindow moduleName={moduleMenuStore.currentModule?.title}/> | ||
<UserProfile user={user} formattedDate={formattedDate}/> | ||
<div className="geolocations"> | ||
<div className="geolocations__wrapper"> | ||
{mapMenuStore.availableLevels.map((level, index) => { | ||
return <Level id={(index + 1).toString()} key={level.id} title={level.title} | ||
theoryUnits={level.theoryUnits} taskUnits={level.taskUnits}/> | ||
})} | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}); | ||
|
||
export default EmployeeMap; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import React from 'react'; | ||
import {IUserType} from "../../types/UserType.ts"; | ||
import CustomButton from "../../UIComponents/customButton/CustomButton.tsx"; | ||
import mapMenuStore from "../../store/mapMenuStore.ts"; | ||
import CustomInput from "../../UIComponents/customInput/CustomInput.tsx"; | ||
import {observer} from "mobx-react-lite"; | ||
|
||
interface ISuperUserMap { | ||
allUsers: IUserType[] | ||
} | ||
|
||
const SuperUserMap: React.FC<ISuperUserMap> = observer(({allUsers}) => { | ||
return ( | ||
<div> | ||
<select> | ||
{allUsers?.map((user) => | ||
<option key={user.username} value={user.username}>{user.username}</option>)} | ||
</select> | ||
<CustomInput type="text" value={mapMenuStore.newNameMap} | ||
handleOnChange={(e) => mapMenuStore.changeNewNameMap(e)}/> | ||
<CustomButton text="Создать новую карту" | ||
handleOnClick={() => mapMenuStore.createMap(mapMenuStore.newNameMap)}/> | ||
|
||
</div> | ||
); | ||
}); | ||
|
||
export default SuperUserMap; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.