Skip to content

Commit 96dc85c

Browse files
authored
Merge pull request #53 from PentabyteDevAlign/feat/profile-menu
Feat/profile menu
2 parents cf75456 + 69902fa commit 96dc85c

File tree

3 files changed

+17
-26
lines changed

3 files changed

+17
-26
lines changed

AI/src/agents/recommendation_agent/model.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import dspy
22

33
from typing import List
4-
from pydantic import BaseModel
4+
from pydantic import BaseModel, Field
55

66
class CandidateModel(BaseModel):
77
"""Model to represent a candidate with relevant metrics."""
8-
_id: str
8+
id: str = Field(alias="_id")
99
name: str
1010
position: str
1111
skills: List[str]

AI/src/models/roster.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from pydantic import BaseModel, field_validator
1+
from pydantic import BaseModel, Field
22
from typing import List, Dict
33
from bson import ObjectId
44

@@ -7,7 +7,7 @@ class ProjectEmbeddingsResponse(BaseModel):
77
project_id: str
88

99
class Candidate(BaseModel):
10-
_id: str
10+
id: str = Field(alias="_id")
1111
name: str
1212
position: str
1313
skills: List[str]
@@ -18,12 +18,6 @@ class Candidate(BaseModel):
1818
rank: int
1919
reason: str
2020

21-
@field_validator('_id', mode='before')
22-
def convert_objectId(cls, v):
23-
if isinstance(v, ObjectId):
24-
return str(v)
25-
return v
26-
2721
class RosterRecommendationsResponse(BaseModel):
2822
success: bool
2923
data: Dict[str, List[Candidate]]

Frontend/src/pages/PM/CreateProject.jsx

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,18 @@ export default function CreateProject() {
9696
});
9797
return;
9898
}
99+
console.log(position);
100+
console.log(teamPositions);
101+
// check if position already exists
102+
const alreadyExists = teamPositions.some((p) => p._id === position._id);
103+
if (alreadyExists) {
104+
toast("Position already added!", {
105+
type: "warning",
106+
position: "top-center",
107+
});
108+
return;
109+
}
110+
console.log("test");
99111
if (position) {
100112
setTeamPositions([
101113
...teamPositions,
@@ -289,21 +301,6 @@ export default function CreateProject() {
289301
setLoadingText("Creating Project...");
290302

291303
try {
292-
// Ensure all selected employees are resolved to real user IDs
293-
console.log(selectedEmployees);
294-
const unresolved = selectedEmployees.filter((id) => {
295-
const emp = manualEmployees.find((e) => e._id === id);
296-
console.log(emp);
297-
return !emp || emp.isResolved === false;
298-
});
299-
300-
if (unresolved.length > 0) {
301-
alert(
302-
"Some selected employees are not matched to real users. Please select resolved users or Auto-Assign the team."
303-
);
304-
setIsSubmitting(false);
305-
return;
306-
}
307304
// Prepare project data according to backend API
308305
const projectData = {
309306
name: formData.projectName,
@@ -397,7 +394,7 @@ export default function CreateProject() {
397394
Project Details
398395
</h3>
399396

400-
<div className="space-y-4">
397+
<div className="space-y-4 mx-1">
401398
<div>
402399
<label className="block text-sm font-medium text-gray-700 mb-2">
403400
Project Name

0 commit comments

Comments
 (0)