Skip to content
Merged
Show file tree
Hide file tree
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

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,6 @@
</VListTileSubTitle>
</VListTileContent>

<VListTileAction>
<IconButton
icon="edit"
color="grey"
:text="$tr('editAction')"
@click="handleClickEdit(search.id)"
/>
</VListTileAction>

<VListTileAction>
<IconButton
icon="clear"
Expand Down Expand Up @@ -70,14 +61,6 @@
</VBtn>
</template>
</MessageDialog>

<EditSearchModal
v-if="searchId"
v-model="showEdit"
:searchId="searchId"
@submit="showEdit = false"
@cancel="showEdit = false"
/>
</div>

</template>
Expand All @@ -86,15 +69,13 @@
<script>

import { mapActions, mapGetters } from 'vuex';
import EditSearchModal from './EditSearchModal';
import MessageDialog from 'shared/views/MessageDialog';
import IconButton from 'shared/views/IconButton';

export default {
name: 'SavedSearchesModal',
inject: ['RouteNames'],
components: {
EditSearchModal,
MessageDialog,
IconButton,
},
Expand All @@ -108,15 +89,14 @@
return {
loading: true,
showDelete: false,
showEdit: false,
searchId: null,
};
},
computed: {
...mapGetters('importFromChannels', ['savedSearches']),
dialog: {
get() {
return this.value && !this.showDelete && !this.showEdit;
return this.value && !this.showDelete;
},
set(value) {
this.$emit('input', value);
Expand All @@ -133,13 +113,8 @@
...mapActions('importFromChannels', ['loadSavedSearches', 'deleteSearch']),
handleCancel() {
this.searchId = null;
this.showEdit = false;
this.showDelete = false;
},
handleClickEdit(searchId) {
this.searchId = searchId;
this.showEdit = true;
},
handleClickDelete(searchId) {
this.searchId = searchId;
this.showDelete = true;
Expand Down Expand Up @@ -178,7 +153,6 @@
},
$trs: {
closeButtonLabel: 'Close',
editAction: 'Edit',
deleteAction: 'Delete',
savedSearchesTitle: 'Saved searches',
noSavedSearches: 'You do not have any saved searches',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
@click="handleBackToBrowse"
/>
</div>

<!-- Search bar -->
<VLayout row wrap class="mt-4 px-2">
<VFlex style="max-width: 700px">
Expand All @@ -22,6 +21,7 @@
box
clearable
hideDetails
@click:clear="handleBackToBrowse"
>
<template #prepend-inner>
<Icon icon="search" />
Expand All @@ -43,6 +43,15 @@
</VFlex>
</VLayout>

<div class="my-2 px-2">
<ActionLink
class="mb-3"
:text="$tr('savedSearchesLabel')"
:disabled="!savedSearchesExist"
@click="showSavedSearches = true"
/>
</div>

<!-- Search or Topics Browsing -->
<ChannelList
v-if="isBrowsing && !$route.params.channelId"
Expand All @@ -66,6 +75,7 @@
@copy_to_clipboard="handleCopyToClipboard"
/>
</VSheet>
<SavedSearchesModal v-model="showSavedSearches" />
</template>
</ImportFromChannelsModal>

Expand All @@ -74,11 +84,12 @@

<script>

import { mapActions, mapMutations, mapState } from 'vuex';
import { mapActions, mapGetters, mapMutations, mapState } from 'vuex';
import { RouteNames } from '../../constants';
import ChannelList from './ChannelList';
import ContentTreeList from './ContentTreeList';
import SearchResultsList from './SearchResultsList';
import SavedSearchesModal from './SavedSearchesModal';
import ImportFromChannelsModal from './ImportFromChannelsModal';
import { withChangeTracker } from 'shared/data/changes';

Expand All @@ -89,16 +100,19 @@
ContentTreeList,
SearchResultsList,
ChannelList,
SavedSearchesModal,
},
data() {
return {
searchTerm: '',
topicNode: null,
copyNode: null,
languageFromChannelList: null,
showSavedSearches: false,
};
},
computed: {
...mapGetters('importFromChannels', ['savedSearchesExist']),
...mapState('importFromChannels', ['selected']),
isBrowsing() {
return this.$route.name === RouteNames.IMPORT_FROM_CHANNELS_BROWSE;
Expand All @@ -122,16 +136,24 @@
);
},
},
beforeRouteEnter(to, from, next) {
next(vm => {
vm.searchTerm = to.params.searchTerm || '';
vm.showSavedSearches = false;
});
},
beforeRouteUpdate(to, from, next) {
this.searchTerm = to.params.searchTerm || '';
this.showSavedSearches = false;
next();
},
beforeRouteLeave(to, from, next) {
// Clear selections if going back to TreeView
if (to.name === RouteNames.TREE_VIEW) {
this.$store.commit('importFromChannels/CLEAR_NODES');
}
next();
},
mounted() {
this.searchTerm = this.$route.params.searchTerm || '';
},
methods: {
...mapActions('clipboard', ['copy']),
...mapMutations('importFromChannels', {
Expand Down Expand Up @@ -196,6 +218,7 @@
backToBrowseAction: 'Back to browse',
searchLabel: 'Search for resources…',
searchAction: 'Search',
savedSearchesLabel: 'View saved searches',

// Copy strings
// undo: 'Undo',
Expand Down
Loading