-
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.
сделал профиль админа и пофиксил баг с request
- Loading branch information
MarkPolyakov
committed
Dec 19, 2024
1 parent
b091e2f
commit 369deed
Showing
24 changed files
with
672 additions
and
12 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
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,14 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using backend.Enums; | ||
|
||
namespace backend.Models.DTO.RequestHelp | ||
{ | ||
public class EditRequestDTO | ||
{ | ||
public int RequestId {get; set;} | ||
public RequestStatus RequestStatus {get; set;} | ||
} | ||
} |
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
Binary file not shown.
Binary file not shown.
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
2 changes: 1 addition & 1 deletion
2
Program/backend/obj/Debug/net9.0/backend.AssemblyInfoInputs.cache
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 @@ | ||
2120636d2c07a26b7799f604bb4f380cdf3cfb49f8ed4c6e0f27f6a7b0cdc1ac | ||
af513f5a2d59734c7491c557bfb23793e894d03bf1a746c8772b8b68f82281b9 |
2 changes: 1 addition & 1 deletion
2
Program/backend/obj/Debug/net9.0/backend.csproj.CoreCompileInputs.cache
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 @@ | ||
48d24789e60b976fab311e58f5a0c166afe297cdaa3d94fd58191c00f42001fe | ||
238b8273d4a4df02ceaf5c22895c67ffb857725d1d45a08ac8e63f834c7af515 |
Binary file not shown.
Binary file not shown.
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 @@ | ||
{"documents":{"/Users/markpolakov/Desktop/WebApi_Insurance/*":"https://raw.githubusercontent.com/babidjon666/WebApi_Insurance/5eaabc4feca8b485b2f115cc0ecc858126022dc9/*"}} | ||
{"documents":{"/Users/markpolakov/Desktop/WebApi_Insurance/*":"https://raw.githubusercontent.com/babidjon666/WebApi_Insurance/b091e2f75a169e5cf887f2e80fabb1ee3da9876e/*"}} |
Binary file not shown.
Binary file not shown.
97 changes: 93 additions & 4 deletions
97
Program/frontend/src/Components/Profiles/Admin/AdminProfile.jsx
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,9 +1,98 @@ | ||
import React from "react"; | ||
import React, { useState, useEffect } from 'react'; | ||
import { useParams, useNavigate } from 'react-router-dom'; | ||
import { Avatar, Menu, Modal} from 'antd'; | ||
|
||
import { getProfile } from "../Client/ClientService"; | ||
|
||
import { AdminTerms } from './AdminTerms'; | ||
import { AdminRequests } from './AdminRequests'; | ||
|
||
export const AdminProfile = () =>{ | ||
return( | ||
<div> | ||
Профиль админа | ||
const [user, setUser] = useState(null); | ||
const { id } = useParams(); | ||
const [activeSection, setActiveSection] = useState('Terms'); | ||
const navigate = useNavigate(); | ||
|
||
useEffect(() => { | ||
fetchProfile(); | ||
}, []); | ||
|
||
const fetchProfile = async () =>{ | ||
try { | ||
const newUser = await getProfile(id); | ||
setUser(newUser); | ||
} catch (error) { | ||
console.error('Ошибка при получении профиля:', error); | ||
} | ||
} | ||
|
||
const handleSectionChange = (section) => { | ||
setActiveSection(section); | ||
}; | ||
|
||
const handleLogout = () => { | ||
Modal.confirm({ | ||
title: 'Exit', | ||
content: 'Are you sure you want to leave the page?', | ||
okText: 'Yes', | ||
cancelText: 'No', | ||
onOk: () => { | ||
navigate(`/login`, { replace: true }); | ||
}, | ||
onCancel: () => { | ||
handleSectionChange("personalInfo"); | ||
}, | ||
}); | ||
}; | ||
|
||
if (!user){ | ||
return<div>Loading...</div> | ||
} | ||
|
||
return ( | ||
<div className="dashboard-container"> | ||
<div className="profile-header"> | ||
<Avatar | ||
src={`https://api.dicebear.com/7.x/miniavs/svg?seed=${id}`} | ||
size={100} | ||
style={{ | ||
marginRight: '16px', | ||
border: '2px solid #f0f0f0', | ||
boxShadow: '0 4px 15px rgba(0, 0, 0, 0.1)', | ||
transition: 'transform 0.3s ease', | ||
}} | ||
className="profile-avatar" | ||
/> | ||
<div className="profile-info"> | ||
<h2 className="profile-title">Admin Profile</h2> | ||
<div className="profile-details"> | ||
<h3 className="profile-name">Name: {user.name}</h3> | ||
<h3 className="profile-surname">Surname: {user.surname} </h3> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<Menu | ||
onClick={({ key }) => handleSectionChange(key)} | ||
selectedKeys={[activeSection]} | ||
mode="horizontal" | ||
style={{ marginBottom: '20px' }} | ||
> | ||
<Menu.Item key="Terms">Terms</Menu.Item> | ||
<Menu.Item key="Requests">Requests</Menu.Item> | ||
<Menu.Item key="logout" onClick={handleLogout}> | ||
Logout | ||
</Menu.Item> | ||
</Menu> | ||
|
||
<div className="dashboard-content"> | ||
{activeSection === 'Terms' && user &&( | ||
<AdminTerms /> | ||
)} | ||
{activeSection === 'Requests' && user &&( | ||
<AdminRequests /> | ||
)} | ||
</div> | ||
</div> | ||
); | ||
}; |
Oops, something went wrong.