Remove the email pipeline
The mailbox sync (Microsoft Graph and IMAP), its Claude classifier, the /email routes and the Settings page's email section are taken out while the pipeline is unused. The last commit with it is tagged email-pipeline-last; reverting this commit brings it back. The status rules the capture path shares (statusOrder, StatusAdvances, NormalizeStatus) move to job_status.go with their tests. ProcessedEmail stays in the migration, marked dormant, so its history survives for a restored pipeline. golang.org/x/oauth2 is no longer needed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
+1
-1
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* The REST half of the API client, beside graphql.js: a thin axios wrapper for
|
||||
* the tracker's JSON endpoints under /jobs/api that are not GraphQL (the
|
||||
* capture token and the email sync controls on the Settings page).
|
||||
* capture token on the Settings page).
|
||||
*
|
||||
* It does two things a bare axios call does not:
|
||||
* - prefixes the API base, so callers name the route
|
||||
|
||||
@@ -11,9 +11,9 @@
|
||||
* stores/jobApplications.js and stores/jobAppReferences.js; nothing here calls
|
||||
* gql() directly.
|
||||
*
|
||||
* Rows also arrive from three places that are not this page: the email
|
||||
* pipeline, the browser userscript in `public/job-capture.user.js`, which the
|
||||
* app shell's sidebar links to for installing, and the leads inbox at `/jobs/leads`
|
||||
* Rows also arrive from two places that are not this page: the browser
|
||||
* userscript in `public/job-capture.user.js`, which the app shell's sidebar
|
||||
* links to for installing, and the leads inbox at `/jobs/leads`
|
||||
* (JobLeads.vue), where tracking a lead adds it here as Saved.
|
||||
*/
|
||||
import { ref, computed, onMounted } from "vue";
|
||||
@@ -262,8 +262,8 @@ const visibleApplications = computed(() => {
|
||||
return false;
|
||||
if (staleOnly.value && !isStale(app)) return false;
|
||||
if (!q) return true;
|
||||
// Notes are searched because the email pipeline appends its findings
|
||||
// there, making them the de-facto history of the application.
|
||||
// Notes are searched because captures and promoted leads append to them,
|
||||
// making them the de-facto history of the application.
|
||||
return [app.jobTitle, app.company, app.location, app.notes]
|
||||
.filter(Boolean)
|
||||
.some((field) => field.toLowerCase().includes(q));
|
||||
|
||||
@@ -1,18 +1,13 @@
|
||||
<script setup>
|
||||
/**
|
||||
* Route `/jobs/settings` — the tracker's own controls, which used to live on
|
||||
* the main site's admin panel or only in the server log:
|
||||
* the main site's admin panel: the job capture token, the credential the
|
||||
* userscript (public/job-capture.user.js) sends. Only a hash is kept on the
|
||||
* server (DATA_DIR/job_capture_token.json), so a new token is shown exactly
|
||||
* once, in the response to generating it, and replacing it needs no restart.
|
||||
*
|
||||
* - the job capture token, the credential the userscript
|
||||
* (public/job-capture.user.js) sends. Only a hash is kept on the server
|
||||
* (DATA_DIR/job_capture_token.json), so a new token is shown exactly once,
|
||||
* in the response to generating it, and replacing it needs no restart;
|
||||
* - the email pipeline: whether it is reading mail, the Microsoft sign-in
|
||||
* link while it is not, and a manual sync.
|
||||
*
|
||||
* Environment settings (API keys, which mailbox, the timers) are not here:
|
||||
* they are the container's environment, edited on the main site's admin
|
||||
* panel.
|
||||
* Environment settings (API keys, the timers) are not here: they are the
|
||||
* container's environment, edited on the main site's admin panel.
|
||||
*/
|
||||
import { ref, onMounted } from "vue";
|
||||
import { api } from "@/api";
|
||||
@@ -91,40 +86,10 @@ async function copyToken() {
|
||||
}
|
||||
}
|
||||
|
||||
// --- email -----------------------------------------------------------------
|
||||
|
||||
// { backend, enabled, ready, authUrl? } from GET /api/email/status.
|
||||
const email = ref(null);
|
||||
const syncResult = ref("");
|
||||
|
||||
async function fetchEmail() {
|
||||
try {
|
||||
email.value = await api.get("/email/status", { fallback: "Failed to load the email status" });
|
||||
} catch (err) {
|
||||
error.value = err.message;
|
||||
}
|
||||
}
|
||||
|
||||
async function syncNow() {
|
||||
busy.value = true;
|
||||
syncResult.value = "";
|
||||
try {
|
||||
// Runs the whole sync before answering, so this can take a while.
|
||||
await api.post("/email/sync", undefined, { fallback: "Sync failed" });
|
||||
syncResult.value = `Synced at ${new Date().toLocaleTimeString()}.`;
|
||||
error.value = "";
|
||||
} catch (err) {
|
||||
error.value = err.data?.details ? `${err.message}: ${err.data.details}` : err.message;
|
||||
} finally {
|
||||
busy.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
const userscriptUrl = `${import.meta.env.BASE_URL}job-capture.user.js`;
|
||||
|
||||
onMounted(() => {
|
||||
fetchCaptureToken();
|
||||
fetchEmail();
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -134,8 +99,8 @@ onMounted(() => {
|
||||
<div>
|
||||
<h1 class="page-title">Settings</h1>
|
||||
<p class="page-sub">
|
||||
The capture script's token and the email pipeline. API keys, the mailbox and the
|
||||
timers are the container's environment, on the main site's admin panel.
|
||||
The capture script's token. API keys and the timers are the container's
|
||||
environment, on the main site's admin panel.
|
||||
</p>
|
||||
</div>
|
||||
</header>
|
||||
@@ -197,47 +162,6 @@ onMounted(() => {
|
||||
</template>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="card">
|
||||
<div class="card-header">
|
||||
<h2 class="card-title"><Icon name="mail" /> Email</h2>
|
||||
<span v-if="email" class="st-state">
|
||||
<span class="dot" :class="email.ready ? 'dot-ok' : email.backend ? 'dot-warn' : ''"></span>
|
||||
{{ email.ready ? "Connected" : email.backend ? "Not ready" : "Not configured" }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="card-body st-body">
|
||||
<template v-if="email">
|
||||
<p v-if="!email.backend" class="st-text">
|
||||
Not configured: set <code>EMAIL_BACKEND</code> to <code>graph</code> or
|
||||
<code>imap</code> and the matching credentials.
|
||||
</p>
|
||||
<template v-else>
|
||||
<p class="st-text">
|
||||
Reading mail over <strong>{{ email.backend === "graph" ? "Microsoft Graph" : "IMAP" }}</strong>.
|
||||
<template v-if="email.ready">
|
||||
{{ email.enabled ? "Syncs on a timer." : "The timer is off; sync by hand below." }}
|
||||
</template>
|
||||
<template v-else-if="email.authUrl">Not signed in yet.</template>
|
||||
<template v-else>Not ready: check the tracker's log.</template>
|
||||
</p>
|
||||
<p v-if="email.authUrl" class="st-text">
|
||||
<a :href="email.authUrl" rel="noopener">Sign in to Microsoft</a>. After signing in,
|
||||
restart the tracker so the timer picks the session up; "Sync now" works at once.
|
||||
</p>
|
||||
<div class="st-actions">
|
||||
<button class="btn" :disabled="busy || !email.ready" @click="syncNow">
|
||||
<span v-if="busy" class="spinner" aria-hidden="true"></span>
|
||||
<Icon v-else name="refresh" />
|
||||
{{ busy ? "Syncing…" : "Sync now" }}
|
||||
</button>
|
||||
<span class="hint">{{ syncResult }}</span>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
<p v-else class="hint">Loading…</p>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
*
|
||||
* This is a COPY. The source of truth is server-side: `enum JobStatus` in
|
||||
* internal/graph/schema/job_application.graphql, ranked by `statusOrder` in
|
||||
* internal/services/email_sync.go (the email pipeline only ever moves a row
|
||||
* forward through that order). The server rejects any value outside the enum,
|
||||
* internal/services/job_status.go (a capture only ever moves a row forward
|
||||
* through that order). The server rejects any value outside the enum,
|
||||
* so a status added here alone cannot be saved — add it there first.
|
||||
*
|
||||
* There is a third copy in web/public/job-capture.user.js (STATUS_LABELS). A
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
|
||||
export const STATUS_OPTIONS = [
|
||||
// Captured from the browser but not applied to yet. No email produces it.
|
||||
// Captured from the browser, or a promoted lead, but not applied to yet.
|
||||
{ value: "saved", label: "Saved" },
|
||||
{ value: "applied", label: "Applied" },
|
||||
{ value: "screening", label: "Screening" },
|
||||
|
||||
Reference in New Issue
Block a user