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

create .space folder if removed #9793

Merged
merged 7 commits into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const useSpaceActionsUploadImage = ({
unref(spaceImageInput)?.click()
}

const uploadImageSpace = (ev) => {
const uploadImageSpace = async (ev) => {
const graphClient = clientService.graphAuthenticated
const file = ev.currentTarget.files[0]

Expand All @@ -56,6 +56,14 @@ export const useSpaceActionsUploadImage = ({
extraHeaders['X-OC-Mtime'] = '' + file.lastModified / 1000
}

if (!store.getters['Files/files'].find((file) => file.name === '.space')) {
JammingBen marked this conversation as resolved.
Show resolved Hide resolved
await clientService.webdav.createFolder(selectedSpace, { path: '.space' })
await clientService.webdav.putFileContents(selectedSpace, {
path: '.space/readme.md',
content: $gettext('Here you can add a description for this Space.')
})
}

return loadingService.addTask(() => {
return clientService.webdav
.putFileContents(selectedSpace, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ function getWrapper({

const storeOptions = defaultStoreMockOptions
const store = createStore(storeOptions)

store.getters['Files/files'].push({
id: '1fe58d8b-aa69-4c22-baf7-97dd57479f23',
name: '.space'
})

return {
wrapper: getComposableWrapper(
() => {
Expand Down