Skip to content

Commit

Permalink
On index page, the "mark all observations as seen" link is removed.
Browse files Browse the repository at this point in the history
This makes sense from a UX perspective since the observation status doesn't really make sense anymore outside of alerts (it is always seen)
  • Loading branch information
niconoe committed Nov 8, 2024
1 parent de97705 commit f1aaa4f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 16 deletions.
7 changes: 6 additions & 1 deletion assets/ts/components/ObservationStatusSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
></ObservationStatusSelectorEntry>
</div>

<p class="m-0" v-if="counts.unseen > 0">
<p class="m-0" v-if="counts.unseen > 0 && !skipMarkAction">
<a @click="confirmationModalOpen = true" href="#"
>{{ $t("message.markAllObservationsAsSeen")}}</a
>
Expand Down Expand Up @@ -65,6 +65,11 @@ export default defineComponent({
type: Object as () => EndpointsUrls,
required: true,
},
// The skipMarkAction prop is used to skip the markAllObservationsAsSeen link/action
skipMarkAction: {
type: Boolean,
default: false,
},
},
data: function () {
return {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
<template>
<div class="row">
<div class="col-sm my-2">
<bootstrap-alert
v-if="showInProgressMessage"
@clickClose="showInProgressMessage = false"
alert-type="success"
class="my-2"
>
<i class="bi bi-info-circle"></i>
The observations are marked as seen in the background. This might take a
couple of minutes if there are a lot of observations. Don't hesitate to
refresh the page.
</bootstrap-alert>

<div class="row">
<div class="col-2 d-flex align-items-center">
<b>{{ $t("message.filters") }}</b>
Expand Down Expand Up @@ -94,9 +82,9 @@
<ObservationStatusSelector
v-if="frontendConfig.authenticatedUser"
v-model="filters.status"
:skip-mark-action="true"
:endpoints-urls="frontendConfig.apiEndpoints"
:filters="filters"
@markAsSeenQueued="showInProgressMessage = true"
></ObservationStatusSelector>
</div>
</div>
Expand Down Expand Up @@ -142,7 +130,6 @@ interface IndexPageRootComponentData {
availableDataImports: DataImportInformation[];
filters: DashboardFilters;
debouncedUpdateDateFilters: null | DebouncedFunc<(range: DateRange) => void>;
showInProgressMessage: boolean;
}
export default defineComponent({
Expand All @@ -166,7 +153,6 @@ export default defineComponent({
filters: initialFilters,
debouncedUpdateDateFilters: null,
showInProgressMessage: false,
};
},
computed: {
Expand Down

0 comments on commit f1aaa4f

Please sign in to comment.