diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 52ffbcedd..1c7577314 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -393,7 +393,7 @@ class ProjectsController < ApplicationController actions: Toolbars::ProjectsService.new( current_user, - items: JSON.parse(params[:items]), + items: JSON.parse(params[:items]) ).actions } end diff --git a/app/javascript/vue/projects/list.vue b/app/javascript/vue/projects/list.vue index 0f583ca11..e85f66b7c 100644 --- a/app/javascript/vue/projects/list.vue +++ b/app/javascript/vue/projects/list.vue @@ -7,6 +7,10 @@ :toolbarActions="toolbarActions" :actionsUrl="actionsUrl" :withRowMenu="true" + :activePageUrl="activePageUrl" + :archivedPageUrl="archivedPageUrl" + :currentViewMode="currentViewMode" + :filters="filters" @tableReloaded="reloadingTable = false" /> @@ -38,6 +42,16 @@ export default { }, createFolderUrl: { type: String, + }, + activePageUrl: { + type: String, + }, + archivedPageUrl: { + type: String, + }, + currentViewMode: { + type: String, + required: true } }, data() { @@ -79,13 +93,40 @@ export default { left: left, right: [] } + }, + filters() { + let filters = [{ + key: 'query', + type: 'Text' + }, + { + key: 'created_at', + type: 'DateRange', + label: this.i18n.t("filters_modal.created_on.label"), + }] + + if (this.currentViewMode === 'archived') { + filters.push({ + key: 'archived_at', + type: 'DateRange', + label: this.i18n.t("filters_modal.archived_on.label"), + }) + } + + filters.push({ + key: 'folder_search', + type: 'Checkbox', + label: this.i18n.t("projects.index.filters_modal.folders.label"), + }) + + return filters } }, methods: { nameRenderer(params) { let showUrl = params.data.urls.show; return ` - ${params.data.folder ? 'sn-icon mini sn-icon-mini-folder-left' : ''} + ${params.data.folder ? '' : ''} ${params.data.name} ` }, diff --git a/app/javascript/vue/projects/renderers/users.vue b/app/javascript/vue/projects/renderers/users.vue index ccef45228..97ea94408 100644 --- a/app/javascript/vue/projects/renderers/users.vue +++ b/app/javascript/vue/projects/renderers/users.vue @@ -1,9 +1,9 @@