Skip to content
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

Add space front page & bump SDK to v2.0.0 #6287

Merged
merged 88 commits into from
Feb 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
6bbfa59
Add space front page
Jan 20, 2022
ebf8407
Add images to space overview
Jan 20, 2022
9a0f043
Add breadbrumb, align images
JammingBen Jan 21, 2022
a24b3d7
Ajdust to owncloud sdk v2
Jan 26, 2022
61aa6cc
Add files table to space
JammingBen Jan 27, 2022
46f836d
make spaceId route param optional
fschade Jan 27, 2022
2f851cf
Add webDavUrl prop to the resource object, adjust paths
JammingBen Jan 28, 2022
0d6bab7
OCResource folderLink from web
Jan 28, 2022
488f7e1
Undo wrong committed files
Jan 28, 2022
2f08753
Enable New Action Button in spaces
Jan 28, 2022
8e046b9
Fix upload in space sub folder
Jan 31, 2022
8f60ec9
Fix upload folder action
Jan 31, 2022
eb30dfb
Fix breadcrumb
Jan 31, 2022
8b96613
Fix breadcrumb
Jan 31, 2022
220cc98
Fix breadcrumb
Jan 31, 2022
a91a993
Add bulk actions
Jan 31, 2022
457b47e
Don't test tooo much
Jan 31, 2022
2de221b
Lint
Jan 31, 2022
fbfc4b1
Adjust some of the unit tests
JammingBen Jan 31, 2022
694779f
Fix public links
Feb 1, 2022
1feb948
Lint
Feb 1, 2022
7d3409e
Enable unit tests in pipeline again
JammingBen Feb 1, 2022
92608b9
Fix delete on the current folder
JammingBen Feb 1, 2022
c006fc2
Fix integration tests
JammingBen Feb 1, 2022
b217ad0
Fix integration tests
JammingBen Feb 1, 2022
b5c2186
Remove unwanted console.log
Feb 2, 2022
1f4b636
Fix spaces table sort
Feb 2, 2022
fcfbf9f
Fix previews
Feb 2, 2022
022d797
Fix previews for spaces
Feb 2, 2022
e551d7c
Fix unit tests
Feb 2, 2022
e52d40a
Implement change space description, EVEN IF THE BACKEND STILL DOES NO…
Feb 2, 2022
c8abc5a
Add disable/delete actions
Feb 2, 2022
bed5a41
Add disable/delete actions
Feb 2, 2022
0c7656a
Add mixing for the spaces details sidebar, fix issue with opening fol…
JammingBen Feb 2, 2022
00d3f55
Fix issue with unobserving the ResizeOverserver when no README.md is …
JammingBen Feb 2, 2022
980a463
Update packages/web-app-files/src/components/FilesList/NotFoundMessag…
Feb 2, 2022
023a92d
Fix pdf downloads
Feb 2, 2022
66993ba
Add restore mixin
Feb 3, 2022
3bc57d9
Truncate space name if too long
Feb 3, 2022
7c21056
Add and fix unit tests
JammingBen Feb 3, 2022
b61ab42
Update test screenshots
JammingBen Feb 3, 2022
6904937
Update test screenshot (again)
JammingBen Feb 3, 2022
c5eaa54
Use jest fake time
JammingBen Feb 3, 2022
02d2122
Update
Feb 4, 2022
462b3f3
Toggle space image expand
Feb 4, 2022
c23e0cf
Lint
Feb 4, 2022
421471b
Fix alignments, add image fit for space frontpage, adjust snapshots
JammingBen Feb 4, 2022
74440c2
Remove spaces filelist snapshot
JammingBen Feb 4, 2022
95b4d0e
Fake commit.
Feb 4, 2022
271e254
Fake commit.
Feb 4, 2022
94ccdf3
Fix can't edit md file
Feb 4, 2022
8646125
Fix new file
Feb 4, 2022
7da7728
Fix path issues with shares
JammingBen Feb 4, 2022
732a5bf
Remove unnecessary comment line
JammingBen Feb 4, 2022
7cebdd5
Adjust checking if a space is disabled because of the new backend res…
JammingBen Feb 4, 2022
70d8409
Grayscale disabled spaces
Feb 4, 2022
f889b75
Fix renaming in other views, fix share webDavPath
JammingBen Feb 4, 2022
49ab7bb
Add disabled tag
Feb 4, 2022
365dd15
Add disabled tag
Feb 4, 2022
bb0e2ae
Update snapshot
JammingBen Feb 4, 2022
1a623cd
Fix integration tests, update snapshot
JammingBen Feb 4, 2022
35539ba
Add space description to spaces overview
Feb 7, 2022
89b0d6f
Adjust changelog item for SDK
JammingBen Feb 7, 2022
b592e98
Fix file favorite action
JammingBen Feb 7, 2022
bd1f3f6
Bump SDK version to 2.0.0-alpha.2
JammingBen Feb 7, 2022
1c73604
Update snapshot
JammingBen Feb 7, 2022
f830217
Run yarn
JammingBen Feb 7, 2022
a930676
Fix md editor path in app bar
Feb 7, 2022
2cf4cea
Run yarn, rebase
JammingBen Feb 7, 2022
1baf47e
Use right spaces route method
JammingBen Feb 7, 2022
8509a59
Lint
Feb 7, 2022
687367f
update yarn.lock
Feb 7, 2022
9086b65
Update snapshot
JammingBen Feb 7, 2022
7e3fb97
Fix media viewer, run linter
JammingBen Feb 7, 2022
dafce73
Update snapshot
JammingBen Feb 7, 2022
c8351a6
Adjustments
Feb 8, 2022
349265d
Adjustments
Feb 8, 2022
90cea3f
Update snapshots
JammingBen Feb 8, 2022
69aecfb
Add changelog item
JammingBen Feb 8, 2022
1fb0d8e
Fix drag and drop move file in all files list
Feb 8, 2022
1e3ccf6
Remove unwanted console.log
Feb 8, 2022
7ba0181
Remove unwanted console.log
Feb 8, 2022
91bf5fe
Minor fixes according to code review
JammingBen Feb 8, 2022
120bb76
Fix integration tests
JammingBen Feb 9, 2022
9ea2695
Fix resize observer on breadcrumb navigation
JammingBen Feb 9, 2022
8e41ca7
Adjust early returns in mixins
JammingBen Feb 9, 2022
6b7ee19
Remove uneccerssary headline
Feb 9, 2022
1ee31b8
Update snapshot
JammingBen Feb 9, 2022
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
21 changes: 19 additions & 2 deletions __mocks__/sdk.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,26 @@ import { DateTime } from 'luxon'

