-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Shortcut url followup 2 * open in same window if is ocis uri * add more tests * add drop * Duplicate filename handling * Confirm modal with enter button * Add https in front of uri if missing * Fix file extension placement * Add unit test * Don't throw * Fix styling * Add search and fix unit tests * Add more tests * Change code comment * Add changelog item * Don't scope scss * Kick oc10 leftover * Fix space icon not shown * Refactor search * Fix unit tests * Refactor tests * React on code review * React on code review * Fix display Link to a file, shown if no search results * Lint
- Loading branch information
1 parent
6f6a6a9
commit ad51cdc
Showing
19 changed files
with
600 additions
and
290 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Enhancement: Create shortcuts | ||
|
||
We've added a new functionality to add to shortcuts to web, those can be created via the "+ New" context menu. | ||
Users can enter URLs or pick a file via the drop down menu and create a '.url' file. | ||
|
||
'.url' files can be opened via web or downloaded and opened on the desktop. | ||
|
||
https://github.com/owncloud/web/pull/9890 | ||
https://github.com/owncloud/web/pull/9908 | ||
https://github.com/owncloud/web/issues/9796 | ||
https://github.com/owncloud/web/issues/9887 | ||
https://github.com/owncloud/web/issues/9850 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,74 +1,19 @@ | ||
import ListComponent from '../../components/Search/List.vue' | ||
import { ClientService, SearchList, SearchResult } from '@ownclouders/web-pkg' | ||
import { ProjectSpaceResource, isProjectSpaceResource } from '@ownclouders/web-client/src/helpers' | ||
import { Component, computed, Ref, unref } from 'vue' | ||
import { DavProperties } from '@ownclouders/web-client/src/webdav/constants' | ||
import { Store } from 'vuex' | ||
import { ConfigurationManager } from '@ownclouders/web-pkg' | ||
import { urlJoin } from '@ownclouders/web-client/src/utils' | ||
import { SearchFunction, SearchList, SearchResult } from '@ownclouders/web-pkg' | ||
import { Component } from 'vue' | ||
|
||
export const searchLimit = 200 | ||
|
||
export default class List implements SearchList { | ||
public readonly component: Component | ||
private readonly store: Store<any> | ||
private readonly clientService: ClientService | ||
private readonly configurationManager: ConfigurationManager | ||
private readonly projectSpaces: Ref<ProjectSpaceResource[]> | ||
private readonly searchFunction: SearchFunction | ||
|
||
constructor( | ||
store: Store<any>, | ||
clientService: ClientService, | ||
configurationManager: ConfigurationManager | ||
) { | ||
constructor(searchFunction: SearchFunction) { | ||
this.component = ListComponent | ||
this.store = store | ||
this.clientService = clientService | ||
this.configurationManager = configurationManager | ||
this.projectSpaces = computed(() => | ||
this.store.getters['runtime/spaces/spaces'].filter((s) => isProjectSpaceResource(s)) | ||
) | ||
this.searchFunction = searchFunction | ||
} | ||
|
||
getProjectSpace(id): ProjectSpaceResource { | ||
return unref(this.projectSpaces).find((s) => s.id === id) | ||
} | ||
|
||
async search(term: string): Promise<SearchResult> { | ||
if (this.configurationManager.options.routing.fullShareOwnerPaths) { | ||
await this.store.dispatch('runtime/spaces/loadMountPoints', { | ||
graphClient: this.clientService.graphAuthenticated | ||
}) | ||
} | ||
|
||
if (!term) { | ||
return { | ||
totalResults: null, | ||
values: [] | ||
} | ||
} | ||
|
||
const { resources, totalResults } = await this.clientService.webdav.search(term, { | ||
searchLimit, | ||
davProperties: DavProperties.Default | ||
}) | ||
|
||
return { | ||
totalResults, | ||
values: resources.map((resource) => { | ||
const matchingSpace = this.getProjectSpace(resource.parentFolderId) | ||
const data = matchingSpace ? matchingSpace : resource | ||
|
||
// info: in oc10 we have no storageId in resources. All resources are mounted into the personal space. | ||
if (!data.storageId) { | ||
data.storageId = this.store.getters.user.id | ||
} | ||
if (this.configurationManager.options.routing.fullShareOwnerPaths && data.shareRoot) { | ||
data.path = urlJoin(data.shareRoot, data.path) | ||
} | ||
|
||
return { id: data.id, data } | ||
}) | ||
} | ||
public async search(term: string): Promise<SearchResult> { | ||
return this.searchFunction(term, searchLimit) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.