Skip to content

Commit

Permalink
adding save search button
Browse files Browse the repository at this point in the history
  • Loading branch information
prakhyatox committed Apr 17, 2024
1 parent 358572d commit 03e4a77
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 59 deletions.
22 changes: 22 additions & 0 deletions src/components/Records/Search/SaveSearch/SaveSearchButton.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<template>
<v-btn class="mb-2 white--text" color="accent2" small>
Save Search Results
</v-btn>
</template>

<script>
export default {
name: "SaveSearchButton",
props: {
value: {
type: Array,
default: () => [],
},
},
data: () => {
return {};
},
methods: {},
};
</script>
78 changes: 19 additions & 59 deletions src/views/AdvancedSearch/AdvancedSearchResultTable.vue
Original file line number Diff line number Diff line change
@@ -1,39 +1,24 @@
<template>
<div
v-if="getErrorStatus"
fluid
class="pa-0"
>
<div v-if="getErrorStatus" fluid class="pa-0">
<ErrorPage />
</div>
<div
v-else
fluid
class="pa-5 mb-15"
>
<v-btn
class="mb-2"
color="primary"
small
@click="downloadResults()"
>
<div v-else fluid class="pa-5 mb-15">
<v-btn class="mb-2" color="primary" small @click="downloadResults()">
Download Results
</v-btn>
<SaveSearchButton />

<p class="body-2 mb-0">
<v-icon
x-small
class="infoIcon"
>
{{ "fa fa-info" }}
</v-icon>Find out more about our Advanced Search in our
<v-icon x-small class="infoIcon">
{{ "fa fa-info" }} </v-icon
>Find out more about our Advanced Search in our
<a
href="https://fairsharing.gitbook.io/fairsharing/how-to/advanced-search"
target="_blank"
class="text-decoration-underline"
>gitbook documentation<v-icon x-small>
{{ "fa fa-link" }}
</v-icon>
>gitbook documentation<v-icon x-small>
{{ "fa fa-link" }}
</v-icon>
</a>
</p>
<v-data-iterator
Expand All @@ -58,11 +43,7 @@
items-per-page-text="Records per page:"
@update:options="updateOptions"
/>
<v-toolbar
dark
color="blue lighten-1"
class="mb-5"
>
<v-toolbar dark color="blue lighten-1" class="mb-5">
<v-text-field
v-model="search"
clearable
Expand All @@ -84,24 +65,11 @@
label="Sort by"
/>
<v-spacer />
<v-btn-toggle
v-model="sortDesc"
mandatory
>
<v-btn
large
depressed
color="blue"
:value="false"
>
<v-btn-toggle v-model="sortDesc" mandatory>
<v-btn large depressed color="blue" :value="false">
<v-icon>mdi-arrow-up</v-icon>
</v-btn>
<v-btn
large
depressed
color="blue"
:value="true"
>
<v-btn large depressed color="blue" :value="true">
<v-icon>mdi-arrow-down</v-icon>
</v-btn>
</v-btn-toggle>
Expand All @@ -112,11 +80,7 @@
<!-- data section begins -->
<template #default="props">
<v-row>
<v-col
v-for="item in props.items"
:key="item.name"
cols="12"
>
<v-col v-for="item in props.items" :key="item.name" cols="12">
<v-card>
<v-card-title class="subheading font-weight-bold">
<RecordStatus :record="item" />
Expand All @@ -140,34 +104,30 @@
{{ item.description }}
</p>

<TagChips
:record="item"
class="ml-10"
/>
<TagChips :record="item" class="ml-10" />
<p class="pb-5" />
</v-card>
</v-col>
</v-row>
</template>
<!-- data section ends -->

<template #loading>
Loading...
</template>
<template #loading> Loading... </template>
</v-data-iterator>
</div>
</template>
<script>
import { mapActions, mapGetters } from "vuex";
import SaveSearchButton from "@/components/Records/Search/SaveSearch/SaveSearchButton.vue";
import RecordStatus from "@/components/Records/Shared/RecordStatus.vue";
import TagChips from "@/components/Records/Shared/TagChips.vue";
import advancedSearch from "@/store";
import recordsCardUtils from "@/utils/recordsCardUtils";
import ErrorPage from "@/views/Errors/404.vue";
export default {
name: "AdvancedSearchResultTable",
components: { RecordStatus, TagChips, ErrorPage },
components: { RecordStatus, TagChips, ErrorPage, SaveSearchButton },
mixins: [recordsCardUtils],
data() {
return {
Expand Down

0 comments on commit 03e4a77

Please sign in to comment.