Skip to content

Commit bedce4b

Browse files
committed
Client - SEBSERV-902-GUI-Client-SearchBar - Refactor Layout - Add dense variable. Prop searchTitle for SearchBar is now optional
1 parent e64f6ba commit bedce4b

8 files changed

Lines changed: 11 additions & 17 deletions

File tree

client/src/components/blocks/filters/FilterChip.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<v-chip
33
size="small"
4-
:color="color || (active ? 'primary' : undefined)"
4+
:color="color ?? (active ? 'primary' : undefined)"
55
:variant="active ? 'flat' : 'tonal'"
66
class="cursor-pointer font-weight-medium"
77
@click="emit('toggle')"

client/src/components/blocks/filters/FilterSection.vue

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,6 @@
66
>
77
{{ title }}
88
</span>
9-
<v-chip
10-
v-if="selectedCount > 0"
11-
size="x-small"
12-
color="primary"
13-
variant="flat"
14-
>
15-
{{ selectedCount }}
16-
</v-chip>
179
</div>
1810
<div class="d-flex flex-wrap ga-2">
1911
<FilterChip
@@ -29,7 +21,6 @@
2921
</template>
3022

3123
<script setup lang="ts">
32-
import { computed } from "vue";
3324
import FilterChip from "./FilterChip.vue";
3425
import type { FilterOption } from "./filterTypes.ts";
3526
@@ -43,8 +34,6 @@ const emit = defineEmits<{
4334
"update:modelValue": [value: string | null];
4435
}>();
4536
46-
const selectedCount = computed(() => (props.modelValue ? 1 : 0));
47-
4837
function toggle(value: string) {
4938
emit("update:modelValue", props.modelValue === value ? null : value);
5039
}

client/src/components/blocks/searches/SearchBar.vue

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div class="pa-6 pt-0">
2+
<div class="pa-6" :class="{ 'pt-0': dense }">
33
<v-row align="start">
44
<v-col
55
cols="12"
@@ -9,7 +9,7 @@
99
<span
1010
class="text-caption text-medium-emphasis text-uppercase font-weight-medium"
1111
>
12-
{{ $t("general.searchTitle") }}
12+
{{ $t(searchTitle ?? "general.searchTitle") }}
1313
</span>
1414
<SearchBox
1515
:model-value="modelValue"
@@ -71,7 +71,7 @@
7171
v-for="pill in activePills"
7272
:key="`${pill.sectionKey}-${pill.option.value}`"
7373
size="small"
74-
:color="pill.option.color || 'primary'"
74+
:color="pill.option.color ?? 'primary'"
7575
variant="tonal"
7676
closable
7777
class="font-weight-medium"
@@ -179,11 +179,13 @@ const props = withDefaults(
179179
searchText: string;
180180
filterSections: FilterSectionDef[];
181181
filterValues: TableFilters;
182+
searchTitle?: string;
182183
dateTitle?: string;
183184
dateValue?: Date | null;
184185
actions?: SearchBarAction[];
186+
dense?: boolean;
185187
}>(),
186-
{ actions: () => [], dateTitle: undefined, dateValue: null },
188+
{ actions: () => [], dateTitle: undefined, dateValue: null, dense: false },
187189
);
188190
189191
const emit = defineEmits<{

client/src/components/views/seb-server/assessment-tool/assessment-tools/AssessmentTools.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
search-text="assessmentToolConnections.assessmentToolsPage.filters.searchField"
1515
:filter-sections="filterSections"
1616
:filter-values="selectedFilters"
17+
dense
1718
@search="onSearch"
1819
@clear="onClearSearch"
1920
@update:filter-values="setFilters"

client/src/components/views/seb-server/certificate/certificates/CertificatesList.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
search-text="certificates.filters.searchField"
1515
:filter-sections="[]"
1616
:filter-values="{}"
17+
dense
1718
@search="onSearch"
1819
@clear="onClearSearch"
1920
@clear-filters="onClearSearch"

client/src/components/views/seb-server/connection-configuration/connection-configurations/ConnectionConfigurations.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
search-text="connectionConfigurations.connectionConfigurationsPage.filters.searchField"
1515
:filter-sections="filterSections"
1616
:filter-values="selectedFilters"
17+
dense
1718
@search="onSearch"
1819
@clear="onClearSearch"
1920
@update:filter-values="setFilters"

client/src/components/views/seb-server/exam/exams/ExamList.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
<SearchBar
88
v-model="searchInputValue"
99
search-text="examList.info.examNameSearchPlaceholder"
10-
search-title="general.searchTitle"
1110
date-title="examList.info.examStartSearchPlaceholder"
1211
:date-value="dateValue"
1312
:filter-sections="filterSections"

client/src/components/views/seb-server/user-account/user-accounts/UserAccounts.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
search-text="userAccount.userAccountPage.filters.searchField"
1515
:filter-sections="filterSections"
1616
:filter-values="selectedFilters"
17+
dense
1718
@search="onSearch"
1819
@clear="onClearSearch"
1920
@update:filter-values="setFilters"

0 commit comments

Comments
 (0)