Skip to content

Commit

Permalink
Rename 'spaceId' to 'storageId' after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
JammingBen committed Mar 17, 2022
1 parent 935009f commit 1f16bfb
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export default {
const sharedParentRoute = computed(() => {
if (isLocationSpacesActive(router, 'files-spaces-project')) {
return createLocationSpaces('files-spaces-project', {
params: { spaceId: route.value.params.spaceId, item: sharedParentDir.value }
params: { storageId: route.value.params.storageId, item: sharedParentDir.value }
})
}
Expand Down Expand Up @@ -318,7 +318,7 @@ export default {
client: this.$client,
path: this.file.path,
$gettext: this.$gettext,
spaceId: this.$route.params.spaceId
storageId: this.$route.params.storageId
})
this.shareIndicators = getIndicators(this.file, this.sharesTree)
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,13 +198,13 @@ export default {
client: this.$client,
path: this.highlightedFile.path,
$gettext: this.$gettext,
spaceId: this.$route.params.spaceId
storageId: this.$route.params.storageId
})
this.loadSharesTree({
client: this.$client,
path: dirname(this.highlightedFile.path),
$gettext: this.$gettext,
spaceId: this.$route.params.spaceId
storageId: this.$route.params.storageId
})
},
linksComparator(l1, l2) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,27 +342,27 @@ export default {
client: this.$client,
share: share,
resource: this.highlightedFile,
spaceId: this.$route.params.spaceId
storageId: this.$route.params.storageId
})
},
$_reloadShares() {
this.loadCurrentFileOutgoingShares({
client: this.$client,
path: this.highlightedFile.path,
$gettext: this.$gettext,
spaceId: this.$route.params.spaceId
storageId: this.$route.params.storageId
})
this.loadIncomingShares({
client: this.$client,
path: this.highlightedFile.path,
$gettext: this.$gettext,
spaceId: this.$route.params.spaceId
storageId: this.$route.params.storageId
})
this.loadSharesTree({
client: this.$client,
path: dirname(this.highlightedFile.path),
$gettext: this.$gettext,
spaceId: this.$route.params.spaceId
storageId: this.$route.params.storageId
})
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,11 +255,11 @@ export default {
this.selectedRole.permissions(!this.isOcis || this.resourceIsSpace)
)
let spaceId
let storageId
if (this.resourceIsSpace) {
spaceId = this.highlightedFile.id
} else if (this.$route.params.spaceId) {
spaceId = this.$route.params.spaceId
storageId = this.highlightedFile.id
} else if (this.$route.params.storageId) {
storageId = this.$route.params.storageId
}
this.addShare({
Expand All @@ -272,7 +272,7 @@ export default {
shareType: collaborator.value.shareType,
permissions: bitmask,
expirationDate: this.expirationDate,
spaceId
storageId
})
})
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export class FolderLoaderProject implements FolderLoader {
ref.loadIndicators({
client: ref.$client,
currentFolder: currentFolder?.path,
spaceId: ref.space.id
storageId: ref.space.id
})
})
}
Expand Down
26 changes: 13 additions & 13 deletions packages/web-app-files/src/store/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export default {
value: computeShareTypes(state.currentFileOutgoingShares)
})
},
loadCurrentFileOutgoingShares(context, { client, path, resource, spaceId }) {
loadCurrentFileOutgoingShares(context, { client, path, resource, storageId }) {
context.commit('CURRENT_FILE_OUTGOING_SHARES_SET', [])
context.commit('CURRENT_FILE_OUTGOING_SHARES_ERROR', null)
context.commit('CURRENT_FILE_OUTGOING_SHARES_LOADING', true)
Expand Down Expand Up @@ -191,8 +191,8 @@ export default {
}

let spaceRef
if (spaceId) {
spaceRef = `${spaceId}${path}`
if (storageId) {
spaceRef = `${storageId}${path}`
}

// see https://owncloud.dev/owncloud-sdk/Shares.html
Expand Down Expand Up @@ -397,8 +397,8 @@ export default {
}

let spaceRef
if (spaceId) {
spaceRef = `${spaceId}${path}`
if (storageId) {
spaceRef = `${storageId}${path}`
}

const remoteShare = shareType === ShareTypes.remote.value
Expand All @@ -419,7 +419,7 @@ export default {
)
)
context.dispatch('updateCurrentFileShareTypes')
context.dispatch('loadIndicators', { client, currentFolder: path, spaceId })
context.dispatch('loadIndicators', { client, currentFolder: path, storageId })
})
.catch((e) => {
context.dispatch(
Expand All @@ -433,7 +433,7 @@ export default {
)
})
},
deleteShare(context, { client, graphClient, share, resource, spaceId }) {
deleteShare(context, { client, graphClient, share, resource, storageId }) {
const additionalParams = {}
if (share.shareType === ShareTypes.space.value) {
additionalParams.shareWith = share.collaborator.name
Expand All @@ -446,7 +446,7 @@ export default {

if (share.shareType !== ShareTypes.space.value) {
context.dispatch('updateCurrentFileShareTypes')
context.dispatch('loadIndicators', { client, currentFolder: resource.path, spaceId })
context.dispatch('loadIndicators', { client, currentFolder: resource.path, storageId })
} else {
context.commit('CURRENT_FILE_OUTGOING_SHARES_LOADING', true)

Expand Down Expand Up @@ -477,7 +477,7 @@ export default {
* This will add new entries into the shares tree and will
* not remove unrelated existing ones.
*/
loadSharesTree(context, { client, path, spaceId }) {
loadSharesTree(context, { client, path, storageId }) {
context.commit('SHARESTREE_ERROR', null)
// prune shares tree cache for all unrelated paths, keeping only
// existing relevant parent entries
Expand All @@ -491,8 +491,8 @@ export default {
}

let spaceRef
if (spaceId) {
spaceRef = `${spaceId}${path}`
if (storageId) {
spaceRef = `${storageId}${path}`
}

// remove last entry which is the root folder
Expand Down Expand Up @@ -635,11 +635,11 @@ export default {
commit('CLEAR_RESOURCES_TO_DELETE_LIST')
},

async loadIndicators({ dispatch, commit }, { client, currentFolder, spaceId }) {
async loadIndicators({ dispatch, commit }, { client, currentFolder, storageId }) {
// kind of bruteforce for now: remove the shares for the current folder and children, reload shares tree for the current folder.
// TODO: when we refactor the shares tree we want to modify shares tree nodes incrementally during adding and removing shares, not loading everything new from the backend.
commit('SHARESTREE_PRUNE_OUTSIDE_PATH', dirname(currentFolder))
await dispatch('loadSharesTree', { client, path: currentFolder, spaceId })
await dispatch('loadSharesTree', { client, path: currentFolder, storageId })
commit('LOAD_INDICATORS')
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,16 @@ describe('InviteCollaboratorForm', () => {
expect(spyTriggerUpload).toHaveBeenCalledTimes(0)
})
it.each([
{ spaceId: undefined, highlightedFile: folderMock },
{ spaceId: undefined, highlightedFile: spaceMock },
{ spaceId: 1, highlightedFile: folderMock }
{ storageId: undefined, highlightedFile: folderMock },
{ storageId: undefined, highlightedFile: spaceMock },
{ storageId: 1, highlightedFile: folderMock }
])('calls the "addShare" action', async (dataSet) => {
const selectedCollaborators = [
{ shareWith: 'marie', value: { shareType: ShareTypes.user.value }, label: 'label' }
]
const wrapper = getWrapper({
selectedCollaborators,
spaceId: dataSet.spaceId,
storageId: dataSet.storageId,
highlightedFile: dataSet.highlightedFile
})
const addShareSpy = jest.spyOn(wrapper.vm, 'addShare')
Expand All @@ -79,7 +79,7 @@ describe('InviteCollaboratorForm', () => {
})
})

function getWrapper({ selectedCollaborators = [], spaceId, highlightedFile = folderMock } = {}) {
function getWrapper({ selectedCollaborators = [], storageId, highlightedFile = folderMock } = {}) {
return mount(InviteCollaboratorForm, {
localVue,
stubs: {
Expand All @@ -94,7 +94,7 @@ function getWrapper({ selectedCollaborators = [], spaceId, highlightedFile = fol
},
mocks: {
$route: {
params: { spaceId }
params: { storageId }
}
},
store: new Vuex.Store({
Expand Down

0 comments on commit 1f16bfb

Please sign in to comment.