Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,72 +13,61 @@
/>
<p
v-else-if="savedSearches.length === 0"
class="grey--text pa-2"
class="empty-state"
>
{{ $tr('noSavedSearches') }}
</p>
<VList v-else>
<template v-for="(search, index) in savedSearches">
<VListTile
:key="index"
class="py-2"
>
<VListTileContent>
<VListTileTitle>
<ActionLink
class="font-weight-bold"
:to="searchResultsRoute(search)"
:text="search.name"
@click="dialog = false"
/>
</VListTileTitle>
<VListTileSubTitle class="metadata">
<span>
{{ $formatRelative(search.created, { now: new Date() }) }}
</span>
<span>
{{ $tr('filterCount', { count: searchFilterCount(search) }) }}
</span>
</VListTileSubTitle>
</VListTileContent>

<VListTileAction>
<IconButton
icon="clear"
color="grey"
:text="$tr('deleteAction')"
@click="handleClickDelete(search.id)"
/>
</VListTileAction>
</VListTile>
<VDivider
v-if="index < savedSearches.length - 1"
:key="index + 'divider'"
/>
</template>
</VList>
<ul
v-else
class="saved-searches-list"
>
<li
v-for="(search, index) in savedSearches"
:key="search.id"
class="search-item"
>
<div class="search-content">
<div class="search-title">
<KRouterLink
:to="searchResultsRoute(search)"
class="notranslate saved-search-link"
@click="dialog = false"
>
{{ search.name }}
</KRouterLink>
</div>
<div class="metadata">
<span>
{{ $formatRelative(search.created, { now: new Date() }) }}
</span>
<span>
{{ $tr('filterCount', { count: searchFilterCount(search) }) }}
</span>
</div>
</div>

<div class="search-actions">
<IconButton
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you please replace by KIconButton? I think using the proxy component in this case doesn't have any additional impact (and later as part of migrating to KDS fully, we will remove IconButton anyway)

icon="clear"
color="grey"
:text="$tr('deleteAction')"
@click="handleClickDelete(search.id)"
/>
</div>
</li>
</ul>
</KModal>

<MessageDialog
v-model="showDelete"
:header="$tr('deleteSearchTitle')"
:text="$tr('deleteConfirmation')"
<KModal
v-if="showDelete"
:title="$tr('deleteSearchTitle')"
:cancelText="$tr('cancelAction')"
:submitText="$tr('deleteAction')"
@cancel="handleCancel"
@submit="handleDeleteConfirm"
>
<template #buttons>
<VBtn
flat
@click="handleCancel"
>
{{ $tr('cancelAction') }}
</VBtn>
<VBtn
color="primary"
@click="handleDeleteConfirm"
>
{{ $tr('deleteAction') }}
</VBtn>
</template>
</MessageDialog>
<p>{{ $tr('deleteConfirmation') }}</p>
</KModal>
</div>

</template>
Expand All @@ -87,14 +76,12 @@
<script>
import { mapActions, mapGetters } from 'vuex';
import MessageDialog from 'shared/views/MessageDialog';
import IconButton from 'shared/views/IconButton';
export default {
name: 'SavedSearchesModal',
inject: ['RouteNames'],
components: {
MessageDialog,
IconButton,
},
props: {
Expand Down Expand Up @@ -189,7 +176,44 @@

<style scoped lang="scss">
.empty-state {
padding: 8px;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you remove this padding? I realize that you used it to preserve the original experience as requested - thanks for paying attention to that :)

I just think that here it'd be more meaningful to rely on default KModal alignment (even though in some cases we make exceptions, generally one of the purposes of KDS components in consistency).

color: var(--v-grey-base);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
.saved-searches-list {
padding: 0;
margin: 0;
list-style: none;
}
.search-item {
display: flex;
align-items: center;
justify-content: space-between;
padding: 16px 0;
border-bottom: 1px solid rgba(0, 0, 0, 0.12);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

&:last-child {
border-bottom: none;
}
}
.search-content {
flex: 1;
min-width: 0;
}
.search-title {
margin-bottom: 4px;
}
.saved-search-link {
font-weight: 600;
}
.metadata {
font-size: 14px;
color: var(--v-grey-darken2);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://design-system.learningequality.org/colors#tokens-annotation

Same token will replace var(--v-grey-base); currently used for the separator dot (defined below on line 221).

span:not(:last-child)::after {
Expand All @@ -199,4 +223,9 @@
}
}
.search-actions {
flex-shrink: 0;
margin-left: 16px;
}
</style>
Loading