-
Notifications
You must be signed in to change notification settings - Fork 257
[Remove Vuetify from Studio] Saved searches dialogs #5604
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: unstable
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
| 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> | ||
|
|
@@ -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: { | ||
|
|
@@ -189,7 +176,44 @@ | |
|
|
||
| <style scoped lang="scss"> | ||
| .empty-state { | ||
| padding: 8px; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
| color: var(--v-grey-base); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. https://design-system.learningequality.org/colors#tokens-annotation Same token will replace |
||
| span:not(:last-child)::after { | ||
|
|
@@ -199,4 +223,9 @@ | |
| } | ||
| } | ||
| .search-actions { | ||
| flex-shrink: 0; | ||
| margin-left: 16px; | ||
| } | ||
| </style> | ||
There was a problem hiding this comment.
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 removeIconButtonanyway)