1515 <template #actions >
1616 <create-space v-if =" hasCreatePermission" class =" oc-mr-s" />
1717 <div v-if =" !selectedResourcesIds?.length" class =" oc-flex oc-flex-middle oc-pl-s" >
18- <span v-text =" $gettext('Learn about spaces')" />
18+ <!-- < span v-text="$gettext('Learn about spaces')" />
1919 <oc-contextual-helper
2020 :list="spacesHelpList"
2121 :title="$gettext('Spaces')"
2222 class="oc-ml-xs"
23- />
23+ /> -->
2424 </div >
2525 </template >
2626 </app-bar >
4545 <oc-icon name =" filter-2" class =" oc-mr-xs" />
4646 <span v-text =" $gettext('Filter:')" />
4747 </div >
48+ <item-filter-inline
49+ class =" project-visibility-filter"
50+ filter-name =" projectVisibility"
51+ :filter-options =" visibilityOptions"
52+ @toggle-filter =" setVisibilityOption"
53+ />
54+ <!-- <item-filter
55+ :allow-multiple="true"
56+ :filter-label="$gettext('Storage Type')"
57+ :filterable-attributes="['label']"
58+ :items="storageTypes"
59+ :option-filter-label="$gettext('Filter storage types')"
60+ :show-option-filter="true"
61+ id-attribute="key"
62+ class="storage-type-filter oc-ml-s"
63+ display-name-attribute="label"
64+ filter-name="storageType"
65+ >
66+ <template #item="{ item }">
67+ <span class="oc-ml-s" v-text="item.label" />
68+ </template>
69+ </item-filter>-->
4870 <!-- FIXME: TEMPORARY REMOVAL OF FILTER -->
4971 <!-- <item-filter-toggle -->
5072 <!-- :filter-label="$gettext('Include disabled')" -->
97119 </template >
98120 </template >
99121 <template #actions =" { resource } " >
100- <oc-button
122+ <!-- < oc-button
101123 v-if="!resource.disabled"
102124 v-oc-tooltip="showSpaceMemberLabel"
103125 class="spaces-list-show-members-button"
106128 @click="openSidebarSharePanel(resource as SpaceResource)"
107129 >
108130 <oc-icon name="group" fill-type="line" />
109- </oc-button >
131+ </oc-button>-->
110132 </template >
111133 <template #contextMenu =" { resource } " >
112134 <space-context-actions
@@ -223,6 +245,7 @@ import {
223245import { orderBy } from ' lodash-es'
224246import { useResourcesViewDefaults } from ' ../../composables'
225247import { folderViewsProjectSpacesExtensionPoint } from ' ../../extensionPoints'
248+ import { ItemFilterInline , InlineFilterOption , ItemFilter } from ' @ownclouders/web-pkg'
226249
227250export default defineComponent ({
228251 components: {
@@ -237,7 +260,9 @@ export default defineComponent({
237260 ResourceIcon ,
238261 ResourceTiles ,
239262 ResourceTable ,
240- SpaceContextActions
263+ SpaceContextActions ,
264+ ItemFilterInline ,
265+ ItemFilter
241266 },
242267 setup() {
243268 const spacesStore = useSpacesStore ()
@@ -259,6 +284,34 @@ export default defineComponent({
259284 (drive ) => isPersonalSpaceResource (drive ) && drive .isOwner (userStore .user )
260285 )
261286
287+ const visibilityOption = ref (' project' )
288+ const storageTypeQuery = useRouteQuery (' q_storageType' )
289+
290+ const visibilityOptions = computed (() => [
291+ { name: ' project' , label: $gettext (' My Spaces' ) },
292+ { name: ' explorer' , label: $gettext (' Explorer' ) },
293+ { name: ' all' , label: $gettext (' All' ) }
294+ ])
295+
296+ const storageTypes = computed (() => [
297+ {
298+ key: ' eos' ,
299+ value: ' eos' ,
300+ label: ' EOS'
301+ },
302+ {
303+ key: ' win' ,
304+ value: ' win' ,
305+ label: ' Winspaces'
306+ }
307+ ])
308+
309+ const setVisibilityOption = async (value : InlineFilterOption ) => {
310+ if (visibilityOption .value !== value .name ) {
311+ visibilityOption .value = value .name
312+ }
313+ }
314+
262315 const loadResourcesTask = useTask (function * (signal ) {
263316 clearResourceList ()
264317 setAncestorMetaData ({})
@@ -281,7 +334,11 @@ export default defineComponent({
281334 let loadPreviewToken: string = null
282335
283336 const runtimeSpaces = computed (() => {
284- return spacesStore .spaces .filter (isProjectSpaceResource ) || []
337+ return (
338+ spacesStore .spaces .filter (
339+ (space ) => isProjectSpaceResource (space ) || space ?.driveType === ' explorer'
340+ ) || []
341+ )
285342 })
286343 const selectedSpace = computed (() => {
287344 if (
@@ -322,6 +379,16 @@ export default defineComponent({
322379 spaces = spaces .filter ((space ) => space .disabled !== true )
323380 }
324381
382+ const selectedStorageTypes = queryItemAsString (unref (storageTypeQuery ))?.split (' +' )
383+ if (selectedStorageTypes ) {
384+ spaces = spaces .filter ((space ) =>
385+ selectedStorageTypes .some ((type ) => space .mimeType ?.includes (type ))
386+ )
387+ }
388+ if (unref (visibilityOption ) !== ' all' ) {
389+ spaces = spaces .filter ((space ) => space .driveType === unref (visibilityOption ))
390+ }
391+
325392 if (! (filterTerm || ' ' ).trim ()) {
326393 return spaces
327394 }
@@ -529,7 +596,11 @@ export default defineComponent({
529596 setSelection ,
530597 viewSize ,
531598 fileListHeaderY ,
532- spacesHelpList
599+ spacesHelpList ,
600+ visibilityOptions ,
601+ storageTypes ,
602+ setVisibilityOption ,
603+ isProjectSpaceResource
533604 }
534605 },
535606 computed: {
0 commit comments