Skip to content

Commit 6c11888

Browse files
committed
More plausible
1 parent 40333f6 commit 6c11888

56 files changed

Lines changed: 623 additions & 895 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

client/src/api/evaluation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const confusionSamplesPath = (corpus: UUID): string =>
3131
`${confusionPath(corpus)}/download`
3232
export const distributionPath = (corpus: UUID): string =>
3333
`${evaluationPath(corpus)}/distribution`
34-
const metricsPath = (corpus: UUID): string =>
34+
export const metricsPath = (corpus: UUID): string =>
3535
`${evaluationPath(corpus)}/metrics`
3636
const metricsSamplesPath = (corpus: UUID): string =>
3737
`${metricsPath(corpus)}/download`

client/src/api/jobs.ts

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,9 @@ type JobsResponse = AxiosResponse<Job[]>
1010
type JobResponse = AxiosResponse<Job>
1111
export type ProgressResponse = AxiosResponse<Progress>
1212

13-
const jobsPath = (corpus: UUID): string => `/corpora/${corpus}/jobs`
13+
export const jobsPath = (corpus: UUID): string => `/corpora/${corpus}/jobs`
1414
const jobPath = (corpus: UUID, job: string): string =>
1515
`/corpora/${corpus}/jobs/${job}`
16-
const jobIsBusyPath = (corpus: UUID, job: string): string =>
17-
`/corpora/${corpus}/jobs/${job}/isBusy`
1816
const jobProgressPath = (corpus: UUID, job: string): string =>
1917
`/corpora/${corpus}/jobs/${job}/progress`
2018

@@ -26,15 +24,6 @@ export function getJobs(corpus: UUID): Promise<JobsResponse> {
2624
return axios.get(jobsPath(corpus), { params: { hasResult: false } })
2725
}
2826

29-
/**
30-
* Fetch a single job for a corpus.
31-
* @param corpus UUID of the corpus.
32-
* @param job Tagger job name.
33-
*/
34-
export function getJob(corpus: UUID, job: string): Promise<JobResponse> {
35-
return axios.get(jobPath(corpus, job))
36-
}
37-
3827
/**
3928
* Post a job to start it. Will return an immediate ProgressResponse.busy=true to give the illusion of a started job.
4029
* @param corpus UUID of the corpus.
@@ -58,16 +47,6 @@ export function cancelOrDeleteJob(
5847
return axios.delete(jobPath(corpus, job), { params: { hard: hard } })
5948
}
6049

61-
/**
62-
* Simplified job progress poll.
63-
*/
64-
export function getJobIsBusy(
65-
corpus: UUID,
66-
job: string
67-
): Promise<AxiosResponse<boolean>> {
68-
return axios.get(jobIsBusyPath(corpus, job))
69-
}
70-
7150
/**
7251
* Poll for job progress.
7352
*/