export default {
files: {
list: (path = '/') => fixtureFiles[path],
list: (path = '/') => {
if (path.startsWith('/files/')) {
path = path.split('/').splice(3).join('/')
if (path === '') {
path = '/'
}
}

return fixtureFiles[path]
},
getFavoriteFiles: () => fixtureFavoriteFiles,
fileInfo: (path) => fixtureFiles[path][0]
fileInfo: (path) => {
if (path.startsWith('/files/')) {
path = path.split('/').splice(3).join('/')
if (path === '') {
path = '/'
}
}
return fixtureFiles[path][0]
}
},
users: {
getUser: (id) => fixtureUsers[id]
Expand Down
6 changes: 6 additions & 0 deletions changelog/unreleased/enhancement-spaces-front-page
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Enhancement: Implement spaces front page

Each space can now be entered from within the spaces list. The space front page will then display all the space contents, plus an image and a readme file if set. Basic actions like uploading files, creating folders, renaming resources, and more. were also implemented in the course of this.

https://github.com/owncloud/web/pull/6287
https://github.com/owncloud/web/issues/6271
9 changes: 8 additions & 1 deletion changelog/unreleased/enhancement-update-sdk
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Enhancement: Update SDK

We've updated the ownCloud SDK to version 1.1.2. As we've switched the SDK to semver only now there is no proper changelog available.
We've updated the ownCloud SDK to version 2.0.0-alpha.2.

- Change - Drop Internet Explorer support: https://github.com/owncloud/owncloud-sdk/pull/966
- Change - Pass full file or directory path to methods of Files class: https://github.com/owncloud/owncloud-sdk/pull/971
- Change - Remove webdav v1 api support: https://github.com/owncloud/owncloud-sdk/pull/962
- Bugfix - Graceful reject for failing network request in OCS: https://github.com/owncloud/owncloud-sdk/pull/977

https://github.com/owncloud/web/pull/6309
https://github.com/owncloud/web/pull/6287
https://github.com/owncloud/owncloud-sdk/releases/tag/v1.1.2
https://github.com/owncloud/owncloud-sdk/releases/tag/v2.0.0-alpha.2
2 changes: 1 addition & 1 deletion packages/web-app-files/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "AGPL-3.0",
"dependencies": {
"copy-to-clipboard": "^3.3.1",
"semver": "^6.1.0",
"semver": "^7.3.5",
pascalwengerter marked this conversation as resolved.
Show resolved Hide resolved
"vue2-dropzone": "^3.6.0"
},
"devDependencies": {
Expand Down
99 changes: 71 additions & 28 deletions packages/web-app-files/src/components/AppBar/AppBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
<size-info v-if="hasBulkActions && selectedFiles.length > 0" class="oc-mr oc-visible@l" />
<batch-actions v-if="hasBulkActions" />
</div>
<view-options />
<view-options v-if="!hideViewOptions" />
</div>
</div>
</div>
Expand All @@ -137,7 +137,7 @@ import pathUtil from 'path'

import Mixins from '../../mixins'
import MixinFileActions, { EDITOR_MODE_CREATE } from '../../mixins/fileActions'
import { buildResource } from '../../helpers/resources'
import { buildResource, buildWebDavFilesPath, buildWebDavSpacesPath } from '../../helpers/resources'
import { bus } from 'web-pkg/src/instance'
import {
isLocationActive,
Expand Down Expand Up @@ -169,7 +169,12 @@ export default {
setup() {
return {
isPersonalLocation: watchActiveLocation(isLocationSpacesActive, 'files-spaces-personal-home'),
isPublicLocation: watchActiveLocation(isLocationPublicActive, 'files-public-files')
isPublicLocation: watchActiveLocation(isLocationPublicActive, 'files-public-files'),
isSpacesProjectsLocation: watchActiveLocation(
isLocationSpacesActive,
'files-spaces-projects'
),
isSpacesProjectLocation: watchActiveLocation(isLocationSpacesActive, 'files-spaces-project')
}
},
data: () => ({
Expand Down Expand Up @@ -247,18 +252,28 @@ export default {
hasBulkActions() {
return this.$route.meta.hasBulkActions === true
},
hideViewOptions() {
return this.$route.meta.hideViewOptions === true
},
pageTitle() {
const title = this.$route.meta.title
return this.$gettext(title)
},

breadcrumbs() {
if (!(this.isPublicLocation || this.isPersonalLocation)) {
breadcrumbs: function () {
if (
!(
this.isPublicLocation ||
this.isPersonalLocation ||
this.isSpacesProjectsLocation ||
this.isSpacesProjectLocation
)
) {
return []
}

const { params: routeParams, path: routePath } = this.$route
const { item: requestedItemPath = '' } = routeParams
const requestedItemPath = routeParams.item || ''
const basePaths =
'/' +
decodeURIComponent(routePath)
Expand All @@ -278,10 +293,25 @@ export default {

if (i === rawItems.length - 1) {
this.isPublicLocation && acc.shift()
acc.length &&
(acc[0].text = this.isPersonalLocation
? this.$gettext('All files')
: this.$gettext('Public link'))

if (acc.length) {
if (this.isPersonalLocation) {
acc[0].text = this.$gettext('All files')
} else if (this.isSpacesProjectLocation || this.isSpacesProjectsLocation) {
acc[0] = {
text: this.$gettext('Spaces'),
to: '/files/spaces/projects'
}
if (this.$route.params.spaceId) {
acc.splice(1, 0, {
text: this.$route.params.spaceId,
to: `/files/spaces/projects/${this.$route.params.spaceId}`
})
}
} else {
acc[0].text = this.$gettext('Public link')
}
}
acc.length && delete acc[acc.length - 1].to
} else {
delete acc[i].onClick
Expand Down Expand Up @@ -398,10 +428,15 @@ export default {
this.fileFolderCreationLoading = true

try {
const path = pathUtil.join(this.currentPath, folderName)

let path = pathUtil.join(this.currentPath, folderName)
let resource

if (this.isPersonalLocation) {
path = buildWebDavFilesPath(this.user.id, path)
await this.$client.files.createFolder(path)
resource = await this.$client.files.fileInfo(path, DavProperties.Default)
} else if (this.isSpacesProjectLocation) {
path = buildWebDavSpacesPath(this.$route.params.spaceId, path)
await this.$client.files.createFolder(path)
resource = await this.$client.files.fileInfo(path, DavProperties.Default)
} else {
Expand Down Expand Up @@ -482,18 +517,17 @@ export default {
this.fileFolderCreationLoading = true

try {
const path = pathUtil.join(this.currentPath, fileName)
let resource
let path = pathUtil.join(this.currentPath, fileName)

if (this.isPersonalLocation) {
path = buildWebDavFilesPath(this.user.id, path)
await this.$client.files.putFileContents(path, '')
resource = await this.$client.files.fileInfo(path, DavProperties.Default)
} else if (this.isSpacesProjectLocation) {
path = buildWebDavSpacesPath(this.$route.params.spaceId, path)
await this.$client.files.putFileContents(path, '')
resource = await this.$client.files.fileInfo(path, DavProperties.Default)
} else {
await this.$client.publicFiles.putFileContents(path, null, this.publicLinkPassword, '')
resource = await this.$client.publicFiles.getFileInfo(
path,
this.publicLinkPassword,
DavProperties.Default
)
}

if (this.newFileAction) {
Expand Down Expand Up @@ -647,16 +681,25 @@ export default {

await this.$nextTick()

const path = pathUtil.join(this.currentPath, file)
let resource = this.isPersonalLocation
? await this.$client.files.fileInfo(path, DavProperties.Default)
: await this.$client.publicFiles.getFileInfo(
path,
this.publicLinkPassword,
DavProperties.Default
)
let path = pathUtil.join(this.currentPath, file)
let resource

if (this.isPersonalLocation) {
path = buildWebDavFilesPath(this.user.id, path)
resource = await this.$client.files.fileInfo(path, DavProperties.Default)
} else if (this.isSpacesProjectLocation) {
path = buildWebDavSpacesPath(this.$route.params.spaceId, path)
resource = await this.$client.files.fileInfo(path, DavProperties.Default)
} else {
resource = await this.$client.publicFiles.getFileInfo(
path,
this.publicLinkPassword,
DavProperties.Default
)
}

resource = buildResource(resource)

this.UPSERT_RESOURCE(resource)

if (this.isPersonalLocation) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export default {
},
computed: {
...mapState(['navigation']),
...mapState(['user']),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the user needed here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We now need the user in some places to build the path (/files/username/...). I don't know why it was needed at that exact position, but without, some action could not generate the path because no user was found.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps hidden deep down in some mixin...

...mapGetters('Files', ['dropzone']),
sidebarStateClass() {
return this.navigation.closed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

<script>
import Mixins from '../../../mixins'
import { mapState } from 'vuex'

export default {
mixins: [Mixins],
Expand All @@ -38,6 +39,9 @@ export default {
},
requestType: { type: String, default: 'PUT' }
},
computed: {
...mapState(['user'])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, what is the user being used for here?

},
methods: {
triggerUpload() {
this.$refs.input.click()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@
</translate>
</div>
<div class="oc-mt-s">
<oc-button
v-if="showSpacesButton"
id="space-not-found-button-go-spaces"
type="router-link"
appearance="raw"
:to="spacesRoute"
>
<translate>Go to »Spaces Overview«</translate>
</oc-button>
<oc-button
v-if="showHomeButton"
id="files-list-not-found-button-go-home"
Expand Down Expand Up @@ -53,12 +62,14 @@ export default {
return {
showPublicLinkButton: isLocationPublicActive(router, 'files-public-files'),
showHomeButton: isLocationSpacesActive(router, 'files-spaces-personal-home'),
showSpacesButton: isLocationSpacesActive(router, 'files-spaces-project'),
homeRoute: createLocationSpaces('files-spaces-personal-home', {
params: { item: store.getters.homeFolder }
}),
publicLinkRoute: createLocationPublic('files-public-files', {
params: { item: router.currentRoute.params?.item?.split('/')[0] }
})
}),
spacesRoute: createLocationSpaces('files-spaces-projects')
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/web-app-files/src/components/SideBar/FileInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
:name="file.name"
:extension="file.extension"
:type="file.type"
:full-path="file.path"
:full-path="file.webDavPath"
:is-path-displayed="false"
/>
</h3>
Expand Down
3 changes: 1 addition & 2 deletions packages/web-app-files/src/components/SideBar/SideBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -296,11 +296,10 @@ export default {
this.selectedFile = this.highlightedFile
return
}

this.loading = true
try {
const item = await this.$client.files.fileInfo(
this.highlightedFile.path,
this.highlightedFile.webDavPath,
DavProperties.Default
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ interface PrivatePreviewBlobOptions {
resource: {
id: string
path: string
webDavPath: string
etag?: string
}
token: string
Expand All @@ -26,9 +27,8 @@ export const privatePreviewBlob = async (

const url = [
options.server,
'remote.php/dav/files/',
options.userId,
encodePath(options.resource.path),
'remote.php/dav',
encodePath(options.resource.webDavPath),
'?',
buildQueryString({
etag: options.resource.etag,
Expand Down
Loading