Compare commits
2 Commits
9f9b335557
...
5253204e17
| Author | SHA1 | Date | |
|---|---|---|---|
| 5253204e17 | |||
| d8b0556a3e |
@@ -2,6 +2,8 @@ package com.andr3h3nriqu3s.applications
|
||||
|
||||
import java.sql.ResultSet
|
||||
import java.util.UUID
|
||||
import java.util.Date
|
||||
import java.text.SimpleDateFormat
|
||||
import kotlin.collections.emptyList
|
||||
import kotlin.collections.setOf
|
||||
import org.springframework.http.MediaType
|
||||
@@ -34,6 +36,7 @@ data class Application(
|
||||
var message: String,
|
||||
var linked_application: String,
|
||||
var status_history: String,
|
||||
var application_time: String,
|
||||
var flairs: List<Flair>,
|
||||
var views: List<View>,
|
||||
) {
|
||||
@@ -54,6 +57,7 @@ data class Application(
|
||||
rs.getString("message"),
|
||||
rs.getString("linked_application"),
|
||||
rs.getString("status_history"),
|
||||
rs.getString("application_time"),
|
||||
emptyList(),
|
||||
emptyList(),
|
||||
)
|
||||
@@ -185,6 +189,7 @@ class ApplicationsController(
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
emptyList(),
|
||||
emptyList(),
|
||||
)
|
||||
@@ -270,6 +275,11 @@ class ApplicationsController(
|
||||
|
||||
application.status_history = status_history.joinToString(",") { it }
|
||||
|
||||
if (info.status == 4) {
|
||||
val sdf = SimpleDateFormat("dd/MM/yyyy hh:mm:ss")
|
||||
application.application_time = sdf.format(Date())
|
||||
}
|
||||
|
||||
applicationService.update(application)
|
||||
|
||||
return application
|
||||
@@ -476,7 +486,7 @@ class ApplicationService(
|
||||
}
|
||||
|
||||
db.update(
|
||||
"insert into applications (id, url, original_url, unique_url, title, user_id, extra_data, payrange, status, company, recruiter, message, linked_application, status_history) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);",
|
||||
"insert into applications (id, url, original_url, unique_url, title, user_id, extra_data, payrange, status, company, recruiter, message, linked_application, status_history, application_time) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);",
|
||||
application.id,
|
||||
application.url,
|
||||
application.original_url,
|
||||
@@ -491,6 +501,7 @@ class ApplicationService(
|
||||
application.message,
|
||||
application.linked_application,
|
||||
application.status_history,
|
||||
application.application_time,
|
||||
)
|
||||
|
||||
return true
|
||||
@@ -527,7 +538,7 @@ class ApplicationService(
|
||||
|
||||
public fun update(application: Application): Application {
|
||||
db.update(
|
||||
"update applications set url=?, original_url=?, unique_url=?, title=?, user_id=?, extra_data=?, payrange=?, status=?, company=?, recruiter=?, message=?, linked_application=?, status_history=? where id=?",
|
||||
"update applications set url=?, original_url=?, unique_url=?, title=?, user_id=?, extra_data=?, payrange=?, status=?, company=?, recruiter=?, message=?, linked_application=?, status_history=?, application_time=? where id=?",
|
||||
application.url,
|
||||
application.original_url,
|
||||
application.unique_url,
|
||||
@@ -541,6 +552,7 @@ class ApplicationService(
|
||||
application.message,
|
||||
application.linked_application,
|
||||
application.status_history,
|
||||
application.application_time,
|
||||
application.id,
|
||||
)
|
||||
return application
|
||||
|
||||
@@ -24,7 +24,8 @@ create table if not exists applications (
|
||||
user_id text,
|
||||
extra_data text,
|
||||
status integer,
|
||||
linked_application text default ''
|
||||
linked_application text default '',
|
||||
application_time text default ''
|
||||
);
|
||||
|
||||
create table if not exists views (
|
||||
|
||||
@@ -78,17 +78,17 @@ async function startup() {
|
||||
title: "Mark Page As the Url target",
|
||||
contexts: ["all"],
|
||||
});
|
||||
|
||||
browser.menus.onClicked.addListener(async function (e, tab) {
|
||||
console.log("here")
|
||||
if (e.menuItemId === "mark-page") {
|
||||
console.log("set mark-page", tab.id)
|
||||
await browser.storage.local.set({
|
||||
windows: tab.id,
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
browser.runtime.onInstalled.addListener(startup);
|
||||
browser.runtime.onStartup.addListener(startup);
|
||||
browser.runtime.onConnect.addListener(startup);
|
||||
browser.menus.onClicked.addListener(async function (e, tab) {
|
||||
console.log("here")
|
||||
if (e.menuItemId === "mark-page") {
|
||||
console.log("set mark-page", tab.id)
|
||||
await browser.storage.local.set({
|
||||
windows: tab.id,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -36,3 +36,7 @@ npm run build
|
||||
You can preview the production build with `npm run preview`.
|
||||
|
||||
> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.
|
||||
|
||||
## TODO
|
||||
|
||||
https://www.glassdoor.co.uk/job-listing/junior-software-developer-full-stack-onnec-group-JV_IC2671300_KO0,36_KE37,48.htm?jl=1009478590946&utm_source=jobsForYou&utm_medium=email&utm_content=jobs-for-you-jobsForYou-jobpos5-1009478590946&utm_campaign=jobsForYou&src=GD_JOB_AD&uido=5EF1E454F911F36A51BB1DD9CB97C8DB&ao=1136043&jrtk=6-y100011i9mkhgisgqqb801ab7157ddf833b2e1c&cs=1_57b69a24&s=362&t=REC_JOBS&pos=105&guid=00000192656d7c18b164f224f0a88e83&jobListingId=1009478590946&ea=1&vt=e&cb=1728410338190&ctt=1728466768707
|
||||
|
||||
@@ -11,6 +11,7 @@ export const ApplicationStatus = Object.freeze({
|
||||
Applyed: 4,
|
||||
Expired: 5,
|
||||
TasksToDo: 6,
|
||||
LinkedApplication: 7
|
||||
});
|
||||
|
||||
export const ApplicationStatusMaping: Record<
|
||||
@@ -24,6 +25,7 @@ export const ApplicationStatusMaping: Record<
|
||||
4: 'Applyed',
|
||||
5: 'Expired',
|
||||
6: 'Tasks To Do',
|
||||
7: 'Linked Application',
|
||||
});
|
||||
|
||||
export type View = {
|
||||
@@ -46,6 +48,7 @@ export type Application = {
|
||||
company: string;
|
||||
message: string;
|
||||
linked_application: string;
|
||||
application_time: string;
|
||||
flairs: Flair[];
|
||||
views: View[];
|
||||
};
|
||||
|
||||
@@ -5,19 +5,36 @@
|
||||
onMount(() => {
|
||||
applicationStore.loadAplyed();
|
||||
});
|
||||
|
||||
let filter = $state('');
|
||||
</script>
|
||||
|
||||
<div class="card p-3 rounded-lg flex flex-col">
|
||||
<h1>Applied</h1>
|
||||
<h1 class="flex gap-2">
|
||||
Applied <input bind:value={filter} placeholder="search" class="flex-grow text-blue-500" />
|
||||
</h1>
|
||||
<div class="overflow-auto flex-grow">
|
||||
{#each applicationStore.applyed as item}
|
||||
{#each applicationStore.applyed.filter((i) => {
|
||||
if (!filter) {
|
||||
return true;
|
||||
}
|
||||
const f = new RegExp(filter, 'ig');
|
||||
|
||||
let x = i.title;
|
||||
|
||||
if (i.company) {
|
||||
x = `${x} @ ${i.company}`;
|
||||
}
|
||||
|
||||
return x.match(f);
|
||||
}) as item}
|
||||
<button
|
||||
class="card p-2 my-2 bg-slate-100 w-full text-left"
|
||||
onclick={() => {
|
||||
applicationStore.loadItem = item;
|
||||
window.scrollTo({
|
||||
top: 0,
|
||||
behavior: 'smooth',
|
||||
behavior: 'smooth'
|
||||
});
|
||||
}}
|
||||
>
|
||||
|
||||
@@ -32,34 +32,50 @@
|
||||
[ApplicationStatus.Expired]: 0,
|
||||
[ApplicationStatus.Applyed]: 0,
|
||||
[ApplicationStatus.TasksToDo]: 0,
|
||||
[ApplicationStatus.LinkedApplication]: 0,
|
||||
Linkedin: 0,
|
||||
Glassdoor: 0,
|
||||
'Unknown Source': 0,
|
||||
Applications: applications.length
|
||||
};
|
||||
|
||||
const baseLinks: { source: NodeType; target: NodeType; value: 0 | 1 }[] = [
|
||||
{ source: 'Linkedin', target: 'Applications', value: 0 },
|
||||
{ source: 'Glassdoor', target: 'Applications', value: 0 },
|
||||
{ source: 'Unknown Source', target: 'Applications', value: 0 },
|
||||
{ source: 'Applications', target: ApplicationStatus.ToApply, value: 1 },
|
||||
{ source: 'Applications', target: ApplicationStatus.Ignore, value: 1 },
|
||||
{ source: 'Applications', target: ApplicationStatus.Expired, value: 1 },
|
||||
{ source: 'Applications', target: ApplicationStatus.WorkingOnIt, value: 1 },
|
||||
{ source: 'Applications', target: ApplicationStatus.Applyed, value: 1 },
|
||||
|
||||
{
|
||||
source: ApplicationStatus.Applyed,
|
||||
target: ApplicationStatus.ApplyedButSaidNo,
|
||||
value: 1
|
||||
},
|
||||
{
|
||||
source: ApplicationStatus.Applyed,
|
||||
target: ApplicationStatus.TasksToDo,
|
||||
value: 1
|
||||
}
|
||||
const showPercentage: string[] = [
|
||||
`${ApplicationStatus.ToApply}`,
|
||||
`${ApplicationStatus.Ignore}`,
|
||||
`${ApplicationStatus.Expired}`,
|
||||
`${ApplicationStatus.Applyed}`,
|
||||
`${ApplicationStatus.LinkedApplication}`,
|
||||
`${ApplicationStatus.ApplyedButSaidNo}`,
|
||||
`${ApplicationStatus.TasksToDo}`
|
||||
];
|
||||
|
||||
const baseLinks: { source: NodeType; target: NodeType; value: 0 | 1; end?: boolean }[] =
|
||||
[
|
||||
{ source: 'Linkedin', target: 'Applications', value: 0 },
|
||||
{ source: 'Glassdoor', target: 'Applications', value: 0 },
|
||||
{ source: 'Unknown Source', target: 'Applications', value: 0 },
|
||||
{ source: 'Applications', target: ApplicationStatus.ToApply, value: 1 },
|
||||
{ source: 'Applications', target: ApplicationStatus.Ignore, value: 1 },
|
||||
{ source: 'Applications', target: ApplicationStatus.Expired, value: 1 },
|
||||
{ source: 'Applications', target: ApplicationStatus.Applyed, value: 1 },
|
||||
{
|
||||
source: 'Applications',
|
||||
target: ApplicationStatus.LinkedApplication,
|
||||
value: 1
|
||||
},
|
||||
|
||||
{
|
||||
source: ApplicationStatus.Applyed,
|
||||
target: ApplicationStatus.ApplyedButSaidNo,
|
||||
value: 1
|
||||
},
|
||||
{
|
||||
source: ApplicationStatus.Applyed,
|
||||
target: ApplicationStatus.TasksToDo,
|
||||
value: 1
|
||||
}
|
||||
];
|
||||
|
||||
applications.forEach((a) => {
|
||||
if (a.url.includes('linkedin')) {
|
||||
nodeTypes['Linkedin'] += 1;
|
||||
@@ -68,8 +84,16 @@
|
||||
} else {
|
||||
nodeTypes['Unknown Source'] += 1;
|
||||
}
|
||||
nodeTypes[a.status] += 1;
|
||||
if ([ApplicationStatus.ApplyedButSaidNo, ApplicationStatus.TasksToDo].includes(a.status) ) {
|
||||
if (a.status !== ApplicationStatus.WorkingOnIt) {
|
||||
nodeTypes[a.status] += 1;
|
||||
} else {
|
||||
nodeTypes[ApplicationStatus.ToApply] += 1;
|
||||
}
|
||||
if (
|
||||
[ApplicationStatus.ApplyedButSaidNo, ApplicationStatus.TasksToDo].includes(
|
||||
a.status
|
||||
)
|
||||
) {
|
||||
nodeTypes[ApplicationStatus.Applyed] += 1;
|
||||
}
|
||||
});
|
||||
@@ -84,8 +108,9 @@
|
||||
value: nodeTypes[a],
|
||||
originalValue: a,
|
||||
id: '',
|
||||
color: 'red',
|
||||
index: i
|
||||
index: i,
|
||||
percentage: Math.trunc((nodeTypes[a] / applications.length) * 100),
|
||||
end: showPercentage.includes(`${a}`)
|
||||
};
|
||||
if (Number.isNaN(Number(a))) {
|
||||
base.id = a as string;
|
||||
@@ -115,7 +140,7 @@
|
||||
let sankey = mySankey()
|
||||
.nodeWidth(20)
|
||||
.nodePadding(10)
|
||||
.size([bounding.width, bounding.height]);
|
||||
.size([bounding.width, bounding.height - 20]);
|
||||
|
||||
let path = sankey.link();
|
||||
|
||||
@@ -202,7 +227,7 @@
|
||||
.attr('text-anchor', 'end')
|
||||
.attr('transform', null)
|
||||
.text(function (d) {
|
||||
return `${d.id} (${d.value})`;
|
||||
return `${d.id} (${d.value} ${d.end ? `${d.percentage}%` : ''})`;
|
||||
})
|
||||
.filter(function (d) {
|
||||
return d.x < bounding.width / 2;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import type { Application } from '$lib/ApplicationsStore.svelte';
|
||||
import { ApplicationStatus, ApplicationStatusMaping, type Application } from '$lib/ApplicationsStore.svelte';
|
||||
import { post, put } from '$lib/utils';
|
||||
|
||||
let {
|
||||
@@ -27,6 +27,7 @@
|
||||
async function submit(item: Application) {
|
||||
try {
|
||||
application.linked_application = item.id;
|
||||
application.status = ApplicationStatus.LinkedApplication;
|
||||
await put('application/update', application);
|
||||
dialog.close();
|
||||
onreload(item);
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
import DropZone from './DropZone.svelte';
|
||||
import { userStore } from '$lib/UserStore.svelte';
|
||||
import LinkApplication from './LinkApplication.svelte';
|
||||
import ApplicationsList from '../ApplicationsList.svelte';
|
||||
|
||||
let activeItem: Application | undefined = $state();
|
||||
|
||||
@@ -301,6 +300,14 @@
|
||||
</div>
|
||||
</fieldset>
|
||||
{/if}
|
||||
{#if activeItem.application_time}
|
||||
<fieldset draggable="false">
|
||||
<div class="flabel">Application Time</div>
|
||||
<div class="finput bg-white">
|
||||
{activeItem.application_time}
|
||||
</div>
|
||||
</fieldset>
|
||||
{/if}
|
||||
<div>
|
||||
<div class="flabel">Tags</div>
|
||||
<div class="flex gap-2 flex-wrap">
|
||||
@@ -435,7 +442,9 @@
|
||||
<DropZone icon="trash-fill text-danger" ondrop={() => remove()}
|
||||
>Delete it</DropZone
|
||||
>
|
||||
{/if}
|
||||
|
||||
{#if [ApplicationStatus.WorkingOnIt, ApplicationStatus.TasksToDo].includes(activeItem.status)}
|
||||
<!-- Applyed -->
|
||||
<DropZone
|
||||
icon="server text-confirm"
|
||||
|
||||
Reference in New Issue
Block a user