-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/fe task detail and history #364
Changes from 11 commits
882863a
cf1ed97
6d2dafa
197b465
ef60436
062bad3
17c9a9b
ad598c1
18f156e
a89b50f
8b896fe
ecdbd2a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @prem056627 remove this file There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove this file There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @prem056627 Please remove this file |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/*! For license information please see main.33db755a.js.LICENSE.txt */ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import { Menu, Transition } from '@headlessui/react'; | ||
import { Fragment, useState } from 'react'; | ||
import { usePopper } from 'react-popper'; | ||
import { ReactComponent as InfoIcon } from '../../../src/assets/images/svg/info-icon.svg'; | ||
|
||
export default function HeaderInfoHover({ message }) { | ||
const [referenceElement, setReferenceElement] = useState(null); | ||
const [popperElement, setPopperElement] = useState(null); | ||
const [isOpen, setIsOpen] = useState(false); | ||
|
||
const { styles, attributes } = usePopper(referenceElement, popperElement, { | ||
placement: 'bottom-end', | ||
modifiers: [ | ||
{ | ||
name: 'offset', | ||
options: { | ||
offset: [460, 2], | ||
}, | ||
}, | ||
], | ||
}); | ||
|
||
return ( | ||
<div | ||
className="relative" | ||
onMouseEnter={() => setIsOpen(true)} | ||
onMouseLeave={() => setIsOpen(false)} | ||
> | ||
<Menu as="div" className="relative flex"> | ||
<Transition | ||
as={Fragment} | ||
ref={(ref) => setPopperElement(ref)} | ||
style={styles.popper} | ||
{...attributes.popper} | ||
show={isOpen} | ||
> | ||
<Menu.Items className="absolute bottom-[30px] right-0 z-20 min-w-[186px] origin-bottom-right rounded-[4px] bg-white shadow-table-menu focus:outline-none"> | ||
<div className="p-[4px]"> | ||
<Menu.Item> | ||
{({ active }) => ( | ||
<div | ||
className={`${ | ||
active ? 'bg-white' : '' | ||
} flex w-full max-w-fit flex-col rounded-[2px] px-[12px] py-[8px]`} | ||
> | ||
<span className="text-wrap text-start font-lato text-[12px] leading-[16px] tracking-[0.2px] text-[#6C747D]"> | ||
{message} | ||
</span> | ||
</div> | ||
)} | ||
</Menu.Item> | ||
</div> | ||
</Menu.Items> | ||
</Transition> | ||
<Menu.Button | ||
className="relative z-10 flex w-full justify-center focus:outline-none" | ||
ref={(ref) => setReferenceElement(ref)} | ||
> | ||
<InfoIcon className="h-[16px] min-h-[16px] w-[16px] min-w-[16px] z-10 " /> | ||
</Menu.Button> | ||
</Menu> | ||
</div> | ||
); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{ "buildMajor": 0, "buildMinor": 3, "buildPatch": 0, "buildTag": "" } | ||
{"buildMajor":0,"buildMinor":3,"buildPatch":1,"buildTag":""} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,6 +52,8 @@ const newTask = () => { | |
last_login: faker.date.past(), | ||
is_enabled: faker.datatype.boolean(), | ||
created_at: faker.date.past(), | ||
docstring: '\n This is a docstring\n ', | ||
code: '@shared_task()\ndef test():\n """\n This is a docstring\n """\n print("test")\n return "test"\n', | ||
}; | ||
}; | ||
|
||
|
@@ -99,6 +101,7 @@ export const appTasksManagementHandlers = [ | |
return res( | ||
ctx.delay(500), | ||
ctx.status(200), | ||
|
||
ctx.json({ | ||
success: true, | ||
response: { | ||
|
@@ -123,6 +126,113 @@ export const appTasksManagementHandlers = [ | |
); | ||
}), | ||
|
||
rest.get('/api/v1/apps/:appId/tasks/:taskId', (req, res, ctx) => { | ||
return res( | ||
ctx.delay(500), | ||
ctx.status(200), | ||
ctx.json({ | ||
success: true, | ||
response: { | ||
task: { | ||
id: 2, | ||
attached_policies: [], | ||
crontab: { | ||
minute: '*', | ||
hour: '*', | ||
day_of_week: '*', | ||
day_of_month: '*', | ||
month_of_year: '*', | ||
}, | ||
schedule: '* * * * *', | ||
docstring: '', | ||
code: '', | ||
run_history: [ | ||
{ | ||
date_created: '2024-08-12T07:30:00.043275Z', | ||
date_done: '2024-08-12T07:30:00.043294Z', | ||
result: '"Task completed successfully"', | ||
traceback: null, | ||
}, | ||
{ | ||
date_created: '2024-08-12T07:29:00.039694Z', | ||
date_done: '2024-08-12T07:29:00.039726Z', | ||
result: '"Data processed"', | ||
traceback: | ||
'Traceback(mostrecentalllast):Filetask.py,line4,inprocess_datadatafetch_dTraceback(mostrecent call last):\n File "task.py", line 34, in process_data\n data = fetch_dTraceback (most recent call last):\n File "task.py", line 34, in process_data\n data = fetch_dTraceback (most recent call last):\n File "task.py", line 34, in process_data\n data = fetch_dTraceback (most recent call last):\n File "task.py", line 34, in process_data\n data = fetch_dTraceback (most recent call last):Filetask.py", line 34, in process_data\n data = fetch_dTraceback (most recent call last):\n File "task.py", line 34, in process_data\n data = fetch_dTraceback (most recent call last):\n File "task.py", line 34, in process_data\n data = fetch_data()\nKeyError: \'id\'', | ||
}, | ||
{ | ||
date_created: '2024-08-12T07:28:00.141579Z', | ||
date_done: '2024-08-12T07:28:00.141628Z', | ||
result: '"Export failed"', | ||
traceback: | ||
'TraceThisisaplaceholderparagraphdesignedtoshowwhattextwithoutspaceslookslikewhenitisrenderedinawebpagewithnocsspropertiesappliedtowraporbreakwordsappropriatelysuchtextcanoverfloworbreaklayoutsinunexpectedsituationsback (most recent call last):\n File "task.py", line 22, in export_data\n export_to_csv(data)\nFileNotFoundError: [Errno 2] No such file or directory: \'output.csv\'', | ||
}, | ||
{ | ||
date_created: '2024-08-12T07:27:00.141579Z', | ||
date_done: '2024-08-12T07:27:00.141628Z', | ||
result: '"Email sent"', | ||
traceback: null, | ||
}, | ||
{ | ||
date_created: '2024-08-12T07:26:00.141579Z', | ||
date_done: '2024-08-12T07:26:00.141628Z', | ||
result: '"Database update failed"', | ||
traceback: | ||
'TracThisisaplaceholderparagraphdesignedtoshowwhattextwithoutspaceslookslikewhenitisrenderedinawebpagewithnocsspropertiesappliedtowraporbreakwordsappropriatelysuchtextcanoverfloworbreaklayoutsinunexpectedsituationseback (most recent call last):\n File "task.py", line 45, in update_database\n cursor.execute(query)\npsycopg2.IntegrityError: duplicate key value violates unique constraint "users_pkey"', | ||
}, | ||
{ | ||
date_created: '2024-08-12T07:25:00.141579Z', | ||
date_done: '2024-08-12T07:25:00.141628Z', | ||
result: '"Backup completed with warnings"', | ||
traceback: | ||
'Traceback (most recent call last):\n File "backup.py", line 10, in perform_backup\n raise Warning(\'Low disk space\')\nWarning: Low disk space', | ||
}, | ||
{ | ||
date_created: '2024-08-12T07:24:00.141579Z', | ||
date_done: '2024-08-12T07:24:00.141628Z', | ||
result: '"Report generation failed"', | ||
traceback: | ||
'Traceback (most recent call last):\n FiThisisaplaceholderparagraphdesignedtoshowwhattextwithoutspaceslookslikewhenitisrenderedinawebpagewithnocssproaplaceholderparagraphdesignedtoshowwhattextwithoutspaceslookslikewhenitisrenderedinawebpagewithnocssproaplaceholderparagraphdesignedtoshowwhattextwithoutspaceslookslikewhenitisrenderedinawebpagewithnocssproaplaceholderparagraphdesignedtoshowwhattextwithoutspaceslookslikewhenitisrenderedinawebpagewithnocssproaplaceholderparagraphdesignedtoshowwhattextwithoutspaceslookslikewhenitisrenderedinawebpagewithnocssproaplaceholderparagraphdesignedtoshowwhattextwithoutspaceslookslikewhenitisrenderedinawebpagewithnocssproaplaceholderparagraphdesignedtoshowwhattextwithoutspaceslookslikewhenitisrenderedinawebpagewithnocssproaplaceholderparagraphdesignedtoshowwhattextwithoutspaceslookslikewhenitisrenderedinawebpagewithnocssproaplaceholderparagraphdesignedtoshowwhattextwithoutspaceslookslikewhenitisrenderedinawebpagewithnocssproaplaceholderparagraphdesignedtoshowwhattextwithoutspaceslookslikewhenitisrenderedinawebpagewithnocssproaplaceholderparagraphdesignedtoshowwhattextwithoutspaceslookslikewhenitisrenderedinawebpagewithnocssproaplaceholderparagraphdesignedtoshowwhattextwithoutspaceslookslikewhenitisrenderedinawebpagewithnocssproaplaceholderparagraphdesignedtoshowwhattextwithoutspaceslookslikewhenitisrenderedinawebpagewithnocssproaplaceholderparagraphdesignedtoshowwhattextwithoutspaceslookslikewhenitisrenderedinawebpagewithnocssproaplaceholderparagraphdesignedtoshowwhattextwithoutspaceslookslikewhenitisrenderedinawebpagewithnocssproaplaceholderparagraphdesignedtoshowwhattextwithoutspaceslookslikewhenitisrenderedinawebpagewithnocssproaplaceholderparagraphdesignedtoshowwhattextwithoutspaceslookslikewhenitisrenderedinawebpagewithnocssproaplaceholderparagraphdesignedtoshowwhattextwithoutspaceslookslikewhenitisrenderedinawebpagewithnocssproaplaceholderparagraphdesignedtoshowwhattextwithoutspaceslookslikewhenitisrenderedinawebpagewithnocsspropertiesappliedtowraporbreakwordsappropriatelysuchtextcanoverfloworbreaklayoutsinunexpectedsituationsle "report.py", line 59, in generate_report\n report = create_report(data)\nValueError: Missing required field \'report_name\'', | ||
}, | ||
{ | ||
date_created: '2024-08-12T07:23:00.141579Z', | ||
date_done: '2024-08-12T07:23:00.141628Z', | ||
result: '"Task completed with warnings"', | ||
traceback: | ||
'Traceback (most recent call last):\n File "task.py", line 78, in execute_task\n validate_input(input_data)\nDeprecationWarning: \'validate_input\' is deprecated and will be removed in future versions', | ||
}, | ||
{ | ||
date_created: '2024-08-12T07:22:00.141579Z', | ||
date_done: '2024-08-12T07:22:00.141628Z', | ||
result: '"Task failed"', | ||
traceback: | ||
'Traceback (most recent call last):\n File "task.py", line 11, in perform_task\n run_process()\nTypeError: \'NoneType\' object is not callable', | ||
}, | ||
{ | ||
date_created: '2024-08-12T07:21:00.141579Z', | ||
date_done: '2024-08-12T07:21:00.141628Z', | ||
result: '"File upload failed"', | ||
traceback: | ||
'Traceback (most recent call last):\n File "upload.py", line 27, in upload_file\n response = requests.post(url, files=files)\nrequests.exceptions.ConnectionError: Failed to establish a new connection', | ||
}, | ||
], | ||
|
||
created_at: '2024-08-12T07:22:14.716445Z', | ||
created_by: '', | ||
modified_at: '2024-08-12T07:30:21.674722Z', | ||
modified_by: '', | ||
name: 'accounts.tasks.test', | ||
is_enabled: false, | ||
is_deleted: true, | ||
args: '["CRMApp2", "accounts.tasks.test"]', | ||
kwargs: {}, | ||
interval: null, | ||
master_task: 52, | ||
}, | ||
}, | ||
}) | ||
); | ||
}), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @prem056627 revert this data as previously discussed |
||
rest.post('/api/v1/apps/:appId/tasks/', (req, res, ctx) => { | ||
const action = req.url.searchParams.get('action'); | ||
if (action === 'sync_tasks') { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@prem056627 remove this file