Skip to content

Commit

Permalink
fix: GEO-1091 fix code smells (#723)
Browse files Browse the repository at this point in the history
  • Loading branch information
banders authored Sep 5, 2024
1 parent 848bb6f commit 85044fd
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
1 change: 0 additions & 1 deletion admin-frontend/src/components/DashboardPage.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<template>Dashboard placeholder</template>

<script lang="ts"></script>
<style></style>
13 changes: 8 additions & 5 deletions admin-frontend/src/components/ReportsPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
<v-btn
class="btn-primary"
prepend-icon="mdi-export"
@click="exportResults()"
:disabled="!searchResults?.length || isDownloadingCsv"
:loading="isDownloadingCsv"
@click="exportResults()"
>
Export results (CSV)
</v-btn>
Expand All @@ -49,10 +49,10 @@
"
@update:options="updateSearch"
>
<template v-slot:item.update_date="{ item }">
<template #item.update_date="{ item }">
{{ formatDate(item.update_date) }}
</template>
<template v-slot:item.actions="{ item }">
<template #item.actions="{ item }">
<v-btn
aria-label="Open Report"
density="compact"
Expand Down Expand Up @@ -93,6 +93,7 @@ import { ReportKeys } from '../types/reports';
import ApiService from '../services/apiService';
import ConfirmationDialog from './util/ConfirmationDialog.vue';
import { formatDate } from '../utils/date';
import { NotificationService } from '../services/notificationService';
const reportsCurrentlyBeingDownloaded = ref({});
const reportSearchStore = useReportSearchStore();
Expand All @@ -109,7 +110,7 @@ const confirmDialog = ref<typeof ConfirmationDialog>();
const itemsPerPageOptions = ref([
{ value: 10, title: '10' },
{ value: 25, title: '25' },
{ value: 50, title: '50' }
{ value: 50, title: '50' },
]);
const headers = ref<any>([
Expand Down Expand Up @@ -187,7 +188,9 @@ async function viewReportInNewTab(reportId: string) {
window.open(objectUrl);
} catch (e) {
console.log(e);
//Todo: show a Snackbar notification describing the error
NotificationService.pushNotificationError(
'Something went wrong. Unable to download report.',
);
}
clearReportDownloadInProgress(reportId);
}
Expand Down
14 changes: 7 additions & 7 deletions admin-frontend/src/components/TokenExpired.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@
<AuthLayout>
<template #content>
<v-container fluid class="root">
<h1 class="title mb-2">Session Expired</h1>
<v-alert dense variant="outlined" class="alert-error mb-3">
<h1 class="text-h6 mb-2">Session Expired</h1>
<v-alert density="compact" variant="outlined" class="alert-error mb-3">
Your session has expired.
</v-alert>
<v-btn class="btn-primary" @click="clearStorageAndRedirectToLogin">Login Again</v-btn>
<v-btn class="btn-primary" @click="clearStorageAndRedirectToLogin"
>Login Again</v-btn
>
</v-container>
</template>
</AuthLayout>
</template>

<script setup lang='ts'>
import { storeToRefs } from 'pinia';
<script setup lang="ts">
import { authStore } from '../store/modules/auth';
import { mapState } from 'pinia';
import { AuthRoutes } from '../utils/constant';
import { sanitizeUrl } from '@braintree/sanitize-url';
import AuthLayout from './util/AuthLayout.vue';
const authRoutesLogin = sanitizeUrl(AuthRoutes.LOGIN_AZUREIDIR);
const { isAuthenticated } = storeToRefs(authStore);
const clearStorageAndRedirectToLogin = () => {
authStore().setJwtToken();
window.location.href = authRoutesLogin;
Expand Down

0 comments on commit 85044fd

Please sign in to comment.