client/src/api/taggers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,5 @@ export function getTaggerHealth(tagger: string): Promise<TaggerHealthResponse> {
3535
* Summed over all taggers & corpora on the server.
3636
*/
3737
export function getDocsAtTaggers(): Promise<TaggersBusyResponse> {
38-
return axios.get(`${taggersPath}/active`)
38+
return axios.get(`${taggersPath}/queue`)
3939
}

client/src/api/useAxios.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export function useAxios<T>(
77
params?: MaybeRefOrGetter<Record<string, string | number | boolean>>,
88
pageReloadOnError?: boolean
99
): {
10-
data: Ref<T | undefined>
10+
data: Ref<T>
1111
loading: Ref<boolean>
1212
reload: () => void
1313
} {
@@ -20,7 +20,10 @@ export function useAxios<T>(
2020

2121
function execute(): void {
2222
const url: string | undefined = toValue(urlRef)
23-
if (url === undefined) return
23+
if (url === undefined) {
24+
data.value = initial
25+
return
26+
}
2427

2528
loading.value = true
2629
axios

client/src/components/AnnotateTab.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<GSpinner />
77
</GCard>
88
<!-- No corpus selected -->
9-
<GCard v-else-if="!corporaStore.activeCorpus && !hideCorpusError" title="No corpus selected">
9+
<GCard v-else-if="!corporaStore.corpus && !hideCorpusError" title="No corpus selected">
1010
<GInfo error>
1111
<p>No corpus has been selected.</p>
1212
<router-link to="/annotate/corpora">Select a corpus</router-link>
@@ -28,7 +28,7 @@
2828
<GSpinner />
2929
</GCard>
3030
<!-- No non-empty jobs-->
31-
<GCard v-else-if="jobSelectionStore.selectableJobs.length == 0 && !hideAnnotationsError" title="No annotations">
31+
<GCard v-else-if="jobSelectionStore.options.length == 0 && !hideAnnotationsError" title="No annotations">
3232
<GInfo error>
3333
<p>None of the documents have annotations. Either:</p>
3434
<ul>

client/src/components/GCard.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
<h3 class="h3">
66
<slot name="title">{{ title }}</slot>
77
</h3>
8-
<GButton v-if="$slots.help" class="help-btn" title="Help" plain @click="expand = !expand">
8+
<GButton v-if="$slots.help" class="help-btn" title="Help" plain
9+
@click="expand = !expand; plausible.helpClicked()">
910
{{ expand ? "&times;" : "?" }}
1011
</GButton>
1112
</hgroup>
@@ -26,6 +27,7 @@
2627
</template>
2728

2829
<script setup lang="ts">
30+
import { plausible } from "@/ts/plausible"
2931
import type { HelpLink } from "@/types/ui/help"
3032
3133
// --- props ---
@@ -36,7 +38,7 @@ const { helpLink, title } = defineProps<{
3638
}>()
3739
3840
// --- data ---
39-
const expand = ref(false)
41+
const expand = ref<boolean>()
4042
</script>
4143

4244
<style scoped lang="scss">

client/src/components/GSpinner.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99
</template>
1010

1111
<script setup lang="ts">
12-
const props = defineProps<{
12+
const { error, small, still } = defineProps<{
1313
error?: boolean
1414
small?: boolean
1515
still?: boolean
1616
}>()
1717
const classes = {
18-
error: props.error,
19-
small: props.small,
20-
still: props.still
18+
error: error,
19+
small: small,
20+
still: still
2121
}
2222
</script>
2323

client/src/components/help/CorpusHelp.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
<h2>Step 1: Corpora</h2>
33
<ol>
44
<li>Click <InlineTextButton green>new</InlineTextButton> to create a new corpus.</li>
5-
<li>Select a corpus and click <InlineTextButton orange>edit</InlineTextButton> to modify the metadata</li>
6-
<li>Select a corpus and click <InlineTextButton red>delete</InlineTextButton> to remove the selected corpus</li>
5+
<li>Select a corpus and click <InlineTextButton orange>edit</InlineTextButton> to modify the metadata.</li>
6+
<li>Select a corpus and click <InlineTextButton red>delete</InlineTextButton> to remove the selected corpus.
7+
</li>
78
</ol>
89
</template>

client/src/components/input/GButton.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ const { disabled, red, orange, green, plain, loading } = defineProps<{
1515
loading?: boolean
1616
}>()
1717
18-
const classes = computed(() => ({
18+
const classes = computed<Record<string, boolean>>(() => ({
1919
red: red,
2020
orange: orange,
2121
green: green,
2222
plain: plain,
2323
disabled: disabled
2424
}))
2525
26-
defineEmits<{
26+
const emit = defineEmits<{
2727
click: []
2828
}>()
2929
</script>

client/src/components/input/GInput.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const {
3030
focus?: boolean
3131
}>()
3232
33-
const inputElement = ref<HTMLInputElement>()
33+
const inputElement = useTemplateRef<HTMLInputElement>("inputElement")
3434
onMounted(() => {
3535
if (focus) {
3636
nextTick(() => {

0 commit comments

Comments
 (0)