Skip to content

Commit

Permalink
Merge branch 'develop': Extra search fields
Browse files Browse the repository at this point in the history
Also contains small fixes for labels and pagination and changes for
tailwind class usage (reuse multiple classes for more than one
component)
  • Loading branch information
joschrew committed Feb 29, 2024
2 parents f7b4a41 + 4dcb943 commit 5b0e585
Show file tree
Hide file tree
Showing 15 changed files with 203 additions and 210 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"jquery.easing": "^1.4.1",
"moment": "^2.24.0",
"oidc-client": "^1.11.5",
"pinia": "^2.1.7",
"postcss": "^8.4.33",
"primevue": "^3.42.0",
"streamsaver": "^2.0.3",
Expand Down
15 changes: 1 addition & 14 deletions src/components/dashview/Import.vue
Original file line number Diff line number Diff line change
Expand Up @@ -97,20 +97,7 @@

<!-- <button type="submit" class="btn btn-primary">Submit</button> -->
<div class="flex justify-end">
<button
type="submit"
class="
bg-sky-600
font-medium
px-4
py-2
mt-4
shadow-sm
rounded-md
text-white
hover:bg-sky-700
"
>
<button type="submit" class="normal-blue-button mt-4">
Submit
</button>
</div>
Expand Down
35 changes: 4 additions & 31 deletions src/components/download-files/Download.vue
Original file line number Diff line number Diff line change
@@ -1,22 +1,9 @@
<template>
<section>
<div class="
bg-gray-100
text-gray-700
flex
items-center
justify-between
flex-1
px-4
py-2
rounded-t
border-b
">
<div class="gray-div-header">
<h4 class="text-base">{{ "File structure" }}</h4>
<div>
<button @click="toggleExpand"
class="rounded border mr-4 px-3 py-1 border-sky-500 bg-sky-500 text-white dark:hover:bg-gray-700"
>
<button @click="toggleExpand" class="detail-blue-button">
<i
:class="[
Object.keys(this.expandedKeys).length ? 'fa-angle-double-up' : 'fa-angle-double-down',
Expand Down Expand Up @@ -47,22 +34,8 @@
</span>
</template>
</Tree>
<button @click="download" :disabled="!isOpen" class="
rounded
border
px-3
py-1
mr-4
ml-4
border-sky-500
bg-sky-500
text-white
dark:hover:bg-gray-700
whitespace-nowrap
max-h-9
disabled:bg-sky-200
disabled:border-sky-200
">
<button @click="download" :disabled="!isOpen"
class="detail-blue-button whitespace-nowrap max-h-9">
<i class="fas fa-download" /> {{ "Download" }}
</button>
</div>
Expand Down
25 changes: 3 additions & 22 deletions src/components/login/LoginBtnCustom.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
<div v-if="showDashboardLink">
<button
type="button"
class="bg-sky-600 font-medium px-4 py-2 shadow-sm rounded-md text-white
hover:bg-sky-700"
class="normal-blue-button"
id="dashboard-link-button"
@click="$router.push('dashview/dashboard')"
>
Expand All @@ -15,16 +14,7 @@
<div v-else-if="!isUserLoggedIn">
<button
type="button"
class="
bg-sky-600
font-medium
px-4
py-2
shadow-sm
rounded-md
text-white
hover:bg-sky-700
"
class="normal-blue-button"
id="user-menu-button"
aria-expanded="false"
aria-haspopup="true"
Expand All @@ -38,16 +28,7 @@
<div v-else>
<button
type="button"
class="
bg-sky-600
font-medium
px-4
py-2
shadow-sm
rounded-md
text-white
hover:bg-sky-700
"
class="normal-blue-button"
id="user-menu-button"
aria-expanded="false"
aria-haspopup="true"
Expand Down
25 changes: 3 additions & 22 deletions src/components/login/LoginBtnKeycloak.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
<div v-if="showDashboardLink">
<button
type="button"
class="bg-sky-600 font-medium px-4 py-2 shadow-sm rounded-md text-white
hover:bg-sky-700"
class="normal-blue-button"
id="dashboard-link-button"
@click="$router.push('dashview/dashboard')"
>
Expand All @@ -14,16 +13,7 @@
<div v-else-if="!isUserLoggedIn">
<button
type="button"
class="
bg-sky-600
font-medium
px-4
py-2
shadow-sm
rounded-md
text-white
hover:bg-sky-700
"
class="normal-blue-button"
id="user-menu-button"
aria-expanded="false"
aria-haspopup="true"
Expand All @@ -35,16 +25,7 @@
<div v-else>
<button
type="button"
class="
bg-sky-600
font-medium
px-4
py-2
shadow-sm
rounded-md
text-white
hover:bg-sky-700
"
class="normal-blue-button"
id="user-menu-button"
aria-expanded="false"
aria-haspopup="true"
Expand Down
67 changes: 14 additions & 53 deletions src/components/pagination/Pagination.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,7 @@
<li class="pr-4" v-if="hasPrev()">
<a href="#" @click.prevent="changePage(prevPage)">
<div
class="
flex
items-center
justify-center
hover:bg-gray-200
rounded-md
h-6
w-6
"
class="page-item"
>
<i class="fas fa-angle-left"></i>
</div>
Expand All @@ -33,17 +25,7 @@
<li class="pr-4" v-if="hasFirst()">
<a href="#" @click.prevent="changePage(1)">
<div
class="
flex
hover:bg-gray-200
rounded-md
transform
rotate-45
h-6
w-6
items-center
justify-center
"
class="page-item transform rotate-45"
>
<span class="transform -rotate-45"> 1 </span>
</div>
Expand All @@ -56,17 +38,7 @@
:class="{
'bg-gradient-to-r from-sky-200 to-sky-600': current == page,
}"
class="
flex
hover:bg-gray-200
rounded-md
transform
rotate-45
h-6
w-6
items-center
justify-center
"
class="page-item transform rotate-45"
>
<span class="transform -rotate-45">{{ page }}</span>
</div>
Expand All @@ -76,36 +48,18 @@
<li class="pr-4" v-if="hasLast()">
<a href="#" @click.prevent="changePage(totalPages)">
<div
class="
flex
hover:bg-gray-200
rounded-md
transform
rotate-45
h-6
w-6
items-center
justify-center
"
class="page-item transform rotate-45"
>
<span class="transform -rotate-45">
{{ totalPages }}
{{ totalPages }} a
</span>
</div>
</a>
</li>
<li class="pr-4" v-if="hasNext()">
<a href="#" @click.prevent="changePage(nextPage)">
<div
class="
flex
items-center
justify-center
hover:bg-gray-200
rounded-md
h-6
w-6
"
class="page-item"
>
<i class="fas fa-angle-right"></i>
</div>
Expand Down Expand Up @@ -234,4 +188,11 @@ export default {
</script>

<style scoped>
</style>
.page-item {
@apply flex items-center justify-center hover:bg-gray-200 rounded-md h-6 w-6
}
.page-item:hover {
@apply bg-gray-200
}
</style>
53 changes: 53 additions & 0 deletions src/components/search/ExtraFilters.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<template>
<div class="grid grid-cols-4 border rounded-md px-3 py-3 bg-gray-50">
<div>
<span class="text-sm font-medium text-sky-900 dark:text-sky-300 m-1 px-1">Author:</span>
<input type="text" class="w-56 px-1 m-1 border rounded-sm" :value="extraFilters['author']"
@change="handleFilterChange($event.target.value, 'author')" />
</div>
<div>
<span class="text-sm font-medium text-sky-900 dark:text-sky-300 m-1 px-1">Title:</span>
<input type="text" class="w-56 px-1 m-1 border rounded-sm" :value="extraFilters['title']"
@change="handleFilterChange($event.target.value, 'title')" />
</div>
<div>
<span class="text-sm font-medium text-sky-900 dark:text-sky-300 m-1 px-1">Place:</span>
<input type="text" class="w-56 px-1 m-1 border rounded-sm" :value="extraFilters['place']"
@change="handleFilterChange($event.target.value, 'place')" />
</div>
<div>
<span class="text-sm font-medium text-sky-900 dark:text-sky-300 m-1 px-1">Year:</span>
<input type="text" class="w-56 px-1 m-1 border rounded-sm" :value="extraFilters['year']"
@change="handleFilterChange($event.target.value, 'year')" />
</div>
</div>
</template>

<script>
export default {
data() {
return {
filters: {}
}
},
props: {
extraFilters: {
type: Object,
default: {},
},
onFilterChange: {
type: Function,
default: () => {},
}
},
methods: {
handleFilterChange(value, fieldname) {
this.filters[fieldname] = value
this.onFilterChange(this.filters);
},
}
}
</script>

<style scoped>
</style>
4 changes: 2 additions & 2 deletions src/components/search/FacetField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ export default {
isExpanded: false,
value: [],
labelsMap: {
"Publish Year": "Place of Publication",
"Place": "Year of Publication",
"Publish Year": "Year of Publication",
"Place": "Place of Publication",
}
};
},
Expand Down
15 changes: 1 addition & 14 deletions src/components/version/Versions.vue
Original file line number Diff line number Diff line change
@@ -1,19 +1,6 @@
<template>
<section>
<div
class="
bg-gray-100
text-gray-700
flex
items-center
justify-between
flex-1
px-4
py-2
rounded-t
border-b
"
>
<div class="gray-div-header">
<h4 class="text-base">{{ "Other versions" }}</h4>
</div>
<div class="px-4 py-2 border-b">
Expand Down
22 changes: 21 additions & 1 deletion src/index.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
@tailwind utilities;

.normal-blue-button {
@apply bg-sky-600 font-medium px-3 py-1 mt-1 shadow-sm text-white rounded-md;
}
.normal-blue-button:hover {
@apply hover:bg-sky-700
}

.detail-blue-button {
@apply rounded border mr-4 px-3 py-1 border-sky-500 bg-sky-500 text-white
}

.detail-blue-button:disabled {
@apply bg-sky-200 border-sky-200
}

.gray-div-header {
@apply text-gray-700 flex items-center justify-between px-4 py-2 rounded-t border-b
bg-gray-100
}
Loading

0 comments on commit 5b0e585

Please sign in to comment.