Skip to content

Commit

Permalink
refactor: priority string replaced with priority model
Browse files Browse the repository at this point in the history
  • Loading branch information
DenisVorop committed Oct 12, 2023
1 parent bdeeb35 commit 49160d0
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 9 deletions.
5 changes: 1 addition & 4 deletions scripts/fillDevData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,6 @@ const sample = (arr: any[]) => arr[Math.floor(Math.random() * arr.length)];
[faker.lorem.words(2), faker.lorem.sentence(5), sample(users).activityId],
// eslint-disable-next-line no-loop-func
].map(([title, description, activityId]: string[], index) => {
const p = sample(priority);

return prisma.goal.create({
data: {
scopeId: index + 1,
Expand All @@ -177,8 +175,7 @@ const sample = (arr: any[]) => arr[Math.floor(Math.random() * arr.length)];
projectId: project.id,
activityId,
ownerId: activityId,
priority: p.title,
priorityId: p.value,
priorityId: sample(priority).id,
participants: {
connect:
Math.random() > 0.5
Expand Down
2 changes: 1 addition & 1 deletion src/components/GlobalSearch/GlobalSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export const GlobalSearch = () => {
gap={10}
item={{
title: item.title,
priority: item.priority,
priority: item.priority?.title,
state: item.state,
owner: item.owner,
issuer: item.activity,
Expand Down
2 changes: 1 addition & 1 deletion src/components/GoalHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export const GoalHeader: FC<GoalHeaderProps> = ({
<IssueStats
estimate={g.estimate}
estimateType={g.estimateType}
priority={g.priority}
priority={g.priority?.title}
achivedCriteriaWeight={g._hasAchievementCriteria ? g._achivedCriteriaWeight : undefined}
comments={g._count?.comments ?? 0}
onCommentsClick={onCommentsClick}
Expand Down
2 changes: 1 addition & 1 deletion src/components/GoalsGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export const GoalsGroup = React.memo<GoalGroupProps>(function GoalsGroup({
issuer={g.activity}
owner={g.owner}
tags={g.tags}
priority={g.priority}
priority={g.priority?.title}
comments={g._count?.comments}
estimate={g.estimate}
estimateType={g.estimateType}
Expand Down
2 changes: 1 addition & 1 deletion src/components/GoalsPage/GoalsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ export const GoalsPage = ({ user, ssrTime, defaultPresetFallback }: ExternalPage
issuer={g.activity}
owner={g.owner}
tags={g.tags}
priority={g.priority}
priority={g.priority?.title}
comments={g._count?.comments}
estimate={g.estimate}
estimateType={g.estimateType}
Expand Down
2 changes: 1 addition & 1 deletion src/components/ProjectListItemConnected.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const ProjectListItemConnected: FC<{
issuer={g.activity}
owner={g.owner}
tags={g.tags}
priority={g.priority}
priority={g.priority?.title}
comments={g._count?.comments}
estimate={g.estimate}
estimateType={g.estimateType}
Expand Down

0 comments on commit 49160d0

Please sign in to comment.