skilld-admin/src/constants/data.ts

313 lines
12 KiB
TypeScript

import { Account } from "@/types/account";
import { ApiCommunication } from "@/types/api-communication";
import { Commit } from "@/types/commit";
import { Configuration } from "@/types/configuration";
import { Criteria } from "@/types/criteria";
import { Evaluation } from "@/types/evaluation";
import { EvaluationStart } from "@/types/evaluation-start";
import { Organization } from "@/types/organization";
import { Skill } from "@/types/skill";
import { User } from "@/types/user";
import { UserRound, UserRoundCheck } from "lucide-react";
export const dummyUsers: User[] = [
{
id: 1,
email: "john@gmail.com",
fullName: "John Doe",
role: "ROLE_ADMIN",
created_at: new Date().toISOString(),
},
{
id: 2,
email: "linustorvalds@gmail.com",
fullName: "Linus Torvalds",
role: "ROLE_USER",
created_at: new Date().toISOString(),
},
{
id: 3,
email: "ryandahl@gmail.com",
fullName: "Ryan Dahl",
role: "ROLE_ADMIN",
created_at: new Date().toISOString(),
},
];
export const userFilterLabels = [
{
value: "ADMIN",
label: "ADMIN",
icon: UserRoundCheck,
},
{
value: "USER",
label: "USER",
icon: UserRound,
},
];
export const dummyOrganizations: Organization[] = [
{
id: 1,
name: "XYZ Tech Inc.",
industry: "Technology",
contactPerson: "John Smith",
email: "john@gmail.com",
phone: "+1234567890",
created_at: new Date().toISOString(),
},
{
id: 2,
name: "ABC Solutions",
industry: "Finance",
contactPerson: "Sarah Johnson",
email: "sarah@example.com",
phone: "+1987654321",
created_at: new Date().toISOString(),
},
{
id: 3,
name: "Acme Corporation",
industry: "Manufacturing",
contactPerson: "Michael Brown",
email: "michael@example.com",
phone: "+1122334455",
created_at: new Date().toISOString(),
},
];
export const dummyAccounts: Account[] = [
{
id: 1,
email: "john@gmail.com",
balance: 1000,
organization: "XYZ Tech Inc.",
accountHistory: "None",
created_at: new Date().toISOString(),
},
{
id: 2,
email: "sarah@example.com",
balance: 0,
organization: "ABC Solutions",
accountHistory: "None",
created_at: new Date().toISOString(),
},
{
id: 3,
email: "michael@example.com",
balance: 1000,
organization: "Acme Corporation",
accountHistory: "None",
created_at: new Date().toISOString(),
},
];
export const dummyConfigurations: Configuration[] = [
{
id: 1,
name: "process_limit",
value: 20,
created_at: new Date().toISOString(),
},
{
id: 2,
name: "process_timeout",
value: 600,
created_at: new Date().toISOString(),
},
{
id: 3,
name: "number_of_courses_to_create",
value: 5,
created_at: new Date().toISOString(),
},
{
id: 4,
name: "max_retries",
value: 2,
created_at: new Date().toISOString(),
},
{
id: 5,
name: "max_token_per_evaluation",
value: 1000000,
created_at: new Date().toISOString(),
},
];
export const dummyApiCommunications: ApiCommunication[] = [
{
id: 1,
messages:
"{"messages":[{"role":"system","content":"\n \n You are a professional language detection service.\n You are given a commit message or a commit diff.\n You have to answer with the programming languages and libraries the user input's code is written in.\n You have to ignore comments and strings in variables. \n You can detect up to 3 but you need to be 100% sure.\n \n Always answer in the following json format where "n" is the name of the detected language or library:\n \n [{"n":"PHP", {"n":"Symfony"}] or []\n \n ----------------------------------------\n \n ONLY JSON IS ALLOWED as an answer. No explanation or other text is allowed.\n \n \n"},{"role":"user","content":"Allow PHP 8\n\ndiff --git a/composer.json b/composer.json\nindex 7889d20..4c6382c 100644\n--- a/composer.json\n+++ b/composer.json\n@@ -13,7 +13,7 @@\n ],\n "minimum-stability": "dev",\n "require": {\n- "php": "^7.1.3",\n+ "php": ">=7.1.3",\n "doctrine/inflector": "^1.2",\n "nikic/php-parser": "^4.0",\n "symfony/config": "^3.4|^4.0|^5.0",\n"}]}",
completion: '"[{"n":"PHP"}]"',
pt: 287,
ct: 7,
tt: 294,
status: "skill_extraction_success",
type: "skill_extraction",
evaluation:
"Uploaded at: 2023-09-20 00:00:00 - Uploader: jschultz@php.net - Developer: fabien@potencier.org - Status: finished",
created_at: new Date().toISOString(),
},
{
id: 2,
messages:
"{"messages":[{"role":"system","content":"\nThis is a training task for a developer who has the following skillMatrix:\n\nskill: PHP - score:7\nskill: Symfony - score: 7\nskill: EasyAdmin - score: 3\n\n===========================================================================\n\n--- task\ntaskTitle: Create a tabbed user administration page in symfony 6 using easy admin\ntaskDescription: \n\n -- index page\n\n - "List" all users that have a Role that matches or is below your own Role\n - "Create" a new user with a Role that matches or is below your own Role \n tab 1\n firstname, lastname, email\n tab 2\n roles with checkboxes\n tab 3\n change password\n - "Edit" a user with a Role that matches or is below your own Role \n tab 1\n form with firstname, lastname, email \n tab 2\n form with roles with checkboxes\n - "Change Password of exiting User"\n form with password and password confirmation \n\n You got 2 hours to finish this task starting from now.\n Document your findings and the challenges you faced. Adhere to the project's coding standards.\n \n===========================================================================\n\nThe user will give you another skill matrix and you need to create a task with a task title for training purposes. \n\nAlways answer in the following json format:\n\n{ "taskTitle": "", "taskDescription": "[15-20 sentences formatted in markdown]" }\n\ntaskDescription should be written in markdown with proper headlines and formatting.\n\nYou may use newlines in the json response values for formatting reasons.\n\nONLY JSON IS ALLOWED as an answer. No explanation or other text is allowed.\n"},{"role":"user","content":"PHP: 7\nSymfony: 7\n"}]}",
completion:
""{ "taskTitle": "Develop a Blogging Platform using Symfony 6", "taskDescription": "\n\nYour task is to create a basic blogging platform using Symfony 6. The platform should have the following features:\n\n- `User Registration and Login`: Implement a user registration and login system using Symfony's security component. Users should be able to register with an email and password.\n\n- `Create Blog Post`: Authenticated users should be able to create a new blog post. A blog post should have a title, content, and the date of creation.\n\n- `List Blog Posts`: Create a page to list all blog posts. Each blog post listing should include the title, an excerpt of the content, and the date of creation. The list should be paginated.\n\n- `View Blog Post`: Users should be able to click on a blog post title in the list to view the full blog post. The full blog post view should include the title, full content, and the date of creation.\n\n- `Edit and Delete Blog Post`: Authenticated users should be able to edit and delete their own blog posts.\n\n- `Comments`: Authenticated users should be able to post comments on a blog post.\n\nYou are given 4 hours to complete this task. Document your findings and the challenges you faced. Adhere to the project's coding standards.\n\n" }"",
pt: 364,
ct: 271,
tt: 635,
status: "course_creation_success",
type: "course_creation",
evaluation:
" Uploaded at: 2023-09-20 00:00:00 - Uploader: jschultz@php.net - Developer: fabien@potencier.org - Status: finished",
created_at: new Date().toISOString(),
},
];
export const dummyCourseAdmin = [
{
id: 1,
title: "How to use the gitextractor",
skill: "git (3)",
created_at: new Date().toISOString(),
},
{
id: 1,
title: "Develop a Blogging System in Symfony 6",
skill: "PHP (7), Symfony (7)",
created_at: new Date().toISOString(),
},
];
export const dummyEvaluation: EvaluationStart[] = [
{
id: 1,
fullName: "John Doe",
email: "johndoe@gmail.com",
status: "finished",
},
{
id: 2,
fullName: "Don Abramov",
email: "don@gmail.com",
status: "unfinished",
},
];
export const dummyCriteria: Criteria[] = [
{
id: 1,
name: "readability",
description: "assesses the clarity and understandability of the code",
prompt: `You are a professional git reviewing assistant with focus on --name--.
You are given a commit message or a commit diff.
You know sometimes developers do simple stuff like fixing a typo.
In that case you can evaluate the criterias with a score of 0 which means it is not applicable.
If there is no code at all, you can evaluate the criterias with a score of 0 which means it is not applicable.
Otherwise if you think the code is good enough to make a review,
You have to rate the code from 1-10, where 1 is poor and 10 is excellent based on the following criterias:
--subcriteria--
If you always rate the coe above 5, you are too nice.
You have to ignore comments and strings in variables.
Always answer in the following json format where "cn" is the name of criterion and "s" is the score:
{[
{"cn": criterion_name_1, "s": score_1},
{"cn": criterion_name_2, "s": score_2},
...
]}
----------------------------------------
ONLY JSON IS ALLOWED as an answer. No explanation or other text is allowed.
`,
created_at: new Date().toISOString(),
},
{
id: 2,
name: "refinement",
description: "assesses the process and stages of code development",
prompt: `You are a professional git reviewing assistant with focus on --name--.
You are given a commit message or a commit diff.
You know sometimes developers do simple stuff like fixing a typo.
In that case you can evaluate the criterias with a score of 0 which means it is not applicable.
If there is no code at all, you can evaluate the criterias with a score of 0 which means it is not applicable.
Otherwise if you think the code is good enough to make a review,
You have to rate the code from 1-10, where 1 is poor and 10 is excellent based on the following criterias:
--subcriteria--
If you always rate the coe above 5, you are too nice.
You have to ignore comments and strings in variables.
Always answer in the following json format where "cn" is the name of criterion and "s" is the score:
{[
{"cn": criterion_name_1, "s": score_1},
{"cn": criterion_name_2, "s": score_2},
...
]}
----------------------------------------
ONLY JSON IS ALLOWED as an answer. No explanation or other text is allowed.
`,
created_at: new Date().toISOString(),
},
];
export const dummySkills: Skill[] = [
{
id: 1,
name: "JavaScript",
created_at: new Date().toISOString(),
},
{
id: 2,
name: "Python",
created_at: new Date().toISOString(),
},
];
export const dummyEvaluations: Evaluation[] = [
{
id: 1,
status: "finished",
uploaderAccount: "johndoe@gmail.com",
developerUser: "danabramov@gmail.com",
uploadTime: new Date().toISOString(),
},
];
export const dummyCommits: Commit[] = [
{
id: 1,
hash: "9998211595b05c7f8555e4a129d7792bce7a8dd6_1",
status: "skills_extracted",
retryCount: 0,
type: "code",
evaluation:
"Uploaded at: 2023-09-20 00:00:00 - Uploader: jschultz@php.net - Developer: fabien@potencier.org - Status: finished",
commitDate: new Date().toISOString(),
skills: "Skill: PHP - Score: 0",
},
];