chore: update the workarea page

This commit is contained in:
Andre Henriques 2024-10-15 13:28:37 +01:00
parent bbc02e5fda
commit 62961363f3
2 changed files with 104 additions and 104 deletions

View File

@ -4,138 +4,135 @@ import { post } from './utils';
export type AsEnum<T> = T[keyof T];
export const ApplicationStatus = Object.freeze({
ToApply: 0,
WorkingOnIt: 1,
Ignore: 2,
ApplyedButSaidNo: 3,
Applyed: 4,
Expired: 5,
TasksToDo: 6,
LinkedApplication: 7,
InterviewStep1: 8
ToApply: 0,
WorkingOnIt: 1,
Ignore: 2,
ApplyedButSaidNo: 3,
Applyed: 4,
Expired: 5,
TasksToDo: 6,
LinkedApplication: 7,
InterviewStep1: 8
});
export const ApplicationStatusMaping: Record<
(typeof ApplicationStatus)[keyof typeof ApplicationStatus],
string
> = Object.freeze({
0: 'To Apply',
1: 'Working On It',
2: 'Ignore',
3: 'Applyed But Said No',
4: 'Applyed',
5: 'Expired',
6: 'Tasks To Do',
7: 'Linked Application',
8: 'Interview 1'
export const ApplicationStatusMaping: Record<AsEnum<typeof ApplicationStatus>, string> = Object.freeze({
0: 'To Apply',
1: 'Working On It',
2: 'Ignore',
3: 'Applyed But Said No',
4: 'Applyed',
5: 'Expired',
6: 'Tasks To Do',
7: 'Linked Application',
8: 'Interview 1'
});
export type View = {
id: string;
application_id: string;
time: string;
id: string;
application_id: string;
time: string;
};
export type Application = {
id: string;
url: string;
original_url: string | null;
unique_url: string | null;
title: string;
user_id: string;
extra_data: string;
payrange: string;
status: AsEnum<typeof ApplicationStatus>;
recruiter: string;
company: string;
message: string;
linked_application: string;
application_time: string;
create_time: string;
status_history: string;
flairs: Flair[];
views: View[];
id: string;
url: string;
original_url: string | null;
unique_url: string | null;
title: string;
user_id: string;
extra_data: string;
payrange: string;
status: AsEnum<typeof ApplicationStatus>;
recruiter: string;
company: string;
message: string;
linked_application: string;
application_time: string;
create_time: string;
status_history: string;
flairs: Flair[];
views: View[];
};
function createApplicationStore() {
let applications: Application[] = $state([]);
let applyed: Application[] = $state([]);
let all: Application[] = $state([]);
let applications: Application[] = $state([]);
let applyed: Application[] = $state([]);
let all: Application[] = $state([]);
let dragApplication: Application | undefined = $state(undefined);
let dragApplication: Application | undefined = $state(undefined);
let loadItem: Application | undefined = $state(undefined);
let loadItem: Application | undefined = $state(undefined);
return {
/**
* @throws {Error}
*/
async loadApplications(force = false) {
if (!force && applications.length > 1) {
return;
}
applications = await post('application/list', { status: 0 });
},
return {
/**
* @throws {Error}
*/
async loadApplications(force = false) {
if (!force && applications.length > 1) {
return;
}
applications = await post('application/list', { status: 0 });
},
/**
* @throws {Error}
*/
async loadAplyed(force = false) {
if (!force && applyed.length > 1) {
return;
}
applyed = await post('application/list', { status: ApplicationStatus.Applyed, views: true });
},
/**
* @throws {Error}
*/
async loadAplyed(force = false) {
if (!force && applyed.length > 1) {
return;
}
applyed = await post('application/list', { status: ApplicationStatus.Applyed, views: true });
},
/**
* @throws {Error}
*/
async loadAll(force = false) {
if (!force && all.length > 1) {
return;
}
all = await post('application/list', {});
},
/**
* @throws {Error}
*/
async loadAll(force = false) {
if (!force && all.length > 1) {
return;
}
all = await post('application/list', {});
},
clear() {
applications = [];
},
clear() {
applications = [];
},
dragStart(application: Application | undefined) {
dragStart(application: Application | undefined) {
if (!application) {
return;
}
dragApplication = application;
},
dragApplication = application;
},
dragEnd() {
dragApplication = undefined;
},
dragEnd() {
dragApplication = undefined;
},
get dragging() {
return dragApplication;
},
get dragging() {
return dragApplication;
},
get applications() {
return applications;
},
get applications() {
return applications;
},
get applyed() {
return applyed;
},
get applyed() {
return applyed;
},
get all() {
return all;
},
get all() {
return all;
},
get loadItem() {
return loadItem;
},
get loadItem() {
return loadItem;
},
set loadItem(item: Application | undefined) {
loadItem = item;
}
};
set loadItem(item: Application | undefined) {
loadItem = item;
}
};
}
export const applicationStore = createApplicationStore();

View File

@ -487,6 +487,9 @@
>
Tasks To Do
</DropZone>
{/if}
{#if [ApplicationStatus.TasksToDo, ApplicationStatus.Applyed].includes(activeItem.status)}
<!-- Tasks to do -->
<DropZone