Skip to content

Commit

Permalink
Fix/sq in job item (#1386)
Browse files Browse the repository at this point in the history
* add correct field from IML

* add and test update bitmap Job (staff only)
  • Loading branch information
danieleguido authored Nov 30, 2024
1 parent 95f814f commit 84ffd84
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 8 deletions.
14 changes: 12 additions & 2 deletions src/components/UserArea.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
<b-dropdown-item v-if="user && user.isStaff" v-on:click="test()">{{
$t('send_test_job')
}}</b-dropdown-item>
<b-dropdown-item v-if="user && user.isStaff" v-on:click="send_update_bitmap()">{{
$t('send_update_bitmap')
}}</b-dropdown-item>
<b-dropdown-item
target="_blank"
href="https://join.slack.com/t/impresso-community/shared_invite/enQtNTg5MzY2NDg2NTAyLTdiMmI2ZWU5ZjliNGNjN2M4NTgxM2UzOTQyYTkxYWU4MTgwN2I1MzQxMzg3N2Y0NGU3OGFjMzFmMGIyNGRlZmQ"
Expand All @@ -38,7 +41,7 @@
<script setup lang="ts">
import { computed } from 'vue'
import Icon from './base/Icon.vue'
import { jobs as jobsService } from '@/services'
import { jobs as jobsService, termsOfUse as termsOfUseService } from '@/services'
const props = defineProps({
user: {
Expand Down Expand Up @@ -66,6 +69,10 @@ const userRole = computed(() => {
const test = () => {
return jobsService.create({})
}
const send_update_bitmap = () => {
return termsOfUseService.patch(0, {})
}
const userPicture = computed(() => {
const style: {
backgroundImage?: string
Expand Down Expand Up @@ -96,7 +103,10 @@ const userPicture = computed(() => {
"logout": "Logout",
"join_slack_channel": "Join Slack Channel",
"current_version": "Current version: {version}",
"send_test_job": "[staff only] Send test job"
"send_test_job": "[staff only] Send test job",
"send_update_bitmap":
"[staff only] Test update bitmap"

}
}
</i18n>
Expand Down
11 changes: 5 additions & 6 deletions src/components/modules/lists/JobItem.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<template>
<div class="JobItem" :class="className">
<h2 class="sans mt-3 mb-1 font-weight-medium font-size-inherit">
<h2 class="sans mt-2 mb-1 font-weight-medium font-size-inherit">
<span
v-html="
$t(`jobs_type_${item.type}`, {
total: item.extra.total > -1 ? $n(item.extra.total) : ''
})
"
/>
<span v-if="item.extra.collection">: {{ item.extra.collection.name }} </span>&nbsp;
<span v-if="item.extra.collection?.name">: {{ item.extra.collection.name }} </span>&nbsp;
<span class="small-caps ml-2" :class="[item.status]">{{
$t(`jobs_status_${item.status}`)
}}</span>
Expand All @@ -17,7 +17,7 @@
{{ $d(item.creationDate, 'precise') }}
(#{{ item.id }})
</div>
<blockquote v-if="item.extra.collection" class="pl-2 my-1 border-left">
<blockquote v-if="item.extra.collection?.name" class="pl-2 my-1 border-left">
<span>
<router-link
class="text-white text-decoration-underline"
Expand All @@ -29,12 +29,11 @@
</span>
<span v-html="item.extra.collection.description" class="small" />
</blockquote>
<blockquote v-else class="pl-2 my-1 border-left">
<blockquote v-else-if="hasSearchQuery" class="pl-2 mt-1 mb-2 border-left">
<span v-html="item.description" class="small" />

&nbsp;
<button
v-if="hasSearchQuery"
class="btn btn-xs text-white btn-outline-white d-inline-flex align-items-center"
@click="gotoSearchPage"
>
Expand Down Expand Up @@ -168,7 +167,7 @@ span.DON {
"jobs_type_BCQ": "Saving {total} item(s) in your collection",
"jobs_type_RDX": "Remove {total} item(s) from your collection",
"jobs_type_BCT": "Add {total} item(s) to your collection from Text Reuse",
"jobs_type_UUB": "Update permissions",
"jobs_status_DON": "done",
"jobs_status_RUN": "in progress",
"jobs_status_ERR": "error",
Expand Down
1 change: 1 addition & 0 deletions src/services/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ export const articlesSearch = app.service('articles-search')
export const entityMentionsTimeline = app.service('entity-mentions-timeline')
export const textReuseConnectedClusters = app.service('text-reuse-connected-clusters')
export const passwordReset = app.service('password-reset')
export const termsOfUse = app.service('terms-of-use')

export const MIDDLELAYER_API = import.meta.env.VITE_MIDDLELAYER_API
export const MIDDLELAYER_MEDIA_PATH = import.meta.env.VITE_MIDDLELAYER_MEDIA_PATH
Expand Down
4 changes: 4 additions & 0 deletions src/stores/jobs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ export const useJobsStore = defineStore('jobs', {
d =>
new Job({
...d,
extra: {
...d.extra,
sq: d.extra?.query_hash ?? ''
},
progress: d.extra ? d.extra.progress : 0
})
)
Expand Down

0 comments on commit 84ffd84

Please sign in to comment.