Merge branch 'feat/wordings-update-sequence' into 'develop'

fix typescript error & update pictures

Closes #64

See merge request geovisio/website!132
This commit is contained in:
Jean Andreani
2024-03-19 14:03:07 +00:00
5 changed files with 30 additions and 17 deletions

View File

@@ -38,7 +38,6 @@
/>
</div>
<div class="entry-button">
{{ isLoading }}
<Button
look="button--blue"
:text="$t('pages.sequence.orientation_panel_button')"

View File

@@ -67,6 +67,8 @@
"orientation_input_placeholder": "Value between -180 and 180",
"orientation_input_error_value": "Value must be between -180 and 180",
"orientation_panel_button": "Validate position",
"orientation_updated": "Orientation updated",
"sort_updated": "Sequence sorted",
"sort_panel_title": "Sequence sort setting",
"sort_panel_settings": "Sort sequence by:",
"sort_panel_settings_order": "Order :",
@@ -100,7 +102,6 @@
"filter_date_upload_title": "Filter by upload date",
"filter_date_title": "Filter by shooting date :",
"radio_date_placeholder": "03/01/2024",
"radio_datetime_placeholder": "03/01/2024 12:00 AM",
"radio_date": "date",
"hide_button": "Hide",
"show_button": "Show",
@@ -114,6 +115,7 @@
"sequence_creation": "Upload",
"sequence_creation_tooltip": "Filter by uploaded date",
"sequence_date_tooltip": "Filter by shooting date",
"reset_filter_button": "Reset the filters",
"filter_bbox_button": "Search on this area",
"sequence_status": "Status",
"sequence_published": "Published",

View File

@@ -67,6 +67,8 @@
"orientation_input_placeholder": "-180 és 180 közötti érték",
"orientation_input_error_value": "Az értéknek -180 és 180 között kell lennie",
"orientation_panel_button": "Pozíció ellenőrzése",
"orientation_updated": "A tájolás megváltozott",
"sort_updated": "A sorozat jól van rendezve",
"sort_panel_title": "Szekvenciás rendezés beállítása",
"sort_panel_settings": "Sorrend rendezése:",
"sort_panel_settings_order": "Rendelés :",
@@ -100,7 +102,6 @@
"filter_date_upload_title": "Szűrés feltöltés dátuma szerint :",
"filter_date_title": "Szűrés forgatás dátuma szerint :",
"radio_date_placeholder": "03/01/2024",
"radio_datetime_placeholder": "03/01/2024 12:00 AM",
"radio_date": "dátum",
"hide_button": "Elrejt",
"show_button": "Előadás",
@@ -114,6 +115,7 @@
"sequence_creation": "Feltöltés ideje",
"sequence_creation_tooltip": "Szűrés feltöltés dátuma szerint",
"sequence_date_tooltip": "Szűrés forgatás dátuma szerint",
"reset_filter_button": "Szűrők visszaállítása",
"filter_bbox_button": "Keresés ezen a területen",
"sequence_status": "Állapot",
"sequence_published": "Közzétéve",

View File

@@ -228,6 +228,7 @@ let itemSelected = ref<string>('')
let isLoading = ref<boolean>(false)
let isLoadingTitle = ref<boolean>(false)
let isLoadingOrient = ref<boolean>(false)
let isLoadingSort = ref<boolean>(false)
let seqDegrees = ref<number>(0)
let seqBruteDeg = ref<number>(0)
let panelView = ref<string>('photos')
@@ -378,7 +379,9 @@ function toggleMenu() {
setHeightValue()
}
function formatSequenceFetched(collectionInfo: ResponseUserSequenceInterface) {
function formatSequenceFetched(
collectionInfo: ResponseUserSequenceInterface
): void {
const times = ['hours', 'minutes', 'seconds']
sequence.value = {
...collectionInfo,
@@ -449,22 +452,28 @@ function triggerCheck(value: CheckboxInterface): void {
}
async function orientSequence(value: number): Promise<void> {
isLoadingOrient.value = true
await patchACollection(route.params.id, {
relative_heading: value
})
const fetchCollectionInfo = await fetchCollection(route.params.id)
formatSequenceFetched(fetchCollectionInfo.data)
const { data }: { data: ResponseUserSequenceInterface } =
await patchACollection(route.params.id, {
relative_heading: value
})
formatSequenceFetched(data)
if (viewerRef.value) viewerRef.value.viewer.clearPictureMetadataCache()
sequenceStore.addToastText(t('pages.sequence.orientation_updated'), 'success')
isLoadingOrient.value = false
}
async function sortSequence(value: string): Promise<void> {
await patchACollection(route.params.id, {
sortby: value
})
const fetchCollectionInfo = await fetchCollection(route.params.id)
formatSequenceFetched(fetchCollectionInfo.data)
isLoadingSort.value = true
const { data }: { data: ResponseUserSequenceInterface } =
await patchACollection(route.params.id, {
sortby: value
})
formatSequenceFetched(data)
const collItems = await fetchCollectionItems(route.params.id, '?limit=100')
selfLink.value = collItems.data.links.filter((el) => el.rel === 'self')
paginationLinks.value = formatPaginationItems(collItems.data.links)
pictures.value = collItems.data.features
sequenceStore.addToastText(t('pages.sequence.sort_updated'), 'success')
isLoadingSort.value = false
}
function selectPhotoToDeleteOrPatch(
item: ResponseUserPhotoInterface

View File

@@ -2,7 +2,8 @@ import axios from 'axios'
import type {
ResponseUserPhotoInterface,
ResponseUserPhotoLinksInterface,
ResponseUserSequenceInterface
ResponseUserSequenceInterface,
UserSequenceInterface
} from '@/views/interfaces/MySequenceView'
function deleteACollection(collectionId: string | string[]): Promise<unknown> {
@@ -12,14 +13,14 @@ function deleteACollection(collectionId: string | string[]): Promise<unknown> {
function patchACollection(
collectionId: string | string[],
fieldObject: object
): Promise<unknown> {
): Promise<{ data: ResponseUserSequenceInterface }> {
return axios.patch(`api/collections/${collectionId}`, fieldObject)
}
function deleteACollectionItem(
collectionId: string | string[],
itemId: string
): Promise<unknown> {
): Promise<{ data: UserSequenceInterface }> {
return axios.delete(`api/collections/${collectionId}/items/${itemId}`)
}